cancel
Showing results for 
Search instead for 
Did you mean: 

Multilevel deep JSON payload using POST method for odata SEGW

alexandreourth
Active Participant
0 Kudos

Hi,

I am doing a POST request where i need to load a json from payload with a deep structure. Here is my JSON :

I created my deep structure in MPC_EXT like this :

ts_deep,
  key TYPE char10,
  sales TYPE tt_sales,
ts_deep.
ty_sales,
  id TYPE char10,
  otherprop TYPE char20,
  return TYPE TABLE OF ESH_S_IF_MESSAGE WITH DEFAULT KEYS
ty_sales,
tt_sales TYPE TABLE OF ty_sales WITH DEFAULT KEYS.

/!\ But the thing is the return arrays are to be filled AFTER i do some things in the method CREATE_DEEP_ENTITY. Problem, even if my return arrays are filled correctly inside the method, in the response, i have message like this :

"Return": { ___deferred" : { uri......... } }

I don't understand why....Associations/Navigations are done correctly. Other data are in the response except for return tables.

Main => Sales (navigation name) and Sales to Return (navigation name)

What am i missing please to fill these return tables inside CREATE_DEEP_ENTITY.

Thanks a lot for your help.

Best regards

Accepted Solutions (1)

Accepted Solutions (1)

alexandreourth
Active Participant
0 Kudos

In my previous message, the return table part was meant to be calculated inside the CREATE_DEEP_ENTITY method. So i gave an example of the output but in my incoming payload, i was not filling it and THAT was the problem of the deferred error.

So in the payload of my request i must have :

{
  "Key" : "SPLIT",
  "Sales": [{
     "id"        : "sales1"
     "otherprop" : "valueProp"
     "Return": [] <================ That was the thing missing
}]}

By putting the empty body of the array RETURN, the model is able to save my calculated messages inside the array put them in the response.

DONE!

Answers (0)