Skip to Content

 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 ‘com.sap.aii.messaging.adapter.Conversion’.
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
       Xml.addHeaderLine

 Module Config-1

 

Module Config-2

Module Key      Parameter Name               Parameter Value

Key                 Transform.Class                com.sap.aii.messaging.adapter.Conversion

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.

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. Keith Wendel
    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?
    (0) 
    1. Sobhitha Laxmi Kata Post author
      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
      ST~834~0001
      BGN~00~0881927~20090417~1410~ ~~~~~2~
      DTP~007~D8~20090417
      N1~P5~XYZ~FI~74-1563240~~
      N1~IN~AETNA~FI~953402799~~
      INS~Y~18~030~~~A~~~~~FT~N~~~~~~~~
      REF~0F~19228198~~
      REF~1L~0881927~~
      DTP~393~D8~20060101
      DTP~303~D8~20060101
      DTP~336~D8~20060101
      NM1~1L~1~Paulson~Kate~X~~~ ~345666823~~~
      PER~IP~~~HP~000~~~~~
      N3~NA~NA
      N4~NA~NA~00000~NA~~
      DMG~D8~19781108~2~R~~~~~
      HD~030~~~LTD~test~EMP~~~~~~
      DTP~348~D8~20060101
      DTP~357~D8~20060101
      SE~18~0001
      GE~20~1
      IEA~22~00000001

      Hope this is what you are looking for.

      (0) 
  2. Matt Austin
    Very interesting application.  How would you handle looping structures in the EDIFACT / X12 message (such as the PO1 or N1 loops) ?
    (0) 
    1. 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!

      (0) 

Leave a Reply