SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Access a Classic Schema from SAP Business Application Studio

Access data in a plain or replicated schema from an HDI Container in SAP Business Application Studio.

Overview

🎓 beginner 20 min. SAP HANABeginnerSAP HANA CloudSAP Business Application Studio

You will learn

  • โœ”How to create a plain schema, with a table and user to simulate a replicated schema
  • โœ”How to create a user-provided service to access a database in SAP HANA Cloud
  • โœ”How to grant permissions to the technical users in your HDI container to access the database
Thomas Jung T Thomas Jung September 24, 2023
Created by January 7, 2021
Contributors

Prerequisites

Prerequisites

Steps

Intro

This tutorial is meant to be an example of cross-container access. Simple data models and loading mechanisms were chosen to simulate a schema replicated using tools such as SAP Landscape Transformation or an ABAP schema.

For more information on this process and additional syntax options, refer to the official documentation on SAP Help.

If you are looking for the steps for an on-premise SAP HANA instance with XS Advanced, such as SAP HANA, express edition, refer to this tutorial.

A video version of this tutorial is also available:


Step 1 Create a plain schema
โ€”

  1. Return to the SAP BTP cockpit and the HANA Cloud Management screen. Choose Open SAP HANA Database Explorer from the Actions column.

    DB Explorer
    DB Explorer

  2. The Database Explorer will open in another browser tab and the DB entry for your DBADMIN user will be selected. Choose Open SQL Console from the context menu

    DB Explorer
    DB Explorer

  3. Use the following code to create a schema and a user. You will also create a simple table to use as an example for cross-container access.

    You will create a SQL role and assign it to the user PLUSR with the permissions granted manually before. This user will be used for the connection between the HDI container and the plain schema, and will grant the role to the HDI container technical user.

    SQL
    CREATE SCHEMA "PLAIN";
    CREATE USER PLUSR PASSWORD "HanaRocks01" SET USERGROUP DEFAULT;
      ALTER USER PLUSR DISABLE PASSWORD LIFETIME;
    
    CREATE ROW TABLE "PLAIN"."REGIONS" (	REGION NVARCHAR(5), 	DESCRIPTION NVARCHAR(100) );
    
    CREATE ROLE CCROLE;
    grant  SELECT, UPDATE, INSERT, DELETE, EXECUTE, SELECT METADATA ON SCHEMA "PLAIN" TO CCROLE with grant option;
    grant  CCROLE to PLUSR with admin option;
  4. Use the green play button or press F8 to execute the statement.

    DB Explorer
    DB Explorer

What is going on?

ย  You have created a plain schema in your SAP HANA database. When you created a database module in SAP Business Application Studio, an HDI container was automatically generated. ย 

schema
schema

ย 

But ultimately these are both just schemas within the same HANA Cloud Database instance. We can communicate between the HDI Container Schema and the classic Schema using synonyms.

Step 2 Load data
+
Step 3 Create a user-provided service
+
Step 4 Grant permissions to technical users
+
Step 5 Create synonyms
+
Step 6 Create a view
+
Step 7 Troubleshooting insufficient privileges
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 7
1. Create a plain schema 2. Load data 3. Create a user-provided service 4. Grant permissions to technical users 5. Create synonyms 6. Create a view 7. Troubleshooting insufficient privileges

Learn more →