Skip to Content

Get Your HANA Data From Everywhere With Netweaver Gateway

With SAP Netweaver Gateway SP04 HANA Database data can be accessible from Gateway system. And I started to search for a document for this. I accessed a SAP Help url but it is very short. (Document Link). But there are some limitations for SAP HANA. You can read them from this link.

First install HANA client on your Gateway Server:

Unix(Logon with root):

hdbinst -a client -p /usr/sap/<SID>/hdbclient -s <SID>

Windows(Logon with SIDadm):

hdbinst -a client -p <lw>:\usr\sap\<SID>\hdbclient

Create a new db entry in DBCON table. To achieve this enter transaction code DBCO.


Now we can create Model Class. Go to transaction SE24. Create a new class. And define Superclass. Superclass is: “/IWHDB/CL_HAI_RT_ABS_MODEL”


Now redefine GET_HDB_ARTIFACTS method and write code. Dont forget to change code with your catalog name and view name.

data: lr_view_assgmnt type ref to /iwhdb/s_hai_rt_view_assgmnt.
 rt_views = super->get_hdb_artifacts( ).
 append initial line to rt_views reference into lr_view_assgmnt.
 lr_view_assgmnt->catalog_name = 'demo'.
 lr_view_assgmnt->view_name = 'AT_SALES'.


Save and activate your class.

Go to transaction SPRO. Click SAP Reference IMG button. Go to SAP Netweaver -> Gateway Service Enablement -> Backend OData Channel -> Service Development for Backend OData Channel. And click “Execute” button near Maintain Models.


Enter your Technical Model Name and Model Version your models and click create. In the next screen enter your class name above created.


Save your work. And enter IMG Activity Maintain Services. In this screen enter your Technical Service Name and Service Version and click Create button. In Data Provider Class input field enter “/IWHDB/CL_HAI_RT_DATA”. Save your service and click Assign Model. Choose you created below Technical Model and save again.


Now we need to create a BAdl Class. We need to do this because system does not know which dbcon entry to use. I dont write how to create a BAdl because I think you know it. In implementing class we implement “/IWBEP/IF_DESTIN_FINDER_BADI~GET_DB_CONNECTION” method. In this method we tell system which DBCON table entry to use. You can check name above. And if you have one more HANA systems you can write own logic to select system.

  rv_db_connection = 'AWSHANA' .


Now we will register a service and use it. Go to transaction /IWFND/MAINT_SERVICE (I dont like Gateway transaction codes!). Add a new service.



Choose your service before you created. Enter your Technical Model Name and Technical Service Name. Enter package name $TMP. If you want you change package name.

And if everything is ok we can test your service.


And yes! We got data from SAP HANA!




You must be Logged on to comment or reply to a post.
  • Hi Erhan,

         I do as you say in this blog except /IWBEP/IF_DESTIN_FINDER_BADI, I create a new class, and implement this interface, add my dbcon information into the method GET_DB_CONNECTION,but I don't know how to use it class? should I add this class into service? If I directly redefine the interface /iwbep/if_destin_finder_badi, the system told me I can't modify this method.

    I think this thing causes my service having 500 internal error when I explore this service. but I am not sure. could you please give me a hint? Thanks.

  • Hi

    Thank you for your reply so quickly. I use se19 to create a new enhancement implement, but the message popped up says "System setting does not allow changes to be made to

    object ENHO /IWBEP/IF_DESTIN_FINDER_BADI", where should I change this setting?

      • Hi

        Yes, I have done this , and I enter           

        Enhancement Implementation: /IWBEP/IF_DESTIN_FINDER_BADI

        Short Text:test

        Composite Enhancement Implementation:

        A error message popped up like this.

        System setting does not allow changes to be made to


        • Enhancement Implementation must start with Z, it is custom impl. And also Composite enhancement implementation must start with Z.

          I think you should get help from an ABAP guy. He will do this steps in a few minutes.

  • Great post.

    However, I followed up the steps but run into a dead-end.

    Our NW and Gateway are running on different server, IMG on NW couldn't configure ODATA Channel, while on Gateway /IWHDB/CL_HAI_RT_ABS_MODEL doesn't exist and ZHANA_BLOG couldn't been found.

    I'm lost here and couldn't carry on, kindly help.



  • Hello Erthan,

    I have followed the step you listed above in your blog. But seeing below error when I am trying to activate service.

    No Model assigned to Service'XXXX' First assign model first. But I can see model assigned to service in SPRO.

    Can you please suggest me I am missing anything which causing this error.