cancel
Showing results for 
Search instead for 
Did you mean: 

IDOC mapping issue (calculation using parent and child fields)

Former Member
0 Kudos

We are mapping an IDOC to a file for output to a third party. The IDOC has many segments, some of which are embedded. This is where I'm having the issue. I am trying to perform a calculation on a field from the parent node (E1EDP01-MENGE) with the field from the child node (E1EDP05-KRATE) to determine the total tax for that line (qty X rate).

<b>Issue:</b> The mapping that is in place is using the same MENGE value for all calculations, even where the E1EDP01 segment is not a parent of the E1EDP05 segment.

Please review the screen prints and explain how I can correctly group the E1EDP05 child segments rate field (KRATE) with the corresponding parent segment E1EDP01 quantity (MENGE).

<b>Example:</b>

Parent segment, E1EDP01 / Child segment E1EDP05 (There are many E1EDP05 segments for 1 E1EDP01 segment)

E1EDP01 (parent node)

E1EDP05 (child node)

<b>Target structure</b>

ITEM (parent) --->E1EDP01 is mapped at node level

-->ITEM_DATA --->E1EDP01 is mapped at node level

-->ITEM_TAX --->E1EDP01 is mapped at node level

-->(fields for item_tax)

-->Record type

-->Invoice number

-->Line total

-->etc...

I am mapping (E1EDP01-MENGE) for calculation with (E1EDP05-KRATE) to determine tax at the line item level. I have the context set at each Node, E1EDP01 for MENGE and E1EDP05 for KRATE. I was using CopyValue, but this was using the frist occurence of MENGE for all line items.

<b>mapping example</b>

<u><b>*I am using MENGE (Copy_Value) then multiplying by KRATE to get the line item total. This was causing the same MENGE (because of Copy_Value) for all line items.</b></u>

E1EDP01-MENGE|Copy_Value|MULT--->TAX_ITEM-LINE_TOTAL

E1EDP05-KRATE|

I removed the CopyValue and now I'm getting the following error:

Cannot produce target element /ns0:MT_DTN_INVOICE1/INVOICE/ITEM/ITEM_TAX[3]/LINE_TOTAL. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd

How can I map this so the child records (E1EDP05) are grouped with the correct parent records (E1EDP01)?

Thanks in advance!

Michael

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

Check this blog:

/people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool

Regards

Stefan

Former Member
0 Kudos

I have awarded the maximum points. This has solved the problem (UseOnAsMany).

Thanks again,

Michael

Answers (0)