Skip to Content
Author's profile photo Sravya Talanki

Message Mapping Simplified – Part I

It was initially very hard for me to understand the message mapping when we are trained on SAP XI.I browsed help.sap.com and ended up getting more confused. After working with SAP XI for some time however the intuition is changed. I will try to simplify the message mapping by elucidating the concepts in the nutshell. Blog does not cover the message mapping in detail but just gives the basic understanding for any new XI developers. Part 1 of the blog provides a base for conceptual understanding of message mapping with suitable examples.

As we know XI produces the XML documents at the inbound/outbound of the integration pipeline, there is a need for us to map the source XML doc to the target XML doc. Message Mapping editor is a built in feature, which helps to map the source and target XML messages graphically.
In this blog we discuss various terms related to it.

Definition: Message Mapping

Firstly, let me define the message mapping in the way I look at it:

“Message Mapping is nothing but a set of rules for producing target XML from the source XML.These rules are nothing but relations between the source XML tags and target XML tags”.

These rules keep varying according to the business requirements on the source and target XML documents.

Sample Rule :

Sample Mapping

Occurence

Illustration of Mapping Error:

Mapping Error

Definition: Representation:

Before we proceed further it is better if we have a clear understanding of the 3 terms:

1.

Element

: Simple XML tag.

2.

Attribute

: Property of XML tag.

3.

Node

: Logical grouping of set of XML tags.

In XI it is represented as shown below:

XML representation in XI:

XML tag representatin in XI

Additionally there is color indicator for the target XML messages:

1.

Red Color

indicates that target nodes/elements/attributes are mandatory and has to be definetly mapped.

2.

Green Color with a red circle

at the bottom indicates that there is a minimum occurrence specified for the tag which has to be met in the mapping.

3.

Green color

indicates that we can map the nodes/elements/attributes according to the requirements.

Color Indication in the Mapping Editor:

Color Indicator in XI Mapping Editor

Contexts in Message Mapping:

Once the above concepts are clear we can proceed to the most confusing part of message mapping called “Context Handling”.
Initially when I was browsing through the training materials and mapping patterns it was really hard for me to exactly figure out what the term “Context” means. (Forget about context handling and context changing).

Definition: Context

After working out few examples I figured out that: “Context of an element is nothing but just the level (with reference to its parent node) where the XML tag appears in the given XML document”.
Level of any element is set to the immediate parent node by default.

Definition: Context Changing

Once the definition of context is very clear the rest of the terms are automatically clarified.“Context Changing is just changing the level of XML tag (element level in the XSD) in the XML document or It is just the flexibility provided by XI for changing the XSD of the XML document at the runtime”. Example given below might make you to understand it better. I added a

Qualifications

node and

Description

element in the source data type and one

Qual_Desc

element in the target data type.

Default Context

The context of the

Description

tag is automatically set to the

Qualification

by default in XI which means that always

Description

XML tag occurs under

Qualification

XML tag as shown below.

Source XML message interpretation by the Mapping runtime before context change:

XML before Context Change

I changed the context of the

Description

tag to the root

MT_SRC

XML tag as shown below.

Changing Context in XI

Source XML message interpretation by the Mapping runtime after context change:

XML after Context Change

Definition: Context Handling

Contexts in XI can be handled by various ways like

node functions, advanced functions

, which will be, illustrated more in detail in the next blog. We also have queuing mechanisms for handling complex Context Changing in advanced user functions.

Once the above concepts are clear , working with the message mapping and trouble shooting any errors that occurred became relatively very easy for me. Part II will provide some more good examples for playing around with message mapping feature

provided by XI.

Assigned Tags

      27 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Excellent work, Sravya. I am eagerly awaiting your next blog. I am just about getting started on XI and am struggling with understanding the core concepts.

      Author's profile photo Sravya Talanki
      Sravya Talanki
      Blog Post Author
      Thanks Raj..You will definetly see some more..:)
      Author's profile photo Former Member
      Former Member
      During the migration process problems have been reported for this blog. The blog content may look corrupt due to not supported HTML code on this platform. Please adjust the blog content manually before moving it to an official community.
      Author's profile photo Sravya Talanki
      Sravya Talanki
      Blog Post Author
      Thanks Thomas!
      Author's profile photo Former Member
      Former Member
      Excellent Blog...
      Author's profile photo Former Member
      Former Member
      Hi Sravya

      You have very neatly elucidated XI mapping basics in this blog. The terminology used in mapping world is difficult to understand for a beginner. I am sure this article which uses simple-plain-vanila English will be a great help.

      Great job.

      Cheers
      Pawan

      Author's profile photo Former Member
      Former Member
      Thanks for the inputs. Greatly appreciated.
      Author's profile photo Former Member
      Former Member
      Excellent work, Sravya

      Regards,
      Venkat Neela

      Author's profile photo Former Member
      Former Member
      khodos sravya,

      Expecting more blogs from you.

      Regards,
      Ameer.

      Author's profile photo Former Member
      Former Member
      Good Job..!!!

      Very well explained...!!!!

      Expecting more such features from you.
      All the best..!!!

      Vishal Kohli
      vishal_kohli@keane.com
      Keane

      Author's profile photo Former Member
      Former Member
      Congratulations for the great job.
      Easy, practical and with a very sense of humor!
      Author's profile photo Former Member
      Former Member
      Hi Sravya,

      It was highly helpful for begineers like us.
      Hope to see some more from you..

      Thanks,
      Younus

      Author's profile photo Former Member
      Former Member
      Hi Sravya,
              this is very important topic for starting sap xi employers...

      Thanks
      sreenivasulu kaipu
      09247500079
      srinu.ababxi@gmail.com

      Author's profile photo Former Member
      Former Member
      It just keeps getting better and better!

      Thank you and best regards

      Kartik Iyengar~

      Author's profile photo Former Member
      Former Member
      Hi Sravya,

      Great work! It does help beginners like me to understand the concept better.

      Thanks,
      Birla.

      Author's profile photo Former Member
      Former Member
      Excellent Sravya...great work...thank you...
      Author's profile photo Former Member
      Former Member
      Its a very beautiful blog. It helped me to get the context of context 🙂
      Author's profile photo Former Member
      Former Member
      Hi Sravya,

      It's a really great job!!
      Thanks for your help!!!

      Best
      Mirita Mistry

      Author's profile photo Former Member
      Former Member
      She explained the Message mapping in simple words.
      Author's profile photo Former Member
      Former Member
      Hi,

      I am new to PI technology. I want to learn Nodefunctions in mapping. So help me on this.

      Regards,
      Naik,Pune,Infosys.

      Author's profile photo Former Member
      Former Member
      Hi This is sarat,I am working as GIS Consultant in Capgemini this is my first hour in XI and It was pretty clear.
           I would be expecting the same stuff further in next stage of blog.
      Author's profile photo Ernesto Cruz
      Ernesto Cruz
      Most clear, imposible!!!! Thankssss. A greet from Argentina
      Author's profile photo Former Member
      Former Member

      Hi Sravya,

      Good Blog..

      Can you clarify me regarding the following

      Source XML message interpretation by the Mapping runtime before context change:

      Source XML message interpretation by the Mapping runtime after context change:

      when you are changing the context for Descriptions you can directly change it to MT_SRC why do you change context for the first to Qualificaitons and then changed to context to MT_SRC

      Kindly Explain it briefly

      Author's profile photo Former Member
      Former Member

      Hi Sravya,

      This is a great material for me who is just starting to learn PI...

      I'll be following your blog to be more familiar with it. 🙂

      Author's profile photo Former Member
      Former Member

      Hi Sravya,

      This very useful to for me.

      Thanks,

      Raman

      Author's profile photo Sravya Talanki
      Sravya Talanki
      Blog Post Author

      Thanks.

      Author's profile photo prashanth reddy
      prashanth reddy

      Hi Sravya,

       

      Very nice blog, useful for who is just starting to learn PI…