2019 May 11 7:52 AM
Hi Experts,
I have a requirement to Edit the Importing parameter IO_TECH_REQUEST_CONTEXT inside method
/IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITY.
My purpose is to change the key Values (MR_REQUEST -> KEY_TAB ) of Importing Parameter IO_TECH_REQUEST_CONTEXT. From UI side, I am getting all the Key values separated by Commas, I just want to split it and call the below method in a loop.
cl_rtst_rp_document=>get_instance( )->get_expanded_entity(
exporting
io_tech_request_context = io_tech_request_context
io_expand = io_expand
importing
ers_entity = data(ert_document_entity)
changing
ct_expanded_tech_clauses = et_expanded_tech_clauses
cs_response_context = es_response_context
).
2019 May 11 10:21 AM
Hello Nisha, hope you're well.
You cannot edit IO_TECH_REQUEST_CONTEXT simply because it's an importing parameter. In OO pattern, importing parameter should not be edit.
In case you need to use key/values pairs, try the following statement below. Once the key/vales are stored in an internal table, you're able to perform any treatment on it.
DATA(lt_keys) = io_tech_request_context->get_source_keys( ) .
KR,
Arthur Silva
2019 May 11 4:12 PM
Hi Arthur,
Thanks for your response!
I can create a copy of the IO_TECH_REQUEST_CONTEXT e.g. LO_REQUEST and use it. That will be fine.
But before I call Method :
CL_RTST_RP_DOCUMENT=>GET_INSTANCE( )->GET_EXPANDED_ENTITY, I want to pass the changed LO_REQUEST with different entries for KEY_TAB.
Is it feasible?
Regards,
Nisha
2020 Jun 09 4:40 PM
2022 Jul 01 1:44 PM
Yes, you can “add values” to the values of IO_TECH_REQUEST_CONTEXT...
Do the following (at least BASIS 750, should also work with higher versions)
Data(original_key_values) = your_clone->mr_request->key_tab
APPEND value#(<>) to original_key_values
Note
Of course, the usuall conditions/terms/caution apply concerning robustness, errorhandling and use of not released API's.
2022 Oct 10 7:39 AM
Hi Andre,
How would you downcast from /IWBEP/CL_MGW_REQUEST to LCL_ MGW_REQUEST since you cannot use ?= unless the parent was narrowcasted from the child?
Alex
2022 Oct 10 10:48 PM
Hi Alex,
I guess you are referring to step 3?
No need for a down cast: In a class, inheriting from /iwbep/cl_mgw_request, you have access to the protected members of class- and objects of type /iwbep/cl_mgw_request, especially mr_request
2024 Jun 11 3:48 PM
Hello,
You can change the IO_TECH_REQUEST_CONTEXT using the method /IWBEP/IF_MGW_CORE_SRV_RUNTIME~READ_ENTITYSET
in my case it was necessary to stop using a search field coming from a fiori app.
METHOD /iwbep/if_mgw_core_srv_runtime~read_entityset.
DATA(ls_request_details) = is_request_details. """"SAME THAN IO_TECH_REQUEST_CONTEXT
IF iv_entity_name = 'APAROpenItem' AND iv_source_name = 'APAROpenItem'.
IF line_exists( ls_request_details-parameters[ name = 'search' ] ).
ls_request_details-parameters[ name = 'search' ]-value = ''.
ENDIF.
ENDIF.
TRY.
CALL METHOD super->/iwbep/if_mgw_core_srv_runtime~read_entityset
EXPORTING
iv_entity_name = iv_entity_name
iv_source_name = iv_source_name
is_paging = is_paging
it_order = it_order
it_filter_select_options = it_filter_select_options
is_request_details = ls_request_details
iv_do_return_provider_format = abap_false
CHANGING
cv_response_body = cv_response_body
ct_headers = ct_headers
cr_entityset = cr_entityset
cr_deleted_entityset = cr_deleted_entityset
cs_response_context = cs_response_context
ct_inline_info = ct_inline_info.
CATCH /iwbep/cx_mgw_busi_exception.
CATCH /iwbep/cx_mgw_tech_exception.
ENDTRY.
ENDMETHOD.