Skip to Content
Author's profile photo Former Member

Cost Free EDI Integration using Message Transformation Bean.

 Cost Free EDI Integration with Message Transformation Bean.

                 EDI integration is always expensive as it involves complex data mapping and secured communication. There are several EDI standards (EDIFACT, RossetaNet, X12 ..etc)  using by different industries. PI can’t handle all kinds of EDI standards by its standard (SAP provided) adapters. Third party PI adapters (Seeburger  …etc) are available in the market to ready to use but involves additional cost as it is not part of standard SAP product. This blog will show a way to implement EDI with standard SAP PI (without third party adapters).

                  Most widely used EDI standards are RosettaNet and EDIFACT. RosettaNet adapter is part of standard PI product which can handle Rosetta Net standard transactions. PI does not have any standard adapter to process EDIFACT transactions (810, 800 …etc). These standard transactions are stored in complex structures in the TEXT file format. PI file adapter can convert text file to PI XML format but it is not capable of handling this kind of complexity. In order to handle complex conversions SAP provided additional adapter modules called Message Transformation Bean.

StructXML2Plain: It converts PI XML format to plain TEXT format which can be used   for  outgoing EDI transactions.

                        StructXML2Plain is used when each row of output file has different structure.

SimpleXML2Plain: It is also used for converting PI XML to plain text format.

                         SimpleXML2Plain is used when all rows of output file has same structure.
Example of using Message Transformation Bean in Outbound Scenario:

StructXML2Plain: For converting complex xml to Plain.



Processing sequence:

        Processing sequence in the module is very important. ‘localejbs/AF_Modules/MessageTransformBean’ should be called first and then ‘CallSapAdapter’.


Module Parameters

1. localejbs/AF_Modules/MessageTransformBean      Local Enterprise Bean       Key

2. CallSapAdapter                                                    Local Enterprise Bean       0


Module Configuration:
        We need to pass the parameters and related values in configuration.

Most important parameters are:
1.    ‘Transform.Class’ and value is ‘’.
2.    ‘Transform.ContentType’ and value is ‘text/xml;charset=utf-8’.
3.    ‘xml.conversionType’: Specify the conversionType here (structXML2Plain, structPlain2XML, simpleXML2Plain, simplePlain2XML ).
4.    ‘xml.recordsetStructure’: Here we need to specify structure of EDIFACT structure e.g: ISA,GS,ST,BGN,DTP,N1,INS,REF,DTP,NM1,PER,N3,N4,DMG,HD,DTP,SE,GE,IEA

Remaining parameters are same like File Content Conversion parameters.
e.g: xml.segmentname.fieldSeparator

 Module Config-1


Module Config-2

Module Key      Parameter Name               Parameter Value

Key                 Transform.Class      

Key                 Transform.ContentType      text/xml;charset=utf-8

Key                 xml.BGN.fieldSeparator       *

Key                 xml.DMG.fieldSeparator      *

Key                 xml.DTP.fieldSeparator       *

Key                 xml.DTP.fieldSeparator       *

Key                 xml.GE.fieldSeparator         *

Key                 xml.GS.fieldSeparator         *

Key                 xml.HD.fieldSeparator         *

Key                 xml.IEA.fieldSeparator        *

Key                 xml.INS.fieldSeparator        *

Key                 xml.ISA.fieldSeparator        *

Key                 xml.N1.fieldSeparator         *

Key                 xml.N3.fieldSeparator         *

Key                 xml.N4.fieldSeparator         *

Key                 xml.NM1.fieldSeparator       *

Key                 xml.PER.fieldSeparator       *

Key                 xml.REF.fieldSeparator        *

Key                 xml.SE.fieldSeparator          *

Key                 xml.ST.fieldSeparator          *

Key                 xml.addHeaderLine             0

Key                 xml.conversionType            StructXML2Plain

Key                 xml.recordsetStructure        ISA,GS,ST,BGN,DTP,N1,INS,REF,DTP,NM1,PER,N3,N4,DMG,HD,DTP,SE,GE,IEA


StructPlain2XML: This Message Transformation Bean converts plain text file into PI XML format.EDIFACT transaction structure needs to map to the PI XML structure which can be done via configuration.
                         StructPlain2XML is used when each row in input file has different structure.
SimplePlain2XML: This Bean also converts plain text file to PI XML format.
                         SimplePlain2XML is used when all the rows in input file has same structure.

Example of using Message Transformation Bean in Inbound Scenario:

Configuration for StructPlain2XML is very similar to StructXML2Plain except that conversionType and some parameters differ.
conversionType here will be StructPlain2XML in case of complex structures and SimplePlain2XML in case of simple structures.

Assigned tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Can't beat cheaper alternatives these days.  Can you give me an example of how the receiver side message would look in the StructXML2Plain example?
      Author's profile photo Former Member
      Former Member
      Hi Keith,

      Receiver side message depends based on format, field separator, end separator etc.

      Below is the example for 834 format with tilde as a separator.

      ISA~00~         ~00~         ~ZZ~0881927       
      GS~BE~0881927~XYZ~20090417~1410~1~X ~004010X095A1
      BGN~00~0881927~20090417~1410~ ~~~~~2~
      NM1~1L~1~Paulson~Kate~X~~~ ~345666823~~~

      Hope this is what you are looking for.

      Author's profile photo Matt Austin
      Matt Austin
      Very interesting application.  How would you handle looping structures in the EDIFACT / X12 message (such as the PO1 or N1 loops) ?
      Author's profile photo Bhavesh Kantilal
      Bhavesh Kantilal
      And, on a similar line, how do you handle one EDI message have multiple messages formats 🙂

      Excellent thought process here in this blog, but this approach has tons of limitations which only having a BIC module or similar module from 3rd parties can help solve!