How to consume external OData services in SAP Gateway


Hello everyone, in this SAP Gateway OData tutorial, we will learn how to consume external OData services in SAP Gateway.

External OData services means the service which are from 3rd party systems (or) Non-SAP systems.

OData Services Consumption and Integration (OSCI)

With OData Services Consumption and Integration (OSCI) SAP has provided the provision of consuming external services. So lets get started.

Supported System Version

SAP NetWeaver Gateway 2.0 SP6 or higher / SAP NetWeaver 7.40 SP2 or higher

Business Scenario

In this demo example we are going to consume Northwind OData service from You can get the list of available OData services here.

Step-by-Step Procedure

1. Create an HTTP connection to your external system by creating a RFC connection of type G in SAP  Gateway system.

1. Go to t-code SM59-Configure RFC Connection. Select HTTP Connections to External Server node and click on Create.

Configuration of RFC Connections2. Enter the RFC Destination name and Target Host name like below and hit Save Save

New RFC Destination3.  Test the connection by clicking on Connection Test button in the application toolbar.You should be able to connect to the server and should see the HTTP Response code as 200 like below.

Connection Test

2. Create SAP System Alias

4. Create a System Alias for the above created RFC destination. Go to SPRO → SAP Reference IMG and Navigate to this path : SAP Netweaver → Gateway → ODATA Channel → Configuration → Connection Settings → SAP Netweaver Gateway to SAP System → Manage SAP System Aliases.

Manage SAP System Alias

5. Enter SAP System Alias name, Description, RFC Destination and Software Version. Select Local GW and For Local App check-box as well. Click on Save Save to save the entries.

New System Alias 6. Go to transaction /IWBEP/OCI_SRV_GEN-OData Service(GW) Generator for External Data Services.Enter 

HTTP Destination = ODATA_ORG
Service Namespace = V2/(S(xuh52ptttgitgrkbtjzk1o31))/OData
Service Name = OData.svc
Model Provider Class = ZCL_NORTHWIND_MPC
Data Provider Class = ZCL_NORTHWIND_DPC

OSCI OData Generator

7. After entering above information hit Execute button to generate the service.After successfully service generation you should see the below screen.

Service generated successfully8. Our next step is to activate and register service.Go to /IWFND/MAINT_SERVICE – Activate and Maintain Services. Hit Add Service button to add our service.

9. In the below screen enter System Alias = NORTHWIND and hit Get Services button.We will get a list of services, select our service and hit Add Selected Services button.

Add Selected Services10. In the Add Service popup window, check the details and hit OK button.

Add Service Details11. We have successfully registered the service,now its time to test the service.Go to transaction /IWFND/GW_CLIENT – Gateway Client. Enter the service name and execute.

Gateway Client

You have successfully learned how to consume external OData services in SAP Netweaver Gateway.

Please stay tuned to us for more SAP Netweaver Gateway tutorials.Please feel free to comment and let us know your feedback. You feedback will keep us alive.

Thank you.


  1. Hi, Didn’t you experience below issue ?

    Will there be a note / fix for the class: /IWFND/CL_OCI_HTTP_PROCESSOR. Regarding the missing ‘http://’ in the ‘mv_target_host’ ? We ran into this issue when consuming an HANA xsodata service or third party servie( via SAP Gateway. It gives issues when loading metadata but also for reading of entities.


    • Hello Prabaharan,

      Thanks for your comments. Can you please try this

      In Step-2 : Under Target System Settings >> Enter “Path Prefix” as http:// or https://


      • Hi Prakash,

        Thanks for the useful blog.

        I followed the steps described the blog and am receiving this error “Could not retrieve the model name and version” when trying to consume the above mentioned external REST service in gateway system(SAP NW 7.4).

        Host name:
        Path prefix -> /V2/OData/

        I am passing RFC destination, Service name in the SEGW tool wizard steps and started in debug mode. I found that in the below standard class RFC destination is getting retrieved as blank value.


        Parameter IV_RFC_DESTINATION is null.

        So exception is raised as below snipped will get executed.

        IF iv_rfc_destination IS INITIAL .

        *– Raise Exception –*

        lv_message = /iwfnd/cl_oci_common_util=>create_message_key( iv_msgid =/iwfnd/if_oci_common=>gc_message_id iv_msgno = ‘001’ ) .

        RAISE EXCEPTION TYPE /iwfnd/cx_mgw_tech_exception


        textid = lv_message.

        ENDIF .

        Message class : /IWFND/OCI_MSG

        Error: Enter an RFC Destination

        Gateway service builder didnt pick up the RFC destination passed via the wizard

        Could you give some insights on this error?

        Your help is appreciated.



        • Hi,

          In step 2, the value for “Path Prefix” should be “/V2/Northwind/Northwind.svc”.
          In step 6, leave “Service Namespace” and “Service Name” empty.
          You should be able to generate required classes successfully.


  2. Hello Prakash,

    I tried to created rfc by follow the same above described process. But when I did save and click on test connection, it is giving Status HTTP Response to ‘404’, Status Text ‘Not found’.
    Can you help me to solve this out.

    Thank you,

  3. How to call consumed webservice from ABAP code in this case, Please point out library or APIS thanks.

Comments are closed.