RAP Basics
Architect / Cross-trackIntermediate

Actions, Determinations and Validations

Use actions for explicit operations, determinations for automatic derivation and validations for business checks.

Explanation

Actions, determinations and validations are key RAP behavior concepts. An action is triggered explicitly by a user or consumer, such as approve, reject or submit. A determination automatically derives or changes values during modify or save, such as setting default status or calculating total amount. A validation checks business rules and reports errors, such as preventing approval when amount exceeds a limit. Mixing these concepts is a common beginner mistake. Use the correct hook so that behavior remains predictable and easy to test.

Code example

ABAP Code
define behavior for ZI_Expense alias Expensepersistent table zexpenselock master{ create; update;  determination setReviewer on modify { create; update; } validation validateAmount on save { create; update; } action submit result [1] $self;} * Determination:* Automatically sets reviewer based on department. * Validation:* Stops save if amount violates policy. * Action:* User explicitly clicks Submit to move status forward.

Real project scenario

An expense report app used validation to enforce policy limits, a determination to auto-set reviewer based on department and an action to submit the report for approval.

Common mistakes

- Using validation to fill default values. - Using determination to raise business errors. - Using action for logic that should happen automatically. - Not returning clear messages from validations.

Best practices

- Use determinations for derived values. - Use validations for rule checks. - Use actions for explicit business commands. - Return clear user-friendly messages.

Interview angle

Interviewers ask this often. Answer must clearly separate when to use action, determination and validation.