Skip to Content

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.

/wp-content/uploads/2012/07/1_122814.png

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”

/wp-content/uploads/2012/07/2_122822.png

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

/wp-content/uploads/2012/07/3_122823.png

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.

/wp-content/uploads/2012/07/4_122825.png

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

/wp-content/uploads/2012/07/5_122826.png

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.

/wp-content/uploads/2012/07/6_122827.png

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

/wp-content/uploads/2012/07/7_122828.png

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.

/wp-content/uploads/2012/07/8_122829.png

/wp-content/uploads/2012/07/9_122830.png

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.

/wp-content/uploads/2012/07/10_122846.png

And yes! We got data from SAP HANA!

/wp-content/uploads/2012/07/11_122848.png

/wp-content/uploads/2012/07/12_122852.png

/wp-content/uploads/2012/07/13_122853.png

To report this post you need to login first.

12 Comments

You must be Logged on to comment or reply to a post.

  1. Yinyang Wang

    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.

    (0) 
  2. Yinyang Wang

    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?

    (0) 
    1. Erhan Keseli Post author

      Hi

      You will put “/IWBEP/ES_DESTIN_FINDER” to Create Implementation->New BAdl->Enhancement Spot. Then press create implementation button.

      (0) 
      1. Yinyang Wang

        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

        object ENHO /IWBEP/IF_DESTIN_FINDER_BADI

        (0) 
        1. Erhan Keseli Post author

          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.

          (0) 
  3. Ethan Zhang

    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.

    Thanks

    Ethan

    (0) 
  4. SANTHOSHI GORLE

    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.

    GW_service_model.JPGGateway_activation_error.JPG

    (0) 

Leave a Reply