Execute action inbound mapping method /IWFND/IF_MGW_BOP_MAP_ACTION~MAP_INBOUND is provided with:
Action Name
Action parameters
BOP DO
Table of Processed BOP DOs
Table of Processed Backend Data – Backend Data is filled with data from Custom Backend Connectivity API
Response Entity Data reference
To implement inbound mapping interface method /IWFND/IF_MGW_BOP_MAP_ACTION~MAP_INBOUND for execute action, proceed as follows:
The input parameter IT_PARAMETER contains the parameters for the Action in the form of Name/Value pairs. Loop at the table IT_PARAMETER to get the parameters and fill the BOP DO request.
DATA: ls_parameter TYPE /iwfnd/s_mgw_name_value_pair. DATA: ls_request TYPE /iwfnd/cl_mgw_bop_fl_read=>_params_request. DATA: lo_bop_do TYPE REF TO /iwfnd/cl_mgw_bop_fl_read_do. lo_bop_do ?= io_bop_do. LOOP AT it_parameter INTO ls_parameter. CASE ls_parameter-name. WHEN 'airlineid'. ls_request-airlineid = ls_parameter-value. WHEN 'connectid'. ls_request-connectionid = ls_parameter-value. WHEN 'flightdate'. ls_request-flightdate = ls_parameter-value. ENDCASE. ENDLOOP. |
Set the BOP DO request.
lo_bop_do->set_request( ls_request ). |
Execute Action outbound mapping method is provided with:
Action name
Action parameters
BOP DO
Table of processed BOP DOs
Table of processed backend data – Backend data is filled with data from Custom Backend Connectivity API
Additional BOP DOs
Response entity data reference
To implement outbound mapping interface method /IWFND/IF_MGW_BOP_MAP_ACTION~MAP_OUTBOUND for execute action, proceed as follows:
Check if there are any backend call errors. In case of backend errors, copy the backend error message and add it to the message container. Set the process code to STOP_PROCESSING.
DATA: ls_response TYPE /iwfnd/cl_mgw_bop_fl_cre=>_params_response. DATA: lo_bop_do TYPE REF TO /iwfnd/cl_mgw_bop_fl_cre_do. DATA: ls_return TYPE LINE OF /iwfnd/cl_mgw_bop_fl_cre=>_params_response-return. DATA: ls_flight TYPE /iwfnd/om_mgw_sample_sflight_s=>flight. DATA: lo_exp TYPE REF TO /iwfnd/cx_mgw_busi_exception. FIELD-SYMBOLS: <fs> TYPE any. lo_bop_do ?= io_bop_do. lo_bop_do->get_response( IMPORTING es_response = ls_response ). * Check for Error READ TABLE ls_response-return INTO ls_return WITH KEY type = 'E'. IF sy-subrc EQ 0. CREATE OBJECT lo_exp EXPORTING textid = /iwfnd/cx_mgw_busi_exception=>business_error message = ls_return-message. /iwfnd/if_mgw_bop_map~mo_request_context->get_message_container( )->add_message_from_exception( io_exception = lo_exp iv_is_leading_message = abap_true iv_system_alias = /iwfnd/if_mgw_bop_map~mv_system_alias iv_message_creator = 'TEST' iv_entity_type = 'flight' ). ev_process_code = /iwfnd/if_mgw_bop_map=>cs_process_code-stop_processing. ELSE. |
In case there are no backend errors, use the response read in the previous step and map it to the entity data reference:
MOVE-CORRESPONDING : ls_response-flightdata to ls_flight. CREATE DATA er_data LIKE ls_flight. ASSIGN er_data->* TO <fs>. <fs> = ls_flight. |
Continue with Error Handling in Mapping Specialists