on 07-07-2016 12:04 PM
Dear Experts,
I want to raise exception and put custom error message within "Show Details" message dialog as below picture.
I can't find the way to put custom message to "Show Details" section.
I'm using message container and "/iwbep/cx_mgw_busi_exception" for raise an exception.
RAISE EXCEPTION type /iwbep/cx_mgw_busi_exception
EXPORTING
textid = /iwbep/cx_mgw_busi_exception=>business_error
message = lv_message.
I tried so many attribute but It didn't work.
Is it possible to make this kind of dialog (Message dialog with "Show Details") with custom error message?
Best Regards,
Hello Choktananan,
Please use the below code and check which can be used to send back all your custom messages as part of the exception.
data: ls_return_msg TYPE BAPIRET2.
data: lt_return_msg TYPE BAPIRET2_T
data: lo_message TYPE REF TO /IWBEP/IF_MESSAGE_CONTAINER.
data: lx_bus_ex TYPE REF TO /IWBEP/CX_MGW_BUSI_EXCEPTION.
LO_MESSAGE = MO_CONTEXT->GET_MESSAGE_CONTAINER( ).
LO_MESSAGE->ADD_MESSAGES_FROM_BAPI( IT_BAPI_MESSAGES = LT_RETURN_MSG ).
create OBJECT lx_bus_ex
exporting
message_container = LO_MESSAGE.
raise EXCEPTION lx_bus_ex.
Where LT_RETURN_MSG is a table containing all your custom messages.
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.