cancel
Showing results for 
Search instead for 
Did you mean: 

Condition based Message Mapping

Former Member
0 Kudos

Hi,

IDoc contains 2 Segments:

Seg1 & Seg2.

Seg2 is the child of Seg1.

Seg1 contains field:

CODE

Seg2 contains fields:

DESCRIPTION

HIERARCHY

When i trigger the idoc, the data is stored as:

Seg1:CODE: 1001

-


Seg2:DESCRIPTION: test1,

-


HIERARCHY: 00

Seg1:CODE: 1002

-


Seg2:DESCRIPTION: test2,

-


HIERARCHY: 01

Seg1:CODE: 1003

-


Seg2:DESCRIPTION: test3,

-


HIERARCHY: 02

Seg1:CODE: 1004

-


Seg2:DESCRIPTION: test4,

-


HIERARCHY: 03

creating the duplicate segments as shown above.

-


This data is mapped to the structure in XI.

The structure to map will be as follows:

str1

---ID1

---DES1

---ID2

---DES2

---ID3

---DES3

-


i've to map depending on the field HIERARCHY condition.

IF HIERARCHY = '02' THEN

ID1 = 1003.

DES1 = TEST3.

IF HIERARCHY = '01' THEN

ID2 = 1002.

DES2 = TEST2.

IF HIERARCHY = '00' THEN

ID3 = 1001.

DES3 = TEST1.

-


How to map this condition based, in the MESSAGE MAPPING?

pls help in solving this if possible with a screen shot.

rgds,

balu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can use Equals(From text category) and IfWithoutElse Function for this.

1) For Equals function inputs are HIERARCHY and constant value like 01, 02 etc. depending upon your node condition.

2) Then use IfwithoutElse function with, keeps property TRUE.

use this mapping for each ID and DES node.

Regards,

Rohit.

Answers (2)

Answers (2)

Former Member
0 Kudos

closed

Former Member
0 Kudos

you can also use the standard function fixvalues available under conversion.

the mapping will be


hierarchy--->fixvalues--->ID

hir=erarchy--->fixvalues-->DESC

right click on the fixvalues,choose properties and fill the keys with hierarchies 01,02,03 and values with ID1,ID2,ID3.

Similarly u shud do 4r filling the DESC field also.

Former Member
0 Kudos

Hi,

thanks for the quick reply.

Here the same segment contains different values as shown above. Depending on the values i've to map the same source field to different target fields.

The mapping will be seen like this:

CODE --> ID1

DESCRIPTION --> DES1

CODE --> ID2

DESCRIPTION --> DES2

CODE --> ID3

DESCRIPTION --> DES3

This mapping of same source fields to different target fields depends on the value of the source field HIERARCHY.

Codewise, i can show U like this:

IF HIERARCHY = '02' THEN

ID1 = CODE.----


"1003.

DES1 = DESCRIPTION.------"TEST3.

IF HIERARCHY = '01' THEN

ID2 = CODE.----


"1002.

DES2 = DESCRIPTION.------"TEST2.

IF HIERARCHY = '00' THEN

ID3 = CODE.----


"1001.

DES3 = DESCRIPTION.------"TEST1.

Can U show me the screen shot if possible using:

http://www.flickr.com/photos/

the solution to solve my requirement...

tnx n rgds,

balu

Former Member
0 Kudos

You cannot map the two targets in a single mapping even if u use udf,standard mapping functions or anything.

u have to go 4r 2 similar mappings for target (code nd description)

fixvalues ll be an easier way.