/AWS1/IF_BDI=>TESTCONVERSION()¶
About TestConversion¶
This operation mimics the latter half of a typical Outbound EDI request. It takes an input JSON/XML in the B2Bi shape as input, converts it to an X12 EDI string, and return that string.
Method Signature¶
METHODS /AWS1/IF_BDI~TESTCONVERSION
IMPORTING
!IO_SOURCE TYPE REF TO /AWS1/CL_BDICONVERSIONSOURCE OPTIONAL
!IO_TARGET TYPE REF TO /AWS1/CL_BDICONVERSIONTARGET OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_bditestconversionrsp
RAISING
/AWS1/CX_BDIACCESSDENIEDEX
/AWS1/CX_BDIINTERNALSERVEREX
/AWS1/CX_BDIRESOURCENOTFOUNDEX
/AWS1/CX_BDITHROTTLINGEX
/AWS1/CX_BDIVALIDATIONEX
/AWS1/CX_BDICLIENTEXC
/AWS1/CX_BDISERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
io_source TYPE REF TO /AWS1/CL_BDICONVERSIONSOURCE /AWS1/CL_BDICONVERSIONSOURCE¶
Specify the source file for an outbound EDI request.
io_target TYPE REF TO /AWS1/CL_BDICONVERSIONTARGET /AWS1/CL_BDICONVERSIONTARGET¶
Specify the format (X12 is the only currently supported format), and other details for the conversion target.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_bditestconversionrsp /AWS1/CL_BDITESTCONVERSIONRSP¶
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->testconversion(
io_source = new /aws1/cl_bdiconversionsource(
io_inputfile = new /aws1/cl_bdiinputfilesource( |string| )
iv_fileformat = |string|
)
io_target = new /aws1/cl_bdiconversiontarget(
io_advancedoptions = new /aws1/cl_bdiadvancedoptions(
io_x12 = new /aws1/cl_bdix12advancedoptions(
io_splitoptions = new /aws1/cl_bdix12splitoptions( |string| )
io_validationoptions = new /aws1/cl_bdix12validationopts(
it_validationrules = VALUE /aws1/cl_bdix12validationrule=>tt_x12validationrules(
(
new /aws1/cl_bdix12validationrule(
io_codelistvalidationrule = new /aws1/cl_bdix12codelstvalida00(
it_codestoadd = VALUE /aws1/cl_bdicodelist_w=>tt_codelist(
( new /aws1/cl_bdicodelist_w( |string| ) )
)
it_codestoremove = VALUE /aws1/cl_bdicodelist_w=>tt_codelist(
( new /aws1/cl_bdicodelist_w( |string| ) )
)
iv_elementid = |string|
)
io_elementlengthvalidationrl = new /aws1/cl_bdix12elementlength00(
iv_elementid = |string|
iv_maxlength = 123
iv_minlength = 123
)
io_elementreqvalidationrule = new /aws1/cl_bdix12elementreqval00(
iv_elementposition = |string|
iv_requirement = |string|
)
)
)
)
)
)
)
io_formatdetails = new /aws1/cl_bdiconvrstgtfmtdets(
io_x12 = new /aws1/cl_bdix12details(
iv_transactionset = |string|
iv_version = |string|
)
)
io_outputsamplefile = new /aws1/cl_bdioutsamplefilesrc(
io_filelocation = 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_convertedfilecontent( ).
LOOP AT lo_result->get_validationmessages( ) 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 TestConversion call¶
Sample TestConversion call
DATA(lo_result) = lo_client->testconversion(
io_source = new /aws1/cl_bdiconversionsource(
io_inputfile = new /aws1/cl_bdiinputfilesource( |Sample file content| )
iv_fileformat = |JSON|
)
io_target = new /aws1/cl_bdiconversiontarget(
io_advancedoptions = new /aws1/cl_bdiadvancedoptions(
io_x12 = new /aws1/cl_bdix12advancedoptions(
io_validationoptions = new /aws1/cl_bdix12validationopts(
it_validationrules = VALUE /aws1/cl_bdix12validationrule=>tt_x12validationrules(
(
new /aws1/cl_bdix12validationrule(
io_codelistvalidationrule = new /aws1/cl_bdix12codelstvalida00(
it_codestoadd = VALUE /aws1/cl_bdicodelist_w=>tt_codelist(
( new /aws1/cl_bdicodelist_w( |X| ) )
( new /aws1/cl_bdicodelist_w( |Y| ) )
( new /aws1/cl_bdicodelist_w( |Z| ) )
)
it_codestoremove = VALUE /aws1/cl_bdicodelist_w=>tt_codelist(
( new /aws1/cl_bdicodelist_w( |A| ) )
( new /aws1/cl_bdicodelist_w( |B| ) )
( new /aws1/cl_bdicodelist_w( |C| ) )
)
iv_elementid = |1280|
)
)
)
(
new /aws1/cl_bdix12validationrule(
io_elementreqvalidationrule = new /aws1/cl_bdix12elementreqval00(
iv_elementposition = |NM1-01|
iv_requirement = |OPTIONAL|
)
)
)
(
new /aws1/cl_bdix12validationrule(
io_elementlengthvalidationrl = new /aws1/cl_bdix12elementlength00(
iv_elementid = |0803|
iv_maxlength = 30
iv_minlength = 5
)
)
)
)
)
)
)
io_formatdetails = new /aws1/cl_bdiconvrstgtfmtdets(
io_x12 = new /aws1/cl_bdix12details(
iv_transactionset = |X12_110|
iv_version = |VERSION_4010|
)
)
iv_fileformat = |X12|
)
).