cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CPI: Dynamic JSON response mapping with SAP wsdl/xsd

former_member329434
Participant

Hi All,

My requirement is to map a synchronous call from SAP--CPI--API( Third-party) (Json call) and Map the response back to SAP system.

I am facing challenge in mapping the requirement as the Json response is having dynamic values at item level under saleorderList ( example as TEST1, TEST2 and so on.. and they are going to change based on the input selection criteria from SAP

My JSON response :

{

"responseCode": 0,

"responseMessage": "Success",

"totalOrders": 2,

"salesorderList": {

"TEST1": {

"orderLocation": "M1",

"orderLocationName": "ABC",

"channelName": "",

"items": [

{

"lineno": "156",

"sku": "234ABC",

"status": "InTransit",

}

]

},

"TEST2": {

"orderLocation": "M2",

"orderLocationName": "ABC

"channelName":,

"items": [

{

"lineno": "1",

"sku": "456ABC",

"status": "Shipped",

"0"

}

]

},

"TEST3": {

......... and so on...

How to define a xsd structure for this in CPI as items coming under saleOrderList are changing dynamically.( TEST1, TEST2 and TEST3) and map this response with an imported SAP's wsdl/xsd file into a response message mapping .

Since xsd are defined static in both CPI and SAP WSDL/XSD, While taking response back into CPI mapping , they fail at this dynamic filed levels, as they are not recognized.

Hope many of you have come across such requirements. Any expert suggestions, would help.

Regards,

Suman.

View Entire Topic
seema_satam
Member
0 Kudos

Hello @suman.kumar13,

Did you get the solution? Kindly share as we have similar requirement where dynamic json expected at source end which needs to be mapped to target SF ODATA API.

Thanks,

Seema