cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Problem

Former Member
0 Kudos

INPUT XML is :

<header>

Num1

num2

num3

OUTPUT XML should be like :

<header>

.....

<Item1>

num1

num2

num3

<item2>

num1

num2

num3

<item3>

num1

num2

num3

How I can get this output, I have tried standard function Split by value, but it is not working.

For first item it is giving the all 3 values, but other Items does not have the values.

Regards,

Study SAP

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

You need to go for UDF.

If you have only 3 Number ,

Like,

Item 0-Unbounded,

Num 0-Unbounded then,

Select the Num and Duplicate the field.

Use Copy Value function.

For Mapping Like Below,

Num(Header)-Copy Value(0) -Num(Item)1

Num(Header)-Copy Value(1) -Num(Item)2

Num(Header)-Copy Value(2) -Num(Item)3

Regards,

Prakasu

Former Member
0 Kudos

Hi,

The one which you used earlier should work like this:\

You must be getting the output like this right:

<Item1>

num1

num2

num3

<item2>

<item3>

But using same SplitByValue you can achieve the required output.

Go to Message mapping and Right click the Num1 and select Context then change it to one lever Higher which is Header.

This Process is called Explicit Context Selection.

Or Try the same with Node Function SplitByValue.

This should use SplitByValue Node Function.

Then you get the appropriate result.

Best Regards

Praveen

Former Member
0 Kudos

hi

you can use the standard node function USE ONEAS MANY

check the explanation in the below link

http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/frameset.htm

regards

kummari

Former Member
0 Kudos

Hi,

is ur output always be three item node or it will be more than that....

if its always three then u can right click on the target item node and use the duplicate option and create the three item node and map the Num1 num2 num3 to all the fields of target element.

occurance of item should be unbounded....

or use

Use standard function "useOneAsMany" http://help.sap.com/saphelp_nw04/helpdata/en/ef/df564b6aa24fc9ab0d685460747de5/content.htm

let me know this wat ur requirement.

chirag

Former Member
0 Kudos

Hi,

Try with "useoneasmany" function instead of splitby value

hope this will work.

Yuga

Former Member
0 Kudos

when using useOneAsMany, it is the exception error :

Too many values in first queue in function useOneAsMany.

Regards,

Study SAP

Former Member
0 Kudos

Hi,

Can u answer to my questions.

chirag

Former Member
0 Kudos

hi chirag,

no my output and input is not fixed for 3.

Regards,

Former Member
0 Kudos

Hi,

Can u tell me:

1) What is the occurance of Header.

2) What is the occurance of Item

3) On what basis u r deciding that Item should be generated how many times.

From ur above example it is not understood properly.

chirag