Start working with SAP HANA Cloud
The latest version of HANA, “SAP HANA Cloud” was recently released in April 2020.
It is a cloud “DataBase as a Service” product. It means you can create an instance in a few minutes, it has built-in high availability, elasticity, and is requires much less maintenance work than an on-premise deployment.
You can try it now for free !
Find out how to create an SAP Cloud Platform trial account and then your own SAP HANA Cloud instance.
SAP HANA Cloud manages data storage, federation, and helps you run powerful applications.
It offers one data access layer across all data sources, which means you can access other data sources through HANA Cloud without having to replicate everything.
It offers a fast and simple interface for administrators to optimize their data landscape.
- Native Storage Extension : multi-temperature storage. SAP HANA Cloud data tiering means you can move your data between the in-memory storage, SAP HANA native storage extension, and the relational data lake.
- Relational Data Lake (SAP IQ deployed in the cloud), supporting petabyte storage for SQL on disks. This also supports document, graph and spatial data types.
- Ability to access data without replication through data virtualization for many data sources– SAP and non-SAP, cloud and on premises.
- It is the first cloud-native SAP HANA service: elastic, resilient, supports consumption-based licensing, no frontloaded costs to use it.
SAP Analytics Cloud enables business users to perform visualization, planning, and prediction on any data source. It offers live data connectivity to SAP HANA Cloud Services so business users can self-serve across from a single, trusted, enterprise data source.
SAP Data Warehouse Cloud is a fully managed, cloud-native, data warehouse that provides users the concept of spaces ensuring data access and governance. It can consume data residing in SAP HANA Cloud Services. Both SAP Analytics Cloud and SAP Data Warehouse Cloud are running on top of SAP HANA Cloud as the database layer to give users performant, secure, access to data. Data Warehouse Cloud provides an additional layer to HANA Cloud that transforms your data to a solid and trusted data foundation for decision making processes. It includes semantic modelling capabilities, flow modelling, process chains, data lineage, advanced analytics and data visualization by addressing business users and data warehouse developers. HANA Cloud serves as the underlying data platform addressing database administrators and HANA developers.
For those who want to know more about SAP HANA’s use cases and history, have a look at this series by Denys Van Kempen.
This blog’s objective is to provide you with the basics to start working with SAP HANA Cloud. It is based on the official reference for SAP HANA Cloud, and the HANA Academy HANA Cloud guide.
Create your SAP HANA Cloud instance
Let’s start by creating an instance of SAP HANA Cloud.
If you are an existing SAP Cloud platform customer, access your SAP Cloud Platform Cockpit.
If you are new to the SAP Cloud platform, start by creating an account.
If you are an SAP Employee, access this page to grant the service plans to your SAP Cloud Platform account.
Open a global account which has a service plan active for
– SAP HANA Cloud(hana, hana-cloud-connection, relational-data-lake) : this is necessary to create instances of HANA Cloud and Relational Data Lake.
– SAP HANA Schemas & HDI Containers(schema or hdi-shared) : this is necessary to build services linking to HDI Containers or schemas.
– Application Runtime(MEMORY) : this is necessary to deploy HDI containers and run applications.
With the global account role of administrator, assign these service plans to the subaccount in which you will create the SAP HANA Cloud instance.
Switch to the “subaccount” tab, and select the subaccount in which you want to work. Click on entitlements, and “Configure entitlements”.
With the subaccount role organization manager, add the service plans hana, hana-cloud-connection, relational-data-lake, hdi-shared or schema, MEMORY to the subaccount in which you will create the SAP HANA Cloud instance. Within the service plans, you can limit entitlements for the Application Runtime : how many GiB of memory you allow developers to use for running applications. In this example, I am allocating 4GiB out of 5GiB available for development.
Assigning service plans and entitlements allow administrators to decide who can use resources within the organization.
You can now enter the space in which you will work, click on “SAP HANA Cloud” on the left panel, then on “Create Instance”.
Assign a name to your instance and a password to your administrator user.
Choose the memory size of your SAP HANA instance, between 30GB and 900GB. Compute power and storage are automatically assigned.
Optionally, you can create a Relational Data Lake.Set the number of virtual CPUs and the storage.
Finally, you can decide which IP addresses are allowed to access the SAP HANA Cloud instance.
After a few minutes, the instance is up and running. You can now access it from the SAP HANA Cockpit and the SAP HANA Database explorer.
You can edit it, reduce or increase its size by clicking on the pencil icon, and delete it with the trash can.
The Relational Data Lake is also up and running. You can edit it, reduce or increase its size and delete it. To access it, you can use the SAP HANA Database Explorer and the Web IDE Full-stack.
Let’s open the SAP HANA Cockpit. It provides tools for the administration and monitoring of your SAP HANA database. You can manage users and system parameters, monitor performance, jobs and SQL statements.
When you first open it, it asks you to enter credentials. Enter DBADMIN and the password you just set up.
From this point, you can already use the SAP HANA Database Explorer and interact with your SAP HANA Cloud database through SQL.
In the next step, we will use the SAP Web IDE Full-stack to build a simple database application.
Design tables and views
Go back to the SAP Cloud Platform Cockpit and open the SAP Web IDE Full-Stack to start designing database objects.
If you have never worked with Web IDE before, Check this tutorial. You will need to set it up, and grant your users the necessary roles for development, and activate two extensions for SAP HANA development.
Switch to Preferences>Extensions and enable the following extensions : SAP HANA Database Development Tools and SAP HANA Database Explorer
Set up the Cloud Foundry Space, then your Database Explorer to the space in which you created you HANA Cloud instance.
In the Web IDE, design-time objects and run-time objects are managed separately.
This allows developers to keep control on the objects they created, and makes communication between team members much easier.
In the development pane of the Web IDE Full-Stack, you can find your own workspace.
This workspace is isolated: whatever you define within this workspace can only be accessed by your user. To share their code, developers commonly use a centralized Git repository, or alternatively share by exporting and importing projects as Zip files.
Having an isolated workspace allows developers to isolate their work from other developers to concentrate on their own work without being distracted by changes that other people make. But how is this isolated behaviour reflected when you create objects that need to be pushed to HANA?
Inside a workspace, you can set up projects that contain HANA Database modules. By default, the Web IDE builds each HDB module into a developer specific HANA Deployment Infrastructure (HDI) container, which on the database is represented by one main schema, and several other objects that hold metadata.
Right-click on the work space and create a new project from a template. Select multi-target application, and follow the wizard.
Right-click on your newly created project and choose New>SAP HANA Database module. Follow the wizard to build a db module.
Now let us create tables. Right-click on the src folder and select New>File.
A pop-up comes up, insert tables/airports.hdbtable
This will create a tables folder with a file called airports.hdbtable.
In SAP HANA Cloud, we use HDBTable files to create tables. This file is a design-time artifact, which will create a table when we build the HDI container. It allows us to keep track on the definition of all our tables, and re-use them easily. HDBTable Syntax reference
COLUMN TABLE "AIRPORTS" ( "AIRPORTCODE" INTEGER, "AIRPORTNAME" NVARCHAR(256), "CITY" NVARCHAR(256), "COUNTRY" NVARCHAR(256), "LOCATION" ST_GEOMETRY(4326), "ALTITUDE" INTEGER, "OFFSETUTC" INTEGER, "PASSENGERS" INTEGER, PRIMARY KEY ("AIRPORTCODE") )
Learn more about SAP HANA supported SQL data types.
And in particular for this table I am using a location column, using SAP HANA Spatial’s capabilities. 4326 is the Spatial Reference system. Learn more about Spatial data here.
Let’s create a second table with the Web IDE has built-in artifact menu.
Right-click the tables folder, and select New>Data base artifact.
This opens a wizard with a list of all available artifacts on SAP HANA Cloud. Choose .hdbtable and give it the name “routes“. This will create routes.hdbtable
Insert the definition of the second table.
COLUMN TABLE "ROUTES" ( "ROUTEID" INTEGER, "AIRLINECODE" NVARCHAR(2), "AIRLINENAME" NVARCHAR(256), "ALLIANCENAME" NVARCHAR(256), "AIRPORTCODEORIGIN" NVARCHAR(3), "AIRPORTCODEDESTINATION" NVARCHAR(3), "DISTANCE" INTEGER, "DURATION" INTEGER, PRIMARY KEY ("ROUTEID") )
We have seen that users can define tables directly with files using the .hdbtable extension, or by selecting “new> database artifact” in the wizard. The result is the same.
Build tables and access them through the Database explorer
Now that you have created two design-time tables, we need to build them so that they are created as actual tables on SAP HANA. Right-click your src folder, select Build>Build Select Files.
When the build process finishes, switch to the database Explorer of the Web IDE. You will need to log in with your SAP Cloud Platform user the first time you use it. Then, click on the + on top of the screen and add the HDI Container you just built.
When you add the HDI container, its content becomes accessible on the left panel. Click on your tables and see their definition.
If you go back to the space where you created your HANA Cloud instance in the Cloud Platform Cockpit, you will notice that a new service of type hdi-shared has been created.
This can be binded to other applications and expose your HANA database for external use.
Note: this HDI container has been built, but it is not deployed yet. Right now it is just a development version used by the developer for testing. In order to expose your HDI containers for productive use, you must deploy them.
Share your code with other developers through Git
Your Web IDEworkspace is personal and cannot be shared with other developers. To share your code, we recommend using Git.
Right-click on your project and select Git>Initialize Local Repository.
A pop-up comes up and allows you to set your Remote repository.
Insert your repository URL.
Now, click on the Git icon on the right-side of the SAP Web IDE Full-stack. This will open the Git panel where you can use Git commands such as push, pull, rebase, merge.
Insert a commit message and push data to your central repository. The first time you push your code, you will need to log in, either through basic authentication or through a token.
A pop-up tells you when the push has been completed.
Access my code on GitHub for this project.
If you want to use SAP HANA Cloud with other clients, have a look at HANA Cloud : Connect clients.
The next step will be to use the routes and airports tables to create a graph.
Hi Maxime Simon
Thank you for the nice blog :))
I am using SAP Web IDE Full Stack with HANA service (CF). I am facing the issue about authorization in Production Environment.
Appreciate, if you can help me in this url https://answers.sap.com/questions/13035211/disable-build-option-in-sap-web-ide-full-stack.html
I checked your question, and here is a way to achieve what you want.
Goal: Using Web IDE Full-stack for accessing data, without the rights to build objects:
Web IDE Full-Stack is a development environment with some data preview capabilities, and it is not a BI tool. I think you should probably use a BI tool, such as SAC for your requirement.
Thank you for this blog.
I am doing the same operation as your blog and I have an issue about building table.
Could you give some advise about this ?
Did I skip something?
you forgot to include provision for the service "SAP HANA Schemas & HDI Containers". See the screenshot below.
You can create an SAP HANA Cloud instance, but you cannot build HDI containers without this service.
I was working on a procedure, which I generated in SQL Console (DB Explorer). And I used multiple CTE queries in a single query. It worked all and got executed.
When I copied the same code to a .hdbprocedure file in development/workspace mode, it threw an error, and I had to remove the subqueries to make it work.
Do you think this absurd behavior is a limitation of the Development Mode in Cloud Foundry?
I could not find a list of features supported by procedures defined in SQL vs procedures defined in .hdbprocedure.
The difference might be due to features which are not supported with .hdbprocedure procedures.
Thank you for sharing the blog, it's quite helpful !!
I have question as below-
OS level access is not allowed for HANA Cloud. Users (even customer admins) cannot use SSH to connect to the instance. Only SAP can access it exceptionally when there is an issue.
All DB admin tasks are realized through the HANA Cockpit accessible from your SAP Cloud Platform Cockpit.
Thank you for this blog.
I am having a problem from Web Ide when I build tables.
The compilation returns this error.
Can you help me with it? I can't solve it.
Hello, when you right-click on your newly created project and choose New>SAP HANA Database module, a wizard opens to build a db module.
It asks you if you want to use a "workspace" : a prefix that will come before every object's name in this project. This helps with clarity when you have different projects with the same table names for example.
I left workspace blank in this blog. It appears you wrote something in workspace, now every table you create needs to have that workspace in its definition as a prefix to build it.
Thank you very much. Resolved
thanks for your blogs.
I'have doubts regarding the structure of 1) cloud-hana database created from the cockpit and the next steps about the 2) creation of HDI container with Travel database etc. I don't understand the relation between the 1) and 2) because I was able to create 2) without creating 1). In addition I think the objects created on web ide are build and deployed in HDI container and not in cloud-hana db so these are two different instances. Do you know a way to build artifacts directly in cloud-hana db and not in an HDI container (also for the runtime development - xsjs, odata, etc) using web ide or other cloud tools/ or include in some way the HDI container in the cloud-hana db?
Data is usually contained within in a schema in Relational databases. This is also the case in SAP HANA.
An HDI container is a wrapper around a schema that allows it to be called easily and securely by applications.
You can build HDI containers in SAP HANA Cloud, SAP HANA as a service, or SAP HANA on-premise. My guess is that your HDI container was deployed in a previously existing HANA as a Service instance.
You can build artifacts directly in cloud-hana db, without going through an HDI container, by using SQL commands directly on the database. You open an SQL console through the database explorer, or DBeaver, and you directly execute SQL commands.
Hi Maxime, What are the major benefits of migrating to SAP HANA Cloud from HANA as a Service on CF? All the steps you referred in the blog are almost(99%) same in HANA as a service on CF also, then why SAP HANA Cloud?
Hello Maxime Simon ,
What are data archival ? Is there any out of the box support on this from SAP HANA Cloud service itself ?
I have a doubt: How can I stablish a connection between SAP HANA Cloud Trial and one S/4 HANA system? With the SQL Endpoint? How?
Thanks in advice!! 🙂