Skip to Content
Author's profile photo Former Member

B2B scenario – creating and testing custom EDI message version- ANSI X12 855v2000

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.


SDN - Custom msg.jpg

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)

SDN -b2bic 8.jpg

SDN -b2bic 5.jpg

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.

SDN -b2bic 7.jpg

SDN -b2bic 6.jpg

Edit custom message:

As per the manual for EDI 855v2000, J2X segment is required in the version

Update Message->Add Segment Above/Below

SDN -b2bic 9.jpg

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.

SDN -b2bic 10.jpg

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

SDN -b2bic 12.jpg

Edit the table content for key 2 (custom control key message version 2000)

SDN -b2bic 11.jpg

Go to ANSI X12-> Tables->B2B_X12_DEF_MSG

SDN -b2bic 13.jpg

Filter control key and version ( 2 and 002000)

Click on Edit at the bottom left of the table

SDN -b2bic 15.jpg

In the details section, PID ( item description) is to be replaced by J2X segment

Filter PID in the SEGMENT column (edit/rename/delete)

SDN -b2bic 16.jpg

Rename PID to J2X across and save (for the selected custom key and version only*)

SDN -b2bic 18.jpg

Activate the changes

SDN -b2bic 19.jpg

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

SDN -b2bic 20.jpg

Rename PID to J2X for the same CTRL_KEY, VERSION combination (2, 002000). Save and activate the change.

SDN -b2bic 21.jpg

Also, update segment name/fields and index in ANSI X12-> Tables->B2B_X12_DEF_FL

SDN -b2bic 22.jpg

As per requirement, rows are deleted/updated/inserted

SDN -b2bic 23.jpg

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)

SDN -b2bic 24.jpg

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 )

SDN -b2bic 26.jpg

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

SDN -b2bic 27.jpg

Click on Insert and add custom key details

SDN -b2bic 29.jpg

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

SDN -b2bic 28.jpg

SDN -b2bic 30.jpg

Test the conversion rules for custom key

Go to ANSI X12->X12-XML-Convertor

Test sample EDI file to XML conversion and vice versa

SDN -b2bic 38.jpg

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

SDN -b2bic 33.jpg

Import the generated XSDs in ESR as external definitions and use in the integration scenario

Scenario Monitoring

Per IDOC triggered, EDI 855 v2000 & v4010 is generated

SDN -b2bic 37.jpg

Successful delivery : EDI 855 v2000 file

SDN -b2bic 35.jpg

Successful delivery : EDI 855 v4010 file

SDN -b2bic 36.jpg

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

SDN -b2bic 40.jpg


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)

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Piyush Gakhar
      Piyush Gakhar

      Hello Pooja,


      First of all thank you for writing an excellent detailed Blog. It is really great.


      I would like to let you know an easy option to add segments and fields as well. There is no need to go to multiple tables and update several rows and columns.


      On the right hand side of the message editor screen, you have to choose segment/field editor from the drop down. Once you have added a new segment (in segment editor) for the corresponding control key, you can save it and come back to message editor screen. The newly added segment name would be avaialble then in your search and you can add it at any position you want. Same procedure is applicable for adding new fields and composites as well.




      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hey Piyush,

      Thank you

      I did try the segment editor , it allows me to add a new segment from scratch, I wanted to replace the names say TD5 to TD2 (carrier routing details, and remove/add a few fields), does it allow to copy/rename segments as well?

      Also, I was not able to find a provision to adjust the index at header level

      eg. L_N1 loop I wanted to move and position it after TAX in the header.


      Move Index feature of segment editor helps in moving fields inside segment of segments in a message?


      While editing tables, we have segments,loops, fields, index, description , references of similar segments at one place, just a little tweaking here and there

      Using segment/field editor is a good idea indeed.

      Have added a note, that edit segment/field can be explored.


      With the 'add loop' feature, was not able to add loops;  I created custom segment with the segment editor, and it takes the name of the segment prefixed by L_,

      below error I get

      "Enter a valid name for segment group"

      Author's profile photo Ruchir .
      Ruchir .

      Hi Pooja,


      It's a great blog !!! Will definitely help others.


      You can move the index around inside the segment and composites but at segment level it's currently not present. But you can achieve the same by deleting and adding the segment. Actually it is not needed to go to the tables and edit them because all the features are covered via Message Editor.


      As far as the error "Enter a valid name for segment group" is concerned you can raise an OSS message with SAP. You can mention in the ticket to assign it to me.



      Best Regards,


      Author's profile photo Former Member
      Former Member

      Very useful blog.

      I have not found this information on SDN. Thanks Pooja for valuable information.

      Author's profile photo Former Member
      Former Member
      Blog Post Author


      Author's profile photo Former Member
      Former Member

      Very nice blog. Keep blogging!

      Author's profile photo Former Member
      Former Member

      This is a very good read! Really helpful

      Keep up the good work!!!

      Author's profile photo Former Member
      Former Member
      Blog Post Author


      Author's profile photo Former Member
      Former Member

      nice one , keep on adding more.