Skip to Content
Author's profile photo Former Member

Introduction to queues in message mapping

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.


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).



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.


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


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

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

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Will be good for XI starters..good job done Venkat
      Author's profile photo Prasad Ulagappan
      Prasad Ulagappan

      Venkat, good blog, keep the good work.

      -Prasad U

      Author's profile photo Former Member
      Former Member
      hi venkata

      xsld maping scneario
      plese send me my email id is

      Author's profile photo Former Member
      Former Member

      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

      Author's profile photo Former Member
      Former Member
      Hi Venkat,
      Good blog to dig into mapping stuff.


      Author's profile photo Former Member
      Former Member
      good job venkat...thank you for the info...
      Author's profile photo raju b
      raju b

      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.


      Author's profile photo Former Member
      Former Member

      The first figure/example in this explanation is erroneous to my opinion : the queue for item that is shown will never be in this way : the higher level for item is level1 for values 10 and 20 and is level2 for values 30 and 40.  It is very confusing to have this example in the explanation of context!