/AWS1/CL_BDI=>GENERATEMAPPING()
¶
About GenerateMapping¶
Takes sample input and output documents and uses Amazon Bedrock to generate a mapping automatically. Depending on the accuracy and other factors, you can then edit the mapping for your needs.
Before you can use the AI-assisted feature for Amazon Web Services B2B Data Interchange you must enable models in Amazon Bedrock. For details, see AI-assisted template mapping prerequisites in the Amazon Web Services B2B Data Interchange User guide.
To generate a mapping, perform the following steps:
-
Start with an X12 EDI document to use as the input.
-
Call
TestMapping
using your EDI document. -
Use the output from the
TestMapping
operation as either input or output for your GenerateMapping call, along with your sample file.
Method Signature¶
IMPORTING¶
Required arguments:¶
iv_inputfilecontent
TYPE /AWS1/BDIGENERATEMAPINPFILEC00
/AWS1/BDIGENERATEMAPINPFILEC00
¶
Provide the contents of a sample X12 EDI file, either in JSON or XML format, to use as a starting point for the mapping.
iv_outputfilecontent
TYPE /AWS1/BDIGENERATEMAPOUTFILEC00
/AWS1/BDIGENERATEMAPOUTFILEC00
¶
Provide the contents of a sample X12 EDI file, either in JSON or XML format, to use as a target for the mapping.
iv_mappingtype
TYPE /AWS1/BDIMAPPINGTYPE
/AWS1/BDIMAPPINGTYPE
¶
Specify the mapping type: either
JSONATA
orXSLT.
RETURNING¶
oo_output
TYPE REF TO /aws1/cl_bdigeneratemappingrsp
/AWS1/CL_BDIGENERATEMAPPINGRSP
¶
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~generatemapping(
iv_inputfilecontent = |string|
iv_mappingtype = |string|
iv_outputfilecontent = |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_mappingtemplate( ).
lv_float = lo_result->get_mappingaccuracy( ).
ENDIF.
Sample GenerateMapping call¶
Sample GenerateMapping call
DATA(lo_result) = lo_client->/aws1/if_bdi~generatemapping(
iv_inputfilecontent = |Sample input file content|
iv_mappingtype = |JSONATA|
iv_outputfilecontent = |Sample output file content|
).