cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple source segments need to map to target based on conditions

sridharreddy_kondam
Active Contributor
0 Kudos

Hi All,

I am facing a problem,

Scenario is like this

Source structure will be like this

E1ADRM1 --> occurences 0...99

E1ADRM1 --> occurences 0...99

E1ADRM1 --> occurences 0...99

E1ADRM1 --> occurences 0...99

Target structure

I9INPT00 --> occurences 1:1

Data comes like this

1) E1ADRM1 --Partner_Q = AG

E1ADRM1 --Partner_ID = 0000011223

2) E1ADRM1 --Partner_Q = OC

E1ADRM1 --Partner_ID = 0000011224

3) E1ADRM1 --Partner_Q = WE

E1ADRM1 --Partner_ID = 0000011565

4) E1ADRM1 --Partner_Q = GE

E1ADRM1 --Partner_ID = 0000011446

Target structure to be mapped

I9INPT00--<b>PHSHTO</b> with value 0000011223(If AG)

I9INPT00--<b>PHSOTO</b> with value 0000011565 (if WE)

the condition is like this

If E1ADRM1--Partenr_Q = AG then PARTNER_ID has to be mapped to target

I9INPT00 --> <b>PHSHTO</b>

If E1ADRM1--Partenr_Q = WE then PARTNER_ID has to be mapped to target I9INPT00 --> <b>PHSOTO</b>

I have tried but getting only one value for the first E1EDARM1 = AG and the rest are not at all triggering

So please can one give suggestions for this...

Thanks and Regards,

sridhar

I

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sridhar,

Do u expect to have all 3 values at the same time. . ie in ur idoc u expect to see

AG,WE,GE and you have to map all of them to the target side. Or is it that u may see any one of them in idoc and u have to map only one value to target side. If it is first case, then u have to change the occurances to 0...unbounded. I dont think it can be done otherwise.

Answers (6)

Answers (6)

sridharreddy_kondam
Active Contributor
0 Kudos

SOlved

former_member183898
Participant
0 Kudos

Hi Sridhar / All ,

Looks like very old post , however want to know how did you fixed this ?

I have used FixValues to achieve this , but not  working the way it should.

Please suggest.

Thanks,

Pushkar

nikhil_bose
Active Contributor
0 Kudos

hi sridhar,

before you create new node, remove the contexts by removeContext() function.

it will solve your problem.

regards

nikhilbos

<i> mark as answered if you've done

        • reward if helpful - thanks</i>

Former Member
0 Kudos

HI Sridhar,

If you wanted to generate the target node based on the below conditions, I assume that you will have maximum 4 target node generated based on the below conditions.

1) E1ADRM1 --Partner_Q = AG

E1ADRM1 --Partner_ID = 0000011223

2) E1ADRM1 --Partner_Q = OC

E1ADRM1 --Partner_ID = 0000011224

3) E1ADRM1 --Partner_Q = WE

E1ADRM1 --Partner_ID = 0000011565

4) E1ADRM1 --Partner_Q = GE

E1ADRM1 --Partner_ID = 0000011446

What you can do is you can right click on target node and by selecting dublicate you generate the 4 target node and then you can compare the values of source and if it is AG or GE then mapp the value to target node.

There will be four different mappings conditions for each target node.

I think this will work.

Thnx

Chirag

Former Member
0 Kudos

Hi Sridhar,

in your mapping, have you tried to apply the function 'removeContexts' to the source fields 'Partner_Q' and 'Partner_ID' before connecting them to the 'if' function?

This could prevent that your ifs only work for the first source record.

Regards,

Matthias

Former Member
0 Kudos

Hi sridhar,

Since your target message has only single occurence , you are getting only one value at target,,

if your target structure is a custom message type , u need to make the occurences of tht message as unbounded in mapping....

if your target structure is idoc...what i guess is...you need to change the occureces of tht idoc by modifying the XML code for tht idoc..in IR....and then use tht idoc at the target structure in mapping..

once you have your target structure as unbounded...the conditions tht you have specified will work ..perfectly fine....

i hope this helps...

Regards,

Sushil

prabhu_s2
Active Contributor
0 Kudos

sridar

in the message mapping change the cardinality of the target message to 0..unbounded.

Former Member
0 Kudos

Hi Sridhar,

I think u can modify the target structure occurance 0 to unbounded.

venu.

sridharreddy_kondam
Active Contributor
0 Kudos

No Venu,

The occurence cannot be changed...

Regards,

sridhar