Native SAP HANA artifacts

Using native SAP HANA database objects alongside an application’s generated data model, including objects and database features the modelling layer cannot express. Choosing a database is database connectors; changing an existing schema is schema evolution.

Overview

Using a database object CDS did not generate from the model, an existing table, a view with parameters, a table function, a calculation view or a table in another HDI container, and shipping the design-time files CDS cannot express, an index, a synonym, a native clause, in the same deployment. Distinct from database connectors, which is which database the model runs on, and from schema evolution, which is getting a model change into data that already exists.

SAP SHIPS
Node.js →

cds-federation-synonyms An experimental CAP plugin for CAP-to-CAP data federation over SAP HANA synonyms, so one project reads another's tables without the rows being copied.

@sap/cds-dk The command line client and development toolkit for CAP projects, with the commands cds build, cds deploy, cds watch and cds add among them.

@sap/cds Treats an entity annotated @cds.persistence.exists as a facade for a database object it does not generate, renders a user-defined function or calculation view call from the matching hint, and inserts @sql.prepend and @sql.append snippets into the generated DDL unevaluated.

@sap/hdi-deploy The Node.js deployer for SAP HANA Deployment Infrastructure: it writes a database module's design-time files into an HDI container as a delta, and it is what cds deploy runs for SAP HANA.

Not covered: At the file. A native object is designed in HDI's own formats and deployed by @sap/hdi-deploy; the compiler checks neither a native clause nor a facade's signature against the object it stands for, and a function with table-like parameters is not supported. Cross-container access needs the grantor's service key and the role grants set up outside the model, which the one sample here does by hand. On any database but SAP HANA there is no HDI and none of this applies.

Built into @sap/cds
THE COMMUNITY ADDS

No community artifact is documented here.

Artifacts5

Group by5 of 5 artifacts
ArtifactSignals
CDS plugins1
cds-federation-synonymsCAP-to-CAP data federation over SAP HANA synonyms
Signals
Functional boundary
CLI tools2
@sap/cds-dkCommand line client and development toolkit for CAP
Signals
none
SAP-samples/hana-developer-cli-tool-exampleDeveloper-centric command line for SAP HANA
Signals
none
Packages2
@sap/cdsCAP Node.js runtime
Signals
none
@sap/hdi-deployNode.js deployer for SAP HANA Deployment Infrastructure containers
Signals
none

Content2

Group by
Piece, what it offers
Connecting Two SAP CAP Projects Without Duplicating Your Data
SAP Community, Inderpreet, BlogThe reasoning
How to share tables across different CAP projects
SAP Community, Mio Yasutake, BlogThe reasoningA recipeRunnable code

Seen working1

ArtifactSignals
Samples1
cap-cross-containerCAP services reading each other's HANA tables across HDI containers
No license

Details

What changed — and what it makes stale1
@sap/cds 9.0.2, CAP, Node.js

CDS associations are no longer reflected as native SAP HANA associations (the WITH ASSOCIATIONS clause) in generated tables and views by default, because CAP does not need them and their validation slowed HDI deployments and introduced indirect dependencies between objects. Dated from the first 9.0 release published on npm, 9.0.2.

Makes stale:

Native HANA code, a calculation view or an SQLScript procedure, that navigated a CDS association on the database through the native association and expects it to still be there after an upgrade.

Coverage
statecore only, CAP
assessed
For your agent
Ref
capability:hana-native-artifacts
JSON
/capabilities/hana-native-artifacts.json
MCP
Connecting an agent