Usually I face edifact, eancom, ansi x.12 messages in my edi integration projects. XML message interfaces like OpenTrans appear from time to time. However, these XML message interfaces were always used in a direct integration omitting the SAP b2b addon.
EDI Separator Adapter is able to handle XML messages – and it is able to use Xpath queries, too.
In this blog I will show you some examples, how to use the edi separator adapter for routing xml messages without large receiver determinations or receiver splits.
Example
Let's say for example you have the following substructure in our xml message...
<Partner>
<Partnertype>Buyer</Partnertype>
<Partner_Id>0000020518</Partner_Id>
</Partner>
<Partner>
<Partnertype>ShipTo</Partnertype>
<Partner_Id>0000020519</Partner_Id>
</Partner>
and you would like to route the xml messages according to the specific buyers Partner_Id. An expression like
(/MyXML/Main/Header/Delivery/Partner/Partner_Id = '0000020518') AND (/MyXML/Main/Header/Delivery/Partner/Partnertype = 'Buyer')
will not work for you. You need to use
/MyXML/Main/Header/Delivery/Partner[(PartnerType = 'Buyer' and Partner_Id = '0000020518')] EX
In the swing tool environment, it looks like this:
In cases you would like to send all messages for this partner - not just one type like delivery messages, but invoices, order responses also, within one listening edi separator sender channel, you can use the following expression:
*/Partner[(PartnerType = 'Buyer' and Partner_Id = '0000020518')] EX
Other xpath expressions widely used in SAP PI/PO will work, too.
Prerequisites
The edi separator receiver channel needs an active check box 'Enable XML'
and secondly, if you have an UTF-8 encoding within your XML files:
Set the following parameters in the Advanced Mode:
edi.recv.input.encoding UTF-8
This is important to keep your codepage as UTF-8.
Limitations
For large XML files the edi separator sender channels will take quite long for fetching their messages. E.g. in my projects 10 MB large XML files took 3 to 5 seconds to route. A 50 MB large XML file took 20 seconds. It seems that the processing time will grow exponentially depending on size of the XML message and the number of the XML sender channels within the SAP PO system.