RAP_CDS_ODATAintermediate
Draft Handling
Learn RAP draft handling for Fiori-style transactional editing where users need intermediate state before activation. Cover draft ownership, edit/activate/discard behavior, side effects, validations, concurrent editing and when draft is unnecessary for stateless APIs.
Overview
Learn RAP draft handling for Fiori-style transactional editing where users need intermediate state before activation. Cover draft ownership, edit/activate/discard behavior, side effects, validations, concurrent editing and when draft is unnecessary for stateless APIs.
Lessons in this topic
- Draft Handling Part 1: Draft Architecture — Active Data and Draft PersistenceUnderstand how RAP draft works under the hood: active and draft instances, draft tables, %is_draft and IsActiveEntity, draft administrative data, and what the framework does for you.
- Draft Handling Part 2: Draft Lifecycle — Create, Edit, Resume, Activate, DiscardFollow the draft lifecycle step by step — new draft, Edit, Resume, Prepare, Activate and Discard — and see what happens in the data, the locks and the UI at each step.
- Draft Handling Part 3: Draft Locking, ETags and ConcurrencyMaster concurrency in draft scenarios: the exclusive lock during editing, lock expiry and the optimistic phase, the total ETag at activation, and what users see in each situation.
- Draft Handling Part 4: Validations, Determinations and Side Effects in DraftPlace business logic correctly in draft-enabled objects: which determinations run on modify, which on save, how Prepare surfaces validation errors, how messages stay in sync with %state_area, and how side effects keep the UI current.
- Draft Handling Part 5: Troubleshooting Draft IncidentsResolve the typical draft tickets — "document locked", "my changes disappeared", "Save does nothing", "data changed by another user" — with a symptom-based checklist and the right tools.
Interview questions covered
- When would you enable draft for a RAP BO, and when not?
- After adding a field to a draft-enabled BO, activation fails and Fiori shows errors. What is the likely cause?
- What is draft in RAP, why is it needed, and how are draft and active instances distinguished?
- Walk through the draft lifecycle actions: Edit, Resume, Prepare, Activate and Discard.
- Users report 'Save does nothing' in a draft app. How do you investigate?
- How do the exclusive lock and the total ETag work together in draft scenarios?
- An hourly integration sets statuses via API, but long-running drafts later reset them. Why, and how do you prevent it?
- How does draft change where you put determinations and validations?
- A user says a purchase request has been 'locked' for two days. Support wants to delete the draft table rows. What do you do?
- You inherit a draft-enabled RAP BO. What do you review?