ERPClimb logoERPClimb

SAP RAP / CDS / OData Unmanaged RAP Interview Questions

In SAP RAP / CDS / OData rounds, unmanaged rap questions are where configuration knowledge meets day-to-day behaviour — what a setting does, and what breaks in a live system when it is wrong.

Understand unmanaged RAP for brownfield scenarios where existing BAPIs, function modules or custom save logic must remain authoritative. Learn how developers implement CRUD, buffering, locking, save sequencing, messages and transaction consistency.

This page carries 10 reviewed SAP RAP / CDS / OData unmanaged rap interview questions, each with a complete written answer and no sign-in required. The set breaks down into 1 foundational, 4 mid-level and 5 advanced questions, so you can start at the top for a first interview or skip ahead to the scenario-based items for a senior round.

Rehearse these out loud rather than reading them. If you can explain each answer in your own words, including one realistic way it goes wrong on a project, you are covering what a normal SAP RAP / CDS / OData round on unmanaged rap expects.

10 Unmanaged RAP questions with answers

easyUnmanaged RAP

1. How do you implement locking in unmanaged RAP, and what should happen when another user already holds the lock?

Declare lock master on the root (and lock dependent by _Parent on children). RAP then calls your lock method before any change, passing the keys. Implementation: 1. Get a lock object instance: cl_abap_lock_object_factory=>get_instance( iv_name = 'EZPR_HEAD' ). A missing lock object is a technical error (RAISE SHORTDUMP). 2. For each key, call enqueue with the key field as parameter. 3. On cx_abap_foreign_lock: add the instance (%tky) to FAILED and a REPORTED message naming the user who holds the lock. There is no manual dequeue — RAP releases locks at the end of the transaction. Important in brownfield: use the same lock object as the legacy transaction, so users in the classic screen and in the Fiori app block each other. For child entities, RAP resolves the lock master through the read-by-association to the parent, which you must implement.
mediumUnmanaged RAP

2. When would you choose unmanaged RAP instead of managed RAP, and what do you have to implement yourself once you do?

Choose unmanaged when an existing application layer must stay the owner of the data: a legacy function group, class or BAPI with business rules, change documents, follow-on postings or user exits that must run, or persistence that is not simple tables you own. Typical brownfield wrapping. For greenfield objects with own tables, managed is right. If only the save must go through an existing API, managed with unmanaged save is often enough. In unmanaged you implement: • the transactional buffer (your own buffer class); • create, update, delete, read, create-by-association and read-by-association handlers; • the lock method (with a lock object, e.g. via cl_abap_lock_object_factory); • numbering (earlynumbering_create or late numbering with adjust_numbers); • the saver: finalize, check_before_save, save, cleanup, cleanup_finalize; • mapping of legacy messages (BAPIRET2) to FAILED/REPORTED per instance. RAP still provides the BDEF contract, EML, services, ETag checks via your read method, authorization/feature-control hooks and phase orchestration — and still owns the LUW, so no COMMIT WORK.
mediumUnmanaged RAP

3. A 15-year-old custom purchase request transaction must get a Fiori app without losing its function-group logic. Walk through your RAP design.

1. Decide the implementation type: the function group owns persistence and rules (budget checks, change documents), so managed on the same tables would bypass them. If the logic is only needed at save, use managed with unmanaged save; if the legacy code also controls in-memory state during editing, use unmanaged. 2. Data model: CDS root and child view entities on the existing tables for queries. 3. BDEF: unmanaged implementation, strict ( 2 ), lock master (reusing the legacy lock object), etag master on a changed-at field, authorization master, early numbering for UUIDs or late numbering if the legacy API assigns the document number. 4. Behavior pool: handlers write only to a transactional buffer; the saver runs legacy checks in check_before_save and legacy posting (update task, no commit) in save; messages mapped from BAPIRET2 with the original message class. 5. Projection + service definition + OData V4 UI binding + metadata extensions for the Fiori Elements app. 6. Tests: EML tests for create, PATCH-update, error messages; compare results with the classic transaction.
mediumUnmanaged RAP

4. Users report that editing only the description of an asset in a new RAP app wipes its location and cost center. The BO is unmanaged. What is the bug and how do you fix it?

The update handler copies the whole incoming entity structure to the database row (MOVE-CORRESPONDING or CORRESPONDING). Fiori sends a PATCH with only the changed field; RAP passes the full structure with all unsent fields initial, so they overwrite real values. Fix: honor %control. For each changeable field, copy the value only if entity-%control-<field> = if_abap_behv=>mk-on. Pattern: 1. Read current state (buffer first, then DB). 2. Not found → FAILED with %fail-cause not_found. 3. Copy only controlled fields. 4. Set admin and ETag fields. 5. Keep flag C if created in this transaction, else U; store in buffer. Add a regression test: update one field via EML with FIELDS ( Description ), read back and assert other fields unchanged. Managed RAP handles this automatically — in unmanaged it is your job.
mediumUnmanaged RAP

5. You must migrate a SEGW-based OData service and the BOPF object behind it to RAP. What is your plan?

1. Inventory: SEGW entity types, DPC_EXT methods, BOPF nodes, determinations, validations, actions, custom persistence, consumers of the service. 2. Extract business logic out of framework-specific code (DPC_EXT, /BOBF/IF_FRW_* classes) into plain ABAP classes — the most valuable step, possible before any RAP code. 3. Map concepts: BOPF node → CDS view entity in a composition tree; determination/validation/action → the same in the BDEF; BOPF locks/ETag → lock/etag master; BOPF draft → RAP draft; GET_ENTITYSET logic → CDS views; CRUD methods → handlers/saver or save_modified; SEGW registration → service definition + binding. 4. Choose the implementation type: standard persistence → managed; custom persistence → managed with unmanaged save or unmanaged. 5. Build the RAP service in parallel under a new name; check if your release offers tool support for CDS-based BOPF migration. 6. Compare old and new responses with automated tests, move consumers one by one (URLs and payloads differ), retire the SEGW service last.
hardUnmanaged RAP

6. Explain the transactional buffer in unmanaged RAP. How do the query path and the transactional read path differ, and what goes wrong if your read method ignores the buffer?

The transactional buffer holds all changes of the current transaction until save. In unmanaged RAP you build it yourself: usually a local class with static tables (so all handler and saver classes share it), each row with a change flag C/U/D, and one helper "buffer first, then database". Created-then-deleted rows are removed entirely; created-then-updated rows stay C. cleanup clears it. Two read paths: • Query path — list reports, filters, $expand for display — answered directly by the CDS views with SQL, committed data only. No ABAP handler involved. • Transactional read path — EML READ ENTITIES, reads in actions/validations, ETag checks before update, results of actions — served by your read method. If the read method selects only from the database: an update followed by an action in the same request works on old data, and ETag checks fail after your own change because the stored ETag differs from the buffered one. Fix: every handler and the read method use the buffer-first helper.
hardUnmanaged RAP

7. In an unmanaged BO, a user changes a field and triggers an action in the same interaction. The action uses the old value, and the next save fails with 'data changed by another user'. What is the likely cause?

Both symptoms point to one design error: the read method (and helpers used by actions) read from the database instead of the transactional buffer. • The action calls READ ENTITIES IN LOCAL MODE, which goes through your read method. If it selects from the database, it misses the uncommitted change — so it works on the old value. • RAP checks the ETag via the read method. After an update, the buffer has a new LocalLastChangedAt but the database still has the old one; returning the database value produces an ETag mismatch. Fix: one buffer-class method "buffer first, then database" used by read, update, delete, actions and the ETag path; return the ETag field in the read result; report deleted rows as not found. Add an EML test: update + action in one MODIFY, then assert the action saw the new value. Code-review rule: no direct SELECT on persistence tables inside handlers.
hardUnmanaged RAP

8. Explain the RAP save sequence in an unmanaged business object: which saver methods run, in which order, and where is the point of no return?

Order: 1. finalize — last derivations (numbers, totals). May still report errors. 2. check_before_save — final consistency checks, e.g. legacy API in check/test-run mode. Errors go to FAILED and REPORTED. If finalize or check_before_save report failures, RAP stops, calls cleanup_finalize (undo derivations, keep user changes in the buffer) and nothing is saved. 3. adjust_numbers — only for late numbering: map %pid to final keys. 4. save — the point of no return. Write via update-task function modules or direct writes to own tables. No errors, no COMMIT WORK, no dialogs. 5. The framework commits. 6. cleanup — clear the buffer. Consequence: everything that can fail must be checked before save. An error in save cannot be reported properly and usually ends in a dump or inconsistent data.
hardUnmanaged RAP

9. A legacy function module you must use in RAP ends with COMMIT WORK and also sends a synchronous RFC to a warehouse system. How do you integrate it safely?

Using it as-is in save breaks RAP's all-or-nothing transaction: the internal COMMIT persists partial data, and the synchronous RFC commits in another system outside RAP's LUW, leaving orphan data if the local save fails. Approach: 1. Inspect the function: COMMIT WORK, BAPI_TRANSACTION_COMMIT, dialogs, CALL TRANSACTION/SUBMIT, MESSAGE without RAISING, synchronous RFC. 2. Split it: expose the checks as a check routine called in check_before_save; move the posting into an update-task function without COMMIT, called in save. 3. Move the RFC after the commit: register a bgRFC unit, use the background processing framework (bgPF) where available, or raise a RAP business event processed asynchronously. 4. Map its BAPIRET2 messages to FAILED/REPORTED with the original message IDs. 5. In ABAP Cloud, wrap the unreleased legacy code in a released classic-ABAP wrapper. Test the failure path: a rejected save must leave both systems unchanged.
hardUnmanaged RAP

10. Compare managed, managed with additional save, managed with unmanaged save and unmanaged RAP. How do you decide?

• Managed — framework does CRUD, buffer, locks, ETag, draft and writes your tables. • Managed with additional save — framework writes as usual; save_modified lets you do extra work in the same LUW (change log, extra table, event). Declared "persistent table ... with additional save". • Managed with unmanaged save — framework still does interaction phase (buffer, %control, locks, ETag, draft, numbering); instead of writing tables it calls save_modified with create/update/delete data and you call the persistence API. Declared "with unmanaged save" (optionally "with full data"). • Unmanaged — you own buffer, CRUD, read, lock, numbering and all saver phases. Decision order: own tables, no legacy logic → managed; plus extra save work → additional save; an existing API must persist but editing is standard → unmanaged save; legacy code must control interaction-phase state → unmanaged. Many teams pick full unmanaged when unmanaged save would do, and pay with hundreds of lines of buffer and CRUD code and PATCH/ETag bugs.

Related lesson

Unmanaged RAP Part 4: Save Sequence, Transaction Safety and Legacy APIs

Related topics

Next practice step

Go deeper on this topic