Technology Blog Posts by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
satyanarayanpradhan
Discoverer
2,628

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

satyanarayanpradhan_0-1751366158119.png

 


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.

satyanarayanpradhan_1-1751366158968.png

 

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

satyanarayanpradhan_2-1751366157827.png

 

satyanarayanpradhan_3-1751366158684.png

 

satyanarayanpradhan_4-1751366158403.png

 


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)

satyanarayanpradhan_5-1751366158872.png

 

To run the application locally
in the terminal do cds watch

satyanarayanpradhan_6-1751366158495.png

 


Click on Open In New Tab

satyanarayanpradhan_7-1751366157922.png

 


Click on any of entities

satyanarayanpradhan_8-1751366160423.png

 

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

satyanarayanpradhan_9-1751366159254.png

 


Generate multi-target Application (MTA)
It will create a mta.yaml file after that do npm update

satyanarayanpradhan_10-1751366160048.png

 

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.

satyanarayanpradhan_11-1751366158118.png

 

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

satyanarayanpradhan_12-1751366160421.png

 

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

1 Comment