ERPClimb logoERPClimb

SAP RAP / CDS / OData EML Interview Questions

EML comes up in SAP RAP / CDS / OData interviews because it is one of the few areas where an interviewer can tell, in two questions, whether you have worked with the process or only read about it.

Use RAP Entity Manipulation Language to read and modify RAP business objects directly from ABAP with type-safe operations. Learn READ/MODIFY ENTITIES, create-by-association, actions, MAPPED/FAILED/REPORTED, local mode and transaction handling with COMMIT ENTITIES.

This page carries 10 reviewed SAP RAP / CDS / OData eml interview questions, each with a complete written answer and no sign-in required. The set breaks down into 1 foundational, 6 mid-level and 3 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.

The fastest way to use this page is to read the question, answer it yourself, and only then read the answer. The gap between your version and the written one is your actual revision list for eml.

10 EML questions with answers

easyEML

1. What is EML, which statements does it have, and why should programs use EML instead of updating tables directly?

Entity Manipulation Language is the ABAP API to RAP business objects: READ ENTITIES (including BY \_assoc and function execution), MODIFY ENTITIES (CREATE, UPDATE, DELETE, EXECUTE actions, CREATE BY \_assoc), COMMIT ENTITIES, ROLLBACK ENTITIES and GET PERMISSIONS. There are short, long and dynamic forms. EML runs the full BO behavior — authorization, feature control, determinations, validations, locking, numbering, draft — exactly as OData does. Direct table updates bypass all of it: missing statuses and numbers, violated rules, no change logs, inconsistent data. EML is also how clean-core code changes SAP data through released RAP BO interfaces.
mediumEML

2. A mass-upload program inserts purchase requests directly into the BO tables. Requests appear in the app without status or number and some violate rules. How do you rewrite it?

Rewrite with EML: MODIFY ENTITIES … CREATE (and CREATE BY \_Item for items) per logical unit with %cid per input row, then COMMIT ENTITIES RESPONSE OF the BO. Evaluate FAILED and REPORTED after MODIFY and after COMMIT, log them per input row, and ROLLBACK ENTITIES for failed units. Commit in reasonable chunks (per request or small batches) so one bad row does not block all. Now determinations set status and number, validations reject invalid rows with messages, and admin fields and logs are maintained as in the UI.
mediumEML

3. Explain %cid, %cid_ref, MAPPED, FAILED and REPORTED using a deep create of a header with two items.

In one MODIFY: CREATE the header with %cid = 'REQ1'; CREATE BY \_Item with %cid_ref = 'REQ1' and %target containing two items, each with its own %cid. %cid names a new instance within the request; %cid_ref refers to it before its key exists. An action on the new header can also use %cid_ref. MAPPED returns one line per created instance per entity with %cid and the assigned key/%tky. FAILED lists instances that could not be processed, identified by %tky or %cid, with %fail-cause (not_found, unauthorized, locked, conflict, disabled…). REPORTED contains messages (%msg, %element), plus %other for unbound ones. Interaction-phase results appear after MODIFY; validation results after COMMIT ENTITIES RESPONSE.
mediumEML

4. Your EML MODIFY returns no FAILED entries, but the data is not saved. Why, and how should the program evaluate results?

MODIFY only runs the interaction phase: authorization, feature control, prechecks, determinations on modify. Validations and on-save determinations run in the save sequence triggered by COMMIT ENTITIES. If a validation fails there, nothing is written — and if the program uses a plain COMMIT ENTITIES without RESPONSE (or COMMIT WORK), it never sees the failure. Evaluate both: FAILED/REPORTED from MODIFY, and COMMIT ENTITIES RESPONSE OF <bo> FAILED … REPORTED … afterwards. Log messages with %msg->if_message~get_text( ). On failure, ROLLBACK ENTITIES and report per input record.
mediumEML

5. What does IN LOCAL MODE skip, what does it not skip, and why is it needed inside a behavior pool?

IN LOCAL MODE skips authorization checks and feature control (static and instance) for that EML statement and allows internal operations. It does not skip determinations, validations, locking/ETag handling, draft handling or the save sequence. It is needed because the BO must do things consumers may not: set read-only fields like Status or TotalAmount in actions and determinations, update instances whose update is feature-disabled (e.g. closing an approved request), and call internal actions. It is only allowed for the BO of the behavior pool. Authorization is still checked at the entry point — the operation the user called.
mediumEML

6. A program creates records in two RAP BOs and commits after each. When the second fails, orphans remain. How do you fix the program?

Committing each BO separately breaks atomicity: the first commit persists data before the second is validated. Fix: per logical unit, MODIFY both BOs (using MAPPED keys from the first to link the second), then one COMMIT ENTITIES RESPONSES OF bo1 FAILED … REPORTED … OF bo2 FAILED … REPORTED …. If MODIFY or COMMIT reports failures, ROLLBACK ENTITIES and log the unit as failed. Never use COMMIT WORK for RAP changes. Clean up existing orphans once with EML deletes, and add a test for the failure path.
mediumEML

7. Why must EML-based tests of validations call COMMIT ENTITIES, and how do you keep such tests isolated?

Validations run only in the save sequence. A test that only calls MODIFY never executes them and passes even if the validation is broken. So validation tests end with COMMIT ENTITIES RESPONSE OF <bo> FAILED … REPORTED … and assert on FAILED, %fail-cause and the message (%element, number). Isolation: when the save succeeds, data is written. Use the ABAP SQL test double framework (cl_osql_test_environment) to redirect the BO's tables and CDS dependencies to test doubles, RAP BO test doubles or wrappers for other BOs, ROLLBACK ENTITIES in teardown, and never depend on existing system data. COMMIT ENTITIES IN SIMULATION MODE (where available) checks without persisting.
hardEML

8. A purchase request action must create a budget reservation in a finance BO, but the user lacks finance authorization. A developer wants to use IN LOCAL MODE or write the table directly. What do you advise?

Neither. IN LOCAL MODE is only allowed for the own BO (syntax error otherwise), and a direct table write bypasses all finance validations and logs — a serious integrity and audit risk. Options: call the finance BO normally via EML (preferably its released interface) and map its FAILED/REPORTED — if the business requires the user to have finance rights, that failure is correct. If the finance team agrees that this specific call should work without the user's finance authorization, they can offer a privileged access path in their BDEF, which the caller uses with PRIVILEGED; document it. Alternatively, trigger the reservation asynchronously under a technical user after commit, with clear responsibility.
hardEML

9. How do two RAP business objects stay consistent when an action in one creates data in the other?

Both changes happen in the interaction phase via EML (the second BO without local mode) and share one transactional context. At commit, RAP runs finalize and check_before_save for all changed BOs; only if all succeed does it save all of them and commit — so both are saved or neither. Rules: no COMMIT ENTITIES inside handlers (the framework commits), no MODIFY in save-phase methods, map the second BO's FAILED/REPORTED into your own response. In programs orchestrating several BOs, call COMMIT ENTITIES RESPONSES OF both BOs once per logical unit and ROLLBACK ENTITIES on failure. Late numbering across BOs needs extra care because final keys exist only after save.
hardEML

10. Design a test suite for a RAP business object before go-live. What must it cover?

Per rule, one test via EML: • Validations: pass and fail (with COMMIT ENTITIES RESPONSE), message and field. • Determinations: correct value and idempotency (trigger twice). • Actions: allowed and disallowed states, result, messages; parameter validation. • Feature control: GET PERMISSIONS per status. • Authorization: restricted user or authority test doubles where available. • Draft: create draft, change, Prepare, Activate; verify active data. • Bulk: hundreds of instances in one call without failure or timeout. • Cross-BO calls replaced by doubles. Infrastructure: SQL test doubles, ROLLBACK ENTITIES, one behavior per test, descriptive names, execution in ATC/transport release checks or CI.

Related lesson

EML Part 4: Cross-BO Calls, COMMIT ENTITIES and ROLLBACK ENTITIES

Related topics

Next practice step

Go deeper on this topic