cancel
Showing results for 
Search instead for 
Did you mean: 

Combining the fields from input and output xml in CPI

varunvichare
Explorer
0 Kudos

Hello Experts,

I have a requirement where I need to combine a field from input xml and output xml and form a resultant xml payload having these two fields. Input and output xml have recurring context. Any idea how this can be achieved in CPI ?

Regards,

Varun Vichare.

Accepted Solutions (1)

Accepted Solutions (1)

alex_bundschuh
Product and Topic Expert
Product and Topic Expert

Hi Varun,

not sure if this is the best solution but you may do this with an n:1 message mapping, for one of the messages, you need to store the payload in an exchange property, the other I assume is still in the body, so in a content modifier first wrap the payloads with the Messages nodes, like:

<ns1:Messages xmlns:ns1="http://sap.com/xi/XI/SplitAndMerge">

<ns1:Message1>

${property.payload}

</ns1:Message1>

<ns1:Message2>

${in.body}

</ns1:Message2>

</ns1:Messages>

then create the message mapping where you merge the both messages into one message, after the mapping you can use a filter step to remove the Messages nodes

Alex

Answers (0)