Skip to Content

Add SAP HANA Support to Your Project

This tutorial shows you how to set up the SAP HANA cloud service instance.
You will learn
  • How to add SAP HANA client to your project
iwonahahnIwona HahnAugust 19, 2022
Created by
manjuX
August 19, 2022
Contributors
manjuX
  • Step 1
    1. Run the following command in your project root folder:

      Shell/Bash
      Copy
      cds add hana --for production
      

      This adds the hdb module for SAP HANA access to your package.json file and will configure kind sql as the database service.

      Changes in the package.json file done by cds add hana:

      JSON
      Copy
      {
          "name": "cpapp",
          ...
          "cds": {
              "requires": {
                  "[production]": {
                      "db": {
                          "kind": "hana-cloud"
                      }
                  },
                  "db": {
                      "kind": "sql"
                  }
              }
          }
      }
      

      Different to CAP default behavior, kind sql uses the SQLite in-memory database for local testing and the SAP HANA database for productive usage in the cloud.

      Additional Documentation:

    2. Run cds watch in your project folder and check that your app still works locally as it used to work before at http://localhost:4004/.

    Which value for kind allows to use SQLite in development and SAP HANA in productive mode?

Back to top