S/4HANAadvanced

RAP (RESTful ABAP Programming Model)

SAP's strategic, HANA-optimized model for building transactional business objects and Fiori/OData services in S/4HANA Cloud and on-premise.

RAP is the topic that most clearly separates candidates with genuine current S/4HANA experience from those whose knowledge stopped at classic ABAP, because it's SAP's official, strategic replacement for older transactional frameworks (BOPF, classic function-module-based BAPIs for new development) and is mandatory for any extension in S/4HANA Cloud's ABAP Environment, so it comes up in nearly every senior ABAP interview today.

RAP is like a well-defined assembly line for building furniture (business objects) with mandatory quality checkpoints (validations, determinations) at fixed stations, versus the old approach of a single craftsperson (a BAPI function module) building the whole piece by hand with no enforced checkpoints - RAP's managed mode is like using the factory's standard automated frame and finish; unmanaged mode is bringing your own custom frame but still running it through the factory's checkpoint stations.

Key Concepts

1
A RAP business object is defined through a small number of interlocking artifacts: a CDS-based data model (interface and projection views, as in the CDS topic), behavior definitions (DEFINE BEHAVIOR FOR ...) that declare which operations (create, update, delete, and custom actions) are supported and which fields are read-only/mandatory, and behavior implementations - ABAP classes implementing the actual business logic for those operations, structured around a strict lifecycle of validations, determinations, and actions that fire at well-defined points (e.g., a determination runs automatically after a field changes; a validation blocks a save if a business rule is violated). This is a deliberate, disciplined structure compared to older BAPI-style development where validation and business logic could be scattered arbitrarily throughout a monolithic function module.
DEFINE BEHAVIOR FOR ...
2
RAP explicitly supports two deployment targets through the same programming model: managed RAP (SAP handles persistence via generated save/transactional logic, ideal for greenfield objects with a clean CDS-based table structure) and unmanaged RAP (the developer writes custom save-sequence logic, typically used when wrapping existing legacy tables/logic that can't follow RAP's default persistence assumptions), plus early-numbering versus late-numbering strategies for how draft/transactional key values get assigned. Draft handling (allowing a user to save an incomplete record and resume editing later, critical for realistic Fiori Elements object-page UX) is a first-class RAP concept, implemented via a companion draft table and specific behavior definition annotations, and is one of the more conceptually tricky parts of RAP to explain clearly in an interview.
3
A senior-level answer distinguishes RAP from the older BOPF framework (both provide structured business-object patterns, but RAP is CDS-native, cloud-ready, and the strategic direction, while BOPF is legacy and largely frozen for new development), covers unit testing RAP business logic via ABAP Unit with the RAP-specific test double framework, and mentions that RAP business objects automatically expose an OData V2/V4 service (via a service definition and service binding) with virtually no separate integration coding required, which is the direct link back to why RAP and Fiori/CDS discussions are so tightly intertwined in real projects.