Dear Experts,
I have a source structure as follows:
<Header>
<Header1>first </Header1>
<Header2>second</Header2>
<Header3>third</Header3>
<LineItem>
<Item1>one</Item1>
<Item2>two</Item2>
<Item3>three</Item3>
<Item4>four</Item4>
</LineItem>
<LineItem>
<Item1>onea</Item1>
<Item2>twob</Item2>
<Item3>threec</Item3>
<Item4>fourd</Item4>
</LineItem>
</Header>
<Header>
<Header1>firstfirst </Header1>
<Header2>secondsecond</Header2>
<Header3>thirdthird</Header3>
<LineItem>
<Item1>oneone</Item1>
<Item2>twotwo</Item2>
<Item3>threethree</Item3>
<Item4>fourfour</Item4>
</LineItem>
<LineItem>
<Item1>oneoneaa</Item1>
<Item2>twotwobb</Item2>
<Item3>threethreecc</Item3>
<Item4>fourfourdd</Item4>
</LineItem>
</Header>
My target structure is an ORDERS IDOC. I have to map the Header3 to the second instance of the segment E1EDP01->E1EDP02->BELNR.
For each occurrance of the Header and IDOC has to be created. and for each occurrance of LINEITEM the E1EDP01 segement has to be populated.
Now when i test the mapping, i get different values of the Header3 in one single IDOC instead of it being the same.Thats is in the first IDOC, the BELNR field of E1EDP02 of the all LineItems should be "third" only. But i get both "third" and "thirdthird". Whereas "thirdthird" should be occuring in the BELNR of the second IDOC. I tried using copyvalue function. But if i use that the same value gets replicated for all the IDOCs which should not be the case. I have tried all possibilities, changing the context, remove context, split by value. But the result is the same as described without the use of copy value.
How should i resolve this probelm?
Thanks and Regards,
Merrilly