
Mapping specialists can set three different kinds of process codes:
Skip Backend Operation - The Inbound mapping specialist can set the process code to /IWFND/IF_MGW_BOP_MAP=>SKIP_BACKEND_OPERATION, if BOP call need not be executed. However, the Outbound mapping will be executed.
Skip Processing - The Inbound mapping specialist can set the process code to /IWFND/IF_MGW_BOP_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 /IWFND/IF_MGW_BOP_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 /IWFND/IF_MGW_BOP_MAP=>STOP_PROCESSING. If the error needs to be shown to the consumer, the attribute IV_IS_LEADING_MESSAGE should be set to ABAP_TRUE while adding the message to the container.
Sample coding for error handling — Stop processing:
DATA: lo_messagecontainer TYPE REF TO /iwfnd/if_mgw_msg_container.
* Get the message container from context
lo_messagecontainer = /iwfnd/if_mgw_bop_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 = /iwfnd/if_mgw_msg_container=>gcs_error_category-processing
iv_is_leading_message = abap_false
iv_message_creator = /iwfnd/if_epm_bp_constant=>gc_bp_agent_id
iv_entity_type = /iwfnd/if_epm_bp_constant=>gc_bp_execution_mode_r
iv_system_alias = /iwfnd/if_mgw_bop_map~mv_system_alias ).
*Stop the processing
ev_process_code = /iwfnd/if_mgw_bop_map=>cs_process_code-stop_processing.
|
Continue with Implementing Entity Data Providers..