Skip to Content
0
Former Member
Jul 27, 2006 at 11:26 AM

Mapping to simplify structure of XML for File Adapter

23 Views

Hi everybody

Here is a short question regarding the restructuring of an incoming IDoc message to an outgoing file.

The IDoc has the structure:

-IDoc

___-->Segment A1

______--> Segment B1

_________-->Segment C1

_________-->Segment C2

_________-->Segment C3

______--> Segment B2

_________-->Segment C4

_________-->Segment C5

_________-->Segment C6

___-->Segment D1

You can see that Segment A1 occurres only ones, but can have several child nodes B. Also Segment B can have several Child nodes.

To transfer this Idoc to a flat file we have to create a flat structure as I understood form several Threads. So the target should look like this:

-->root

_____-->Segment A1

_____-->Segment B1

_____-->Segment C1

_____-->Segment C2

_____-->Segment C3

_____-->Segment B2

_____-->Segment C4

_____-->Segment C5

_____-->Segment C6

_____-->Segment D1

If I map the structure just one by one, I loose the last segments of C and it look like:

-->root

_____-->Segment A1

_____-->Segment B1

_____-->Segment C1

_____-->Segment C2

_____-->Segment C3

_____-->Segment B2

_____-->Segment D1

How can I manage to get the needed target structure. I thought of using function <i>sortbykey</i> or <i>sort</i>, because I have values in C and B which are equal.

Any help?

Regards Oliver