Basics of the Cloud Application Programming Model
The SAP Cloud Application Programming Model (CAP) is a framework for the rapid development of cloud-based business applications. It offers a structured architecture, clear conventions and powerful tools for efficiently modeling, implementing and providing backend services. At the heart of the modeling is the declarative data model with CDS (Core Data Services), which together with services and entities forms the basis of a CAP application.
Structure of the data model in CAP
A CAP project usually consists of several central components:
Data Models (CDS-Model)
The data structure is described in .cds files. Entities (e.g. Books, Authors) are defined here, including fields, types, relationships (associations) and validations.
Example: A Books entity with fields such as title, author, price, pages.
Service-Definition (OData V4)
To make data from the entities available, services are defined, usually in the srv folder. These automatically generate OData v4 APIs with CRUD functionality (Create, Read, Update, Delete).
Associations
Entities can be linked to each other – e.g. a book to an author. CAP automatically generates foreign keys such as author_ID.
Relationships can be “to one” or “to many”.
.
Test & Interaction
CAP provides an integrated server for local development. The APIs can be tested using simple HTTP requests (e.g. with an .http file or tools such as Postman). CAP offers clear naming conventions for URLs and supports parameters such as $expand to deliver linked data (e.g. author of a book).
Deployment & Runtime
A locally developed CAP project can be deployed in the SAP Business Technology Platform (BTP) – initially locally with SQLite, later productively with SAP HANA, for example.
HANA integration
The project is prepared for SAP HANA via cds add hana. The database structure is then created automatically during deployment.
Authentication with XSUAA
The integration of xsuaa enables role-based access control and secure authentication in the BTP environment.
MTA (Multi-Target Application) SUAA
An MTA project is created for the deployment, which bundles all modules (e.g. service, DB, Auth). After the build, an .mtar archive is created that can be deployed to the BTP.
HDI-Container
The HANA database runs in a so-called HDI container – an isolated environment in which tables and views of the CAP project are managed.

Do you have any questions?
Get in touch with us.