Technology - SAP

SAP CAP — The Framework Behind Modern BTP Development

Every BTP project conversation eventually arrives at the same question: are we using CAP? For most teams, the answer is yes — but when you ask what CAP actually is, the explanations get vague fast. A framework. Something to do with CDS. Node.js, maybe Java.

That vagueness is understandable. CAP sits at the intersection of several SAP concepts — CDS, OData, BTP services, clean core — and it is easy to describe the parts without ever explaining what holds them together.

This post explains CAP clearly: what problem it was built to solve, how its three layers work, what it gives you without writing a line of boilerplate, and when to use it instead of RAP.

🔗 Foundation posts

SAP BTP — The Platform Explained covers what BTP is and how its services fit together — read that first if BTP is new to you.
CDS Views and the VDM in SAP S/4HANA Explained introduces CDS in the S/4HANA context — useful background before this post.

The problem CAP was built to solve

Before CAP, building a custom application on SAP BTP meant assembling the pieces yourself. You defined your data model, manually created an OData service, wired up authentication, configured the database connection, and wrote boilerplate for every recurring task — security checks, error handling, pagination, multitenancy hooks.

Every project started from scratch. Every team made different decisions. There was no standard. That produced inconsistent applications, slow delivery, and maintenance problems that accumulated over time.

CAP was SAP’s answer to that problem. It is a framework that standardises the development path — providing the languages, libraries, and tools so that teams spend their time on business logic, not infrastructure plumbing.

📌 Key Takeaway

CAP is SAP’s primary framework for building side-by-side extensions on BTP. In SAP’s clean core maturity model — formalised in August 2025 — CAP-based extensions on BTP are classified as Level A: the cleanest, most upgrade-safe way to extend S/4HANA without touching the core.

That clean core connection is why CAP has become unavoidable. If your organisation is on S/4HANA and needs custom logic that goes beyond standard configuration, the question is no longer whether to move that logic to BTP — it is which framework to use when you get there. For anything cloud-native and language-agnostic, the answer is CAP.

What CAP actually is

CAP stands for Cloud Application Programming Model. It is not a product. It is not a platform. It is a framework — a set of languages, libraries, and tools that SAP calls the golden path for building enterprise-grade services and applications on BTP.

The golden path concept is deliberate. CAP does not force you into a single way of doing everything. But it provides a well-lit, well-maintained path with proven practices built in — so that you are not solving the same problems every project team has already solved before you.

SAP CAP architecture diagram on white background showing four layers — CDS at the top, CAP runtime with Node.js and Java, database layer with HANA Cloud and SQLite, and BTP platform services at the bottom

CAP has four components:

ComponentWhat it isWhat it does
CDSCore Data Services — CAP’s modelling languageYou define your data models, service interfaces and UI annotations declaratively. CDS is the backbone of everything.
Service RuntimesNode.js or JavaThe runtime that serves your application. Generic handlers automatically respond to requests — you add custom logic only where needed.
Platform IntegrationsCalesi — CAP-level platform connectorsPre-built integrations to BTP services: authentication, multitenancy, messaging, audit logging. You configure, not code.
CLI and Toolingcds command-line interfaceScaffolding, local development server, build and deploy commands. Integrated with SAP Build Code, VS Code, IntelliJ and Eclipse.

📝 Note

Node.js or Java — Both runtimes are fully supported and production-ready. Node.js tends to be the default for new projects because of its faster local development cycle. Java is common in enterprise environments where Java skills are established or where performance and ecosystem integration requirements align better with the JVM.

The three layers of a CAP application

Once you understand what happens inside a CAP project — how a CDS definition becomes a live OData service backed by a real database — everything else follows naturally.

Layer 1 — CDS: define once, generate everything

CDS is where you do the modelling. You define your entities (the data structures), your services (the APIs that expose them) and your annotations (the UI and behaviour hints). You write this in a declarative language that is close to plain English.

From a single CDS definition, CAP generates the database schema, the OData service metadata, the UI annotations for Fiori Elements, and the input for the runtime. You are not writing SQL. You are not writing WSDL. You define the intent once, and CAP produces the artefacts.

💡 Practical Tip

CDS annotations are what connect your data model to Fiori Elements UI. A @UI.LineItem annotation on an entity tells CAP to expose that entity as a list in a Fiori List Report — no UI code required. Get the annotations right, and you get a working Fiori app as a side effect of your model.

Layer 2 — The CAP runtime: generic handlers do the heavy lifting

The CAP runtime reads your CDS service definitions and bootstraps generic service providers automatically. When a request arrives — say, a GET request for a list of purchase orders — the runtime handles it. It translates the OData query into SQL, runs it against the database, and returns the result. No code written by you.

You add custom logic only when the generic behaviour is not enough. You write event handlers — before, on, or after standard CRUD operations — that run your business logic at the right point. The rest is handled.

This is the core value of CAP: the plumbing is solved. You focus on the logic that is specific to your application.

Layer 3 — Database: SQLite locally, HANA Cloud in production

During local development, CAP uses SQLite automatically. You get a working database the moment you start the local server — no HANA instance needed, no BTP connection, no setup overhead. The development loop is fast.

CAP application flow diagram on white background showing three stages — CDS definition on the left, CAP runtime in the centre handling requests, and database on the right with HANA Cloud for production and SQLite for local development

What CAP gives you out of the box

The list of things CAP handles automatically is where the productivity argument becomes concrete. These are not minor conveniences — they are the things that consume weeks on projects that build without a framework.

What you getWhat it means in practiceWithout CAP
Automatic OData V4 exposureEvery CDS service definition is immediately available as a standards-compliant OData V4 API — no manual service creationWrite and maintain OData annotations and service definitions by hand
Generic CRUD handlingList, read, create, update, delete are all handled automatically for every entity you defineImplement each operation per entity, per service
Authentication integrationXSUAA and SAP IAS hook in via configuration — user claims flow into your handlers automaticallyWire up OAuth flows and token validation manually for every service
Multitenancy supportCAP’s MTX sidecar handles tenant onboarding, database isolation and schema upgrades for SaaS scenariosBuild tenant isolation and lifecycle management from scratch
Local development without HANASQLite runs in-memory locally — start coding immediately without a BTP subaccount or HANA entitlementProvision a HANA instance for every developer
Cloud Foundry and Kyma deploymentcds add mta for Cloud Foundry, cds add helm for Kyma — deployment configuration generated, not hand-writtenWrite and maintain MTA descriptors or Helm charts manually

Best Practice

Start every new BTP application project with cds init and run cds watch immediately. You will have a local server with a working SQLite database and a live OData endpoint within minutes. Validate the data model and service design locally before you involve any BTP services — it is dramatically faster to iterate at this stage than after deployment.

CAP or RAP — how to choose

RAP — the ABAP RESTful Application Programming Model — is SAP’s other strategic framework. Both are supported. Both are actively developed. They are not competing for the same use cases.

The decision comes down to three things: where your application lives, what skills your team has, and what you are extending.

Decision factorChoose CAPChoose RAP
Where the app runsBTP Cloud Foundry or Kyma — cloud-native, outside the ABAP stackABAP environment on BTP or S/4HANA on-premise — inside the ABAP stack
Team skillsNode.js or Java developers — web and cloud backgroundsABAP developers — existing S/4HANA and SAP basis expertise
What you are extendingSide-by-side extensions — custom apps that consume S/4HANA via published APIsOn-stack extensions — enhancing or exposing existing ABAP business logic via OData
Clean core levelLevel A — BTP side-by-side, fully upgrade-safeLevel A — ABAP Cloud on-stack, also upgrade-safe when using released APIs only
Multitenancy / SaaSStrong — built-in MTX support designed for cloud SaaS scenariosNot the primary use case — single-tenant on-stack is the typical RAP scenario
Open-source integrationStrong — integrates naturally with npm ecosystem, Docker, Kubernetes toolingLimited — ABAP environment is largely SAP-contained

⚠️ Warning

The most expensive mistake in SAP BTP projects is defaulting to RAP because the team knows ABAP, when the actual requirement is a cloud-native, externally-facing application. RAP is excellent for on-stack ABAP extensions. It runs into real scalability and architectural limits when forced into a cloud-native, multi-tenant, side-by-side role. Choose based on the use case, not the team’s comfort zone.

In practice, many projects use both. RAP exposes the S/4HANA business logic through clean OData APIs. CAP consumes those APIs and builds the cloud-native application layer on top. The two models complement each other when the architecture is designed correctly.

SAP CAP project structure diagram on white background showing folder tree with schema.cds, service.cds and service.js on the left generating a live OData V4 API and Fiori Elements app on the right

At a glance — SAP CAP

ConceptOne-line summary
SAP CAPThe Cloud Application Programming Model — SAP’s standard framework for building cloud-native applications on BTP
Golden pathSAP’s term for CAP’s opinionated, proven development path — reduces decisions, builds in best practices
CDSCore Data Services — CAP’s declarative modelling language for data, services and UI annotations
CAP runtimeThe Node.js or Java layer that reads CDS models and serves requests automatically via generic handlers
Generic handlersBuilt-in request handling for CRUD operations — no custom code needed for standard behaviour
SQLite / HANA CloudSQLite for fast local development, SAP HANA Cloud for production — same CDS model drives both
OData V4Every CDS service is automatically exposed as a standards-compliant OData V4 API
Clean core Level ACAP-based side-by-side extensions on BTP are SAP’s cleanest extension pattern — fully upgrade-safe
CAP vs RAPCAP = cloud-native, Node.js/Java, side-by-side. RAP = ABAP, on-stack S/4HANA extensions. Both are strategic.
Deployment targetsCloud Foundry (MTA-based) and Kyma/Kubernetes (Helm-based) — both fully supported

What to take away

CAP is the answer to a question SAP spent years getting wrong: how do you give a developer team a consistent, productive starting point for building on BTP without making them assemble everything from scratch?

The golden path framing is not marketing language. It describes something real. Every CAP project starts with a working OData service, a local database, and authentication hooks in place — before you write a single line of business logic. That is the productivity argument. The clean core argument follows from the architecture: code that lives on BTP instead of in the ABAP stack survives upgrades, scales independently, and integrates cleanly with cloud services.

If you are on an S/4HANA programme that involves custom development, the question is not whether to use CAP — it is whether your use case is side-by-side (CAP) or on-stack ABAP (RAP). Get that decision right early. The projects that got it wrong spent significant time and budget finding out why.

🔗 Related posts on this site

SAP BTP — The Platform Explained — the platform CAP runs on: services, runtimes, and how it all fits together.
OData Protocol in SAP — V2, V4 and How It Works — CAP exposes OData V4 automatically; this post explains what that means and why V4 matters.
CDS Views and the VDM in SAP S/4HANA Explained — CDS in the S/4HANA context: how the same modelling language powers both the core and CAP extensions.
SAP S/4HANA vs ECC — The Real Difference — the clean core strategy and why extending S/4HANA the right way matters for your upgrade path.
ABAP Fundamentals That Still Matter — if you are evaluating RAP alongside CAP, this post covers the ABAP foundation RAP builds on.

Published on rakeshnarayan.com — Articles

URL: https://rakeshnarayan.com/articles/sap-cap-the-framework-behind-modern-btp-development/