Skip to Content
Technical Articles

SAP Business Application Studio – Using SAP HANA Tools with SAP Cloud Application Programming Model projects

SAP Business Application Studio now supports SAP HANA Native Application development. To learn more about SAP HANA Development in SAP Business Application Studio, see SAP HANA Cloud and SAP Business Application Studio.

To develop SAP HANA Native artifacts, you can either create an “SAP HANA Native Application” dev space or add the SAP HANA Tools extension to other dev space types. Learn more about dev spaces here.

In this blog post, I will show you how to add native HDB artifacts using SAP HANA tools to SAP Cloud Application Programming Model projects. We will start by creating an SAP Cloud Application Programming Model project, and then we will adjust it step-by-step to work with SAP HANA tools. We continue to improve our tools so that in the near future, there will be no need for these manual steps.

STEP 1: Add SAP HANA Tools Extensions to SAP Cloud Business Application Dev Space

The first step is to create an SAP Cloud Business Application dev space and add the following additional SAP extensions to it:

  • SAP HANA Tools – Allows you to develop native SAP HANA applications. The extension includes tools such as graphical and text-based editors, project generators, etc.
  • SAP HANA Database Explorer – Allows you to access and inspect SAP HANA run-time objects using SAP HANA Database Explorer.
  • SAP HANA Calculation View Editor – Allows you to edit and manage SAP HANA calculation views. The extension includes the SAP HANA calculation view editor, the synonym editor, and the analytical privilege editor.


If you already have your own dev space, you can always edit it and add to it additional extensions by clicking the Edit icon in the Dev Space Manager.

STEP 2: Create an SAP Cloud Application Programming Model Project

SAP HANA Tools supports only MTA projects. In this blog post, you can find more information about MTA projects in SAP Business Application Studio.

When creating a new SAP Cloud Application Programming Model Project using “Create Project from Template” from the command palette, select the following features:

  • Configuration for SAP HANA Deployment
  • MTA based SAP Cloud Platform Deployment


For more information about SAP Cloud Application Programming Model Development in SAP Business Application Studio see this blog post.

If you already have your own SAP Cloud Application Programming Model project, you can add an MTA file using the following command in the terminal, under the project root:

cds add mta


STEP 3: Define the HDB Module Path

In Node.js projects, by default, the HDB module path in the “mta.yaml” file points to the “gen/db” folder.

We need to edit the “mta.yaml” file so that it points to the “db” folder.

STEP 4: Define the CDS Build Output Directory

The SAP HANA PROJECTS view allows you to deploy to the database HDB artifacts that reside under the DB module. To deploy also data models that were defined using CDS, you need to change the CDS build output folder. It should be generated under the DB module.

In Java projects, by default, the target folder is defined under the DB module.

In Node.js projects, set the CDS output directory by adding the following definition to the “package.json” file:

 "cds": {
   "build": {
      "target": "."


In addition, in the “package.json” file, change the “kind” property to “hana”, to create a run configuration that uses HANA as the target database instead of SQLite.

"requires": {
   "db": {
      "kind": "hana"


STEP 5: Working with SAP HANA CLOUD

SAP HANA Cloud does not support hdbcds.

If you deploy your HDB artifacts to SAP HANA Cloud, configure the CDS build command to generate hdbtable and hdbview artifacts instead of hdbcds.

In the Node.js project, add the following in your “package.json” file:

"hana": {
   "deploy-format": "hdbtable"

The resulting “package.json” file should look like this:

In a Java project, add the configuration to the project’s “.cdsrc” file.

"hana": {
   "deploy-format": "hdbtable"


STEP 6: Define the HDB module’s “package.json” file

In a Node.js project, add a new “package.json” file under the DB folder with the following content:

  "name": "deploy",
  "dependencies": {
    "@sap/hdi-deploy": "^3"
  "scripts": {
    "start": "node node_modules/@sap/hdi-deploy/deploy.js"


STEP 7: Add an HDB artifact to your data model

You can now add your native HDB artifacts under the “db\src” folder using the SAP HANA: Create SAP HANA Database Artifacts command in the command palette.

STEP 8: Deploy your HDB Artifacts to the database

To deploy your HDB artifacts to the database:

  1. From the terminal, run the following command under the project root to convert the CDS definition to HDB format.
cds build --production

Make sure that a “gen” folder was generated under the “db/src” folder and that all of your HDB artifacts were generated correctly under the “gen” folder.

  1. In the SAP HANA PROJECTS view, under Database Connections, bind your resource to a new or an existing HDI Container service instance.


  1. In the SAP HANA PROJECTS view, click the Deploy icon to deploy your HDB module.

  1. If you want to expose your native HDB artifacts as an OData service, you can use the SAP HANA CLI tool to create its CDS proxy entity. See hana-developer-cli-tool.

STEP 9: Run your project

To locally test your project, use the Run Configurations tool.

In a Node.js project:

  1. Add a run configuration to your project. For more information see Running CAP Node Applications in SAP Business Application Studio.
  2. Bind your service to the same HDI Container service that you used in the SAP HANA PROJECTS view.


In a Java project:

  1. Generate the “default-env.json” file using the following command:
cds deploy --to hana:myService --auto-undeploy

Make sure to use the same HDI Container service name as in the SAP HANA PROJECTS view.

  1. Add a cloud profile.

In the “application.yaml” file under “srv\src\main\resources\”, add an empty cloud profile:

 profiles: cloud
  1. Add a new run configuration using the cloud profile.

  1. Run your application.


While there are some manual adjustments that need to be done to use SAP HANA tools with SAP Cloud Application Programming Model projects, these changes will be required only for a short period of time. We are already working on improving the tools to allow a smooth cross-scenario development.


I hope you found this blog post useful.


You must be Logged on to comment or reply to a post.
  • Thanks for such detailed blog.  Please let me know are these tools are available for visual studio as well . If yes , which extension we need to install in visual studio code running locally.

    Thanks once again.

  • Hello Ayala,
    Thanks for the detailed blog! That really helps.
    One question, If we want to develop or edit existing calculation views inside our CAP project, is there a workaround inside SAP Cloud Business Application dev space to open it in Calculation view editor?
    Even if I clone my CAP project in SAP HANA Native dev space, still it does not load calculation view in Calculation view editor.
    • HI Aniket,

      which extensions do you have in your workspace? did you add the CDS graphical modeler extension?

      If so there is a collision between the SAP HANA CDS editor and the CDS graphical Modeler CDS editor. This bug was already fixed and should be available in production on Jan 18.

      If it is not the case, please share more details. or even a link to your repo if possible,


      Best regards,


  • Hi Ayala,

    Thanks for such a detailed blog.

    I had some issues even after carefully following the steps above, I was getting the error ” Task ‘SAP HANA: Deploy module’ has exited with code 1″, I have also attached the screenshot of the detail error. Can you please let me know what should I do in order to remove the error.

    Thank you in advance.


    Atharva Pravin Singru

  • Can you please expand the DB module node in the SAP HANA Projects and take a look at the database connection. I believe that you did not bind your resource to an HDI Container

    Best regards,


  • I am also facing the issue of deployment in SAP HANA Project from the data provided by SAP from their link . I also tried deploying each hdbtable until I came to OPENSAP_HD_ADDRESSES.hdbtable which returns me code 1 (Pending Deployment). Shall appreciate if you can guide me as to how to resolve the Pending Deployment issue. Below is the screenshot of the error generated. Thanks in advance.