In our B2B integration assignment, we have come across a requirement where ANSI X12 EDI 855v2000 is traded and this version is not available in the standard B2B integration content.
One of the latest articles Not finding required EDI message versions in B2BIC ? ,very well highlights the B2BIC functionality of copying and editing the EDI message.
This weblog is an extension to the above topic.The complete scenario is demonstrated on how to add segments/loops to the custom message which are not available in the SAP default B2B tables and test the custom conversion rules.
In this outbound scenario, IDoc triggered from SAP is translated into orders acknowledgment ANSI X12 EDI 855 version 2000 & version 4010 and transmitted to EDI partner.
Copy existing version to a new control key:
A message type/version can be created from scratch, but to minimize the effort, copy an existing version from SAP control key which is closest to your required version to a custom key.
Here, set 855 version 2003 is copied from SAP control key to a new key 855v2000_test ( Message version 002000)
In the same custom key, copy 855 4010 version, the significance of having 2000 and 4010 version in the same key will be explained in the latter part of the article.
Edit custom message:
As per the manual for EDI 855v2000, J2X segment is required in the version
Update Message->Add Segment Above/Below
Filter J2X in the extended value selector popup. In the standard SAP control key J2X is not deployed, so in the copy, therefore no value is retrieved here .
We need to edit B2B tables for the custom key.
Editing B2B tables for custom key :
Adding custom segments/loops to the B2B tables
Check the key for the custom control key 855v2000_test
Go to EDI content manager->Ansi X12->Editor-> Control Key Description Editor
Edit the table content for key 2 (custom control key message version 2000)
Go to ANSI X12-> Tables->B2B_X12_DEF_MSG
Filter control key and version ( 2 and 002000)
Click on Edit at the bottom left of the table
In the details section, PID ( item description) is to be replaced by J2X segment
Filter PID in the SEGMENT column (edit/rename/delete)
Rename PID to J2X across and save (for the selected custom key and version only*)
Activate the changes
Note: ‘Insert new row’ option allows to add new segments to the table
Similarly, update segment name in ANSI X12-> Tables->B2B_X12_DEF_SEG
Rename PID to J2X for the same CTRL_KEY, VERSION combination (2, 002000). Save and activate the change.
Also, update segment name/fields and index in ANSI X12-> Tables->B2B_X12_DEF_FL
As per requirement, rows are deleted/updated/inserted
Adjusting the index of custom segments/loops/fields
Requirement is to shift L_N1 loop (Name) to 7th position in the header
Eg. Swap FOB’s index with L_N1 ( 7<->27)
Similarly, alter the index of other segments/fields in the respective tables; in case change in the sequence ( don’t miss the sequence, while adjusting index )
Save and activate the changes.
Reference- Editing Tables
Note- Edit Message Edit Segment/field functionality can be used as an alternative to add custom segments/fields
Control Key Association for custom key :
Define conversion rules for the custom key i.e. define control key association
Go to ANSI X12-> Editor->Control Key Scenario Association
Click on Insert and add custom key details
It is necessary to define interface specific properties in at least one of the columns to differentiate in SAP default and custom control key
In this scenario, both 2000 and 4010 are in same namespace and part of one interface, therefore namespace is used in the custom key data
Test the conversion rules for custom key
Go to ANSI X12->X12-XML-Convertor
Test sample EDI file to XML conversion and vice versa
Run time :
Generate XSD for EDI 855 version 2000 & 4010
Go to EDI Content Manager->ANSI X12->XSD-Generator
Select the custom control key version and click on start to generate EDI schema
Import the generated XSDs in ESR as external definitions and use in the integration scenario
Per IDOC triggered, EDI 855 v2000 & v4010 is generated
Successful delivery : EDI 855 v2000 file
Successful delivery : EDI 855 v4010 file
Export/Import Custom Control Key content
Go to EDI Content Manager->ANSI X12->Import/Export Content->Export
Select custom CTRL_KEY, versions, add to export choice., export and download export file
The temporary export file with table content for custom key can be imported across environments as below
1) Role SAP_PI_B2B_SUPERADMIN_J2EE for editing message.
2) PIB2BTOOLKIT SP02 Patch 12 or above for UI enhancement ( message editor->update message->drop down UI actions etc.)
3) Custom Message Version manual (E.g. 855v2000 overview attached)