Draft Handling Part 4: Validations, Determinations and Side Effects in Draft
Preview · a free account unlocks the full lesson
Place 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.
In this lessonShow sectionsHide sections
Visual overview
Explanation
Determinations marked "on modify" run on every draft change, so the user sees the results while still typing. Determinations marked "on save" run only once, at activation — appropriate for things like document numbers. Validations run when they're listed in Prepare, which fires on a Save click, and again at activation. Side effects are what make Fiori reload derived fields immediately rather than leaving them stale.
Parts 1 through 3 covered draft mechanics. Draft changes when your logic actually runs, because users make many small changes before ever activating, so this part is about where each piece of logic belongs in that timeline.
Determinations on modify run after each triggering change in the draft — a single field change counts as one request. They're the right place for values the user needs to see immediately: a default status, item totals, derived descriptions. Because they may run dozens of times in a single session, they need to be cheap and idempotent. Combined with side effects, they let the UI show a new value without any manual refresh.
Determinations on save run exactly once, during activation, as part of the save sequence's finalize step. They belong wherever a value must be assigned only once, or only once the data becomes real — a number drawn from a number range, or final approval data. One thing to watch for: an on-save determination that draws a number on every single Prepare call would waste numbers, so number assignment should stay on save, or use late numbering instead.
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.