The Inbound mapping method is provided with:
BOP DO
A set of BOP DOs processed by previous mapping specialists
The entity data (ER_ENTITY or ER_ENTITYSET or ER_DATA). The entity data can be partially filled by previous mapping specialists.
Operation specific parameters
To implement inbound mapping interface method /IWBEP/IF_MGW_BOP_MAP_GSTREAM~MAP_INBOUND for GET_STREAM, proceed as follows:
Read the input parameters IT_KEY_TAB, IT_NAVIGATION_PATH.
Determine if the Backend Operation Proxy needs to be called multiple times based on the input (Optional).
Set the BOP DO request.
Sample Code
DATA: ls_key_tab TYPE LINE OF /iwbep/t_mgw_name_value_pair. DATA: lo_bop_do TYPE REF TO /IWBEP/cl_mgw_bop_sfl_bkrd_do. DATA: lo_bop_do_additional TYPE REF TO /IWBEP/cl_mgw_bop_sfl_bkrd_do. DATA: ls_request TYPE /IWBEP/cl_mgw_bop_sfl_bkrd=>_params_request. lo_bop_do ?= io_bop_do. LOOP AT it_key_tab INTO ls_key_tab. IF sy-index > 1. CREATE OBJECT lo_bop_do_additional. APPEND lo_bop_do_additional TO ET_ADDITIONAL_BOP_DO . lo_bop_do = lo_bop_do_additional. ENDIF. IF ls_key_tab-name Eq 'airlineid'. ls_request-airlinecarrier = ls_key_tab-value. lo_bop_do->set_request( ls_request ). ENDIF. ENDLOOP. |
To implement outbound mapping interface method /IWBEP/IF_MGW_BOP_MAP_GSTREAM~MAP_OUTBOUND for GET_STREAM, proceed as follows:
Get the BOP response.
Map the response (binary content, mime type) to the parameter ER_STREAM.
DATA: lo_bop_do TYPE REF TO /iwbep/cl_mgw_test_bop_do, ls_response TYPE /iwbep/cl_mgw_test_bop=>_params_response, lo_api TYPE REF TO if_mr_api, lv_uri TYPE string. lo_bop_do ?= io_bop_do. lo_bop_do->get_response( IMPORTING es_response = ls_response ). lo_api = cl_mime_repository_api=>get_api( i_prefix = ls_response-ev_url ). lv_uri = '3_people_money.gif'. " sample binary content to be retrieved lo_api->get( EXPORTING i_url = lv_uri IMPORTING e_content = es_stream-value e_mime_type = es_stream-mime_type ). |
Continue with Error Handling in Mapping Specialists
Back to Developing Content on SAP Gateway OData Channel Using IWBEP