Skip to Content

During PI migrations for the new java version of the new PI some of us might experience issues related to the fact that custom written code does not work in one of the user defined functions from the message mapping. If we know which part of code is causing the error we can always easily find it out by checking all UDFs in the mappings. What if we have a bit more then just a few mappings (like thousands) and same number of UDFs ? Do we need to go one by one ? Let me share with you and idea on how this issue can be solved.

Problem

How to get the source code of UDFs for all the mappings? 

Solution

Use the SimpleQuery to get the UDFs source code

http://host:port/rep/support/SimpleQuery

Step 1

Use the SimpleQuery to get all of the mappings from the ESR. You need to select object – Message Mapping and in the Result attributes – Link to object.

/wp-content/uploads/2012/07/linkt_to_object_115642.png

Step 2

As a result you will get a list of objects with a link to the “RAW” mapping specification as per screenshot below.

/wp-content/uploads/2012/07/object_with_raw_115646.png

Step 3

Inside the RAW link you can see that one of the nodes contains a zipped source code of the mapping.

/wp-content/uploads/2012/07/zipped_code_115647.png

Step 4

You need to get the zipped value and decode it with BASE64 decoder.

Decoder:

http://www.opinionatedgeek.com/dotnet/tools/Base64Decode/Default.aspx

Step 5

Now you can unzip the mapping and you will the source code.

/wp-content/uploads/2012/07/result_source_115648.png

Step 6

Now you can easily check in all UDFs for the string wich you need to replace and get the message mapping name from it

Note

In order to make it more practical to use you’d need to write a small tool which can get all the RAW source codes from all of your Message Mappings automatically but this is much easier if you know where to look for the code.

Request

Please let me know what you think of this approach – thank you.

To report this post you need to login first.

3 Comments

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

  1. Sunil Chandra

    Hi Michal,

    Happy to see this blog.

    In order to make it more practical to use you’d need to write a small tool…

    You would also be happy to know that tool is already there as MappingMaster uses exactly the same approach to fetch the mapping details. Although MappingMaster is already open source tool, this blog is making the secrets behind more public. 🙂

    http://scn.sap.com/community/pi-and-soa-middleware/blog/2011/12/19/lets-excel-mappingmaster-is-here

    This approach would be very useful as exporting mapping details using ctrl+shift+0 won’t be available from PI 7.3 onwards.

    Regards,

    Sunil Chandra

    (0) 
    1. Michal Krawczyk Post author

      Hi Sunil,

      didn’t know that mappingmaster is using the same thing 🙂 anyway at least now we get a bit more insight as you said 🙂

      thanks for the info,

      Regards,

      Michal Krawczyk

      (0) 

Leave a Reply