Skip to content

Connecting to SAP HANA

Version requirement

SAP HANA support is available in PuppyGraph 1.18.0 and later.

PuppyGraph reads SAP HANA directly over JDBC: tables, SQL views, ABAP CDS views (for example in SAPABAP1) and calculation views in _SYS_BIC. This covers SAP S/4HANA, SAP BW/4HANA and SAP HANA Cloud.

Prerequisites

  • SAP HANA 2.0 or SAP HANA Cloud, reachable over the network from every PuppyGraph node.
  • SAP's HANA JDBC driver (ngdbc) installed on every PuppyGraph node. PuppyGraph does not include it; see Installing SAP's JDBC driver.
  • A database user with SELECT on the schemas and views you map. Calculation views in _SYS_BIC also need the matching analytic privileges, without which HANA returns no rows or an authorization error.
  • Your SAP licence must allow direct SQL access to the database. Reading an SAP application's database (for example S/4HANA's ABAP schema) from a non-SAP tool over SQL generally requires a SAP HANA Full Use licence; a Runtime licence usually does not permit it. Check your SAP contract before connecting.

Installing SAP's JDBC driver

SAP licenses the driver under the SAP Developer License Agreement, so PuppyGraph cannot ship it. You install it once per deployment:

  1. Get SAP's JDBC driver jar: ngdbc.jar from your SAP HANA client installation, or ngdbc-<version>.jar from SAP (it is also published on Maven Central as com.sap.cloud.db.jdbc:ngdbc). Downloading it binds you to SAP's licence terms. Any file name that contains ngdbc and ends in .jar works.
  2. Place the jar in PuppyGraph's driver directory, /data/data-drivers, on every PuppyGraph node. /data is where PuppyGraph keeps its data, so when it is on a persistent volume the jar stays installed after a container or pod is recreated. You do not need to restart PuppyGraph before creating the catalog.

With Docker, mount the jar into the driver directory:

docker run ... \
  -v /path/to/ngdbc-2.30.11.jar:/data/data-drivers/ngdbc-2.30.11.jar \
  puppygraph/puppygraph:<version>

On Kubernetes, each leader and compute pod has its own /data volume. Copy the jar into every pod, for example kubectl cp ngdbc-2.30.11.jar <pod>:/data/data-drivers/.

Leave the catalog's JDBC Driver URL empty: PuppyGraph finds the jar in the driver directory. Until the jar is in place, creating the catalog fails with an error saying that SAP's HANA JDBC driver is missing.

Configuration

Choose SAP HANA under SQL Databases when you create the catalog.

Configuration Explanation
Username The database user.
Password The user's password.
JDBC URI jdbc:sap://<host>:<port>/?databaseName=<tenant> for SAP HANA, for example jdbc:sap://hana.example.com:30015/?databaseName=PRD. For SAP HANA Cloud, copy the host and port from your instance's service key: jdbc:sap://<instance-id>.<domain>.hanacloud.ondemand.com:443/?encrypt=true. See SAP's JDBC connection properties.
JDBC Driver Class Default: com.sap.db.jdbc.Driver.
JDBC Driver URL Leave empty; see Installing SAP's JDBC driver.

What you can map

  • Schemas: HANA's system schemas (SYS, _SYS_*) are hidden, except _SYS_BIC.
  • Tables and views: column-store and row-store tables, SQL views, ABAP CDS views and calculation views. Names are used exactly as HANA spells them, including slash-namespaced objects such as /BIC/AZSALES00, calculation views such as sap.hba.ecc/CostCenter, and mixed-case CDS columns such as SalesOrder.
  • Not supported yet: CDS views and calculation views with mandatory input parameters.

Data types

SAP HANA type PuppyGraph type
NVARCHAR, VARCHAR, ALPHANUM, SHORTTEXT, NCLOB, CLOB String
DECIMAL(p,s) Decimal
DECIMAL without precision, SMALLDECIMAL String (read as text so no digits are lost)
TINYINT, SMALLINT Short
INTEGER Int
BIGINT Long
REAL Float
DOUBLE Double
BOOLEAN Boolean
DATE Date
SECONDDATE, TIMESTAMP DateTime (to the microsecond; HANA's seventh fractional digit is dropped)
VARBINARY, BINARY Binary
TIME, BLOB, ST_GEOMETRY Not supported: a node or edge can't map these columns

ABAP stores CHAR, NUMC, DATS (YYYYMMDD) and TIMS (HHMMSS) fields as NVARCHAR, so they arrive as strings. CURR and QUAN fields are fixed DECIMAL(p,s).