RAP_CDS_ODATAintermediate
Behavior Implementations
Learn how RAP behavior pools implement actions, determinations, validations, authorization and unmanaged persistence while respecting bulk-processing and save-sequence rules. The emphasis is thin framework handlers, reusable domain services and correct FAILED/REPORTED messaging.
Overview
Learn how RAP behavior pools implement actions, determinations, validations, authorization and unmanaged persistence while respecting bulk-processing and save-sequence rules. The emphasis is thin framework handlers, reusable domain services and correct FAILED/REPORTED messaging.
Lessons in this topic
- Behavior Implementations Part 1: The Behavior Pool — Handler and Saver ClassesUnderstand the anatomy of a behavior pool: the global ZBP_ class, local handler and saver classes, how methods are generated from the BDEF, implicit parameters, derived types and the %-components you use in every method.
- Behavior Implementations Part 2: Determinations and Validations Without Side EffectsWrite determinations and validations that are safe to run any number of times: idempotent logic, the right triggers, set-based EML in local mode, no side effects outside the BO, and messages that disappear once fixed.
- Behavior Implementations Part 3: Actions, Results and User-Facing MessagesImplement every kind of RAP action correctly — instance actions with results, actions with parameters, factory actions with MAPPED — and give users clear, translatable messages from message classes.
- Behavior Implementations Part 4: Save Sequence, Late Numbering and Unmanaged SaveKnow what belongs in the saver class of each implementation type: when a managed BO needs a saver at all, how late numbering works with adjust_numbers, and how save_modified implements additional save and unmanaged save.
- Behavior Implementations Part 5: Performance, Unit Testing and DebuggingKeep behavior implementations fast, tested and diagnosable: set-based handler design, EML-based ABAP Unit tests with isolation, and the tools to debug RAP requests coming from Fiori or APIs.
Interview questions covered
- What is a behavior pool, and what is the difference between its handler and saver classes?
- Explain %tky, %key, %cid, %pid, %control and %param. Which mistake happens when developers use key fields instead of %tky?
- A purchase request total is sometimes doubled after editing in draft. The determination adds the changed item's amount to the total. What is wrong and how do you fix it?
- What rules must determinations and validations follow, and what must they never do?
- An integration called the approve action for requests in status New and approved them, bypassing the workflow. The Fiori button was correctly disabled. What went wrong?
- Implement a 'copy request' feature in RAP. Which action type do you use and how does it return the new instance?
- When does a managed RAP BO need a saver class, and what goes into adjust_numbers and save_modified?
- An audit log written in a determination contains duplicate entries and entries for changes that were never saved. How do you fix it?
- How do you test and debug a RAP behavior implementation effectively?
- You review an inherited behavior pool before go-live. What checklist do you apply?