What is EML? Show me how you read, change and save a RAP business object from ABAP.
Say your answer out loud first.
Practise another way
EML, the Entity Manipulation Language, is the ABAP syntax for reading and changing RAP business objects in a type-safe way.
READ ENTITIES reads instances, MODIFY ENTITIES creates, updates, deletes or runs actions in the transactional buffer, and COMMIT ENTITIES triggers the save sequence and database commit. Every statement returns failed, reported and, for creates, mapped. Behavior implementations use the IN LOCAL MODE variant.
EML is the ABAP language extension for accessing RAP business objects. It works on the BO's transactional buffer, so it respects validations, locks and authorization instead of writing to tables directly. Consumers are ABAP programs, tests, and the RAP runtime for OData.
Read
READ ENTITIES OF zr_travel
ENTITY Travel
FIELDS ( AgencyId Description )
WITH VALUE #( ( TravelUUID = uuid ) )
RESULT DATA(travels)
FAILED DATA(failed).
Modify, then save
MODIFY ENTITIES OF zr_travel
ENTITY Travel
CREATE FIELDS ( AgencyId Description )
WITH VALUE #( ( %cid = 'T1' AgencyId = '70' Description = 'Offsite' ) )
MAPPED DATA(mapped)
FAILED DATA(failed)
REPORTED DATA(reported).
COMMIT ENTITIES
RESPONSES FAILED DATA(c_failed) REPORTED DATA(c_reported).
IF sy-subrc <> 0.
" save sequence rejected it, handle c_failed / c_reported
ENDIF.
Key points
MODIFYonly changes the buffer. Nothing is on the database untilCOMMIT ENTITIES.COMMIT ENTITIESruns the save sequence and finishes with the final database commit. If the early save phase finds errors, it returnssy-subrc4 and you are back in the interaction phase.- In an OData or Fiori scenario you do not write the commit. The RAP runtime engine does it.
%cidis a content ID you give to new instances, so later operations in the same call can refer to them. UseAUTO FILL CIDif you do not need to refer back.- Prefer
%tky(the transactional key, which includes the draft flag) over%key, so the code works for draft and non-draft objects. - Inside the BO's own handler and saver classes use
IN LOCAL MODE, covered in its own card. - Short forms exist (
READ ENTITY,MODIFY ENTITY) for one entity. The long form withENTITIES OFcan batch several entities of one BO in one statement.
Also available: ROLLBACK ENTITIES clears the buffer and locks without saving.
Use in tests: EML is how you drive a BO in an ABAP Unit test without a UI.
Shows read, modify and commit, explains that modify only touches the buffer, and mentions %cid, %tky and sy-subrc.
Says EML 'is like Open SQL for RAP' and forgets that nothing is saved before COMMIT ENTITIES.
Writing `COMMIT WORK` after a MODIFY ENTITIES, or forgetting to commit at all. Outside a RAP-managed transaction you need COMMIT ENTITIES, and inside a behavior implementation you need neither.
- Why use %tky instead of %key?
- What does COMMIT ENTITIES return when a validation fails?
- How do you call an action with EML?
- What is ROLLBACK ENTITIES for?
2 official pages, 2 prep guides and 1 technical reference. Confidence: high. Checked 21 Nov 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Technical reference Backs the answer.
- Prep guide Gives the question.
- Prep guide Gives the question.