cancel
Showing results for 
Search instead for 
Did you mean: 

CPI Gather - is this possible?

Jose_Pietri
Discoverer
0 Kudos

Hi,

I have a payload that looks something like this:

#1:
<root>
<row>
<OrderID>11111</OrderID>
<OrderData>
<Country>US</Country>
<State>CA</State>
</OrderData>
<Item>
<SKU>1234</SKU>
<Qty>1</Qty>
</Item>
</row> </root>

#2:
<root>
<row>
<OrderID>11111</OrderID>
<OrderData>
<Country>US</Country>
<State>CA</State>
</OrderData>
<Item>
<SKU>4567</SKU>
<Qty>1</Qty>
</Item>
</row>
</root>

#3:
<root>
<row>
<OrderID>22222</OrderID>
<OrderData>
<Country>US</Country>
<State>CA</State>
</OrderData>
<Item>
<SKU>4567</SKU>
<Qty>1</Qty>
</Item>
</row>
</root>
I'm trying to gather all the items under the same order ID, so the resulting XML would look like this:
<root>
<row>
<OrderID>11111</OrderID>
<OrderData>
<Country>US</Country>
<State>CA</State>
</OrderData>
<Item>
<SKU>1234</SKU>
<Qty>1</Qty>
</Item>
<Item>
<SKU>4567</SKU>
<Qty>1</Qty>
</Item>
</row>
<row>
<OrderID>22222</OrderID>
<OrderData>
<Country>US</Country>
<State>CA</State>
</OrderData>
<Item>
<SKU>4567</SKU>
<Qty>1</Qty>
</Item>
</row>
</root>
Is this possible with a Gather? Any insight would be appreciated!!
andrea_schroeter
Employee
Employee
0 Kudos

Hi Jose,

just a thought: why do you need content-based mapping? Any chance to provide the required structure by the source?

Regards,

Andrea.

View Entire Topic
nshivaprasad5334
Participant
0 Kudos

Hi Jose,

This cant be achieved if you use gather here.

Please refer the below blog.

https://blogs.sap.com/2019/11/15/sap-cloud-platform-integration-cpi-use-cases-of-node-functions-in-m...

start reading from below screenshot.