Skip to Content

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 http://scn.sap.com/community/manufacturing/blog/2015/12/12/hands-on-sap-me-integration-or-how-i-learnt-pi-xi

 

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

FirstStep.png

 

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:

ImportedMaterial.png

 

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,

Alex.

To report this post you need to login first.

2 Comments

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

  1. Evgeniy Ulitin

    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,

    Evgeniy

    (0) 
    1. Alexander Teslyuk 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:

      Dates.png

      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.

      (0) 

Leave a Reply