Skip to Content
avatar image
Former Member

Message Mapping with Alternative and Missing elements

Hi All.

This is my first question on SCN so pardon if I overstep on any rules.

I'm mapping a ORDERS05 IDOC to another XML document.

On the ORDERS05 <E1EDP01 SEGMENT="1"> contains some of the material information and it CHILD node <E1EDP19 SEGMENT="1"> contains material numbers. I have removed some of the ELEMENTS to simplyfy my example.

I want to map the <IDTNR> where <QUALF>Z02</QUALF> to my target XML structure with is a single NODE structure for material.

This works fine in the QUALIFIER exists and I have the context on the E1EDP19 level. If the <QUALF>Z02</QUALF> segment is missing I want to use the IDTNR from <QUALF>001</QUALF> and I can't get it right. I have tried changing the context to E1EDP01 but then the queues are missalinged as the E1EDP19 with <QUALF>010</QUALF> has no IDTNR.

So my questions is can this be solved with Graphic mapping or may a UDF?

I could always do it by writing a XSLT but that feels like a cop out instead of using the ESB mapping.













<KTEXT>Hungry Lion Chips 6X2.5Kg</KTEXT>






Various Mapping that I have done so far

Thank you all for your assistance in this regard.

Mapping1.png (103.8 kB)
Mapping2.jpg (261.8 kB)
Mapping3.png (93.1 kB)
Mapping4.png (74.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Jul 08, 2016 at 11:24 AM

    Hi Derick!

    You could use MapWithDefault to add value for missing IDTNR element.

    I'm not at work now so I can't try it myself, but:

    IDTNR-MapWithDefault-RemoveContexts-FormatByExample(QUALF in context of E1EDP01).

    Thus you should get the correct items count for IDTNR queue in context of E1EDP01 and use it for substitution.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Evgeniy.

      The mapping you suggested worked for what we needed.

      Below is an example of the mapping that worked should someone else wish to do the same.

      Herewith issues that needs to be noted.

      If the 001 QUALF NODE is found before the Z02 then it will use the IDTNR for 001.

      If both QUALF elements are missing it will move the IDTNR value one context up.

      Mapping5.png (75.1 kB)
  • Jul 08, 2016 at 08:45 AM

    Hello Derick,

    I guess the requirment is similar to logic in the below discussion ,can you try it

    Add comment
    10|10000 characters needed characters exceeded

    • Hello Derick,

      Removecontexts after that UDF should remove the Suppress values if am not wrong.

      Anyways I will work out more and help you.

      Guess Eve Solution helped you for the time being..thats glad to hear. 😊