cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping from Multiple Rows to single Row

Former Member
0 Kudos

Hi,

SOURCE:

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

<SHIP_INFO_HDR>

<SHNUMBER/>

</SHIP_INFO_HDR>

<item> -


can be multiple

<DOC_NUMBER/>

<COM_NUMBER/>

</item>

TARGET:

<TARGET>

<SHITEM_ALL>

<DOC_NUMBER_1/>

<DOC_NUMBER_2/>

<DOC_NUMBER_3/>

<DOC_NUMBER_4/>

<DOC_NUMBER_5/>

<DOC_NUMBER_6/>

</SHITEM_ALL>

</TARGET>

My requirement is to map the 1st item with the corresponding fileds in Target and similarly for 2nd item.

I also have to map the rest to zero.

Please suggest.

regards,

Piyush

Edited by: Piyush Mathur SAP on Jan 19, 2011 8:21 AM

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

> I also have to map the rest to zero.

What does that mean?

Former Member
0 Kudos

Hi Stefan,

This means that the target shuld have 6 DOC_NUM always.

If the source has lets say 3 rows then the target will have the 1st 3 docnums mapped to source and rest 3 as zero.

regards,

Piyush

stefan_grube
Active Contributor
0 Kudos

> If the source has lets say 3 rows then the target will have the 1st 3 docnums mapped to source and rest 3 as zero.

Add "mapwithdefault" as last step to the sequence.

Former Member
0 Kudos

Thanks a lot Stefan....

Appreciate your prompt responses

Answers (1)

Answers (1)

former_member200962
Active Contributor
0 Kudos

your target in this thread and earlier one seems to be different!

source --> index(1,1) -->  greater --> Ifwithoutelse (Constant(0) --> Then)--> Target3/4/5/6
constant(2) ------->

use above logic for 3rd node onwards.

Former Member
0 Kudos

Hi Abhishek,

The If without else works absoultely fine but the main problem is the default zero values that have to be passed.

To incorporate the default zeros, I used an If WITH else but it does not give the expected output