cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Issue

Former Member
0 Kudos

Hi All,

I have a issue I couldn't solve in mapping.

My Request Structure is like:

<Record>

<item>

<partnr>000010</partnr>

</item>

<item>

<partnr>000020</partnr>

</item>

<row>

<partnr>000010</partnr>

<field3>abc</field3>

</row>

<row>

<partnr>000010</partnr>

<field3>abc1</field3>

</row>

<row>

<partnr>000020</partnr>

<field3>abcd</field3>

</row>

<row>

<partnr>000020</partnr>

<field3>abcd1</field3>

</row>

</Record>

My request shoud look like this:

<item>

<partnr>000010</partnr>

<fielda>abc</fielda>

<fielda>abc1</fielda>

</item>

<item>

<partnr>000020</partnr>

<fielda>abcd</fielda>

<fielda>abcd1</fielda>

</item>

I have to combine the structure according to their partnr. There can be many rows under one partnr. It is like we have a partnumber and this partnumber contains subparts. These parts can be 1,2 or more. At the end I have to combine them in one structure.

I couldn't solve it with graphical. Can anyone help.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

when the partner numbers come sortet, then you can do:


                                                     field3 \
partnr * - removeContext - splitbyValue(value changed) - formatByExample - fielda



  • partnr under row

Former Member
0 Kudos

When I do this it gives me the following output:

<item>

<partnr>000010</partnr>

<fielda>abc</fielda>

<fielda>abc</fielda>

</item>

<item>

<partnr>000020</partnr>

<fielda>abcd</fielda>

<fielda>abcd</fielda>

</item>

But I am searchin for a solution to get the output below:

<item>

<partnr>000010</partnr>

<fielda>abc</fielda>

<fielda>abc1</fielda>

</item>

<item>

<partnr>000020</partnr>

<fielda>abcd</fielda>

<fielda>abcd1</fielda>

</item>

There is the problem.

stefan_grube
Active Contributor
0 Kudos

See this blog, I did it as described and it works for me.

/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13

Former Member
0 Kudos

Hi Stefan,

Thanks for your help. Now the structure is deeper then I thought. See below the example:

Request:

<E1EDL24>

<POSNR>000010</POSNR>

<MATNR>000000000000001001</MATNR>

</E1EDL24>

<E1EDL24>

<POSNR>000020</POSNR>

<MATNR>000000000000001001</MATNR>

</E1EDL24>

<E1EDL24>

<POSNR>000030</POSNR>

<MATNR>000000000000001001</MATNR>

</E1EDL24>

<E1EDL24>

<POSNR>000040</POSNR>

<MATNR>000000000000001055</MATNR>

</E1EDL24>

<E1EDL37>

<EXIDV>00000000000000100000</EXIDV>

<E1EDL44>

<POSNR>000010</POSNR>

</E1EDL44>

</E1EDL37>

<E1EDL37>

<EXIDV>00000000000000100001</EXIDV>

<E1EDL44>

<POSNR>000010</POSNR>

</E1EDL44>

</E1EDL37>

<E1EDL37>

<EXIDV>00000000000000100004</EXIDV>

<E1EDL44>

<POSNR>000020</POSNR>

</E1EDL44>

</E1EDL37>

<E1EDL37>

<EXIDV>00000000000000100005</EXIDV>

<E1EDL44>

<POSNR>000020</POSNR>

</E1EDL44>

</E1EDL37>

<E1EDL37>

<EXIDV>00000000000000100006</EXIDV>

<E1EDL44>

<POSNR>000030</POSNR>

</E1EDL44>

</E1EDL37>

<E1EDL37>

<EXIDV>00000000000000100007</EXIDV>

<E1EDL44>

<POSNR>000030</POSNR>

</E1EDL44>

</E1EDL37>

<E1EDL37>

<EXIDV>00000000000000100012</EXIDV>

<E1EDL44>

<POSNR>000040</POSNR>

</E1EDL44>

</E1EDL37>

<E1EDL37>

<EXIDV>00000000000000100013</EXIDV>

<E1EDL44>

<POSNR>000040</POSNR>

</E1EDL44>

</E1EDL37>

Result:

<item> (for each E1EDL24 one item is created)

<MATNR>000000000000001001</MATNR>

<POSNR>000010</POSNR>

<CASE1>00000000000000100000</CASE1> (first EXIDV for that posnr)

<CASE1>00000000000000100001</CASE1> (second EXIDV for that posnr)

</item>

<item>

<MATNR>000000000000001001</MATNR>

<POSNR>000020</POSNR>

<CASE1>00000000000000100004</CASE1> (first EXIDV for that posnr)

<CASE1>00000000000000100005</CASE1> (second EXIDV for that posnr)

</item>

<item>

<MATNR>000000000000001001</MATNR>

<POSNR>000030</POSNR>

<CASE1>00000000000000100006</CASE1> (first EXIDV for that posnr)

<CASE1>00000000000000100007</CASE1> (second EXIDV for that posnr)

</item>

<item>

<MATNR>000000000000001055</MATNR>

<POSNR>000040</POSNR>

<CASE1>00000000000000100012</CASE1> (first EXIDV for that posnr)

<CASE1>00000000000000100013</CASE1> (second EXIDV for that posnr)

</item>

Is this possible with graphical mapping.

stefan_grube
Active Contributor
0 Kudos

You can apply the same pattern here.

Former Member
0 Kudos

Hi Stefan,

I got it work. It worked when I changed the result field. First I had two Case fields. After I made 1 case field with occurence 1 to unbounded it worked.

Now I have one last question.

In my field I get this

<item>

<Case>0000000001<Case>

<Case>0000000002<Case>

<Case>0000000003<Case>

<Case>0000000004<Case>

<Case>0000000005<Case>

</item>

Now I have to take just the first and the last ones. SAP sents everthing one by one. Byt the 3rd party system wants just the first and the last one.

How can I get this? Maybe in a single field concatenated or two field:

<item>

<Case>0000000001<Case>

<Case>0000000005<Case>

</item>

Or

<item>

<Case>0000000001 0000000005<Case>

</item>

Thanks very much.

stefan_grube
Active Contributor
0 Kudos

When you want to have it in the same field, you have to write a Java function for it.

When you want it in different fields, you can combeine functions like this:

first entry: case - index - equals(1) - ifwithoutelse (case) - target1

last entry case - index - equals ( case - count ) - ifwithoutelse (case) - target2

Former Member
0 Kudos

Perfect, it works.

Thanks very very much. People like you make SDN a special place!

Best Regards.

Answers (0)