on 10-16-2012 4:49 PM
We are trying to perform the following mapping logic via visual mapping in SAP PI. The source data has the following structure:
<Item>
<ID>
</ID>
<ItemAssignment>
<ItemID>
</ItemID>
</ItemAssignment>
</Item>
For example:
<Item>
<ID>
10
</ID>
<ItemAssignment>
<ItemID>
20
</ItemID>
</ItemAssignment>
</Item>
<Item>
<ID>
20
</ID>
</Item>
We are trying to map this data to a field in target structure that concatenates the child item with parent item (let's say separated by * character). So for above example it would be 20*10.
So in a more complex example:
20
40
10
30
10
50
40
50
Needs to produce:
40*20
10*30
50*30
We have tried a number of approaches concatenating<ItemAssignment> with <Item> via UseOneAsMany, but have not been successful so far. At this point we are using XSLT to accomplish this, but were wondering if there is a way to achieve it via visual mapping instead.
Any help would be greatly appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Raja,
Thank you for your reply. Unfortunately we've tried your suggested approach originally and it does not seem to work primarily because only some of the items have itemassignments. So when doing concatenation in the way you are describing it is concatenated incorrectly. Here is an example:
Item 40 (in1) has ItemAssignment 0000000010 (in0). Item 20 (in1) also has ItemAssignment 0000000010 (in0). Items 30, 10 and KeyRec have no ItemAssignment. The output needs to be:
0000000010*40
0000000010*20
But instead straight concatenation mapping that you suggest produces:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.