Skip to content

/AWS1/IF_LOM=>GETSAMPLEDATA()

About GetSampleData

Returns a selection of sample records from an Amazon S3 datasource.

Method Signature

METHODS /AWS1/IF_LOM~GETSAMPLEDATA
  IMPORTING
    !IO_S3SOURCECONFIG TYPE REF TO /AWS1/CL_LOMSAMPLEDATAS3SRCCFG OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_lomgetsampledatarsp
  RAISING
    /AWS1/CX_LOMACCESSDENIEDEX
    /AWS1/CX_LOMINTERNALSERVEREX
    /AWS1/CX_LOMRESOURCENOTFOUNDEX
    /AWS1/CX_LOMTOOMANYREQUESTSEX
    /AWS1/CX_LOMVALIDATIONEX
    /AWS1/CX_LOMCLIENTEXC
    /AWS1/CX_LOMSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Optional arguments:

io_s3sourceconfig TYPE REF TO /AWS1/CL_LOMSAMPLEDATAS3SRCCFG /AWS1/CL_LOMSAMPLEDATAS3SRCCFG

A datasource bucket in Amazon S3.

RETURNING

oo_output TYPE REF TO /aws1/cl_lomgetsampledatarsp /AWS1/CL_LOMGETSAMPLEDATARSP

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->getsampledata(
  io_s3sourceconfig = new /aws1/cl_lomsampledatas3srccfg(
    io_fileformatdescriptor = new /aws1/cl_lomfilefmtdescriptor(
      io_csvformatdescriptor = new /aws1/cl_lomcsvfmtdescriptor(
        it_headerlist = VALUE /aws1/cl_lomheaderlist_w=>tt_headerlist(
          ( new /aws1/cl_lomheaderlist_w( |string| ) )
        )
        iv_charset = |string|
        iv_containsheader = ABAP_TRUE
        iv_delimiter = |string|
        iv_filecompression = |string|
        iv_quotesymbol = |string|
      )
      io_jsonformatdescriptor = new /aws1/cl_lomjsonfmtdescriptor(
        iv_charset = |string|
        iv_filecompression = |string|
      )
    )
    it_historicaldatapathlist = VALUE /aws1/cl_lomhistoricaldatapa00=>tt_historicaldatapathlist(
      ( new /aws1/cl_lomhistoricaldatapa00( |string| ) )
    )
    it_templatedpathlist = VALUE /aws1/cl_lomtmpldpathlist_w=>tt_templatedpathlist(
      ( new /aws1/cl_lomtmpldpathlist_w( |string| ) )
    )
    iv_rolearn = |string|
  )
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  LOOP AT lo_result->get_headervalues( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_headervalue = lo_row_1->get_value( ).
    ENDIF.
  ENDLOOP.
  LOOP AT lo_result->get_samplerows( ) into lt_row_2.
    LOOP AT lt_row_2 into lo_row_3.
      lo_row_4 = lo_row_3.
      IF lo_row_4 IS NOT INITIAL.
        lv_dataitem = lo_row_4->get_value( ).
      ENDIF.
    ENDLOOP.
  ENDLOOP.
ENDIF.