This end-to-end tutorial helps you set up your SAP BTP Trial and build a full-stack application using:
SAP CAP (Cloud Application Programming Model)
- SAP HANA Cloud
- SAP Business Application Studio (BAS)
- SAP Fiori Elements
- Cloud Foundry Deployment
- Approuter + XSUAA Authentication
This guide is ideal for students, beginners, and consultants who want to understand how real full-stack applications are built on SAP BTP.
Creating a SAP BTP Trial Account
Access SAP BTP Cockpit
Go to: https://account.hana.ondemand.com/
Click Create Account → This creates:
A Global Account
- A Default Subaccount
- Access to BTP Cockpit services like BAS, HANA Cloud, etc.
Understanding Global Account, Directories & Subaccounts
Global Account:
This is the root-level account that contains all subaccounts, users, quotas, and entitlements.
Directories
Directories help organize subaccounts logically such as:
Development
- Testing
- Production
How to create:
Account Explorer → Create → Directory
Subaccount
A Subaccount is where the actual development happens. We can:
Enable services
- Deploy applications
- Create destinations
- Manage entitlements
- Select region + environment
Steps:
Account Explorer → Create → Subaccount
Entitlements:
Entitlements are your service quotas — they define which services your subaccount can use (e.g., HANA Cloud, XSUAA, Destinations).
You can always allocate or modify entitlements for each subaccount.
Boosters — Automated Guided Configuration
Boosters help you set up complex scenarios with just a few clicks, such as:
SAP HANA Cloud
- SAP Build Apps
- SAP Build Process Automation
- CAP + Fiori Full-stack setup
Navigate to:
Boosters → Start
Cloud Foundry: Spaces & Instances
Space
A space is a workspace inside Cloud Foundry used for:
Deploying apps
- Managing services
Instance
An instance is a running version of a service like:
Destination
- XSUAA
- HANA Cloud
- HTML5 Apps Repository
Setting Up SAP HANA Cloud
Go to:
Subaccount → Services → Instances & Subscriptions
Select SAP HANA Cloud
If you face a permission error → assign the user:
In the left-hand panel, go to Security > Users
SAP HANA Cloud Administrator role collection
Subaccount Admin
Mapping HANA Instance to Cloud Foundry
Mapping allows CAP HDI containers to deploy artifacts to HANA Cloud.
Instance → Actions → Manage Configuration
Click Sign in to Cloud Foundry → Add Mapping → Review → Save
Setting Up SAP Business Application Studio (BAS)
Create a Dev Space
Open BAS → Create Dev Space:
Full-Stack Cloud Application
Enable:
- Workflow module
- SAP HANA Tools
- SAP HANA Performance Tools
Open the Dev Space once it turns RUNNING.
Building a CAP Project
Project Steps:
Open the workspace
- Update mta.yaml file → Change database path ‘gen/db’ to ‘db’
- Update package.json →Replace existing CDS code -
"cds": {
"build": {
"tasks": [
{
"for": "hana",
"dest": "../db"
},
{
"for": "node-cf"
}
]
},
"requires": {
"db": {
"kind": "hana-cloud"
}
}- Install dependencies:
npm install- To get Additional files in db folder
npm install -g hana-cli
hana-cli createModuleAdd CDS files - Right click on db folder -
- /db/e_learning.cds
namespace app.e_learning;
using { Language, managed } from '@sap/cds/common';
type string50 : String(50);
entity Categories {
key id : UUID;
name : string50;
description : String(100);
Courses : Association to many Courses on Courses.category=$self;
}
entity Courses : managed {
key course_id : UUID;
course_name : string50;
price : String(100);
Language : Language;
category : Association to Categories;
}- /srv/eLearning_srv.cds
using app.e_learning from '../db/e_learning';
service eLearning {
entity Categories as projection on e_learning.Categories;
entity Courses as projection on e_learning.Courses;
}Build Project
cds buildDeploying to SAP HANA Cloud
Go to DB module → Deploy
- Open HDI container → load data
- Import using SAP HANA Database Explorer
Now, right click on table and click on Open Data
Running the App Locally
cds bind -2 e_Learning-db:SharedDevKey
npm install
cds watch --profile hybridDeployment to Cloud Foundry
mbt buildDeploy
cf deploy mta_archives/e_Learning_1.0.0.mtarAdding Approuter + XSUAA for Authentication
Approuter
Provides a single entry point for your application and handles routing & authentication.
Create using BAS:
Right-click → Create MTA Module from Template → Approuter
XSUAA
Authentication is different from authorization
Authentication - Ensures the user is valid and can access the system.
Authorization - Checks the scopes/roles
Adds OAuth2.0-based authentication & authorization.
cds add xsuaa
npm installThis generates:
- xs-security.json
- Required scopes/roles
Generating a Fiori Application:
Using templates:
Right-click → Create MTA Module from Template → SAP Fiori App
Run:
cds watch