Skip to Content
Introduction: SAP XI Message Mapping internally uses SAX parser which has a number of advantages when it comes to mapping:

1) It can handle large messages, meaning it has no size limitations on messages.

2) SAX parser has a better runtime performance than a DOM parser.

Message mapping works internally using Queues. These queue’s can be used as debugging functionality when it comes to handling messages. They can be used as step by step check of mappings and are applicable to any step in the mapping program.

Let’s take a simple example and see how message processing is done using Queue.

image

The above example illustrates on how the queue stacks up the elements from the source xml.
If no further elements are present at a particular hierarchy level, a context change is inserted in the queue.

The following scenario demonstrates the working of queues.

This Scenario is from a one level source hierarchy structure (MT_SOURCE) to a flat target structure (MT_TARGET).

image

image

Execute the mapping program in the test mode with appropriate data.

Now you can apply Display Queue function to each element and standard functions that are used within the mapping program.

image

Right click on the elements displayed in the Mapping editor and select Display Queue function to display the content of the Queue.

image

The mapping program fills in DESCP element based on specific KEYNAME value. In this case it is MATNAME.

After using the Display Queue function you can see that the KEYNAME element is filled up with 3 different values MATCODE, MATNAME and MATPRICE. Now that the condition is true for only MATNAME (as specified), the Equals Function is only true for the second test condition (i.e. MATNAME) and false for the rest of values. This way we can validate the mapping program for an input value. Now the resulting DESCP element has only one value in the queue i.e. “TEST2”.

Above Fig clearly depicts the process flow explained above.

Note that the queue is displayed for all the elements be it user-defined elements or standard functions.

Let’s have a closer look at the queue entries in the DESCP element and find what the different entries represent.

Firstly the gray and the black rectangle at the beginning and at the end of the queue represent the initial and the terminal context change. These are not passed to the queue for message processing, so these are not used in user-defined functions.

The inner context changes are represented by light gray color. They are represented in user-defined functions by the constant ResultList.CC.

The actual Data is represented in the white rectangle.

Suppressed values are represented by blue rectangles, in our case the suppressed values are TEST1 and TEST3, they are highlighted when the target elements are created as shown in the fig above.
They are represented in he user-defined functions by the constant ResultList.SUPPRESS.

So, if you are using a user-defined function to enhance your mapping, the queue that is displayed above for DESCP element will result in a string array that is built up of:
ResultList. SUPPRESS
ResultList.CC
TEST2
ResultList.CC
ResultList.SUPPRESS

The above diagram clearly gives you an overall view of how messages are processed at any given point of time.

To report this post you need to login first.

7 Comments

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

  1. Venu Gopal Sirangi
    Venkat,

    Thanks good information regarding Mapping.

    I have one doubt regarding mapping.

    1) After mapping is done we test and store the XML file in one directory later we use it for inbound process.

    2)If I have number of files with the same format , for all the files i have to do like this or any other options
    Venu.

    (0) 
  2. raju b
    hi

    may i know how to split a sting in to two parts in graphical mapping. For this is there any standard function or need to write any udf for this.

    raju

    (0) 

Leave a Reply