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

Prepare for Production

As you've followed the tutorials for the Incident Management application, you’ve developed an application with an in-memory database and basic authentication. To have such an application on production, you need to make the respective configurations.

Overview

🎓 beginner 20 min. SAP Cloud Application Programming ModelBeginnerNode JsJavaSAP Business Technology PlatformSAP Fiori

You will learn

  • How to configure SAP HANA Cloud in your project.
  • How to configure the SAP Authorization and Trust Management service in your project.
Created by May 16, 2024
Contributors

Prerequisites

Prerequisites

You’ve added test cases in your application. Follow the steps in the Add Test Cases tutorial that is part of the Develop a Full-Stack CAP Application Following SAP BTP Developer’s Guide tutorial group.

OUT OF MAINTENANCE

This tutorial is no longer maintained. For an up-to-date version and support with any issues, refer to the Develop a Full-Stack CAP Application Following the SAP BTP Developer’s Guide mission in the SAP Discovery Center.

Steps

Step 1 Add SAP HANA Cloud

You can create a CAP project in either Node.js or Java. You have to choose one way or the other and follow through. The tabs Node.js and Java provide detailed steps for each alternative way.

  1. In SAP Business Application Studio, go to your IncidentManagement dev space.

    Make sure the IncidentManagement dev space is in status RUNNING.

  2. From the root of the INCIDENT-MANAGEMENT project, choose the burger menu, and then choose TerminalNew Terminal.

  3. To add an SAP HANA Cloud client to your application, run the following command:

    Shell
    cds add hana --for production

    The cds add hana command adds the @sap/cds-hana module that allows SAP HANA Cloud to access the package.json file and the database configuration "db": "hana" that uses SAP HANA Cloud when the application is started on production.

    The cds add hana command adds to the package.json file the "@cap-js/hana": "^x" dependency and the cds.requires [production] profile "db": "hana".

    JSON
    {
        "name": "incident-management",
        "dependencies": {
            ...
            "@cap-js/hana": "^x"
        },
        ...
        "cds": {
            "requires": {
                ...
                "[production]": {
                    "db": "hana"
                }
            }
        }
        ...
    }

    To learn more, see:

    By default, these profiles are available:

    • For local testing: development
    • For hybrid testing: hybrid
    • For productive testing: production

    Deployments are done using the production profile automatically. You can inspect the effective production configuration with the cds env command:

    Shell
    cds env requires -4 production

    The output of this command looks like this:

    Shell
    {
      middlewares: true,
      auth: { kind: 'jwt', vcap: { label: 'xsuaa' } },
      db: { impl: '@sap/cds/libx/_runtime/hana/Service.js', kind: 'hana' }
    }
  4. Verify that your application still works locally. If you closed it, choose the Preview Application option in the Application Info - incidents tab and select the watch-incidents npm script.

    To open the Application Info - incidents tab:

    1. Invoke the Command Palette - ViewCommand Palette or Command + Shift + P for macOS / Ctrl + Shift + P for Windows.
    2. Choose Fiori: Open Application Info.
Step 2 Configure the SAP Authorization and Trust Management service
+
Step 3 Add configuration for SAP Build Work Zone, standard edition
+
Step 4 Run a test build
+
Step 5 Deployment Options
+

Resources

Discussion

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

Submit detailed feedback Discuss in Community
Steps
Step 1 of 5
1. Add SAP HANA Cloud 2. Configure the SAP Authorization and Trust Management service 3. Add configuration for SAP Build Work Zone, standard edition 4. Run a test build 5. Deployment Options

Learn more →