1. Start Your Business application studio Dev Space
2. Creating new Cap Project Using Terminal
for creating a new project you can go through the new Project from Template or you can use the terminal
Open the new Terminal and follow the steps:
Change the current directory to your desired workspace, typically located at /home/user/projects/:
Run the CAP project initialization command:
cds init firstCapProject
then we need to go inside the project folder using
cd firstCapProject
Your project will now have a structured directory layout containing essential folders such as db for data models, for services, app for UI modules (currently empty), and package.json which manages dependencies.
then we install all the packages from the npm(Node Package Manager). It is a tool and registry used primarily for packages in node.js projects
It manages the dependencies. It keeps track of all the packages your project uses in a file called package.json
npm install
3. Defining Data Model and Services
Define the Data Model
Create the schema.cds file db/schema.cds
The Schema.cds file in a CAP project defines the data model using CDS. It is just like a container that contains entities, types, relationship and aspects that describes the structure of your application's database.
Define the name space and Create Books and Author entities.
Add Sample Data in CSV Format
Create the .csv file manually or you can type the command
cds add data
This command creates the .csv files for each entities. The naming convention for the .csv file
<namespace>-<entityName>.csv
Define a CAP Service
create a file cat-service.cds inside srv folder
expose the entity that you have created in schema.cds file inside a service(CatalogService)
To run the application locally
in the terminal do cds watch
Click on Open In New Tab
Click on any of entities
you can see the data that is present in the .csv file
4. Configuring for SAP HANA Deployment
Add HANA configuration for production:
cds add hana --for production
Add hybrid setup (for both dev and prod compatibility):
cds add hana --for hybrid
Generate multi-target Application (MTA)
It will create a mta.yaml file after that do npm update
then run the application again.
5. Adding XSUAA for Authentication and Authorization
XSUAA is required for deploying CAP apps to Cloud Foundry with authentication support.
This updates your package.json and adds authentication requirements under the "requires" section.
Adding a Managed Application Router
Right-click on the mta.yaml file and select Create MTA Module from Template.
Choose the Approuter Configuration template.
6. Deploying the Application to SAP BTP Cloud Foundry
Login to Cloud Foundry
In the Terminal type cf login
Provide the API endpoint, credentials, and select the correct organization and space.
7. Verifying Deployment and Launching Your Fiori App
In the BTP cockpit, go to Services → Instances. You should see instances for the db, approuter, CAP service, and xsuaa.
Go to HTML5 Applications (enabled via SAP Build Work Zone) and find your firstCapProject app
Launch the app to see the same Fiori UI you previewed locally, now hosted on the cloud
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 27 | |
| 24 | |
| 13 | |
| 12 | |
| 12 | |
| 11 | |
| 10 | |
| 10 | |
| 9 | |
| 9 |