Skip to Content
Author's profile photo Neetu Singla

Accessing HANA Sandbox via ABAP system – Secondary DB (example)

Here, we will access the HANA Sandbox system from an ABAP system. The ABAP system has database like MaxDB. We will access HANA DB (HDB) from this ABAP system as a secondary DB.
This is the example which connects ERP system with HANA system.
SAP HANA DBSL is needed (this is the Database specific library which is part of the ABAP Kernel). The SAP HANA DBSL is only available for the ABAP Kernel 7.20, which is already the kernel for NetWeaver 7.02, 7.03, 7.20, 7.30 and 7.31. So make sure, the ABAP system you use has valid release of Netweaver.
  1. Create Connection:
    • Create/Get a user (prefer a generic user) in HANA sandbox:  I created ‘EBSCLNT001’.


    • Note the connection (host) information from HANA Sandbox:
    • Create DB connection in ABAP system: Transaction SM30, table DBCON.  You need to give the HANA Sandbox username/password created in step 1(a). Give the connection information from step 1 (b). Give a connection name such as ‘HANA_COE_EBS’.

     2. In the user specific schema, you need to create your own tables/views etc., manually/programatically (via ABAP). Table SFLIGHT created in schema EBSCLNT001.
     3.  Accesing this table from ABAP Program (ABAP System where DBCON setting was done):

Sample code:

DATA: flight TYPE sflight,
LIKE TABLE OF sflight,
LIKE LINE OF t_flight.

* Single Record
SELECT SINGLE * FROM sflight INTO flight
(‘HANA_COE_EBS’) WHERE carrid = ‘AA’.
IF sysubrc IS INITIAL.   WRITE: / ‘Successful access to HANA Sandbox COE!’,/,/ENDIF.

* Multiple records from HANA table
WRITE: /‘Data from Table SFLIGHT, no. of records: ‘, sydbcnt.
LOOP AT t_flight INTO wa_flight.
WRITE: / wa_flightcarrid, wa_flightconnid, wa_flightfldate.

Execute: You will get all the records!

You can try this with any ABAP system with appropriate Netweaver release and HANA Sandbox.
Also refer the blog(s) here for more detailed information:


Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Uwe Fetzer
      Uwe Fetzer

      Unfortunately your pictures are stored on the SAP intranet and cannot be seen outside the network. Can you please upload them to SCN? Thank you

      Author's profile photo Neetu Singla
      Neetu Singla
      Blog Post Author

      Please check now.

      Author's profile photo Uwe Fetzer
      Uwe Fetzer

      Perfect, thank you.