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

Develop and Configure an approuter application for the multitenant application of the SaaS solution

Develop and configure the approuter application for the multitenant application of the solution

Overview

🎓 beginner 10 min. SAP BTP ABAP EnvironmentBeginnerABAP DevelopmentABAP Extensibility

You will learn

  • โœ”How to configure an approuter application.
Sumana Vasuki S Sumana Vasuki July 10, 2023
Created by May 22, 2023
Contributors

Prerequisites

Prerequisites

  • You have created an MTA project for the Multitenant Application in the Business Application Studio as per the previous tutorial of this group

Steps

Step 1 Create a Node.js project for the router
โ€”

To authenticate business users of the application at runtime, use the tenant-aware approuter application and the XSUAA service in SAP Business Technology Platform. This will also provide the necessary callbacks for the SaaS Provisioning Service. In addition, we provide the middleware @sap/asp-middleware component that enhances the approuter to also take care of automatically routing the consumer to their ABAP tenant.

Provider Subaccount-MTA
Provider Subaccount-MTA

  1. Create a new folder called ‘router’. This step happens in the Business Application Studio, in the project folder created in the previous tutorial

    New Folder
    New Folder

  2. Open a command prompt (terminal) in this folder

    Open in terminal
    Open in terminal

  3. Create a new project by executing the following command

    Shell/Bash
    npm init

    In the upcoming wizard flow you can leave the defaults or define your own values if preferred

    NPM INIT
    NPM INIT

    Result: After the project is initialized, the package contains a package.json file

    Package JSON
    Package JSON

  4. The package.json should have the following content (if the defaults are kept):

  5. Replace your code

    JSON
    { 
      "name": "router",
      "version": "1.0.0",
      "description": "",
      "main": "index.js",
      "scripts": {
      "test": "echo \"Error: no test specified\" && exit 1"
      },
      "author": "",
      "license": "ISC",
    } 
Step 2 Install necessary dependencies
+
Step 3 Add a start script
+
Step 4 Create the start script index.js
+
Step 5 Configure the routes
+
Step 6 Test the router
+
Step 7 Test yourself
+

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 Node.js project for the router 2. Install necessary dependencies 3. Add a start script 4. Create the start script index.js 5. Configure the routes 6. Test the router 7. Test yourself

Learn more →