SAP ABAP – HANA connectivity using secondary database connection.

Requirement: We want to connect secondary HANA database system from SAP ABAP system. This is the most common client requirement, where they want to connect a SAP ABAP system with HANA to accelerate business process execution.

SAP ABAP HANA Connectivity scenerio

·       Communication User: We need an HANA DB user with CATALOG READ or DATA ADMIN assigned.
·       Network connectivity: HANA system is reachable from ABAP servers.
·       HANA Client: Compatible HANA client installed on all SAP ABAP application servers.  Refer : How to install HANA client.

Verify network connectivity between SAP ABAP and SAP HANA system.
From OS level or using report RSBDCOS0 execute the PING command and make sure there is no package loss in test.
Please note: Transaction OS01 can also be used to ping the server.  Once the network connectivity is verified, we will create secondary database connection in SAP ABAP.
SAP HANA Ping test

Secondary database creation in SAP ABAP.
Execute transaction DBCO and go to change mode and create a new entry with HANA database parameters as shown below.
SAP ABAP HANA DBCO connectivity
In the connection info field we need to enter the HANA hostname/IP and port information in following convention:

Where <nn> is the HANA instance number. Once the entry is created, we can verify the ABAP -HANA connectivity by executing following tests.                                                                                                                 

Multiple methods can be used to validate the ABAP-HANA connection, PFB two most common used methods.

Method 1
We can validate the connectivity using the standard program "ADBC_TEST_CONNECTION", execute this program using SE38 and select our DB Connection Name "HDB" as input.

We should see a success message as shown below:
SAP HANA DBCO connection verification

Method 2
We can also use standard DBACOCKPIT transaction to verify the connectivity.

SAP Note: 1597627 - SAP HANA connection