Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Andre_Fischer
Product and Topic Expert
Product and Topic Expert

Updates



Introduction


Today I got the question from a customer what one would have to do if moving from central hub deployment to embedded deployment when using SAP S/4HANA since this is the recommended deplyoment option as described in the blog SAP Fiori Deployment Options and Recommendations.

From a SAP Gateway perspective this would mean that OData services that have been activated in the SAP Gateway Hub would have to be activated in the SAP S/4HANA backend.

For the mass activation there is the tasklist SAP_GATEWAY_ACTIVATE_ODATA_SERV available. This tasklist now also supports transporting the service activation.

Updated tasklist available for SAP Gateway service activation

However what does one do if the services have already been activated before having imported the note that contains these changes?

As mentioned above, if you are running SAP S/4HANA 1709, 1809, 1909 or later please continue to read the following blog from my colleague jbaltazar SAP Fiori transition from Standalone to Embedded Deployment in SAP S/4HANA

Solution


Since I am currently developing a new task list that will allow mass changes to activated OData services I developed a feature that would list all services that have been changed if you have selected to delete the services.The resulting list can then be used as an input for the tasklist SAP_GATEWAY_ACTIVATE_ODATA_SERV. See also my blog Custom tasklist for OData service mass-maintenance

Based on this I wrote a little report that allows you to select a list of activated services in your SAP Gateway Hub that you can then take in your SAP S/4HANA backend to activate the services locally there.

Report source code


*&---------------------------------------------------------------------*
*& Report z_get_list_for_odata_srv_act
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT z_get_list_for_odata_srv_act.

* update 02.04.2019 - replaced structure binding by types definition for mt_selected_gw_service_group
* and ms_selected_gw_service_group

TYPES: BEGIN OF ty_selected_service_group,
technical_name TYPE /iwfnd/med_mdl_srg_name,
version TYPE /iwfnd/med_mdl_version,
END OF ty_selected_service_group.

DATA: ls_layout TYPE slis_layout_alv,
lv_textline1(45) TYPE c,
lv_grid_title TYPE lvc_title,
ls_i_med_srh TYPE /iwfnd/i_med_srh,
ls_tadir TYPE tadir,
mt_selected_gw_service_group TYPE STANDARD TABLE OF ty_selected_service_group,
ms_selected_gw_service_group TYPE ty_selected_service_group,
lv_number_of_selected_services TYPE string.

SELECTION-SCREEN BEGIN OF BLOCK part0 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS : s_srv_id FOR ls_i_med_srh-srv_identifier,
s_devcls FOR ls_tadir-devclass.
SELECTION-SCREEN END OF BLOCK part0 .

SELECT obj_name
FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'IWSG'
AND obj_name IN @s_srv_id
AND devclass IN @s_devcls
INTO TABLE @DATA(tadir_entry_tab). "#EC CI_GENBUFF

IF tadir_entry_tab IS INITIAL.
WRITE : / 'no service groups found.'.
EXIT.
ENDIF.

SELECT * FROM /iwfnd/i_med_srh
FOR ALL ENTRIES IN @tadir_entry_tab
WHERE srv_identifier = @tadir_entry_tab-obj_name
INTO TABLE @DATA(lt_i_med_srh) .

"create a list of the services that have been selected
"that can be used for input for the tasklist SAP_GATEWAY_ACTIVATE_ODATA_SERV

LOOP AT lt_i_med_srh INTO ls_i_med_srh.
ms_selected_gw_service_group-technical_name = ls_i_med_srh-service_name.
ms_selected_gw_service_group-version = ls_i_med_srh-service_version.
APPEND ms_selected_gw_service_group TO mt_selected_gw_service_group.
ENDLOOP.

"count the number of selected services
DESCRIBE TABLE lt_i_med_srh LINES lv_number_of_selected_services.

lv_grid_title = lv_number_of_selected_services && 'services selected for tasklist SAP_GATEWAY_ACTIVATE_ODATA_SERV'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_grid_title = lv_grid_title
i_structure_name = '/IWFND/S_COF_SRG_NAME_VERSION'
is_layout = ls_layout
TABLES
t_outtab = mt_selected_gw_service_group
EXCEPTIONS
program_error = 1
OTHERS = 2.

IF sy-subrc <> 0.
"do some error handling
write : / 'Error when using REUSE_ALV_GRID_DISPLAY'.
ENDIF.

 
9 Comments