Skip to Content
0
Jun 20, 2021 at 06:37 AM

SAP CPI Message Mapping help

104 Views Last edit Jun 20, 2021 at 06:48 AM 4 rev

Hello Experts,

We have a requirement to convert the source payload to the expected target payload as described below. Request to please suggest the mapping to achieve this in SAP CPI.

Source Payload :

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

<Items>

<Item>

<Description>01_PROPER</Description><Quantity>100.000000</Quantity>

</Item>

<Item><Description>01_PROPER</Description><Quantity>100.000000</Quantity>

</Item>

<Item><Description>01_PROPER</Description><Quantity>100.000000</Quantity>

</Item>

<Item><Description>02_PROPER</Description><Quantity>100.000000</Quantity>

</Item>

<Item><Description>02_PROPER</Description><Quantity>100.000000</Quantity>

</Item>

<Item><Description>03_PROPER</Description><Quantity>100.000000</Quantity>

</Item>

<Item><Description>04_PROPER</Description><Quantity>100.000000</Quantity>

</Item>

<Item><Description>04_PROPER</Description><Quantity>100.000000</Quantity>

</Item>

<Item><Description>04_PROPER</Description><Quantity>100.000000</Quantity>

</Item>

<Item><Description>05_PROPER</Description><Quantity>100.000000</Quantity>

</Item>

</Items>

Target Payload :

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

<Items>

<Item><Description>01_PROPER</Description><Quantity>300.000000</Quantity></Item>

<Item><Description>02_PROPER</Description><Quantity>200.000000</Quantity></Item>

<Item><Description>03_PROPER</Description><Quantity>100.000000</Quantity></Item>

<Item><Description>04_PROPER</Description><Quantity>300.000000</Quantity></Item>

<Item><Description>05_PROPER</Description><Quantity>100.000000</Quantity></Item>

</Items>

I tried mapping the Items field on target with Description in the source payload but the target payload is not as is is expected, and am unable to design logic for Quantity field.

Please suggest for any solution/corrections to achieve this.

//Thanks

T.Tarun

Attachments

1.png (53.6 kB)