RAP Managed vs Unmanaged: The Real Choice
Managed RAP lets the framework generate the create, update, delete and lock handling against a persistence you control, while you still write determinations, validations and actions. Unmanaged RAP means the developer writes every operation in the behavior implementation class, usually to call existing BAPIs or legacy logic. Choose managed for new development, unmanaged only when wrapping code that already owns the save.
Covers the structural difference between managed and unmanaged RAP business objects, when each is the right implementation type, and how the choice plays out in a behavior definition. Focuses on the decision criteria an architect actually applies and the pitfalls of picking the wrong one on a project that already has legacy transactional logic in place.
Published 16 Sept 2026· 1,403 words
What it is
Managed and unmanaged are implementation types declared on a RAP behavior definition, and they decide who is responsible for persisting data during a save. In a managed scenario the framework generates the standard operations, create, update, delete, lock, numbering, buffering, and maps them onto the underlying CDS entity's persistence, usually a database table reachable through the associated CDS view. In an unmanaged scenario the developer writes every one of those operations by hand inside the behavior implementation class, typically to call an existing BAPI, function module or older business logic layer that already knows how to save the data. The point of confusion for people new to RAP is assuming managed means no code is written at all. It is not. Determinations, validations and actions are hand-written in both types. What managed actually removes is the boilerplate around create, update, delete and the transactional save sequence, not the business logic layered on top of it.
When to use it
Managed is the default choice for any new custom business object where the developer owns the table or CDS entity end to end, particularly when draft handling, standard Fiori Elements list report and object page patterns, or ETag concurrency are wanted with minimal plumbing. Unmanaged is the right tool when the save logic already exists and cannot be duplicated safely, for example a sales order creation BAPI with its own numbering, pricing calls and update tasks, or a legacy custom program with save logic too entangled to reimplement. Reaching for unmanaged on a greenfield custom table is a common mistake; it throws away draft handling, ETag support and most of the generated plumbing for no reason. Reaching for managed to wrap an existing BAPI is the opposite mistake; the framework will fight the BAPI's own transactional assumptions, particularly around numbering and locking, and the result is fragile.
How it fits the stack
The managed or unmanaged choice sits inside the behavior definition, which sits on top of a CDS entity with a behavior binding, itself built on a projection or root CDS view. Above the behavior definition sits the service definition and service binding, which exposes the business object as OData for Fiori Elements or SAP Fiori freestyle apps. Below the behavior implementation, unmanaged scenarios typically call out to older function modules or BAPIs, meaning the RAP layer becomes a thin transactional wrapper around code that predates RAP entirely. Managed scenarios replace the old pattern of writing custom BAPI wrappers by hand for simple CRUD cases; unmanaged is essentially a controlled way of keeping that older pattern alive underneath a modern OData-exposed business object, rather than a separate architecture in its own right.
A worked example
A custom quality inspection request application starts as a managed scenario. The developer creates a custom database table, a CDS interface view and projection view on top of it, and a behavior definition marked managed with early numbering. Create, update and delete operations need no manual implementation; only a validation checking that the inspection date is not in the past and a determination defaulting the status field are hand-coded in the behavior implementation class. Contrast this with a requirement to expose sales order creation through the same Fiori app pattern. Sales order creation already runs through a mature legacy function module handling pricing, credit checks and numbering. Wrapping that in managed RAP would mean reimplementing all of that logic to satisfy the framework's save contract, which is wasteful and risky. Instead the behavior definition is marked unmanaged, and the create operation implementation simply maps the RAP request structure onto the function module's import parameters, calls it, and maps the result back, leaving the existing logic entirely in charge of the save.
How to choose
- Who owns the persistence: if the table and its save logic are entirely custom and new, managed is almost always cheaper to build and maintain; if an established BAPI or legacy program already owns the save, unmanaged avoids duplicating that logic.
- Draft handling: managed scenarios get generated draft support largely for free when annotated; retrofitting draft onto an unmanaged object is possible but considerably more manual work, so factor this in early if the Fiori app needs draft.
- Numbering strategy: managed supports early and late numbering natively through generated logic; unmanaged numbering is whatever the wrapped legacy code already does, which may conflict with RAP's expectations around temporary keys during buffering.
- Locking and concurrency: managed generates ETag and lock handling automatically from annotations; unmanaged requires the developer to implement locking explicitly, and it is easy to under-implement this and only discover the gap under concurrent access.
- Migration cost versus reuse cost: ask whether reimplementing the legacy save logic in managed style is realistically achievable within project budget, or whether the legacy code is stable, well-tested and simply needs a modern service face; the latter argues strongly for unmanaged.
- Long-term maintenance: managed objects age better across upgrades because the generated layer absorbs framework changes; unmanaged objects carry the maintenance burden of the wrapped legacy code plus the wrapper code indefinitely.
Common pitfalls
- Choosing unmanaged reflexively because a similar legacy transaction exists, when the actual save logic could reasonably be rebuilt managed; this trades a small amount of upfront work for years of extra maintenance on a wrapper nobody wants to touch.
- Choosing managed for a business object that must call a BAPI with side effects like credit checks or stock updates, then discovering the generated save sequence does not give enough control over when those side effects fire relative to determinations and validations.
- Assuming unmanaged means the framework does nothing; the transactional buffer, save sequencing and error propagation contracts still apply, and skipping any part of the required implementation causes save failures that only appear under multi-instance or draft scenarios, not in a simple IDE test.
- Mixing numbering strategy incorrectly in unmanaged scenarios, where the wrapped legacy code assigns the key at a different point than RAP expects, producing duplicate or missing key errors that only surface under concurrent user load in production, not during single-user development testing.
- Underestimating lock implementation in unmanaged objects; two users editing the same legacy record can both succeed if the lock behavior implementation is stubbed out or copied incompletely from a template, and this typically surfaces months after go-live as a data consistency complaint rather than an obvious error.
ECC, S/4HANA and clean core
Managed RAP is the implementation type aligned with clean core extensibility guidance for new custom development on S/4HANA; it keeps custom logic inside the framework's generated boundaries and minimizes what has to be revisited on upgrade. Unmanaged is not deprecated, but it is positioned narrowly, as the bridge for reusing stable existing logic rather than as a general-purpose alternative. Building new custom objects unmanaged purely out of familiarity with older BAPI-based patterns runs against the direction SAP is pushing development, and it tends to accumulate technical debt that later has to be migrated to managed anyway once draft handling or standard Fiori Elements features are wanted.
Whose problem this is
This is a developer and architect decision made at design time, not something changed casually later since it reshapes the behavior implementation class. The architect should own the managed versus unmanaged call for each business object and document the reasoning, particularly for unmanaged cases, so the next developer understands why legacy logic is being wrapped rather than reimplemented. Functional consultants contribute the business rules that become determinations and validations regardless of which type is chosen.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-technical-topics/rap-managed-versus-unmanaged-scenariosERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.