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

JSON deep insert returns atom/xml

rpanneel
Participant
0 Likes
1,974

Dear,

When I test a json deep insert (For eaxmple:a POST on /sap/opu/odata/sap/<Gateway_service>/<GW_Data>Set in the GW Client then it returns the result in atom/xml....

If i add ?$format=json to the call i receive following error:

The Data Services Request contains SystemQueryOptions that are not allowed for this Request Type

Is there a way to get the response in json for a POST deep insert/create?

Thanks in advance!

Kind Regards,

Robin

View Entire Topic
ChandrashekharMahajan
Active Contributor
0 Likes

Hi Robin,

This error is coming from method PROCESS_ENTITY_SET (/IWCOR/CL_DS_PROC_DISPATCHER)

Below system query options are not allowed for POST.


" system query option are not allowed

         IF io_uri->expand IS NOT INITIAL OR

            io_uri->select IS NOT INITIAL OR

            io_uri->filter IS BOUND OR

            io_uri->orderby IS BOUND OR

            io_uri->skip IS NOT INITIAL OR

            io_uri->top IS NOT INITIAL OR

            io_uri->skiptoken IS NOT INITIAL OR

            io_uri->inlinecount IS NOT INITIAL OR

            io_uri->format IS NOT INITIAL.

           RAISE EXCEPTION TYPE /IWCOR/cx_DS_proc_error

             EXPORTING

               textid = /IWCOR/cx_DS_proc_error=>invalid_system_query_option.

ENDIF.

May be using batch call you can get response in JSON format. I mean using batch method, 1st give call to POST and then to GET which allows $format.

again on client side (may be ui5), you can easily convert response in json format with available APIs.

Regards,

Chandra