Show TOC

Error Handling in Mapping SpecialistsLocate this document in the navigation structure

The mapping specialists can set three different kinds of process codes

  • Skip Backend Operation - The Inbound mapping specialist can set the process code to /IWBEP/IF_MGW_EDP_MAP=>SKIP_BACKEND_OPERATION, if BOP call need not be executed. However, the Outbound mapping is called.

  • Skip Processing - The Inbound mapping specialist can set the process code to /IWBEP/IF_MGW_EDP_MAP=>SKIP_PROCESSING, if both the BOP call and Outbound mapping need not be executed.

  • Stop Processing - The Inbound mapping specialist or Outbound mapping specialist can set the process code to /IWBEP/IF_MGW_EDP_MAP=>STOP_PROCESSING, if no further processing needs to be carried out.

In case of errors, mapping specialist needs to put the error message into a message container and set the process code to /IWBEP/IF_MGW_EDP_MAP=>STOP_PROCESSING. If the error needs to be shown to the consumer, the attribute LEADING_MESSAGE should be set to ABAP_TRUE while adding the message to the container.

Sample code for error handling — Stop processing:

DATA: lo_messagecontainer TYPE REF TO /IWBEP/IF_MESSAGE_CONTAINER.

* Get the message container from context
lo_messagecontainer = /iwbep/if_mgw_edp_map~mo_request_context->get_message_container( ).
lo_messagecontainer->add_message(
EXPORTING
            iv_msg_type           = ls_return-type
            iv_msg_id             = ls_return-id
            iv_msg_number         = ls_return-number
            iv_msg_text           = ls_return-message
            iv_msg_v1             = ls_return-message_v1
            iv_msg_v2             = ls_return-message_v2
            iv_msg_v3             = ls_return-message_v3
            iv_msg_v4             = ls_return-message_v4
            iv_error_category     = /IWBEP/IF_MESSAGE_CONTAINER=>gcs_error_category-processing
            iv_is_leading_message = abap_true
            iv_entity_type        = mv_entity_name           "entity
            iv_system_alias       = mv_system_alias ).

*Stop the processing 
ev_process_code = /IWBEP/IF_MGW_EDP_MAP=>cs_process_code-stop_processing.
 

Continue with Registering the service in the SAP Gateway System.

Back to Developing Content on SAP Gateway OData Channel Using IWBEP