cancel
Showing results for 
Search instead for 
Did you mean: 

Graph mapping with context not in pair

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

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

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks guys, Both solutions seem to work so far.

Points rewarded

regards,

David R.

Former Member
0 Kudos

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