Segw 常用技巧
/iwbep/cx_mgw_busi_exception
DATA: BEGIN OF business_error,
msgid TYPE symsgid VALUE 'ZRRE_DMCP',
msgno TYPE symsgno VALUE '005',
attr1 TYPE scx_attrname VALUE '',
attr2 TYPE scx_attrname VALUE '',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF business_error .
*1. Instatiate the Message Container
DATA: lo_message_container TYPE REF TO /iwbep/if_message_container.
CALL METHOD me->/iwbep/if_mgw_conv_srv_runtime~get_message_container
RECEIVING
ro_message_container = lo_message_container.
IF RS_MSG-MSG_TYPE = 'E'.
CALL METHOD lo_message_container->add_message
EXPORTING
iv_msg_type = RS_MSG-MSG_TYPE
iv_msg_id = 'ZRRE_DMCP'
iv_msg_number = '005'
IV_MSG_TEXT = CONV #( RS_MSG-MSG_TEXT )
IV_MSG_V1 = CONV #( RS_MSG-MSG_TEXT )
iv_add_to_response_header = abap_true. "add the message to the header
business_error-attr1 = RS_MSG-MSG_TEXT.
RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception
EXPORTING
textid = business_error
message_container = lo_message_container.
ENDIF.
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Hblog!