Draft Handling Part 3: Draft Locking, ETags and Concurrency
Preview · a free account unlocks the full lesson
Master 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.
In this lessonShow sectionsHide sections
Visual overview
Explanation
Edit sets an exclusive lock on the active instance, which is why other users see "Locked by …". That exclusive lock eventually expires — the draft itself stays, but another user may then start editing. A total ETag protects activation: if the active data changed while the draft existed, activation fails outright. Without that total ETag, a returning user could silently overwrite someone else's already-saved changes.
Part 2 walked through the draft lifecycle; this part answers the concurrency questions — who may edit while a draft exists, and what happens once a draft gets old.
In the first phase, the exclusive lock, when user A clicks Edit, RAP locks the active instance using the lock master on the root, and keeps it locked for as long as A keeps working, across many separate requests. User B sees "Locked by A" and simply cannot create a draft of their own. This is exactly what makes long editing sessions safe.
In the second phase, once the exclusive lock expires after a configured period, the draft itself still exists, but the situation changes.
User B may now edit the object, though B's Edit only creates B's own draft once A's draft is discarded or has become invalid — Fiori shows "Unsaved changes by A" and lets B decide whether to take over, which discards A's draft in the process.
If B doesn't take over and A comes back, A's Resume simply re-acquires the lock. It's worth checking with your basis or RAP team about the exact durations configured for the exclusive lock and the draft lifetime before promising users specific timings.
Create a free account to keep reading
You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.
- Full explanation
- Code example
- Real project scenario
- Common mistakes
- Best practices
- Interview angle
One tap with Google works too. Every topic keeps its first lesson open to everyone.
Keep exploring
Interview questions on this topic
Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.