SAP NetWeaver Gateway

2 Posts authored by: Erhan Keseli

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.

 

1.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"

 

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

 

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

 

4.png

 

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

 

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

 

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

 

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

8.png

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

 

10.png

 

And yes! We got data from SAP HANA!

 

11.png

12.png

13.png

Hi gurus, I want to ask you a question about SAP Gateway.

 

Come on, you get used to read this sentence from upgrading to new SCN. And this is a joke.

 

When I downloaded SAP Netweaver Gateway from SCN it was very easy to setup it on Linux. Ok, I didn’t try to install it on Windows. I found some documents about Gateway. I read them all. It is good to know that documentation is very well on SAP Gateway. I implemented scenarios on the documents.

 

Pros:

  • Easy installation. That's standart ABAP installation
  • It is easy to expose ABAP functions. Just some clicks and voila!
  • Easy to use screens. Mapping screens are enough good to use.

    

Cons:

  • JSON is not supported
  • When you get an error, it is very hard to find where the error is.
  • Hard to remember transaction codes.

 

Well, that's my thoughts about SAP Netweaver Gateway. You can write your own thoughts below blog. Waiting for them!

Filter Blog

By author:
By date: By tag: