The SAP HANA Deployment Infrastructure (HDI) is a set of services that allows the deployment of database objects into isolated HDI containers.
HDI containers are simply database schemas, but they include additional features such as a dedicated owner of the container plus metadata to manage their database objects. Think of a container as a smart schema.
The objects included in the containers are defined in the HDB modules of your project, using source files and during deployment, the runtime objects are created and added to the container.
HDI takes care of dependency management and determines the order of deployment; it also provides support for upgrading existing runtime artifacts when their corresponding design-time artifacts are modified.
One key concept of HDI containers is the fact that the entire lifecycle (creation, modification, and deletion) of database objects is performed exclusively by the HDI. Therefore, you aren't able to directly create database artifacts, such as tables or views, with Data Definition Language (DDL) statements using SQL.
Data Sources for Calculation Views
When you develop calculation views, the data sources you choose must exist as design-time files in the container of your HDB module. So they must be of one of the following types:
- "Real" database objects (table, view, table function, virtual tables, and so on) existing inside the container and having a corresponding design-time file in the HDB module
- Synonyms referencing database objects located in any other schema than the container itself. You’ll learn about synonyms later on.
The file requires "db://HA300::TABLE_SQL" which is not provided by any file
Key Properties of HDI Containers
A container is create automatically when you deploy your database module for the first time.
A container generates a database schema the moment that a container is first created.
Database objects are deployed into that schema.
Source file definitions must be written in a schema-free way.
Direct references to objects outside your container aren't allowed. You must use synonyms.
HDI Container Configuration File
Within each HDB module of a project you'll find a very important and mandatory file that exists under the src folder with the suffix: .hdiconfig. This is the HDI container configuration file that is used to bind the design-time files of your project to the corresponding installed build plug-in.
Without the build plug-in it isn't possible to deploy the runtime objects from the design-time files. This configuration file directs each source file in your project to the correct build plug-in.
Usually there's only one .hdiconfig file in an HDB module, and this must be located in the src folder of the HDB module. This file contains a list of all bindings for all source file types.
The minimum_feature_version entry of this file is there to prevent building your HDB module objects with a version of HANA Cloud that is lower than what is specified and/or what your code requires. For example, if you've designed and tested your HDB module with version 1004 of the build plug-ins, this will not deploy on an SAP HANA Cloud instance where version 1002 is in place.
Inside the container configuration file you'll find, for each source file type, two entries:
Suffix name, for example, "hdbcalculationview"
Plug-in name, for example, "com.sap.hana.di.calculationview"
It’s very important to remember that when you import a project into your landscape, it brings with it its own .hdiconfig file that refers to the feature version that was used when it was first developed. If you then plan to update the source file using newer features of SAP HANA (for example, you want to add a new feature to a calculation view that just became available with the newer version of SAP HANA) you will not see the new feature in the source editor if the .hdiconfig file hasn't been adjusted to use the later feature version.
The SAP HANA PROJECTS View
In SAP Business Application Studio, when a project includes an SAP HANA DB module, a dedicated view SAP HANA PROJECTS is available (alongside the Explorer view.
The SAP HANA Projects view/panel is the materialization of the HDB modules defined in your projects. The upper part represents the folder structure of the HDB module. The root element corresponds to the path to the HDB module in the project. To create the runtime objects inside the connected HDI container schema, you can execute a deployment. This deployment can be triggered at different levels: a single file, a folder, or the entire HDB module.
In the file structure, Pending Deployment identifies where a deployment is required for new or modified files. For deleted design-time files, you need to activate the run-time object deletion by deploying the folder that contained them.
The lower part represents the Database Connections between the HDB module and the HDI containers or services providing access to external resources.
A project with an SAP HANA Database module needs at least a corresponding HDI Container to deploy its runtime objects. This is what is shown in the image, The SAP HANA PROJECTS View.
In the connection part, you can bind an existing HDB module to a new or existing HDI container. You can also add new connections (for example to another container), and
The Database Explorer
From SAP Business Application Studio, you can launch the Database Explorer application to view the database artifacts (tables, views, procedures, column views) of one or several containers.
When you do this, even if you're logged on to SAP Business Application Studio with your usual SAP Business Application Studio user, access to the container is done by a technical SBSS (Service Broker Security Support) user that is created transparently when you add the container to the Database Explorer. This technical user interacts with the database objects on your behalf, for example, to view the content of a table or preview the data of a calculation view.
If your container consumes data from an external schema, the technical user must also be granted authorizations to the external schema objects, for example, to view the data of an external table referenced by a synonym. You'll learn more about this in the unit, Security in SAP HANA Modeling.