Você está na página 1de 10

Message Mapping Demystified

Applies to:
SAP NetWeaver PI 7.1 / 7.0, XI 3.0.
For more information, visit the Service Bus-based Integration homepage.

Summary
This guide will help you in implementation of common mapping requirements that we often find difficult to
design using graphical mapping. The scope of this document is to provide an overview of the necessary
design tasks and tools for selected mapping requirements.
Author:

Sunil Singh

Company: L&T InfoTech Ltd.


Created on: 26 November 2008

Author Bio
Sunil Singh is a SAP PI/XI Consultant in L&T InfoTech Ltd. His area of expertise includes SAP PI/XI, Java.

SAP COMMUNITY NETWORK


2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


1

Message Mapping Demystified

Table of Contents
1 Introduction ......................................................................................................................................................3
2 What is your Requirement? .............................................................................................................................3
2.1 Create the node at run time ......................................................................................................................4
2.1.1 Design.................................................................................................................................................................4
2.1.2 Results ................................................................................................................................................................5

2.2 Display unique values ...............................................................................................................................6


2.2.1 Design.................................................................................................................................................................6
2.2.2 Result..................................................................................................................................................................7

2.3 Transfer fixed values.................................................................................................................................7


2.3.1 Design.................................................................................................................................................................7
2.3.2 Result..................................................................................................................................................................8

Conclusions ........................................................................................................................................................8
Related Content..................................................................................................................................................9

SAP COMMUNITY NETWORK


2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


2

Message Mapping Demystified

1 Introduction
This guide answers the various common mapping requirements and their implementation using graphical
mapping. The scope of this document is to provide an overview of the necessary design tasks and tools for
selected mapping requirements.
This guide is intended for use in conjunction with the accompanying screen shots. The screen shots serve as
an entry point to the guide by providing high-level guidance at a glance, while the guide provides step-bystep instruction for the individual design tasks

2 What is your Requirement?


This section addresses the various mapping requirements, design and their results.

Fig 1: Standard Structure


Above structure is used to demonstrate various mapping requirement throughout the guide.

SAP COMMUNITY NETWORK


2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


3

Message Mapping Demystified

2.1 Create the node at run time


Many times we come across the requirement where we have to create the node in target structure based on
some condition at run time.
2.1.1 Design
In above structure target node Official should be created only when value of source element Type is P.

Fig 2
If value of element Type is P then output of function equalsS is true otherwise it will return false.
Node function creatIf will create the node only if input to this function is true.

Fig 3: Queue values when the value of element Type is P

Fig 4: Queue values when the value of element Type is other than P

SAP COMMUNITY NETWORK


2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


4

Message Mapping Demystified

2.1.2 Results

Fig 5: Result when the value of element Type is P.

Fig 6: Result when the value of element Type is other than P.

SAP COMMUNITY NETWORK


2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


5

Message Mapping Demystified

2.2 Display unique values


In many business scenarios it is required to select only unique values
2.2.1 Design
Duplicated values of element PsNo should be removed and only that much number (equal to unique
number of values in PsNo) of Official node should be created at target side

Fig 7
As there will be multiple values in source element PsNo its context must be changed to root level node.
Also change the property of node function SplitByValue to Value Change as shown in the figure.

Fig 8
As shown in the figure source element PsNo has three values out of which one value is duplicate.
According to design there should be only two target node Official.

SAP COMMUNITY NETWORK


2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


6

Message Mapping Demystified

Fig 9

As shown in the figure only two nodes are generated for two unique values of PsNo.

2.2.2 Result

Fig 10
2.3 Transfer fixed values
Sometimes target demands different value for the particular value in the source structure.
2.3.1 Design
If the value of source element Type is L then it should be transferred as Learner to the target. If it is T
then it should be transferred as Temporary and in case of P it should be transferred as Permanent to the
target.

Fig 11
As shown in the figure values of source element Type is entered as a key and the corresponding value to
be sent to the target is entered as value.

Fig 11 If the input is P then it will be shown as Permanent in the target.

SAP COMMUNITY NETWORK


2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


7

Message Mapping Demystified

Fig 12 If the input is other than the keys


If the input is other than the one mentioned as a key in the fixed- value table then the default value will be the
result. In above design the default value is set to blank.
2.3.2 Result

Fig 13 When input Type is P

Fig 14 When input Type is other than the keys in the Fixed-Values table.

Conclusions
Often we write UDFs to fulfill our mapping requirements that could be easily achieved using graphical
mapping.
Graphical mapping offers easy maintenance, flexible context handling which becomes nightmares when we
use UDFs to implement same functionality.

SAP COMMUNITY NETWORK


2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


8

Message Mapping Demystified

Related Content
http://help.sap.com/saphelp_nw04/helpdata/en/d9/cea942ad920c31e10000000a1550b0/frameset.htm
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2458
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2792
For more information, visit the Service Bus-based Integration homepage.

SAP COMMUNITY NETWORK


2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


9

Message Mapping Demystified

Disclaimer and Liability Notice


This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not
supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.
SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document,
and anyone using these methods does so at his/her own risk.
SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or
code sample, including any liability resulting from incompatibility between the content within this document and the materials and
services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this
document.

SAP COMMUNITY NETWORK


2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


10

Você também pode gostar