Skip to Content

Multiple source segments need to map to target based on conditions

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

7 Answers

  • Best Answer
    avatar image
    Former Member
    Dec 16, 2006 at 08:48 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 16, 2006 at 07:52 AM

    Hi Sridhar,

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

    venu.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 16, 2006 at 08:34 AM

    sridar

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 16, 2006 at 02:02 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 16, 2006 at 07:00 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 01, 2007 at 11:11 AM

    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>

          Add comment
          10|10000 characters needed characters exceeded

          • Former Member

            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

        • Jun 09, 2011 at 10:27 AM

          SOlved

          Add comment
          10|10000 characters needed characters exceeded

          • 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