ERPClimb logoERPClimb

SAP RAP / CDS / OData Draft Handling Interview Questions

Interviewers use draft handling to test depth rather than coverage: the follow-up question is almost always "why does the system behave that way?", and that is where prepared answers usually run out.

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.

This page carries 10 reviewed SAP RAP / CDS / OData draft handling interview questions, each with a complete written answer and no sign-in required. The set breaks down into 1 foundational, 6 mid-level and 3 advanced questions, so you can start at the top for a first interview or skip ahead to the scenario-based items for a senior round.

If you can handle every question here without hesitating, draft handling is unlikely to be what costs you an SAP RAP / CDS / OData interview — and the same reasoning pattern transfers to the neighbouring topics linked at the bottom of this page.

10 Draft Handling questions with answers

easyDraft Handling

1. What is draft in RAP, why is it needed, and how are draft and active instances distinguished?

Draft persists unfinished changes for stateless web apps: every change is stored immediately in framework-managed draft tables, so input survives refreshes and interruptions, determinations react while typing, and the object is protected by an exclusive lock. Each instance can exist as active (persistent tables) and draft (draft tables) with the same key; they are distinguished by %is_draft in %tky (IsActiveEntity in OData). Activation runs the save sequence, copies draft to active and deletes the draft. Code must use %tky.
mediumDraft Handling

2. When would you enable draft for a RAP BO, and when not?

Enable draft for UI scenarios where users edit complex objects over time: several sections or items, long forms, interruptions, need for immediate derivations and early validation, or multiple devices. Do not use draft for integration APIs (clients send complete requests), simple single-field maintenance or high-volume technical processing. Common design: one BO with draft in the UI projection (use draft) and a separate API projection without draft. Draft costs: draft tables, lifecycle actions, more complex testing.
mediumDraft Handling

3. After adding a field to a draft-enabled BO, activation fails and Fiori shows errors. What is the likely cause?

The draft table no longer matches the entity: the new CDS field is missing in the draft table (and possibly in the mapping). Regenerate the draft table via the ADT quick fix on the BDEF's draft table declaration, activate it, then activate the BDEF and the chain; add the field to the mapping block if names differ; include it in the projection. Test create, edit and activate again. Transport the regenerated draft table together with the CDS change.
mediumDraft Handling

4. Walk through the draft lifecycle actions: Edit, Resume, Prepare, Activate and Discard.

New objects start as draft (create with %is_draft). Edit copies an active instance with its children into the draft tables and sets an exclusive lock; with preserve_changes it fails if a draft already exists. Every change updates the draft. Resume re-acquires the lock for an existing draft after the lock expired (checking the total ETag). Prepare runs the validations and determinations listed in "draft determine action Prepare" — Fiori calls it on Save. Activate copies draft to active through the full save sequence and deletes the draft (Activate optimized avoids reprocessing unchanged data). Discard deletes the draft and releases the lock. Abandoned drafts are cleaned up after their lifetime.
mediumDraft Handling

5. Users report 'Save does nothing' in a draft app. How do you investigate?

Save triggers Prepare then Activate. Most often Prepare or Activate returned validation errors the user did not notice: messages without %element or %state_area, or shown only in a popover. Check the network responses or message popover, run an ABAP Cross Trace for the request, and look at which validations are listed in Prepare — errors from validations not in Prepare appear only at Activate. Also check authorization/feature control on Activate and on-save determinations that fail. Fix by improving messages (%element, %state_area, %path), listing validations in Prepare, and retesting.
mediumDraft Handling

6. How does draft change where you put determinations and validations?

On-modify determinations run on every draft change — use them for values users must see immediately (defaults, totals) and keep them cheap and idempotent. On-save determinations run once at activation — use them for numbers or final values so abandoned drafts do not consume numbers. Validations run at activation; list them (including child validations) in "draft determine action Prepare" so errors appear on Save. Messages need %state_area, %element and, for children, %path. Side effects refresh derived fields; business actions like approve are disabled on drafts via feature control.
mediumDraft Handling

7. A user says a purchase request has been 'locked' for two days. Support wants to delete the draft table rows. What do you do?

Stop the manual delete — it corrupts draft admin data and locks. Check whether a draft exists and who owns it (READ with %is_draft or the app's own-drafts filter); often the owner is the same user on another device. If the owner can act, they Resume and save or Discard. If not, discard the draft properly via EML Discard (with appropriate authorization) or the app. Check SM12 for real enqueue locks held by jobs. Document the case and inform users about drafts on other devices.
hardDraft Handling

8. How do the exclusive lock and the total ETag work together in draft scenarios?

Edit sets an exclusive lock on the active instance, held for the draft session, so others see "Locked by" and non-draft APIs get lock errors. After the lock expires, the draft stays; another user may take over (discarding it), or the owner resumes. The total ETag (root, e.g. LastChangedAt) is remembered when the draft is created and checked at Resume/Activate: if active data changed meanwhile (e.g. via an API after lock expiry), activation is rejected so the old draft cannot overwrite newer data. Both timestamp fields are maintained via @Semantics in managed RAP.
hardDraft Handling

9. An hourly integration sets statuses via API, but long-running drafts later reset them. Why, and how do you prevent it?

The drafts were created before the API change and activated afterwards, overwriting the newer status. This happens when there is no total etag (or its field is not maintained), so RAP cannot detect that the active data changed during the draft session. Add "total etag LastChangedAt" on the root with @Semantics.systemDateTime.lastChangedAt so activation of outdated drafts is rejected; users reload and reapply changes. Also ensure the API respects locks (retry on lock errors).
hardDraft Handling

10. You inherit a draft-enabled RAP BO. What do you review?

Draft checklist: with draft, draft tables up to date, total etag with maintained field, draft actions including Resume and Prepare (Activate optimized), "with draft" on associations, projection with use draft and all draft actions. Code: %tky everywhere, no key-only reads; determinations on modify cheap and idempotent; numbering on save/late; validations listed in Prepare; messages with %state_area/%element/%path; side effects for derived fields; business actions disabled for drafts. Tests: full lifecycle, edit conflicts, lock expiry and total ETag conflict.

Related lesson

Draft Handling Part 4: Validations, Determinations and Side Effects in Draft

Related topics

Next practice step

Go deeper on this topic