Show TOC

/IWFND/CL_MGW_ACTIVATION_APILocate this document in the navigation structure

Use

Class /IWFND/CL_MGW_ACTIVATION_API is a central service activation API: This class provides functionality to activate a service on the SAP Gateway hub system and also to check if a service is already active. An existing service in the backend is a prerequisite. To a large extent, the functionality is similar to the Activate and Maintain Services transaction (/IWFND/MAINT_SERVICE).

Note

Note that the following features are currently not supported:

  • Create with OAuth

  • Service metadata load

  • Create without ICF node

Methods

Method GET_INSTANCE

This method gets the instance of class /IWFND/CL_MGW_ACTIVATION_API.

Parameter

Description

RO_INSTANCE

Instance of the API for service generation and activation.

Method ACTICATE_SERVICE

This method generates and activates an OData service within the SAP Gateway framework.

Parameter

Description

IV_SERVICE_NAME

Technical service document name.

IV_SERVICE_VERSION

Service version, for example 0001.

IV_PREFIX

Optional prefix, for example Z for customer namespaces.

IV_DEFAULT_CLIENT

Specifies if the default client shall be used, the default value is TRUE.

IV_SYSTEM_ALIAS

System alias of the backend system.

IV_PACKAGE

Package where the service is to be stored.

IV_TRANSPORT

Transport request, may be initial.

IV_SUPPRESS_DIALOG

Suppresses user popups, if set to TRUE.

EV_SRG_IDENTIFIER

Return parameter Service Document Identifier

Method IS_ACTIVE

This method checks if a specified sevice is already active on the SAP Gateway hub system.

Parameter

Description

IV_SERVICE_NAME

Technical service document name.

IV_SERVICE_VERSION

Service version, for example 0001.

IV_PREFIX

Optional prefix, for example Z for customer namespaces.

EV_ACTIVE

Returns TRUE if a service is active.

Example

Sample report:

REPORT z_srv_activate_api.

DATA:
	lo_activate_service TYPE REF TO /iwfnd/cl_mgw_activation_api,
	lv_srg_identifier TYPE /iwfnd/med_mdl_srg_identifier,
	lv_is_active TYPE abap_bool,
	lx_med_remote TYPE REF TO /iwfnd/cx_med_remote.

TRY.
   lo_activate_service = /iwfnd/cl_mgw_activation_api=>get_instance( ).
   lo_activate_service->is_active( EXPORTING
					iv_service_name = '/IWBEP/TRANSPORT_TEST_2'
					iv_service_version = '0001'
					iv_prefix = 'Z'
			        IMPORTING
					ev_active = lv_is_active ).

IF lv_is_active = abap_false.
	lo_activate_service->activate_service(
		EXPORTING
		 	iv_service_name = '/IWBEP/TRANSPORT_TEST_2'
			iv_service_version = '0001'
			iv_prefix = 'Z'
			iv_system_alias = 'alias'
			iv_package = '$TMP'
			iv_transport = ''
			iv_suppress_dialog = abap_true
		IMPORTING
			ev_srg_identifier = lv_srg_identifier ).
ENDIF.

CATCH /iwfnd/cx_med_remote INTO lx_med_remote.
    WRITE: 'Exception occured'.
ENDTRY.