Skip to Content
Author's profile photo Alexander Teslyuk

PRE/POST XSLT step in integration scenario via PI

I decided to make some more advanced integration and write this separate Blog post based on the comments to the first Blog that I wrote about ME integration via PI


The main feature that I discovered since then, is that it is possible to define more than 1 mapping step and thus implement PRE/POST XSLT steps.

In my sample scenario the first step is a Message Mapping step (iDOC to iDOC) that selects only needed tags from the incoming iDOC



and makes a transformation of one of its fields (Description) based on the string concatenation rule:

modify iDOC.png


So, the inbound scenario I implemented looks like this:


iDOC is sent from ERP -> received by PI -> as PRE XSLT step, the initial iDOC is converted to another one with modifications using the capabilities of PI -> the modified iDOC is transformed by the XSL to the SOAP request -> the SOAP request is received and processed by SAP ME



Here is a screenshot of the imported Material with 2 times modified Description field. Prefix Alex+ was added by the XSL transformation, suffix +IDOC2IDOC was added at PRE XSLT step:



The main point was, of course, not to modify the iDOC before XSL transformation, but actually to show that it is possible to define the PRE or POST XSLT steps. Since it is possible to define a Java Class at PRE/POST XSLT step to be executed instead of a Message Mapping, any custom code can be executed within it (not necessarily for mapping purposes). Just at the end it should return the message to the next mapping (in this case XSL transformation) step.



I am looking forward for your comments. Your comments to my first PI Blog helped me to study PI deeper and in a right direction, so this Blog on how to implement PRE/POST XSLT steps was born.


I also hope you find information about ME integration via PI as much interesting as I do. Your Likes and Ratings would be appreciated.



Best  regards,


Assigned Tags

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

      Hi Alex,

      Sometimes additional information is required to process IDOC. E.g. dates in Production order are converted to GMT-0 before sending it to ME. Information about ERP timezone is stored in SAPMEINT_SUPPORTED_PLANTS table. How do you think it is possible to do it in PI - getting this info from table and converting accordingly data/time columns to different timezone?

      Thank you,


      Author's profile photo Alexander Teslyuk
      Alexander Teslyuk
      Blog Post Author

      Hi Evgeniy,

      And thank you for the question.

      In the Message Mapping (in the case I described it was PRE XSLT step Idoc2Idodc) it is possible to use a JDBC Lookup. So, SAPMEINT_SUPPORTED_PLANTS table in particular can be queried to get the timezone.

      JDBC Lookup.png

      Then even some pre-defined date functions can be used if needed:


      Eventually, if it is not enough for XSL transformation, one more PRE XSLT step that is actually a Java Class can be added to perform the needed changes based on the queried data from the JDBC Lookup.

      I am not saying though it is a convenient way to do, but it seems to be technically possible.

      Would be an interesting thing to try someday.

      Br, Alex.