This SAP BTP tutorial walks through building and deploying your first application on SAP BTP. By the end you will have BTP access, a CAP (Cloud Application Programming Model) service running locally, and that same service deployed to Cloud Foundry on BTP.
This is a beginner tutorial. It assumes basic command-line comfort and JavaScript knowledge, but no prior SAP experience. For the concepts behind each step, read What is SAP BTP? first.
Step 1: Set Up Your Account
- Sign up for SAP BTP access with your SAP Universal ID. For this tutorial, the 90-day BTP trial is the easiest starting point. For ongoing access, use Pay-As-You-Go or SAP BTP Enterprise Agreement with free tier service plans.
- Pick a provider and region (AWS, Azure, or GCP). Any region works for this tutorial.
- Wait for the account to provision. You will receive an email when it is ready.
- Open the SAP BTP cockpit at
https://cockpit.<region>.hana.ondemand.comand sign in.
The cockpit is the web UI you will use for everything that is not code: accounts, entitlements, services, and deployments.
Step 2: Install the Tools
Install the command-line tools you need:
# Node.js 18+ (required for CAP)
node --version
# SAP Cloud Application Programming Model CLI
npm install -g @sap/cds-dk
# Cloud Foundry CLI (for deployment)
# macOS: brew install cloudfoundry/tap/cf-cli
# Linux: see cf CLI install docs
cf --version
# btp CLI (for account operations)
# Download from the SAP Help Portal "Using the btp CLI"
btp --version
Verify each command prints a version before moving on.
Step 3: Enable Cloud Foundry
In the BTP cockpit:
- Open your subaccount.
- Go to Environment > Cloud Foundry.
- Create a Cloud Foundry environment instance with a name and an org.
- Create a space (e.g.
dev) inside the org. Apps run inside spaces.
Then log in with the cf CLI using the API endpoint shown in the cockpit:
cf api https://api.cf.<region>.hana.ondemand.com
cf login
Enter your SAP Universal ID credentials when prompted.
Step 4: Build a CAP App
Scaffold a CAP service and run it locally:
# Create a new CAP project
cds init bookshop
cd bookshop
npm install
# Define a simple data model
cat > db/schema.cds <<'EOF'
namespace my.bookshop;
entity Books {
key ID : Integer;
title : String;
stock : Integer;
}
EOF
# Define a service that exposes the entity
cat > srv/service.cds <<'EOF'
using { my.bookshop as bookshop } from '../db/schema';
service CatalogService {
@readonly entity Books as projection on bookshop.Books;
}
EOF
# Add sample data
mkdir -p db/data
cat > db/data/my.bookshop-Books.csv <<'EOF'
ID;title;stock
1;The Hobbit;12
2;Jane Eyre;10
3;Wuthering Heights;7
EOF
# Run it locally with SQLite
cds watch
Open http://localhost:4004/odata/v4/catalog/Books in a browser. You should see the three
books. CAP has automatically generated an OData V4 service from your model and served it on
an in-memory SQLite database.
Step 5: Deploy to BTP
Now deploy the same app to Cloud Foundry so it runs on BTP instead of your laptop.
First, add the deployment configuration. CAP generates it for you:
cds add mta
This creates an mta.yaml that describes the app as a Multi-Target Application. Then build
and deploy:
# Install the MTA build tool
npm install -g mbt
# Build the deployable archive
mbt build
# Deploy to your Cloud Foundry space
cf deploy mta_archives/bookshop_*.mtar
The deploy command uploads the archive, creates the application, stages it, and starts it.
When it finishes, the cf CLI prints the application URL. Open it and append
/odata/v4/catalog/Books to confirm your service is live on BTP.
Step 6: Next Steps
From here you can extend the app in any direction:
- Add a database. Bind an SAP HANA Cloud or PostgreSQL instance so data persists across restarts instead of using in-memory SQLite.
- Add a UI. Generate a Fiori elements List Report on top of the OData service using SAP Fiori tools.
- Secure it. Add authentication via the XSUAA or SAP Cloud Identity Services so only logged-in users can call the service.
- Automate. Wire the deploy into a CI/CD pipeline using the SAP CI/CD service or GitHub Actions.
Using AI Assistants During the Tutorial
Each step above has places where a general AI assistant will guess wrong — CAP event handler
signatures, the exact mta.yaml structure, or which CLI command to reach for. Installing
the CAP skill gives the assistant accurate, current context so it can explain errors and
suggest the next command instead of inventing one:
npx skills add secondsky/sap-skills --skill sap-cap-capire
With that skill loaded, you can ask the assistant to explain a cds error, draft an event
handler, or review your mta.yaml, and get answers grounded in the real Capire reference.
Recap
You now have:
- SAP BTP access through either the 90-day trial or a no-time-limit commercial account with free tier service plans.
- A working CAP service running locally on SQLite.
- The same service deployed to Cloud Foundry on BTP.
That is the full BTP development loop — model, serve, deploy — in under an hour. Everything else in BTP is a variation on this pattern with different services bound in.