Show TOC

Dynamic System Alias Calculation Via /IWFND/ES_MGW_DEST_FINDERLocate this document in the navigation structure


Enhancement spot /IWFND/ES_MGW_DEST_FINDER is provided to help you in dynamically calculating which system alias should be used. You can therefore use this enhancement spot to overwrite or enhance the standard routing for a service. Alternatively, you can use this enhancement spot to control the traffic from the SAP Gateway system to a backend system, so as to limit the load on that backend system.

The enhancement spot needs the following input:

  • OData service ID

  • User ID

  • Result of the standard routing in the form of a list of system aliases

  • List of HTTP request parameters which is only provided for data requests and not for metadata requests.

The enhancement sport returns a list of system aliases with the following fields:

  • system_alias of TYPE /iwfnd/defi_system_alias.

    This has to be defined with the standard implementation guide activity for system aliases.

  • user_role of TYPE /iwfnd/defi_role_name.

    This field is filled according to the standard routing in the implementation guide which has the role as an optional “filer”. Note that this field can be empty.

  • is_default of TYPE /iwfnd/mgw_inma_default_alias.

    If the table contains only one entry this can be empty. If the table contains more than one entry exactly one entry must be flagged as default.

    • That system alias is used for all normal (non multi destination composition) requests.

    • That system alias is used for multi destination composition requests in case of CREATE, metadata or function imports of multiplicity 1.


The service created in the backend system is as follows:

Technical Service Name:


External Service Name:




The service registered on the SAP Gateway system is as follows:



External Service Name:




Technical Service Name:

ZTEA_TEST_APPLICATION (provided during registration)

Service Document Identifier:

ZTEA_TEST_APPLICATION_0001 (technical service name plus version)

The URI would be as follows: URI = /sap/opu/odata/iwbep/TEA_TEST_APPLICATION/TeamCollection

The BAdI input would be as follows:





Table of system aliases containing the result of the standard routing

The BAdI output would then be a table of system aliases which were changed by the BADI (or not changed) as a result of the standard routing.

Sample coding throwing an exception in case of too much load on the backend system:

    RAISE EXCEPTION TYPE /iwfnd/cx_mgw_dest_finder
        textid           = /iwfnd/cx_mgw_dest_finder=>backend_load_too_high
        http_status_code = /iwfnd/cx_mgw_dest_finder=>gc_status_service_unavailable
        system_alias     = lv_system_alias.