Prerequisites
Before you deploy your sample SAP Cloud Application Programming Model (CAP) app to SAP Business Technology Platform (BTP), ensure you have the following in place:
BTP Account (Trial or Paid)
You’ll need a BTP global account with a sub-account in the Cloud Foundry environment.You can register for a free trial at the SAP website. BTP Trial
Development Environment: SAP Business Application Studio or VS Code alternative + CLI tools & MBT
If using Business Application Studio, follow SAP’s onboarding tutorial: “Set Up SAP Business Application Studio for Development”. Setup Business Application Studio
Otherwise you may use VS Code (or another IDE) with the following command-line tools:
Make sure you’ve configured your CLI to target your BTP subaccount/space (cf api, cf login, cf target). CLI API & Login
HANA DB Instance (or Trial) for your DB
Your CAP app will typically require a database backend.Get started with the HANA Cloud trial using this tutorial: HANA Trial
After completing all the prerequisites we can start build the application
Start a Terminal in you IDE of choice
generate the project
cds init bookshop --add sampleAdd hana, mta, xsuaa and workzone
cds add hana,mta,xsuaa,workzone --for productionrun npm install in all the applications, the sample bookshop has 2 Fiori Elements applications that we'll need to run npm i in their folder as well as in the project folder
cd app/admin-books
npm i
cd ../browse
npm i
cd ../..
npm inow we can build the project
mbt buildif all goes well then we'll get an mtar file inside the mta_archive folder
before deploying we'll need to make sure that we're logged into cloud foundry
cf loginnow we deploy
cf deploy mta_archives/*.mtarand that is it you should now have a CAP service and 2 fiori elements applications deployed on BTP.
You can then create an instance of Work Zone and surface the application through it or build applications that use the cap application as its backend (This is what I intend to do in upcoming blogs)