BTPadvanced

SAP CAP (Cloud Application Programming Model)

SAP's opinionated, model-driven framework for building cloud applications with a unified data model spanning Node.js and Java.

CAP is the topic that most clearly signals whether a candidate has actually built a modern SAP BTP application, since it's SAP's officially recommended, opinionated framework for new BTP development, and interviewers use it to check whether a candidate understands the model-driven philosophy that runs through it, not just superficial Node.js or Java syntax.

CAP is like an architect's parametric building-design software - you declare the building's structure and rooms (the CDS model) once, and the software automatically generates the wiring, plumbing, and staircases (the working OData service) for you, letting you focus your actual effort on the custom features (event handlers) that make this particular building different, while still being able to preview it cheaply on a small scale model (SQLite) before building the real, full-scale version (HANA Cloud) from the identical blueprint.

Key Concepts

1
At CAP's core is CDS (Core Data Services) - notably the same conceptual modeling language ABAP CDS views use, applied here in a non-ABAP, Node.js/Java cloud-native context - where a developer defines entities, associations, and service definitions (.cds files) declaratively, and CAP's runtime automatically generates a working OData V4 service (with full CRUD, $filter/$expand/$select query support, and even draft handling for UI patterns) from that model, without hand-writing typical boilerplate CRUD handler code for straightforward cases. Custom business logic hooks into this generated service through event handlers (srv.on('CREATE', 'Orders', handler) in Node.js, or annotated methods in Java) that fire before, on, or after specific CRUD operations, letting a developer layer validation, custom calculation, or side-effects onto the auto-generated foundation rather than building the entire service by hand.
.cds$filter$expand$selectsrv.on('CREATE', 'Orders', handler)
2
CAP's "one model, multiple protocols and databases" philosophy is a deliberate architectural choice - the same CDS-defined service can be exposed as OData or plain REST, and can run against SQLite in local development, then deploy against SAP HANA Cloud in production, without changing the service definition itself, since CAP's runtime handles the database-specific SQL generation underneath. This lets a developer iterate quickly locally without needing a live HANA instance for every small change, then deploy the identical model against production-grade HANA when ready - a meaningfully different (and much faster) development loop than hand-writing HANA-specific SQLScript or calculation views for every requirement.
3
A senior-level answer covers CAP's built-in support for multitenancy (SaaS applications serving many customer subaccounts from one codebase, with tenant-specific database schema provisioning handled by CAP's framework rather than custom-built per project), extensibility (allowing SaaS application customers to extend the CAP application's data model in a controlled way, conceptually similar to S/4HANA's key user extensibility), and how CAP integrates with BTP services (using the same destination and connectivity services, event mesh for messaging) as first-class citizens rather than bolted-on afterthoughts, and can articulate why SAP steers new CAP-based greenfield BTP development over hand-rolled Express.js/Spring Boot applications specifically because of this integrated tooling and the model-driven productivity gain for standard CRUD-heavy business applications.