How to create cf cap project on SAP Business Application Studio?

XAP Software · June 10, 2022

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.

Step 1

Enter a name for the workspace and select the type Full Stack Cloud Application.

Step 2

Now we create our dev space and we can start creating our application.

Step 3

Create simple CAP Project

Let’s create a project from the template.

Step 4

Select the CAP project.

Step 5

We will deploy the application on SAP BTP and HANA Cloud so we need to select the appropriate settings.

Step 6

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.

File structure

// 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.

Step 7

Select ‘Create Approuter’.

Step 8

Enter the name and agree that you are planning to add UI.

Step 9

Select ‘Create MTA Module from Template’.

Step 10

Select Create SAP Fiori application.

Step 11

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.

Step 12

Let’s choose Local CAP project, CAP project location and our service which we will use for our front end application.

Step 13

Select Main entity.

Step 14

Config our application and add deployment configuration and FLP configuration.

Step 15

Select Local CAP Project API.

Step 16

Configurate FLP.

Step 17

Deploy CAP project to SAP BTP.

Login to our API endpoint using cf.

Step 18

Build our project to MTA archive.

Step 18

Deploy MTA archive.

Step 18

Verbin Kirill

Twitter