Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
Showing results for 
Search instead for 
Did you mean: 
Product and Topic Expert
Product and Topic Expert

With this blog series we provide an update with the latest information on getting started with SAP HANA Cloud on the SAP Cloud Platform.

  1. About SAP HANA Cloud

  2. SAP HANA Cloud Getting Started

  3. SAP HANA Cloud and SAP Business Application Studio

  4. HDI with SAP HANA Cloud

  5. SAP Analysis for Microsoft Office and SAP HANA Cloud

  6. Cloud Foundry Advanced <=

  7. SAP HANA Cloud, JWT Provider, and Certificate Collection with Purpose JWT

  8. Data masking and data anonymization

  9. Predictive Analysis Library (PAL) and Automated Predictive Library (APL)

  10. Remote data sources and virtual tables

  11. OData with SAP HANA Cloud

  12. SAP HANA Cloud Graph

  13. Role Attributes

  14. SAP HANA Cloud and Smart Data Integration

For more information about the free trial, see

For the new features overview posts, see

Questions? Post as comment.

Useful? Give us a like and share on social media.


Hands-On Video Tutorials

Chief partner engineer, philip.mugglestone just updated his SAP HANA Cloud playlist on the SAP HANA Academy YouTube channel with three short new videos covering space travel for SAP HANA Cloud instances or instance sharing, how to handle multiple instances in a single space, and to define explicit schema names for HDI containers.

In this blog, you will find the videos embedded with some additional information and resources.

You can watch the four video tutorials in about 30 minutes. What you get back is

  • How to access an SAP HANA Cloud instance from a different Cloud Foundry spaces and/or orgs

  • How to set the database ID of an SAP HANA Cloud instance when creating HDI container service instances

  • How to explicitly set the schema name when creating HDI container service instances

  • How to set the SAP HANA Cloud database ID and/or schema when creating multi-target applications

  • How to configure intra-HDI container access (from one container to another container)

We created the SAP HANA Cloud instance and explained how to work with HDI containers and the SAP Business Application Studio in the previous blogs, so make sure to read these first. To bookmark the playlist on YouTube, go to > SAP HANA Cloud

Ready for lift-off?

Instance Sharing

In this tutorial, we discover how to access an SAP HANA Cloud instance from another Cloud Foundry space or organisation.

To access an SAP HANA Cloud instance from another Cloud Foundry space or even organisation, we need to create a mapping for the instance to the relevant Org and Space ID.

Across organisations, the cloud provider and region needs to be the same. If no space is selected, the mapping applies to all spaces.

Subsequently, we can create, for example, an instance of SAP HANA Schemas & HDI Container service (plan: hdi-shared) in our SAP. HANA Cloud database.

For the documentation, see

Multiple Instances

In this video we discover how we can use the database ID when creating an HDI service instance or MTA application in case multiple instances are running in a single Cloud Foundry space.

In case your space contains multiple SAP HANA Cloud instances, you need to specify the database ID as parameter in JSON format when creating a service instance of the HDI container.

The cf command equivalent is
# connect
cf l
# target the right space
cf t -s dev
# list the available services
cf s
# get the GUID of the service
cf service <service_name> --guid

# target the right space
cf t -s test
# create an HDI service instance specifying GUID
cf create-service hana hdi-shared <name> -c '{"database_id":"<GUID>"}'

On Windows, escape the double quote characters
cf create-service hana hdi-shared <name> -c '{\"database_id\":\"<GUID>\"}'

The database ID is also used used as parameter in the mta.yaml file of the db target of a multi-target application (MTA). Below an example of the configuration using the SAP Business Application Studio.

For the documentation, see

Explicit Schema Names

In this video tutorial, we discover how to set the schema name of an HDI container explicitly. The alternative and default value is a unique GUID.

When creating the HDI service instance, we can specify the schema as parameter in JSON format. The schema name must be unique in the database.

The service key displays the new schema value and is also used as prefix for the design time (DT) and runtime (RT) users.

When connecting we can now use a more user-friendly identifier.

Using the command line, specify the schema as parameter in JSON format.
cf create-service hana hdi-shared <name> -c '{"schema":"MYSCHEMA"}'

When creating a multi-target application. set the parameter in the resource section for the HDI container.

Configure JWT Trust

In this video tutorial, we cover how to configure the trust relationship between your Cloud Foundry subaccount and the SAP HANA Cloud instance. This is required, for example, when a Node.js application needs to access an HDI container.

Source code:

[0:00] - Introduction

[0:45] - 500 Internal Server Error returned when trust is not configured

[1:00] - Log message: the predefined session variable cannot be set via SET command XS_APPLICATION USER

[1:20] - open Database Explorer. The first four queries verify no JWT configuration has been configured yet

[2:45] - construct the JWT trust URL

[3:20] - create certificate
'user_name', true);

[3:50] - get certificate ID and create PSE
ALTER pse PSE1 ADD certificate <certificate_id>;

[4:30] - app returns data

Intra-HDI Container Access

In this video tutorial, we learn how to configure access from one HDI container to another within the same Cloud Foundry Org and Space.

The source code for this project is in the SAP HANA GitHub repository

0:40 - Use git clone to import this into SAP Business Application Studio (or your preferred IDE).

1:30 - The protagonists of this tutorial are the applications scpapps (source) and myappssyn (target) and we start with defining two design-time role definitions (.hdbrole):

  • a standard role with read access to the sales table in the container

  • a privileged role, identical to the standard but with grant option 

2:50 - Build and deploy the MTAR to your Cloud Foundry space.

3:40 - This results in an app, we can access in a browser to display data from the sales table.

4:10 - We can view the same data when we connect to the HDI container in the Database Explorer.

5:00 - The mta.yaml configuration file for our second application specifies the TARGET_CONTAINER property and references an existing service name, the name of the HDI container that was created when we deployed the myapphana app.

6:11 - The target app includes sales.hdbgrants which assigns the two roles to the technical users:

  • with-grant option (_g#) to the object owner

  • regular role to the runtime user

6:55 - The target app also includes the src/sales.hdbsynonym and cfg/sales.hdbsynonymconfig artifacts specifying myapphana as the source object.

8:15 - The query in server.js selects from the synonym.
app.get('/srv/sales', function (req, res) {
req.db.exec('SELECT * FROM "myappsyn.db::sales"',
function (err, results)
(...) }

8:30 - Build and deploy the application.

9:07 - Open the myappsyn app and view the sales data stored in the HDI container from myapphana.

9:28 - Add the HDI container from myappsyn to Database Explorer and view the sales data via the synonym.

10:00 - In case the service name (in our example myapphana-hdi) is not known when you develop the application, you can use the file mta-config.mtaext to provide this information at deploy time.

For the documentation, see the topics in the SAP HANA Developer Guide for SAP HANA XS Advanced Model

Share and Connect 

Questions? Post as comment.

Useful? Give us a like and share on social media. Thanks!

If you would like to receive updates, connect with me on

For the author page of SAP Press, visit

For the SAP HANA Cloud e-bite, see