on 02-14-2019 7:28 PM
Hey guys,
I developed a batch request as changeset (Multiple create, update, delete operations). If an error occured in a single operation I raise exception /iwbep/cx_mgw_busi_exception with a custom message (see method changeset_process). The custom message is captured in /IWBEP/ERROR_LOG but the response shows a generic error message: "Rollbacked because of error during changeset processing (/iwbep/cm_mgw_rt, 049).
I want to populate all my custom messages to the response, so that the messages can be shown in the frontend.
How can I achieve that? Thanks for your help.
Chris
You need to use the message container and add all the messages to it. At the end raise the exception by passing the message container to it.
For code you can see the below example on how to access the message container and add the messages:
https://archive.sap.com/discussions/thread/3470565
http://www.saplearners.com/map-message-odata-response-header-sap-message/
Don't forget to pass the message container to the exception you will raise.
BR,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for your help. I changed the method changeset_process and implemented the message container (see screenshot). Still the same behavior. The response contains only the generic error message.
Any further ideas?
Chris
Hey Mahey,
the method changeset_process doesn't have a parameter io_message_container.
I tried following, but still not working:
METHOD /iwbep/if_mgw_appl_srv_runtime~changeset_process.
DATA: ls_changeset_respone TYPE /iwbep/if_mgw_appl_types=>ty_s_changeset_response.
LOOP AT it_changeset_request ASSIGNING FIELD-SYMBOL(<s_changeset_request>).
"DATA(lo_message_container) = me->/iwbep/if_mgw_conv_srv_runtime~get_message_container( ).
<s_changeset_request>-msg_container->add_message( iv_msg_type = 'E'
iv_msg_id = '/ZTEST/BC'
iv_msg_number = 009
iv_msg_v1 = 'TEST' ).
RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception
MESSAGE ID '/ZTEST/BC'
TYPE 'E'
NUMBER 001
EXPORTING
message_container = <s_changeset_request>-msg_container.
ENDLOOP.
ENDMETHOD
Regards
Chris
User | Count |
---|---|
91 | |
10 | |
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.