{"id":7742,"date":"2025-09-03T01:20:01","date_gmt":"2025-09-02T19:50:01","guid":{"rendered":"https:\/\/www.sapewmhelp.com\/?question=what-is-eml-in-sap-rap"},"modified":"2025-09-03T01:20:01","modified_gmt":"2025-09-02T19:50:01","slug":"what-is-eml-in-sap-rap","status":"publish","type":"question","link":"https:\/\/www.sapewmhelp.com\/?question=what-is-eml-in-sap-rap","title":{"rendered":"What is EML in SAP RAP?"},"content":{"rendered":"<p>EML (<strong>Entity Manipulation Language<\/strong>) is a standardized way to <strong>interact with RAP business objects<\/strong> (BOs).<br \/>Instead of directly updating database tables, you manipulate <strong>entities of a business object<\/strong> using EML statements.<\/p>\n<p>It\u2019s similar to SQL but tailored for RAP-managed business objects (like CDS-based BOs).<\/p>\n<\/p>\n<h6>Common EML Statements<\/h6>\n<p>You can use EML to perform:<\/p>\n<ul>\n<li><strong>READ<\/strong> \u2192 retrieve data from BO entities<\/li>\n<li><strong>CREATE<\/strong> \u2192 create new instances<\/li>\n<li><strong>UPDATE<\/strong> \u2192 change existing instances<\/li>\n<li><strong>DELETE<\/strong> \u2192 delete instances<\/li>\n<li><strong>ACTION<\/strong> \u2192 call business actions<\/li>\n<li><strong>FUNCTION<\/strong> \u2192 call determinations\/validations indirectly<\/li>\n<\/ul>\n<p><strong>Syntax Examples<\/strong><\/p>\n<p>1. <strong>Read<\/strong><\/p>\n<p>READ ENTITIES OF zi_travel<br \/>\nENTITY travel<br \/>\nFIELDS ( travel_id agency_id status )<br \/>\nWITH VALUE #( ( travel_id = &#8216;0001&#8217; ) )<br \/>\nRESULT DATA(lt_travel).<\/p>\n<p>&nbsp;<\/p>\n<p>2. <strong>Create<\/strong><\/p>\n<p>MODIFY ENTITIES OF zi_travel<br \/>\nENTITY travel<br \/>\nCREATE<br \/>\nFIELDS ( travel_id agency_id customer_id )<br \/>\nWITH VALUE #( ( travel_id = &#8216;1001&#8217; agency_id = &#8216;7000&#8217; customer_id = &#8216;C01&#8217; ) )<br \/>\nFAILED DATA(ls_failed)<br \/>\nREPORTED DATA(ls_reported).<\/p>\n<p>&nbsp;<\/p>\n<p>3. <strong>Update<\/strong><\/p>\n<p>MODIFY ENTITIES OF zi_travel<br \/>\nENTITY travel<br \/>\nUPDATE<br \/>\nFIELDS ( status )<br \/>\nWITH VALUE #( ( travel_id = &#8216;1001&#8217; status = &#8216;X&#8217; ) )<br \/>\nFAILED DATA(ls_failed)<br \/>\nREPORTED DATA(ls_reported).<\/p>\n<p>4. <strong>Delete<\/strong><\/p>\n<p>MODIFY ENTITIES OF zi_travel<br \/>\nENTITY travel<br \/>\nDELETE<br \/>\nFROM VALUE #( ( travel_id = &#8216;1001&#8217; ) )<br \/>\nFAILED DATA(ls_failed)<br \/>\nREPORTED DATA(ls_reported).<\/p>\n<p>5. <strong>Action Execution<\/strong><\/p>\n<p>MODIFY ENTITIES OF zi_travel<br \/>\nENTITY travel<br \/>\nEXECUTE action confirm<br \/>\nFROM VALUE #( ( travel_id = &#8216;1001&#8217; ) )<br \/>\nFAILED DATA(ls_failed)<br \/>\nREPORTED DATA(ls_reported).<\/p>\n<p>&nbsp;<\/p>\n<h6>Key Points<\/h6>\n<ul>\n<li>\n<p>Always executed <strong>against business objects (BOs)<\/strong>, not database tables.<\/p>\n<\/li>\n<li>\n<p>Works inside <strong>ABAP classes (behavior implementations, service consumption, or test code)<\/strong>.<\/p>\n<\/li>\n<li>\n<p>Returns:<\/p>\n<ul>\n<li><strong>RESULT<\/strong> \u2192 successful data<\/li>\n<li><strong>FAILED<\/strong> \u2192 failed instances<\/li>\n<li><strong>REPORTED<\/strong> \u2192 messages\/warnings<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","question-category":[175],"question_tags":[201,200,177],"class_list":["post-7742","question","type-question","status-publish","hentry","question-category-rap","question_tags-btp","question_tags-rap","question_tags-sap"],"_links":{"self":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question\/7742","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question"}],"about":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7742"}],"wp:attachment":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7742"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion-category&post=7742"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion_tags&post=7742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}