Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
Showing results for 
Search instead for 
Did you mean: 
Active Participant
Hello All

This blog is continuation of my previous post:

Let's discuss on the installation setup for SAP CAMP and an basic example of building SAP CAPM application using Node.js

Local Development tools required if we choose to develop the apps locally in our machine:

On cloud, SAP Business Application Studio is the IDE to develop SAP CAPM based applications.

SAP Business Application Studio features:

AS Core Data Service (CDS) is one of the foundation to our SAP CAPM developments, let’s see what does CDS refer to:

Core Data Service is a collection of domain-specific languages helping you during development to focus entirely on specific domain model.

Now i will be creating a basic SAP CAPM application using Node.js

Login to SAP Business Application Studio from Cloud Foundry space as seen in previous blog.

Create a new application in Projects folder by running the command cds init studentreport in the Terminal as shown.

Go to the directory studentreport by executing cd studentreport from Terminal.
user: projects $ cd studentreport

Create a data model in db folder: schema.cds

entity Student {
key ID : Integer;
name : String(100);
score : String(20);
attendance : String;

Execute cds watch from the Terminal to see the output.
user: studentreport $ cds watch

What does CDS watch will do for us: If there is a datamodel in the db folder, it will automatically be deployed to in-memory SQLite database.

Create a service file in SRV folder: cat-service.cds
using { as my } from '../db/schema';
service CatalogService @(path:'/browse') {

@readonly entity Student as SELECT from my.Student {*} ;

Again run CDS watch and observe the service output in new tab. We can see serving CatalogService at /browser and server listening which indicates the application is running

Let's have some test data. Create a sub-folder data in db folder. Also create a file with below info in data folder.
1;Supriya Sidagam;87;80%
2;SuryaSainath Sidagam;81;85%
3;Bhuvana Sidagam;23;100%

Run the CDS watch and open the student service in new tab and see the above sample data in browser.


Let's focus on business logic now. For that create a file cat-service.js in srv folder and write the below code.
module.exports = (srv)=>{

const {Student} = cds.entities

srv.after ('READ','Student', (each)=>{
if (each.score < 50) += ' -- You are failed'

Project Structure:

Refresh the browser and check the output.

Please comment if any..

Thank you 🙂


BR//Dhanasupriya Sidagam
Labels in this area