Skip to Content
0
Jan 21, 2021 at 01:39 PM

SAP PI Advanced Json mapping problem

108 Views

Hi,

I have a troubling problem on Json mapping and cant quite solve it out.

So the scenario is like this, request triggered from R3 via PROXY adapter and response is getting from REST adapter.

Here are the converted example of my request.

[ { "code": "A12345" },

{ "code":"B98765" }, ]

and get a response like this,

{ "data": {

"A12345": {

"firstname": "name",

"lastname": "surname" },

"B98765": {

"firstname": "name2",

"lastname": "surname2" } }, }

My response structure is connected to proxy and class structures must be solid. So i cant use its dynamic array names. For this purpose, i think this kind of response should do it;

{ "data": {

"item": {

"code": "A12345" ,

"firstname": "name",

"lastname": "surname" },

"item": {

"code": "B98765",

"firstname": "name2",

"lastname": "surname2" } }, }

So here is the question, how can i gather title name from array, change it's name to "item" and map title name on a element? And can it be done with REST conversion mapping rules?


Thanks in advance,