In SAP RAP, the Behavior Definition (BDEF) defines the contract between the runtime orchestrator and your persistence layer. Architects must choose between four distinct archetypes:
| Archetype | Persistence Layer | CRUD Responsibility | Clean Core Tier |
|---|---|---|---|
| Pure Managed | Custom transparent tables | 100% Framework Managed | Tier-1 ABAP Cloud |
| Managed with Unmanaged Save | Standard legacy BAPIs / FMs | Framework buffers; Class saves | Tier-2 Quarantine Wrapper |
| Managed + Late Numbering | Custom tables + SNRO | Framework CRUD; Class numbers | Tier-1 ABAP Cloud |
| Pure Unmanaged | Complex legacy function pools | 100% Custom Saver Class | Legacy Migration Only |
In Clean Core architecture, you frequently need to build a modern SAP Fiori Elements application that ultimately creates a standard S/4HANA business document (e.g. Sales Order, Purchase Order) for which SAP has not yet provided a C1-released RAP business object.
Attempting to write a Pure Unmanaged RAP BO requires hundreds of lines of boilerplate code to handle transactional locking, transactional read buffers, and message mapping.
Instead, the Managed with Unmanaged Save archetype provides the ultimate balance:
save_modified sequence, the framework hands over the delta records to your custom saver class.BAPI_PO_CREATE1) and translates legacy return tables into RAP failed/reported structures.In stateless enterprise web applications, users frequently close their browser tab, lose Wi-Fi connectivity, or need hours to complete a complex requisition.
Enabling Draft (with draft;) in your BDEF creates an automatic shadow table (draft table _d) that decouples user input from the live database:
total etag LastChangedAt.draft determine action Prepare: Executes field validations before activation.draft action Activate: Validates, copies draft data to active tables, and purges draft records.draft action Edit: Creates a draft copy of an existing active record.draft action Discard: Deletes draft buffer and unlocks the entity.Allocation of semantic document identifiers must align with strict audit rules:
cl_system_uuid). Ideal for greenfield cloud applications where semantic sequential numbering is not mandated by tax or legal authorities.
adjust_numbers). Guaranteed gapless sequential numbers for invoices, purchase orders, and financial vouchers.
Get all 15 modules, 40 Retina architecture diagrams, 61 production-grade code snippets, editable DOCX specifications, and the SAP BTP AI Companion.