Skip to main content
Version: 2.0.0

Install / Deploy

Pre-Installations for SAP CLI Environment

Install the required tools before deploying any BDM application:

ToolCommand
Cloud Application Model CLInpm i -g @sap/cds-dk
Cloud MTA Build Toolnpm install -g mbt
MTA Plugin for CF CLIcf install-plugin multiapps
HTML5 Applications Repository Plugincf install-plugin -r CF-Community "html5-plugin"

If the CF-Community repository is not registered:

cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org

Setting make File Path in Environment Variables:

  1. Download make.exe.
  2. Open Environment Variables for your account.
  3. Edit the Path variable → click New → add the path to make.exe → click OK.

Deploy Frontend React App (Vite) to SAP BTP

Reference: https://community.sap.com/t5/technology-blogs-by-sap/deploy-your-reactjs-application-in-cloud-foundry/ba-p/13464100

Prerequisites

  • SAP BTP account with Cloud Foundry enabled
  • Cloud Foundry CLI installed
  • Node.js and NPM installed
  • Vite-based React project

Steps

1. Build the Vite app for production:

npm run build

This creates a dist folder with the production build.

2. Create Staticfile in the dist folder:

pushstate: enabled

This ensures client-side routing works correctly after deployment.

3. Create manifest.yml in the project root:

applications:
- name: your-app-name
path: ./dist
memory: 128M
buildpacks:
- staticfile_buildpack
routes:
- route: your-app-name.cfapps.eu10-004.hana.ondemand.com
default-route: true
FieldDescription
nameUnique app name in SAP BTP
pathMust point to the dist folder
buildpacksstaticfile_buildpack for static frontend apps

4. Login to Cloud Foundry:

cf login -a https://api.cf.<region>.hana.ondemand.com

Replace <region> with your BTP region (e.g., eu10, us10). Enter credentials and select your org and space.

5. Push the app:

cf push

Cloud Foundry will use manifest.yml and output a URL for your app.

Troubleshooting:

IssueFix
Buildpack errorsVerify the staticfile_buildpack URL is correct
Routing issuesConfirm pushstate: enabled is set in the Staticfile

Creating and Deploying an MTA Application

1. Download the sample MTA application from the provided App_React_SAP link.

2. Update mta.yaml: Replace app with your application name.

app_approuter  →  cw_workrules_approuter

3. Update package.json: Replace app with your application name.

app-mta  →  workrules-mta

4. Update xs-security.json: Change xsappname to your application name (as in mta.yaml).

app  →  cw_workrules

If using an existing XSUAA instance, use the xsappname from BTP mapped to that instance.

5. Update xs-app.json (app-router): Change target to your application name.

6. Copy your React app's build folders into the webapp folder of the newly created application.

7. Update the manifest file in the React app's public folder: Change the id to match the target name in xs-app.json.

8. Build and deploy:

cd <webapp-folder>
npm install
npm run build
cd ..
mbt build

A mta_archives folder is generated containing a .mtar file.

cf login -a <api-endpoint> -u user@incture.com -p <password>
cf deploy mta_archives/<your-file.mtar>

Frontend Deployment Steps (BDM UI)

  1. Open Command Prompt at the project root.
  2. Navigate to UI deployer folder:
    cd Demo_ui_deployer
  3. Delete existing resources (PowerShell):
    rm resources
  4. Navigate back to root:
    cd ..
  5. Build the MTA archive:
    mbt build
  6. Login to Cloud Foundry:
    cf8 login -a https://api.cf.eu10-004.hana.ondemand.com
  7. Deploy the application:
    cf8 deploy mta_archives\BDM_0.0.8.mtar

Note (If Build Fails Due to Memory Issue):

set NODE_OPTIONS=--max-old-space-size=32768

SAP BTP: Business Accelerator Hub (BAH)

  • URL: https://api.sap.com/
  • CRUD destinations are managed in the Sub-Account (changes made by the SAP Ops Team).

Steps:

  1. Go to SAP BAH and search/select Destination Service (Cloud Foundry).
  2. Select the Try Out tab and select or create an environment.
  3. Select Add New Environment and provide details from the Service Key:
FieldValue
Starting URLuri
Client Idclientid
Client Secretclientsecret
Subdomainidentityzone
  1. Click Configure.
  2. Use the APIs on the left panel to perform required actions.

BDM Backend Deployment

SAP BTP Level Changes

  1. Get access to the required space in SAP BTP.
  2. Create required service instances from the Service Marketplace (SAP Ops Team). Instances
    • Current BDM services in Incture-Cherrywork-DEV/CW-BDM-DEV: xsuaa, dms, schema, destination
  3. Add those services in manifest.yml.
  4. After deploying, note the Application Routes (backend endpoint URL). Application Routes
  5. Create a destination (SAP Ops) so the frontend can access the backend: Application Routes
FieldValue
NameUnique name to identify the destination
URLDeployed backend URL
AuthenticationUserTokenExchange (for user details) or ClientCredentials
Client IDclientid from the XSUAA bound to the backend app
Client Secretclientsecret from the XSUAA bound to the backend app
Token Service URLXSUAA url + /oauth/token

Application Routes

Code Level Changes

  1. In application.properties, comment out local spring profiles and uncomment deployment profiles.
  2. Run Maven clean and install — a JAR file is created in the target folder.
  3. Make required modifications in manifest.yml.
  4. Ensure Cloud Foundry CLI (cf8) is installed, then run:
# Login to the required subaccount
cf8 l -a {subaccount-API-Endpoint}

# Deploy the JAR to the space
cf8 push -f manifest.yml -t 180 -i 1