Skip to Content
author's profile photo Former Member
Former Member

Graph mapping with context not in pair

Hi,

In an IDOC ORDERS05 to whatever scenario I found the following situation. I have to evaluate the value of the field NAME4 when the partner function (PARVW) is WE. The issue comes with the fact that the NAME4 tag only appears when is not empty, so the XML should look like this.

<E1EDKA1 SEGMENT="1">
   <PARVW>AG</PARVW>
   <PARTN>0000103905</PARTN>
</E1EDKA1>
<E1EDKA1 SEGMENT="1">
   <PARVW>RE</PARVW>
   <PARTN>0000103905</PARTN>
</E1EDKA1>
<E1EDKA1 SEGMENT="1">
   <PARVW>RG</PARVW>
   <PARTN>0000103905</PARTN>
</E1EDKA1>
<E1EDKA1 SEGMENT="1">
   <PARVW>WE</PARVW>
   <PARTN>0000103905</PARTN>
   <NAME4>S</NAME4>
</E1EDKA1>

The issue is that the NAME queue will have only one value (or even 0) while the PARVW queue will have 4.

The question: How can I pair both queues again (i.e: inserting blanks to the NAME4 queue wherever is empty)?

thanks in advance for help,

David R.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Oct 23, 2006 at 01:24 PM

    You can use the standard function <b>mapWithDefault</b>.

    But you do not need this in the most scenarios, as you get 4 contexts for the NAME4, three of them are empty. This should be sufficient to distinguish the values.

    Regards

    Stefan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2006 at 01:25 PM

    Hi,

    You can use standard function 'exists' to chek ehther the field exist and 'createIf' to creat the node if it does not exisit

    <i>If there are structuring elements in your target structure that do not exist in the source structure, insert them using this function. Using condition I you can control whether the element is inserted or not. You connect the element in the target structure using O.</i>

    Regards

    Vijaya

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2006 at 01:35 PM

    Thanks guys, Both solutions seem to work so far.

    Points rewarded 😉

    regards,

    David R.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.