cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping flat XML to nested IDOC using node functions

Former Member
0 Kudos

Hi all,

I have a file to Idoc scenario where I get file pipe separated.

By FCC I read this file into a flat XML.

Now I have to map this to Idoc WPUBON.

How can I achive this using Graphical mapping?

My src is

WPB01,a,a,a

WPB02,b,b,b

WPB03,c,c,c

WPB03,d,d,d

WPB04,e,e,e

WPB02,f,f,f

WPB03,g,g,g

WPB04,h,h,h

WPB06,i,i,i

My target structure is:

WPB01

~WPB02

~ ~ WPB03

~ ~ WPB03

~ ~ WPB04

~WPB02

~ ~ WPB03

~ ~ WPB04

~ WPB06

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

> My target structure is:

> WPB01

> ~WPB02

> ~ ~ WPB03

> ~ ~ WPB03

> ~ ~ WPB04

> ~WPB02

> ~ ~ WPB03

> ~ ~ WPB04

> ~ WPB06

Based on what conditon you want to map WPB03 & WPB04 under different WPB02.

Former Member
0 Kudos

There is no condition:

The requirement is to simply map it to the target as it comes from the src.

Like if 3 occurance of B03 comes after first B02 and 2 occurance of B03 after second B02 in the flat XML as below

B01

B02

B03

B03

B03

B02

B03

B03

Then in my target the output should have 3 occurances of B03 under first B02 and 2 occurances of B03 under second B02.

B01

~B02

~~B03

~~B03

~~B03

~B02

~~B03

~~B03

Let me now if it is not clear...

regards,

Anirudh.

Edited by: Anirudh Vyas on Oct 10, 2008 5:18 PM

Former Member
0 Kudos

Hi,

See the mapping & expected results..

Mapping

http://www.flickr.com/photos/23639237@N02/2928516063/

The mapping is simple 1:1 mapping.

Mapping Results

http://www.flickr.com/photos/23639237@N02/2929379948/

let me know if it works for you..

Regards,

Sarvesh

Former Member
0 Kudos

Hi Sarvesh,

Thanks for your reply.

The source in your mapping is nested.

But my src is flat.

The reason is that I am generating this src XML from File content conversion where there is a limitation of having only flat XML structure. as below

MT_RECEIPT

TRANS

B01

|field1

|field2

B02

|field3..

B03

B03

B02

B03

But my target is nested.

Thats why I have a mapping problem.

If there is any way where I can generate a nested structure from content conversion then it solves my problem.

I have also tried Riyaz Sayyad's solution of using intermediate message with attributes but it is not working.

Everytime I get all my B03 in first B02.

The actual problem is to identify where to insert context change in B03.

regards,

Anirudh.

Former Member
0 Kudos

Well, without converting it into nested structure it doesn't seem possible.

I hope you are talking about this blog...

http://www.riyaz.net/?p=263

You also do not have any conditions to put in mapping.. let me think if there is any possiblity for it..

Regards,

Sarvesh

Former Member
0 Kudos

Give a good example with desired result so that one can understand where is the problem in mapping.

Former Member
0 Kudos

My src message is

<?xml version="1.0" encoding="utf-8"?>

<MT_RECEIPTS>

<TRANS>

<WPB01>

<A>a

<B>b

</WPB01>

<WPB02>

<C>c1

<D>d1

</WPB02>

<WPB03>

<E>e1

<F>f1

</WPB03>

<WPB03>

<E>e2

<F>f2

</WPB03>

<WPB04>

<G>g1

<H>h1

</WPB04>

<WPB02>

<C>c2

<D>d2

</WPB02>

<WPB03>

<E>e3

<F>f3

</WPB03>

<WPB04>

<G>g2

<H>h2

</WPB04>

<WPB06>

<I>i

<J>j

</WPB06>

Expected output:

<?xml version="1.0" encoding="utf-8"?>

<MT_RECEIPTS>

<TRANS>

<WPB01>

<A>a

<B>b

<WPB02> (child of 01)

<C>c1

<D>d1

<WPB03> (child of 02)

<E>e1

<F>f1

</WPB03>

<WPB03> (child of 02)

<E>e2

<F>f2

</WPB03>

<WPB04>(child of 02)

<G>g1

<H>h1

</WPB04>

</WPB02>

<WPB02> (child of 01)

<C>c2

<D>d2

<WPB03>(child of 02)

<E>e3

<F>f3

</WPB03>

<WPB04>(child of 02)

<G>g2

<H>h2

</WPB04>

</WPB02>

<WPB06>

<I>i

<J>j

</WPB06>

</WPB01>

regards,

Anirudh.

Former Member
0 Kudos

Hi Anirudh,

Can you please share how you read the flat file inot flat XML using FCC

I have a similar file to be read

WPB01,a,a,a

WPB02,b,b

but using FCC i am getting XML like

<?xml version="1.0" encoding="utf-8"?>

<MT_RECEIPTS>

<TRANS>

     <WPB01>

                       <A>a

                       <B>b

     </WPB01>

</TRANS>

<TRANS>

     <WPB02>

                       <A>b

                       <B>b

     </WPB02>

</TRANS>