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:- saplearners.com
  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 Aliases5. 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 XS7. 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 Successfully8. 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 Service10. 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. 🙂

  • trond

    Brilliant – thanks for this valuable tutorial!

    • AdminSAPLearners

      Thanks Trond

  • Madhu

    tutorial is awesome..
    What is the Use of Aliase and why we need to create Aliases

  • Infaaz

    Hi,

    when I try this, I am getting following error.
    RFC error message: Illegal destination type ‘G’ at step 9. Do you have any idea about this issue??
    It is highly appreciated if u can help to solve the issue asap

  • Hiroshi

    Hi.

    Me too.

    RFC error message: Illegal destination type ‘G’.
    Why??

  • Séverin de Beaulieu

    Hi,

    To avoid – RFC error message: Illegal destination type ‘G’ – at step 9, you can check Local GW and For local app boxes in step 5.

    Cheers,

    Severin

    • TeamSAPLearners

      Hi Severin,

      Thanks for the information.

      Thanks,
      Prakash

  • Unnati Bellare

    thanks ! very informative.
    I would like to know the reason to consume xsodata in the gateway. Typically for which scenario would this be required?

    • Trond

      This would be a normal requirement for scenarios where you do not want to expose your HANA DB system to the outside world, ie. most enterprise-like scenarios. Gateway is, as the name implies, used for exactly that purpose. With the above setup, your HANA XS services would be firmly protected behind your firewall.

      • Unnati Bellare

        Makes sense… Thanks!

      • TeamSAPLearners

        Thank you very much Trond for the information.

        Thanks,
        Prakash