cancel
Showing results for 
Search instead for 
Did you mean: 

error message not shown in response header for OData get_entityset

05-13-2021 11:41 AM
kjyothiraditya Participant
1623 views 2 comments
0 Likes
SAP Managed Tags
Subscribe

Hi ,

I have created a z odata project with GET_ENTITYSET method redefined and raising an error exception if any error or no data like below but the error is shown in reponse but not in the HTTP header in sap-message although it gives HTTP 500 error.

CALL METHOD me->/iwbep/if_mgw_conv_srv_runtime~get_message_container
      RECEIVING
        ro_message_container = lo_message_container.

    CALL METHOD lo_message_container->add_message
      EXPORTING
        iv_msg_type               = /iwbep/cl_cos_logger=>error
        iv_msg_id                 = 'ZMSG'
        iv_msg_number             = '000'
        iv_add_to_response_header = abap_true. "add the message to the header 

RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception
 EXPORTING message_container = lo_message_container.


0 Likes

Accepted Solutions (0)

Answers (0)