In this blog, I’ll explain how to create a cap project in SAP Business Application Studio.
Create Development space
Open SAP Business Application Studio and create new Dev Space.
Enter a name for the workspace and select the type Full Stack Cloud Application
.
Now we create our dev space and we can start creating our application.
Create simple CAP Project
Let’s create a project from the template.
Select the CAP project.
We will deploy the application on SAP BTP and HANA Cloud so we need to select the appropriate settings.
We need to create files service.cds
and service.js
in folder srv/
and file schema.cds
with simple code in folder db/
for CAP project.
// db/schema.cds
using {cuid} from '@sap/cds/common';
namespace db;
entity Foo : cuid {
title: String default 'Hellow world';
num: Integer default 0;
}
// srv/service.cds
using { db as db } from '../db/schema';
service MyService {
entity Foo as projection on db.Foo;
}
Creating Fiori elements application
Select Create MTA Module from Template.
Select ‘Create Approuter’.
Enter the name and agree that you are planning to add UI.
Select ‘Create MTA Module from Template’.
Select Create SAP Fiori application
.
In this step we will create front-end application for our Full Stack Application. We can create SAP UI5 application or Fiori application from the template. For example, we choose Fiori elements List report.
Let’s choose Local CAP project, CAP project location and our service which we will use for our front end application.
Select Main entity
.
Config our application and add deployment configuration and FLP configuration.
Select Local CAP Project API
.
Configurate FLP.
Deploy CAP project to SAP BTP.
Login to our API endpoint using cf
.
Build our project to MTA archive.
Deploy MTA archive.