RAP Basics
Architect / Cross-trackAdvanced

EML: Entity Manipulation Language

Use EML to read and modify RAP business objects safely.

Explanation

EML, or Entity Manipulation Language, is used to interact with RAP business objects. It provides statements like READ ENTITIES, MODIFY ENTITIES and COMMIT ENTITIES. Instead of directly updating database tables, RAP code and consumers should work through entity behavior. EML respects RAP behavior, validations, determinations and transactional consistency. EML is very important for testing, actions, background logic and internal RAP-to-RAP operations.

Code example

ABAP Code
* Purpose:* Read RAP entities using EML instead of direct table access. READ ENTITIES OF ZI_Travel IN LOCAL MODE ENTITY Travel FIELDS ( TravelId Status AgencyId ) WITH VALUE #( ( TravelId = '00000001' ) ) RESULT DATA(lt_travel) FAILED DATA(lt_failed) REPORTED DATA(lt_reported). * Modify entity using RAP behavior.MODIFY ENTITIES OF ZI_Travel IN LOCAL MODE ENTITY Travel UPDATE FIELDS ( Status ) WITH VALUE #( ( TravelId = '00000001' Status = 'APPROVED' ) ) FAILED DATA(lt_update_failed) REPORTED DATA(lt_update_reported). * Key point:* EML works through RAP behavior.* Avoid direct DB updates for RAP-managed business objects.

Real project scenario

A background approval job used EML to read pending travel requests and execute an approve action instead of directly updating the status table.

Common mistakes

- Updating RAP persistence table directly. - Ignoring failed and reported results. - Using EML without understanding transactional behavior. - Calling COMMIT ENTITIES in the wrong context.

Best practices

- Use READ ENTITIES and MODIFY ENTITIES for RAP objects. - Always check failed and reported. - Respect RAP transaction boundaries. - Avoid direct persistence updates.

Interview angle

Architect-level RAP interviews often ask what EML is and why direct table update should be avoided.