How to consume HANA XS OData service in SAP Netweaver Gateway


Hello everyone, in our previous tutorial we have learned how to consume NON-SAP OData services. In this SAP Netweaver Gateway tutorial, we will learn how to consume HANA XS OData services in SAP Netweaver Gateway.

HANA XS OData services means the service which are developed in HANA XS Engine.  SAP has provided the provision of consuming HANA XS OData services in SAP Netweaver Gateway system with OData Services Consumption and Integration (OSCI) and convert them to Gateway OData 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

You have created/developed HANA XS OData service in HANA XS Engine.Now you want to expose XS OData service as OData service from SAP Netweaver Gateway System.

Step-by-Step Procedure

Create an HTTP connection to your HANA XS Engine by creating a RFC connection of type G in SAP  Netweaver Gateway system

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

Create RFC Connection

2. Enter the RFC Destination name and Target Host name like below and hit Save Save.

RFC Connection to HANA XS Engine
  1. RFC Destination Name
  2. RFC Destination Description
  3. Target Host – <server_name>  Eg:-
  4. Service No : Port No  Eg:-8003
  5. Path Prefix :  /      [ Note: Please mention this as it is.]

3. 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.

HANA XS Engine Successful

Create SAP System Alias

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

Manage SAP System Aliases

5. Enter SAP System Alias name, Description, RFC Destination and Software Version.Click on Save Save to save the entries.

New SAP System Alias Entry

OData Services Consumption and Integration(OSCI)

6. Go to transaction /IWBEP/OCI_SRV_GEN – OData Service(GW) Generator for External Data Services. Please enter 

  1. HTTP Destination = HANAXS
  2. Service Namespace = shinesp8/services  (HANA repository path in which your xsodata service is stored)
  3. Service Name = poWorklist.xsodata
  4. Model Provider Class = ZCL_XSODATA_MPC
  5. Data Provider Class = ZCL_XSODATA_DPC
  6. Model Name = ZXSODATA_MDL
  7. Service Name = ZXSODATA_SRV
ODate Service Genarator for HANA XS

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

OData Service Generated Successfully

8. To activate and register the 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 = HANAXS and hit Get Services button.We will get a list of services, select our service and hit Add Selected Services button.

Add Service

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

Add Selected Service

11. You should see a successful popup message saying

Service ‘ZXSODATA_SRV’ was created and its metadata was loaded successfully.

12. 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 HANA XS OData service 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. 🙂

Comments are closed.