on 05-13-2016 1:24 AM
Hi
Consuming the JSON filed by the external system and push into the SAP, If external system sends the same field as in the sap gateway structure then no problem, but when external field sends additional fields to the existing json then sap will raise an error "/IWCOR/CX_DS_EP_PROPERTY_ERROR/" with message "Property 'XXXX' is invalid. Please let me how to handle it , if the other external system sends an additional fields then sap should not through an error
Hi Kiran,
Could you confirm what parameters(Means structure type or only single parameter in the output type as edm.string) did you define in the Gateway system.
Are you using any RFC call? what are output parameters for the RFC?
If you are calling RFC call and RFC is returning JSON data that should not be problem to give response in gateway system even if the JSON structure changes.
Regards,
Suresh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kiran,
As i know, Better option is to convert your structure into JSON format using CALL TRANSFORMATION syntax. This can handle if you do any structure changes in future it won't give any error.
If you are requirement is different please let me know or if you give sample example of you requirement i can provide the solution.
Regards,
Suresh.
Hi Kiran,
Below logic will help you to covert ABAP to JSON .
DATA: lr_writer TYPE REF TO cl_sxml_string_writer,
lrx_root TYPE REF TO cx_root,
ls_bapiret TYPE bapiret2.
TRY.
* ABAP to JSON
lr_writer = cl_sxml_string_writer=>create( type = if_sxml=>co_xt_json no_empty_elements = abap_true ).
CALL TRANSFORMATION id
SOURCE data = iv_data
RESULT XML lr_writer
OPTIONS initial_components = 'suppress'.
ev_json = cl_abap_codepage=>convert_from( lr_writer->get_output( ) ).
CATCH cx_root INTO lrx_root.
ls_bapiret-type = 'E'.
ls_bapiret-message = lrx_root->get_text( ).
APPEND ls_bapiret TO et_messages.
ENDTRY.
In the above logic iv_data would be your abap structure or table and ev_json would be response in json format.
please let me know if you have doubts.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.