Get Stream inbound mapping method /IWFND/IF_MGW_BOP_MAP_GSTREAM~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_GSTREAM~MAP_INBOUND for get stream, proceed as follows:
Map the input keys to the BOP DO request.
DATA: ls_key_tab TYPE LINE OF /iwcor/if_odata_types=>nvp_t. DATA: lo_bop_do TYPE REF TO /iwfnd/cl_mgw_bop_fl_read_do. * BOP DO Request DATA: ls_request TYPE /iwfnd/cl_mgw_bop_fl_read=>_params_request. lo_bop_do ?= io_bop_do. * Loop over the key tab to get the list of entity keys * Map them to the BOP DO request structure LOOP AT it_key_tab INTO ls_key_tab. CASE ls_key_tab-name. WHEN 'airlineid'. ls_request-airlineid = ls_key_tab-value. WHEN 'connectid'. ls_request-connectionid = ls_key_tab-value. WHEN 'flightdate'. ls_request-flightdate = ls_key_tab-value. ENDCASE. ENDLOOP. |
Set the BOP DO with BOP DO request structure.
lo_bop_do->set_request( ls_request ). |
Get Stream outbound mapping method is provided with:
Request parameters for an entity
BOP DO
Table of processed BOP DOs
Table of processed backend data – Backend data is filled with data from Custom Backend Connectivity API
Reference to entity data – Entity data can be partially filled by previous mapping specialists
To implement inbound mapping interface method /IWFND/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.
Sample code
DATA: lo_bop_do TYPE REF TO /iwfnd/cl_boprr_tea_edp_do, ls_response TYPE /iwfnd/cl_boprr_tea_edp=>_params_response, lo_api TYPE REF TO if_mr_api, lv_uri TYPE string. DATA: lo_exp TYPE REF TO /iwfnd/cx_mgw_busi_exception. 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'. 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