ABAP RESTful Application Programming Model (RAP)
The ABAP RESTful Application Programming Model (RAP) is SAP's programming model for building transactional business objects, OData services and SAP Fiori apps in ABAP. RAP combines ABAP CDS data models, behavior definitions that declare operations, validations and draft, ABAP behavior implementations, and service definitions and bindings that expose the result as OData V2 or V4.
Quick facts
- Type
- ABAP programming model
- Layer
- Business logic & data model, exposed through Services & APIs
- Built in
- ABAP Development Tools (Eclipse)
- Building blocks
- CDS view entities, behavior definition, behavior pool, service definition, service binding
- On-premise availability
- Unmanaged from ABAP 7.53, managed from ABAP 7.54 (SAP S/4HANA 1909), draft from 7.55 (2020)
- Who works with it
- ABAP developers
- Applies to
- SAP S/4HANA (all deployment options), SAP BTP ABAP environment
Layer: Business logic & data modelWhere it sits ▾
How is a RAP application built?
A RAP application is assembled from layers, each a separate repository object:
- Data model: CDS view entities over database tables. A root entity and its child entities, linked by compositions, form the business object, for example a purchase request with its items.
- Behavior definition (BDEF): declares what the business object can do: create, update, delete, actions, validations, determinations, locking, concurrency control and draft.
- Behavior pool: an ABAP class that implements the custom parts the behavior definition declares, such as a validation that rejects requests above a limit.
- Projection layer: projection views and a projection behavior definition that expose only what a given service needs.
- Service definition: lists the entities a service exposes.
- Service binding: chooses the protocol (OData V2, OData V4 or InA) and the category, UI or Web API, and publishes the service. A preview shows the result as a SAP Fiori elements app.
Each layer has one job, which is how RAP keeps data model, behavior and exposure separate in one ABAP business object.
What is the difference between managed and unmanaged RAP?
The implementation type in the behavior definition decides who writes the transactional code:
- Managed: the RAP framework handles standard create, update and delete operations, the transactional buffer and saving to the persistent tables. Developers add only business logic: validations, determinations and actions.
- Unmanaged: developers implement every operation and the save sequence themselves, typically by calling existing application code that already handles persistence.
A third variant exists for older code: business objects built with the predecessor ABAP Programming Model for SAP Fiori (BOPF) can be migrated to BOPF-based RAP business objects. SAP notes these are not native RAP business objects and are not enabled for ABAP Cloud.
Decision criterion: choose managed when the business object owns its tables, such as a new custom application at Alder Manufacturing; choose unmanaged when proven legacy logic must be reused rather than rewritten. Managed RAP reduces code; unmanaged RAP protects existing investments.
Which releases support RAP?
RAP grew release by release, so availability depends on the feature, not only on the model:
| Milestone | ABAP release on-premise | SAP S/4HANA | Cloud (SAP BTP ABAP environment) |
|---|---|---|---|
| Unmanaged business objects | 7.53 | 1809 | 1808 |
| Managed business objects | 7.54 | 1909 | 1908 |
| Draft handling (draft table) | 7.55 | 2020 | 2008 |
| Behavior definition extensions | 7.57 | 2022 | 2208 |
SAP S/4HANA Cloud Public Edition receives features with the cloud cadence, and Private Edition follows the on-premise release it runs on. SAP ERP (ECC) does not include RAP: the ABAP Platform releases that carry it, from 7.53 on, ship only with SAP S/4HANA. SAP's RAP BDL feature tables list the release of every language element, and checking them for the target release is the first step of any RAP design.
How do RAP and ABAP Cloud relate?
ABAP Cloud is SAP's development model for cloud-ready, upgrade-stable ABAP: released APIs only, a restricted language version and Eclipse-based tools. RAP is the programming model ABAP Cloud uses for transactional applications and services.
- In the SAP BTP ABAP environment and in developer extensibility of SAP S/4HANA Cloud Public Edition, RAP is the way to build transactional apps and APIs.
- In Private Edition and on-premise, RAP can be used with ABAP Cloud rules, available from SAP S/4HANA 2022 (ABAP 7.57), or in classic ABAP. The choice decides which SAP objects the code may use.
- Strict mode in a behavior definition enforces current best practices, such as using CDS view entities as data sources.
RAP is therefore not tied to SAP BTP: the same model runs inside SAP S/4HANA. ABAP Cloud adds the rules; RAP provides the structure.
Where does RAP stop?
RAP's strengths are real. One model runs from the database to the SAP Fiori elements UI; locking, concurrency control and draft come from the framework instead of hand-written code; services stay upgrade-stable when built on released APIs; and the same business object can serve a UI and an API.
Its boundaries follow from where it runs:
- ABAP only. RAP needs ABAP skills, ABAP Development Tools and an ABAP system; teams without them face a real learning curve.
- One system. A RAP business object is transactional inside one ABAP system. Processes spanning several systems need integration or events on top.
- Release-bound. A feature documented for the cloud may arrive on-premise only with a later release.
- UI flexibility through annotations. Apps generated with SAP Fiori elements are as flexible as the floorplans and their extension points.
RAP is the strongest option when logic and data belong in the ABAP system; it is not designed for cross-system orchestration.
What are common mistakes with RAP?
- Exposing the base layer directly. Without a projection layer, every service change touches the core business object.
- Choosing unmanaged out of habit. Unmanaged makes sense when legacy logic is reused; for new tables, managed saves most of the code.
- Binding a SAP Fiori app to a Web API service. Web API bindings carry no UI metadata, so the app shows empty tables or default layouts. Use a UI binding.
- Building on DDIC-based CDS views. They are obsolete, and strict mode expects view entities.
- Ignoring the feature tables. Code copied from a cloud tutorial can fail to activate on an older on-premise release.
Most RAP problems are layering and release decisions made too early, not coding errors.
RAP vs. CAP: what is the difference?
| RAP | CAP | |
|---|---|---|
| Language and runtime | ABAP, in an ABAP system | Node.js or Java |
| Where it runs | SAP S/4HANA (all deployment options) and SAP BTP ABAP environment | Mainly SAP BTP (Cloud Foundry or Kyma runtime) |
| Data model | ABAP CDS view entities | CAP's own CDS language |
| Access to SAP S/4HANA data | Direct, inside the same system (released APIs in ABAP Cloud) | Through remote APIs |
| Typical use | Transactional apps and APIs next to SAP S/4HANA data | Side-by-side applications, multi-source services, SaaS |
RAP and CAP solve the same problem in different places: RAP inside the ABAP system, CAP beside it on SAP BTP.
FAQ
Is RAP the successor of the ABAP Programming Model for SAP Fiori?
Yes. SAP describes RAP as designed to improve on the ABAP Programming Model for SAP Fiori, which combined CDS views, BOPF and SAP Gateway. Existing BOPF-based business objects can be migrated to BOPF-based RAP business objects, but those are not enabled for ABAP Cloud.
Does RAP require SAP BTP?
No. RAP runs in SAP S/4HANA on-premise and in Private Edition from the releases listed in SAP's feature tables, in SAP S/4HANA Cloud Public Edition through developer extensibility, and in the SAP BTP ABAP environment.
Does RAP replace SAP Gateway Service Builder (SEGW) projects?
Not for existing projects. For new OData V4 services, SAP's Gateway documentation strongly recommends the programmatic approach in ABAP Development Tools, where RAP is the model, instead of the Service Builder. SEGW is still documented in current SAP Gateway Foundation releases, so existing SEGW projects keep running.
Which OData versions can a RAP service expose?
A RAP service binding can publish a service as OData V2 or OData V4, in the UI or Web API category; an InA binding type also exists for analytical consumption. Which combination fits depends on whether a SAP Fiori app or an external consumer uses the service.
Should I use RAP or CAP?
Use RAP when the logic must run inside the ABAP system next to the SAP S/4HANA data and transactions it works on. Use CAP when building a side-by-side application on SAP BTP, combining several sources or targeting Node.js or Java teams.
Sources
- SAP Help Portal: ABAP RESTful Application Programming Model (development guide)
- SAP Help Portal: RAP BDL — Feature Tables (release availability of behavior definition elements)
- SAP Help Portal: Why ABAP Cloud? (product availability per edition and release)
- SAP Help Portal: RAP — BOPF-Based RAP Business Objects
- SAP Help Portal: News for ABAP Release 7.5x (ABAP release to SAP S/4HANA release mapping)
- Applies to
- SAP S/4HANA on-premise · SAP S/4HANA Cloud Private Edition · SAP S/4HANA Cloud Public Edition · SAP BTP
- Last reviewed