Skip to content

/AWS1/CL_BDI=>TESTPARSING()

About TestParsing

Parses the input EDI (electronic data interchange) file. The input file has a file size limit of 250 KB.

Method Signature

IMPORTING

Required arguments:

io_inputfile TYPE REF TO /AWS1/CL_BDIS3LOCATION /AWS1/CL_BDIS3LOCATION

Specifies an S3Location object, which contains the Amazon S3 bucket and prefix for the location of the input file.

iv_fileformat TYPE /AWS1/BDIFILEFORMAT /AWS1/BDIFILEFORMAT

Specifies that the currently supported file formats for EDI transformations are JSON and XML.

io_editype TYPE REF TO /AWS1/CL_BDIEDITYPE /AWS1/CL_BDIEDITYPE

Specifies the details for the EDI standard that is being used for the transformer. Currently, only X12 is supported. X12 is a set of standards and corresponding messages that define specific business documents.

Optional arguments:

io_advancedoptions TYPE REF TO /AWS1/CL_BDIADVANCEDOPTIONS /AWS1/CL_BDIADVANCEDOPTIONS

Specifies advanced options for parsing the input EDI file. These options allow for more granular control over the parsing process, including split options for X12 files.

RETURNING

oo_output TYPE REF TO /aws1/cl_bditestparsingrsp /AWS1/CL_BDITESTPARSINGRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

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->/aws1/if_bdi~testparsing(
  io_advancedoptions = new /aws1/cl_bdiadvancedoptions( new /aws1/cl_bdix12advancedoptions( new /aws1/cl_bdix12splitoptions( |string| ) ) )
  io_editype = new /aws1/cl_bdieditype(
    io_x12details = new /aws1/cl_bdix12details(
      iv_transactionset = |string|
      iv_version = |string|
    )
  )
  io_inputfile = new /aws1/cl_bdis3location(
    iv_bucketname = |string|
    iv_key = |string|
  )
  iv_fileformat = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_string = lo_result->get_parsedfilecontent( ).
  LOOP AT lo_result->get_parsedsplitfilecontents( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_string = lo_row_1->get_value( ).
    ENDIF.
  ENDLOOP.
ENDIF.

Sample TestParsing call

Sample TestParsing call

DATA(lo_result) = lo_client->/aws1/if_bdi~testparsing(
  io_editype = new /aws1/cl_bdieditype(
    io_x12details = new /aws1/cl_bdix12details(
      iv_transactionset = |X12_110|
      iv_version = |VERSION_4010|
    )
  )
  io_inputfile = new /aws1/cl_bdis3location(
    iv_bucketname = |test-bucket|
    iv_key = |sampleFile.txt|
  )
  iv_fileformat = |JSON|
).

Sample TestParsing call without EDI Splitting

Sample TestParsing call without EDI Splitting

DATA(lo_result) = lo_client->/aws1/if_bdi~testparsing(
  io_advancedoptions = new /aws1/cl_bdiadvancedoptions( new /aws1/cl_bdix12advancedoptions( new /aws1/cl_bdix12splitoptions( |NONE| ) ) )
  io_editype = new /aws1/cl_bdieditype(
    io_x12details = new /aws1/cl_bdix12details(
      iv_transactionset = |X12_110|
      iv_version = |VERSION_4010|
    )
  )
  io_inputfile = new /aws1/cl_bdis3location(
    iv_bucketname = |test-bucket|
    iv_key = |sampleFile.txt|
  )
  iv_fileformat = |JSON|
).

Sample TestParsing call with EDI Splitting by Transaction

Sample TestParsing call with EDI Splitting by Transaction

DATA(lo_result) = lo_client->/aws1/if_bdi~testparsing(
  io_advancedoptions = new /aws1/cl_bdiadvancedoptions( new /aws1/cl_bdix12advancedoptions( new /aws1/cl_bdix12splitoptions( |TRANSACTION| ) ) )
  io_editype = new /aws1/cl_bdieditype(
    io_x12details = new /aws1/cl_bdix12details(
      iv_transactionset = |X12_110|
      iv_version = |VERSION_4010|
    )
  )
  io_inputfile = new /aws1/cl_bdis3location(
    iv_bucketname = |test-bucket|
    iv_key = |sampleFile.txt|
  )
  iv_fileformat = |JSON|
).