ERPClimb logoERPClimb
RAP Basics
Architect / Cross-trackintermediate 7 min read

RAP Basics Part 7: Actions, Determinations and Validations — Design Decisions

Preview · a free account unlocks the full lesson

Key takeaway

Decide where each piece of business logic belongs in a RAP BO: validations (check on save, reject with messages), determinations (derive values on modify or on save), actions (explicit user or API operations, instance, static and factory), side effects for Fiori, and the trigger conditions that keep logic efficient.

In this lessonShow sections

Visual overview

RAP Basics Part 7: Actions, Determinations and Validations — Design Decisions — learning sheetFlow: List business rules and classify each as validation, determination or action → Define triggers as narrowly as possible → Declare them in the BDEF; add side effects for recalculated fields → Add validations to draft determine action Prepare. Key ideas: VALIDATIONS; DETERMINATIONS; ACTIONS; DRAFT AND SIDE EFFECTS. Watch out: Putting checks into determinations or derivations into validations breaks the transactional model — validations must not modify, determinations must not reject.ERPClimb.com / ARCH / LESSON 7/11 / LEARNING SHEETRAP Basics Part 7: Actions, Determinations and Validations— Design Decisions1 · HOW IT FLOWS1List businessrules andclassify each as…2Define triggersas narrowly aspossible3Declare them inthe BDEF; addside effects for…4Add validationsto draftdetermine action…2 · KEY IDEAS EXPLAINEDValidationsvalidation validateCustomer on save { create;field CustomerID; }Read data, check, fill failed-travel andreported-travel.Determinationsdetermination setInitialStatus on modify { create;} — default status 'O' (open).determination calculateTotal on modify { fieldBookingFee, CurrencyCode; } — immediaterecalculation.ActionsInstance action: action acceptTravel result [1]$self; — operates on selected instances.Static action: static action massRecalculate; — noinstance.Draft And Side Effectsdraft determine action Prepare { validationvalidateCustomer; } — run validations beforeactivation.side effects { field BookingFee affects fieldTotalPrice; } — tells Fiori to reload affectedfields.3 · REMEMBER · WATCH OUTRememberValidation = check; runs on save (and in draft Prepare), reportsfailed keys and messages, never changes data.Determination = derivation; on modify (immediate, e.g. default values,recalculated totals) or on save (e.g. draw number, set final status).Action = explicit operation triggered by the user or API(acceptTravel, copy, recalculate) — instance, static, or factory…!Watch outPutting checks into determinationsor derivations into validationsbreaks the transactional model —validations must not modify,determinations must not reject.4 · IN A REAL PROJECTOn an expense-claim BO, the team implemented the total amount calculation as a determination on save. Usersentered line items in the Fiori object page but saw a total of zero until they pressed Save, and many rejectedtheir own claims as "wrong". The architect changed it to determination on modify with trigger fields…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Part 6 controlled operations and fields; now we place business logic correctly. Part 9 shows the implementation code for what's declared here. Validation is a check: it runs on save (and, with draft, during Prepare), reports failed keys and messages, and never changes data — for example, validation validateCustomer on save { create; field CustomerID; } reads the data, checks it, and fills failed-travel and reported-travel. A failed validation stops the save, and with draft it runs during Prepare/Activate.

Determination is a derivation rather than a check. It can run on modify, immediately — for example setting default values or recalculating totals, as in determination setInitialStatus on modify { create; } for a default status of 'O' (open), or determination calculateTotal on modify { field BookingFee, CurrencyCode; } for immediate recalculation — or on save, as in determination drawTravelID on save { create; }, where a number is only assigned at save time. Determinations run IN LOCAL MODE and are allowed to set readonly fields.

Free account

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

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.