Skip to Content
0
Former Member
Mar 21, 2006 at 10:53 AM

Flattening an IDOC via Graphical mapping

21 Views

Hi,

I'm still new to the context mapping functions.

Though there are numerous examples to do parts of what I would like to do, none seems to address my scenario in such a way that I can combine the mapping methods.

My scenario

Source IDOC

<SEG1> (Occurs 1)

<PLANT>P1</PLANT>

</SEG1>

<SEG2> (Occurs 1..9999)

<MATERIAL>

<MATNR>M1</MATNR>

<MAKTX>D1</MAKTX>

<SEG3>

<UOM>U1</UOM>

<UOM>U2</UOM>

<UOM>U3</UOM>

</SEG3>

</MATERIAL>

<MATERIAL>

<MATNR>M2</MATNR>

<MAKTX>D2</MAKTX>

<SEG3>

<UOM>U4</UOM>

<UOM>U5</UOM>

<UOM>U6</UOM>

</SEG3>

</MATERIAL>

</SEG2>

Target flat structure

<Target> (Occurs 0 to unbounded)

<Plant/>

<Matnr/>

<Desc/>

<UOM/>

</Target>

What I'm looking for is :

<Target>

<Plant>P1</Plant>

<Matnr>M1</Matnr>

<Desc>D1</Desc>

<UOM>U1</UOM>

<Plant>P1</Plant>

<Matnr>M1</Matnr>

<Desc>D1</Desc>

<UOM>U2</UOM>

<Plant>P1</Plant>

<Matnr>M1</Matnr>

<Desc>D1</Desc>

<UOM>U3</UOM>

<Plant>P1</Plant>

<Matnr>M2</Matnr>

<Desc>D2</Desc>

<UOM>U4</UOM>

<Plant>P1</Plant>

<Matnr>M2</Matnr>

<Desc>D2</Desc>

<UOM>U5</UOM>

<Plant>P1</Plant>

<Matnr>M2</Matnr>

<Desc>D2</Desc>

<UOM>U6</UOM>

</Target>

and so on.

I can flatten the structure to get the <Plant><Material> part with the <removeContext> method

and

the <Matrial><Desc><UOM> with a <copyHeaderPerUOM> user function folowed by a <SplitByValue> assignment but I cannot seem to combine the two methods to get to resultant flat structure I'm looking for.

Any help will be appreciated.

Thanks

Andre