Introduction:
Core Data Services (CDS) is the modeling foundation behind SAP Cloud Application Programming Model (CAP), and it also plays a central role in modern ABAP development. The important distinction is that SAP does not use one identical CDS implementation everywhere. CAP uses CDS to define domain models, services, queries, and expressions, while ABAP provides its own CDS language and artifacts for ABAP-based applications.
For SAP developers, the real value of CDS is the model-driven approach. Instead of defining database structures, service contracts, and application metadata independently, developers can capture business concepts in a structured model and let the relevant SAP tooling derive or consume the required artifacts.
This article focuses on CDS in the CAP context, with clear references to ABAP CDS where the concepts differ. It covers the core terminology, CDL and CSN, the relationship between CDS queries and CQN, and the role CDS plays when building services on SAP BTP.

What Is SAP CAP and How Does CDS Fit In?
The SAP Cloud Application Programming Model (CAP) is a framework of languages, libraries, and tools for building enterprise services and applications on SAP BTP. It combines the CDS modeling language with runtimes for Node.js and Java, so developers define a domain model once and rely on generic framework handlers for common operations such as reading, creating, and updating data. Because CAP prescribes a clear project structure and service design, teams produce consistent applications and write less boilerplate code.
A typical CAP project contains a db folder for the domain model, a srv folder for service definitions, and an app folder for UI content. During development, CAP runs against SQLite for fast local testing, while production deployments on SAP BTP usually target SAP HANA Cloud, and PostgreSQL is also supported. Applications run on SAP BTP Cloud Foundry or Kyma, and they integrate with SAP Fiori, SAP UI5, and event-driven scenarios. CDS is the foundation of this model, because it defines the domain model, the service layer, and the query logic that the CAP runtime executes.
| Feature | Description |
| Framework | Full-stack application development |
| Core Tools | CDS, Node.js SDK, Java SDK, CAP CLI |
| Primary Use Cases | SAP BTP, SAP Fiori, SAP UI5, APIs, and Event-driven apps |
| Supported Languages | JavaScript/TypeScript, Java |
| Deployment Targets | SAP HANA, SQLite, PostgreSQL, SAP BTP Cloud Foundry/Kyma |
CAPM’s foundation is Core Data Services (CDS), which serves as the universal modeling language for defining domain models, service layers, and data logic. Strong SAP ERP security controls help businesses protect sensitive financial records, manage user access, and safeguard critical operational data across the enterprise. Read more about how SAP ERP security protects financial and operational data
What Is the Purpose of Core Data Services in SAP CAP?
Core Data Services is a declarative, domain-specific language that describes entities, relationships, service interfaces, and queries in a single model. Developers do not write database scripts and service code separately, because the CAP compiler derives the required artifacts from the model, such as SQL tables and views for the database, and OData or REST endpoints for the service layer. This keeps the data model and the service contract synchronized, which reduces the inconsistencies that usually appear when both are maintained by hand.
CDS also carries business semantics through associations, compositions, aspects, and annotations. Associations describe relationships between entities, aspects provide reusable fields such as managed and temporal data, and annotations add metadata that SAP Fiori elements uses to render lists, forms, and filters without custom UI code. As a result, one well-structured model supports the database, the API, and the user interface at the same time.
7 Must-Know Facts About CDS for ABAP, CAPM, and HANA
SAP uses the name CDS in both CAP and ABAP, but the two implementations differ in syntax, tooling, and runtime. CAP CDS files are plain text models that the CAP compiler processes and that Node.js or Java runtimes execute, while ABAP CDS definitions are created in ABAP Development Tools and stored in the ABAP repository of an SAP S/4HANA or SAP BTP ABAP Environment system. The table below summarizes the differences that matter most in project planning.
| Aspect | CAP CDS | ABAP CDS |
|---|---|---|
| Runtime | Node.js or Java on SAP BTP | ABAP application server |
| Source and tooling | .cds files in SAP Business Application Studio or VS Code | CDS definitions in ABAP Development Tools (Eclipse) |
| Service exposure | Services defined in CDS, served as OData or REST by the CAP runtime | Exposed through service definitions and bindings in RAP |
| Typical database | SQLite for development, SAP HANA Cloud or PostgreSQL for production | SAP HANA in SAP S/4HANA or SAP BTP ABAP Environment |
Teams should choose the implementation based on where the business logic and data live. Extensions that need access to SAP S/4HANA data inside the ABAP stack fit ABAP CDS and RAP, whereas side-by-side extensions, multitenant SaaS applications, and event-driven services on SAP BTP fit CAP. In hybrid landscapes, both models often coexist and communicate through APIs.
Types of Core Data Services (CDS) Languages and Notations
CAP separates the human-readable modeling language from the machine-readable formats and from the query layer, and each notation serves a different stage of development. Developers write models in CDL, the compiler converts them into CSN, and the runtime uses CQL and CQN to read and write data against those models. The table below shows each notation and where it is used.
| Notation | Full Name | Purpose |
|---|---|---|
| CDL | Conceptual Definition Language | Human-readable syntax for defining entities, services, and annotations |
| CSN | Core Schema Notation | JSON representation of a model, used by the compiler, tools, and runtime |
| CQL | CDS Query Language | SQL-like syntax for querying CDS models |
| CQN | CDS Query Notation | JSON representation of a query, used internally by the runtime |
| CXN | CDS Expression Notation | JSON representation of expressions used in queries and models |
Definition Language (CDL)
CDL is the primary syntax for writing CDS models in CAP. Developers use it to declare entities, which represent business objects, associations and compositions, which define relationships between them, and aspects, which package reusable fields. Services are declared in the same language and typically expose projections on the underlying entities, so the service layer reuses the domain model instead of duplicating it.
The following example defines a Customers entity with a one-to-many association to Orders, followed by a service that exposes both entities.
cds
namespace sales;
entity Customers {
key ID : UUID;
name : String(100);
city : String(60);
orders : Association to many Orders on orders.customer = $self;
}
entity Orders {
key ID : UUID;
customer : Association to Customers;
netAmount : Decimal(15,2);
currency : String(3);
}
service SalesService {
entity Customers as projection on sales.Customers;
entity Orders as projection on sales.Orders;
}
When a CAP project runs with this model, the framework creates the database tables, and the service automatically provides OData endpoints for Customers and Orders with filtering, sorting, paging, and navigation between the two entities. Because CDL reads like a structured specification, business analysts and developers can review the same file, which helps catch modeling errors before implementation.or developers and domain specialists to work together.
Core Schema Notation (CSN)
CSN is the JSON representation of a CDS model. The CAP compiler converts every CDL file into CSN, and both the CAP command-line tools and the CAP runtime work with this format instead of parsing CDL directly. Because CSN is plain JSON, tools can read and generate models programmatically, and the compiler can derive OData metadata, SQL statements, and OpenAPI definitions from the same source.
Developers can inspect the compiled result with the command cds compile db/schema.cds --to json. For the Customers entity defined above, a simplified CSN output looks like this.
{
“definitions”: {
“sales.Customers”: {
“kind”: “entity”,
“elements”: {
“ID”: { “key”: true, “type”: “cds.UUID” },
“name”: { “type”: “cds.String”, “length”: 100 },
“city”: { “type”: “cds.String”, “length”: 60 }
}
}
}
}
Reviewing CSN is useful when a model does not behave as expected, because it shows how the compiler resolved associations, inherited aspects, and applied annotations. The CAP runtime also loads CSN at startup, so the same model definition drives the database schema and the service behavior without additional configuration.

CDS Query Language (CQL) and CDS Query Notation (CQN)
CQL extends SQL with path expressions that follow associations, so a query such as SELECT from Orders { ID, customer.name } retrieves order data together with the customer name without an explicit join. The CAP runtime converts each CQL statement into CQN, which is a JSON representation of the query, and then translates CQN into native SQL for the target database. This approach keeps application code independent from the database dialect, so the same query runs against SQLite during development and SAP HANA Cloud in production.
The next part of this series covers CQL, CQN, and CXN in more detail, together with a showcase project that uses CDS-based service definitions.
Latest CDS Updates (As of 2025)
| Date | Highlights |
| June 2025 | Improved CAP Java support, persistent draft messaging, runtime tweaks |
| May 2025 | CAP Node.js v9, Java v4, end-of-life for older HDB and deprecated formats |
| March 2025 | Standalone TypeScript typings, enhanced multi-DB support |
| Feb 2025 | CDS v9 major release: semantic precision, performance, TypeScript boost |
Internal Resource: Custom Development for SAP
We help businesses create, add to, and keep up SAP applications with strong custom development. Our services include everything from full-stack CAPM implementations to CDS-based UI5 apps.
- Making CDS and CAPM Services
- Integration of Custom OData and OpenAPI
- Modelling SAP UI5 and CDS Annotations
- Designing ABAP CDS Views for S/4HANA
Go to: SAP Custom Development by Cremencing
Conclusion
Core Data Services (CDS) is no longer something you can choose to do; it’s something you have to do. CDS gives you the modelling power and flexibility you need to succeed, whether you’re developing new apps on SAP BTP, Core Data Services in SAP CAP gives developers one declarative model for the database schema, the service layer, and the UI metadata, and the CAP compiler turns that model into CSN and platform-specific artifacts. Understanding the roles of CDL, CSN, and CQN, and recognizing that ABAP CDS is a separate implementation, helps teams choose the right technology for each requirement and avoid reusing assumptions across the two stacks.
As SAP continues to promote clean-core extensions on SAP BTP, CAP and CDS remain central to building side-by-side applications for SAP S/4HANA, while ABAP CDS and RAP cover in-system development. The next part of this series covers CQL, CQN, and CXN, and demonstrates how CDS-based service definitions work in a showcase project.
FAQs
What is Core Data Services in SAP CAP?
Core Data Services in SAP CAP is a declarative modeling language for defining entities, relationships, services, and queries. The CAP compiler converts these models into database schemas and service endpoints, so developers maintain one model instead of separate database and API definitions.
What does CAP stand for in SAP, and is it the same as CAPM?
CAP stands for SAP Cloud Application Programming Model. Some older articles call it CAPM, but SAP’s official abbreviation is CAP. It is a framework with CDS, Node.js and Java runtimes, and command-line tools for building enterprise applications and services on SAP BTP.
What is the difference between CDL and CSN in SAP CDS?
CDL is the human-readable syntax developers use to write CDS models, while CSN is the JSON representation that the compiler generates from CDL. Tools and the CAP runtime process CSN, so CDL serves authoring and CSN serves compilation, deployment, and runtime execution.
Is ABAP CDS the same as CAP CDS?
No. Both use the name CDS and share modeling concepts such as entities and associations, but ABAP CDS runs in the ABAP stack and is created in ABAP Development Tools, while CAP CDS runs on Node.js or Java on SAP BTP. Their syntax and tooling differ.
Which databases does SAP CAP support with CDS models?
CAP supports SQLite for local development, SAP HANA Cloud for production on SAP BTP, and PostgreSQL. The CAP runtime translates CDS queries into the SQL dialect of the target database, so the same model can run across these databases with minor configuration changes.
What are CDS annotations used for in SAP Fiori?
CDS annotations add metadata to a model, such as field labels, list columns, filters, and value helps. SAP Fiori elements reads this metadata from the service and generates list report and object page applications, so developers avoid writing custom UI5 views for standard scenarios.
What is CQN in SAP CAP?
CQN is the JSON-based notation for queries in CAP. The runtime converts each CQL statement into CQN and then translates it into native SQL for the database. This keeps application logic independent of the database dialect and allows custom handlers to build and modify queries programmatically.
Can I use CDS for SAP S/4HANA extensions on SAP BTP?
Yes. CAP applications can consume SAP S/4HANA APIs and extend them as side-by-side applications on SAP BTP. If the extension must run inside the ABAP stack, ABAP CDS with RAP is the better choice, so the decision depends on where the logic and data should live.
One Response