cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to pass Json as parameter

0 Kudos
2,319

I'm passing some ids in the form of JSON to backend sap server. The query I wrote is hitting the method but I'm unable to find in which variable I will get the input values.

Thanks and Regards

Naveen

img-20200625-wa0008.jpg

View Entire Topic
ilachaudhary297
Product and Topic Expert
Product and Topic Expert
0 Kudos

If you doing function import. Use below code to get jason data.

DATA : Lt_data type <structure> " fields which you are getting from frontend.

** ************************** BAckend
READ TABLE it_parameter WITH KEY name = 'JSONData' ASSIGNING FIELD-SYMBOL(<fs_parameter>).
IF sy-subrc EQ 0.
/ui2/cl_json=>deserialize( EXPORTING json = <fs_parameter>-value
pretty_name = abap_false
CHANGING data = lt_data ).

****************Frontend

this.getOwnerComponent().getModel().callFunction("/<fucntion import>", { method: "POST", urlParameters: { JSONData: JSON.stringify(this.<entries array>),

0 Kudos

Thanks for your reply.

How do i do it for GetEntitySet (Query)