New to SAP RAP / CDS / OData? Start with the module overview
SAP CAP vs RAP: Choosing a Cloud Application Programming Model
Quick answer
RAP (the ABAP RESTful Application Programming Model) and CAP (the SAP Cloud Application Programming Model) are both model-driven frameworks built around CDS, but they target different runtimes and audiences: RAP is ABAP-based and tied to an ABAP system (on-premise S/4HANA, S/4HANA Cloud, or the BTP ABAP Environment), while CAP is a polyglot, cloud-native framework coded in Node.js or Java and runs independently of any ABAP backend. Choose RAP when the application is extending or building on S/4HANA business data and logic directly; choose CAP when building a standalone cloud-native service, side-by-side extension, or application that is not fundamentally tied to one ABAP system's data model.
The real difference between RAP and CAP as SAP's two model-driven application programming models, when each one actually fits a project, and how teams get the choice wrong.
Published 17 Nov 2026· 925 words
What it is
RAP is the modern ABAP development model for building OData services, Fiori-ready business objects, and local or released APIs, available on the BTP ABAP Environment, SAP S/4HANA Cloud, and on-premise S/4HANA from release 1909 onward, and it generates a large share of the runtime behavior (CRUD handling, draft logic, number ranges) automatically from the CDS-based data model and behavior definition.
CAP is a separate, open framework of tools, languages, and libraries for building enterprise-grade cloud services, written primarily in Node.js or Java rather than ABAP, that also uses CDS for data modeling but executes outside the ABAP stack entirely, commonly on SAP BTP's Cloud Foundry or Kyma runtime.
When to use it
Use RAP when the application's core data and business logic genuinely belong to an S/4HANA system — extending a sales order, building a custom business object that needs to participate in S/4HANA's transactional and authorization model, or exposing a released API from existing SAP business logic.
Use CAP when building a standalone, cloud-native application or side-by-side extension on SAP BTP that does not need to live inside the ABAP stack, especially when the development team's existing skill set is JavaScript or Java rather than ABAP, or when the application needs to be portable across cloud-native infrastructure independent of any specific ABAP backend.
How it fits together
- Both frameworks are built around Core Data Services as the shared modeling layer, so a team fluent in CDS concepts (entities, associations, annotations) is not starting from zero when moving between the two.
- RAP applications typically run where the business data already lives — inside the S/4HANA system itself or the BTP ABAP Environment extending it — while CAP applications typically call into S/4HANA or other backends as external services rather than sharing a database with them directly.
- A side-by-side extension built in CAP commonly calls RAP-exposed, released APIs on the S/4HANA side as its source of business data, so the two models are frequently used together across the same solution rather than treated as strictly exclusive alternatives.
A worked example
A team building a custom approval workflow that needs to read and update sales order data directly inside S/4HANA, with S/4HANA's own authorization and number-range logic enforced, builds it as a RAP business object extending the sales order, exposed as an OData service consumed by a Fiori elements app.
A different team building a standalone supplier-onboarding portal, meant to run independently of any single S/4HANA system and call several backends including non-SAP systems, builds it as a CAP application in Node.js on BTP, calling the relevant S/4HANA released APIs as one of several external services it integrates.
How to decide what to build
Start from where the business data actually lives and who will maintain the application long-term, not from which framework a team happens to know. If the application is fundamentally an extension of S/4HANA's own transactional data and processes, RAP keeps the application inside the governed, clean-core extension model and avoids an unnecessary extra moving part.
If the application is cloud-native, polyglot by nature, or genuinely independent of any one ABAP backend, CAP avoids forcing an ABAP skill requirement onto a team and project that do not actually need one. Database considerations generally do not decide the choice on their own, since both ultimately run against SAP HANA Cloud in a standard BTP landscape.
Common pitfalls
- Choosing CAP for a project that is really just an S/4HANA extension, which then has to make expensive external API calls for data and logic that RAP could have accessed directly inside the same system.
- Choosing RAP for a project with no real S/4HANA dependency, forcing an ABAP skill requirement and an ABAP Environment subscription onto a team and use case that did not need either.
- Assuming RAP and CAP are mutually exclusive architecture decisions for an entire landscape, when in practice many solutions legitimately combine a CAP side-by-side extension consuming RAP-released APIs from S/4HANA.
- Underestimating that CAP, while open-source in its tooling, still carries real BTP subscription, Cloud Foundry or Kyma runtime, and HANA Cloud database cost that needs to be budgeted like any other BTP service.
ECC, S/4HANA and clean core
RAP has no equivalent in classical ECC development, which relied on SE80, BAdIs, and classic Dynpro or Web Dynpro; it is specifically the clean-core-compliant successor for building extensions and APIs on S/4HANA without modifying standard objects. CAP, by contrast, was never an ECC-era concept at all — it exists purely as a BTP-native framework, and its relevance to an S/4HANA landscape is entirely as an external, side-by-side extension technology rather than as a replacement for any on-premise development approach.
Whose problem this is
The architecture or extensibility lead for the program should own this decision, made jointly with whichever delivery team will actually build and support the application long-term, since the skill-set implications (ABAP versus Node.js or Java) directly determine which team can realistically own the resulting code after go-live.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-technical-topics/sap-cap-vs-rap-choosing-programming-modelERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.