Hi,
i use oData and therefore create an error like this:
DATA: lo_exception TYPE REF TO /iwbep/cx_mgw_busi_exception, lo_container TYPE REF TO /iwbep/if_message_container. lo_container = mo_context->get_message_container( ). lo_container->add_messages_from_bapi( EXPORTING it_bapi_messages = lt_return * iv_error_category = iv_determine_leading_msg = abap_true iv_entity_type = iv_entity_name it_key_tab = it_key_tab iv_add_to_response_header = abap_true ). CREATE OBJECT lo_exception EXPORTING * textid = * previous = message_container = lo_container * http_status_code = '500' * http_header_parameters = * sap_note_id = * msg_code = * entity_type = iv_entity_name * message = 'Konnte nicht gespeichert werden!' * message_unlimited = * filter_param = * operation_no = . RAISE EXCEPTION lo_exception.
but i always get more error-messages then i supose to get:
only the one in the middle is the error i added.