cancel
Showing results for 
Search instead for 
Did you mean: 

Additional fields on Existing Json-/IWCOR/CX_DS_EP_PROPERTY_ERROR/ error

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

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.

Former Member
0 Kudos

Hi Suresh,

only single parameter in the output type as edm.string  to make in the required structure and call the REST services using the gateway.

0 Kudos

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.

Former Member
0 Kudos

Hi Suresh,

Requesting can you please send me the sample example. I will help full to me.

0 Kudos

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.

Answers (0)