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
maheshpalavalli
Active Contributor
0 Kudos
Thanks Andre, It's very useful. It would be awesome if SAP creates a tool based on the code you have provided and uses the output data to auto activate the services in s4 system :).

BR,

Mahesh
zaferonbas
Participant
Hi Andre,

Thanks for the blog, I've just used your report to export the list. Unfortunately the structure "/iwfnd/s_cof_srg_name_version" is not available in our systems. I've tried to find it in several versions including 1709, 1809 etc. but I couldn't. At the end I created a "Z structure" instead of it.

Thanks,
Zafer
Andre_Fischer
Product and Topic Expert
Product and Topic Expert

Hi Zafer,

thanks for the hint.

I fixed the code and replaced the structure by an internal type definition.

And I also fixed a bug, tadir_entry_tab must not be initial because otherwise all service groups that are present in the system are listed.

Best regards,

Andre

Michael_Kespohl
Newcomer
Hi André,

thanks for the blog that certainly helps me with a customer's request to do the very same thing.
As addition to your corrections to the source code, adding the type definition alone didn't work for me (7.52 based frontend server), but I also had to create a structure in SE11

Structure: ZCOF_SRG_NAME_VERSION
TECHNICAL_NAME Type /IWFND/MED_MDL_SRG_NAME
VERSION Type /IWFND/MED_MDL_VERSION

and change the call to REUSE_ALV_GRID_DISPLAY to

i_structure_name 'ZCOF_SRG_NAME_VERSION'

as otherwise the program dumps with exception "NO_FIELDCATALOG_AVAILABLE" in the ALV part.

 

Best regards

Michael
Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert
Hi Mahesh, OData Services are just one of the items that need to be moved across ... so unfortunately it's not possible to do everything with a tool

We are currently working on an end to end Hub to Embedded Migration Guide that will be published soon by Jorge Baltazar. Please watch for his blogs and we will also publish it on the SAP Fiori for SAP S/4HANA wiki when it is released.

Thanks

Jocelyn
maheshpalavalli
Active Contributor
0 Kudos
That's great to hear. Thanks for the update Jocelyn!
Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert
Hi folks the Hub to Embedded Migration guide can now be found here

SAP Fiori transition from Standalone to Embedded Deployment in SAP S/4HANA

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
Hi Jocelyn, thanks for the hint. I have updated my blog referring customers running on SAP S/4HANA 1709 or later to Jorge's blog.
Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert
0 Kudos
Thanks Andre - much appreciated!