I am working on Odata services and want to return messages to front end application which is designed in HTML5, which provide status of update/delete or create operation. I want to return error type and description to front end.
I am using class - /iwbep/if_message_container to return message and tried with following methods:
lo_message_container = mo_context->get_message_container( ).
ls_return-type = 'S'.
ls_return-id = 'ZTEST'.
ls_return-number = '000'.
* ls_return-log_no = '111'.
ls_return-message = 'Data Available in Update Method'.
APPEND ls_return TO lt_return.
it_bapi_messages = lt_return
iv_determine_leading_msg = /iwbep/if_message_container=>gcs_leading_msg_search_option-first
Its not showing up in response of request to front end and response body is empty . if i raise exceptions /IWBEP/CX_MGW_BUSI_EXCEPTION or /IWBEP/CX_MGW_TECH_EXCEPTION response will come with error code - 404.
Please suggest any better way to send response to front end.