cancel
Showing results for 
Search instead for 
Did you mean: 

Message-Mapping: nested Loops over Elements

Former Member
0 Kudos

Hi Experts,

I have problems with my Message-Mapping in the IR. I have a source and a target structure. In the following I will give you easy examples of these structures:

<u>source structure:</u>

<E1EDP01>

<E1EDP19>

<QUALF> ... </QUALF>

<IDTNR> ... </IDTNR>

</E1EDP19>

<E1EDP19>

<QUALF> ... </QUALF>

<IDTNR> ... </IDTNR>

</E1EDP19>

</E1EDP01>

<E1EDP01>

<E1EDP19>

<QUALF> ... </QUALF>

<IDTNR> ... </IDTNR>

</E1EDP19>

<E1EDP19>

<QUALF> ... </QUALF>

<IDTNR> ... </IDTNR>

</E1EDP19>

</E1EDP01>

<u>target structure:</u>

<LineItem>

<IDTNR></IDTNR>

</LineItem>

<LineItem>

<IDTNR></IDTNR>

</LineItem>

That means:

For every <E1EDP01> in the source structure I create one <LineItem> in the target structure. One E1EDP01-Element can contain more than one E1EDP19-Elements. I have to loop over these E1EDP19-Elements, because I have to locate the Element <QUALF> with a given (fixed) value. The Mapping should put the value from the Element <IDTNR> from the source structure - where the QUALF-Element has this given value - in the IDTNR-Element of the target structure.

I tried it with a UDF, but only the first <IDTNR> in the target structure got filled.

Thanks for your help

Christopher

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

chenge the context of E1EDP19 to its parent

and map the E1EDP19 to Lineitem

and check the before UDF use removecontext and after UDF splitbyvalue -- if you

want umultiple values from UDF and insert the Context change between each value..

Regards

Chilla

Former Member
0 Kudos

Thank you Chilla,

the problem is, that there are other Elements in the direct context of E1EDP01 that should be mapped in LineItem. Is this fact important?

best regards

Christopher

Former Member
0 Kudos

Hi Christopher,

see map EIEDP01 to lineitem......for IDTNR and QUALF set context of both of these to EDP01, after the output of UDF, insert splitByValue and then map to target field..........then for each lineitem you will get IDTNR......

Thanks,

Rajeev Gupta

Former Member
0 Kudos

Thank you,

but how I can set the Elements IDTNR and QUALF to the context E1EDP01?

In the splitByValue-Function do I need "each value"?

best regards

Christopher

Former Member
0 Kudos

Hi Cristopher,

just right-click IDTNR.....select context.....then select E1EDP01.....then IDTNR context will change to E1EDP01......

in splitbyvalue use each value.....

Thanks,

Rajeev Gupta

Former Member
0 Kudos

Thank yor very much

that solved my problem

With best regards

Christopher

Answers (0)