EML (Entity Manipulation Language) is a standardized way to interact with RAP business objects (BOs).
Instead of directly updating database tables, you manipulate entities of a business object using EML statements.
It’s similar to SQL but tailored for RAP-managed business objects (like CDS-based BOs).
Common EML Statements
You can use EML to perform:
- READ → retrieve data from BO entities
- CREATE → create new instances
- UPDATE → change existing instances
- DELETE → delete instances
- ACTION → call business actions
- FUNCTION → call determinations/validations indirectly
Syntax Examples
1. Read
READ ENTITIES OF zi_travel
ENTITY travel
FIELDS ( travel_id agency_id status )
WITH VALUE #( ( travel_id = ‘0001’ ) )
RESULT DATA(lt_travel).
2. Create
MODIFY ENTITIES OF zi_travel
ENTITY travel
CREATE
FIELDS ( travel_id agency_id customer_id )
WITH VALUE #( ( travel_id = ‘1001’ agency_id = ‘7000’ customer_id = ‘C01’ ) )
FAILED DATA(ls_failed)
REPORTED DATA(ls_reported).
3. Update
MODIFY ENTITIES OF zi_travel
ENTITY travel
UPDATE
FIELDS ( status )
WITH VALUE #( ( travel_id = ‘1001’ status = ‘X’ ) )
FAILED DATA(ls_failed)
REPORTED DATA(ls_reported).
4. Delete
MODIFY ENTITIES OF zi_travel
ENTITY travel
DELETE
FROM VALUE #( ( travel_id = ‘1001’ ) )
FAILED DATA(ls_failed)
REPORTED DATA(ls_reported).
5. Action Execution
MODIFY ENTITIES OF zi_travel
ENTITY travel
EXECUTE action confirm
FROM VALUE #( ( travel_id = ‘1001’ ) )
FAILED DATA(ls_failed)
REPORTED DATA(ls_reported).
Key Points
-
Always executed against business objects (BOs), not database tables.
-
Works inside ABAP classes (behavior implementations, service consumption, or test code).
-
Returns:
- RESULT → successful data
- FAILED → failed instances
- REPORTED → messages/warnings