Skip to content

Commit b469d83

Browse files
authored
Update cds.md
1 parent 63bbeb0 commit b469d83

File tree

1 file changed

+39
-38
lines changed

1 file changed

+39
-38
lines changed

docs/development/cds.md

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -47,45 +47,8 @@ ENDCLASS.
4747
### EML
4848
The Entity Manipulation Language simplifies the read, creation, update, and deletion of RAP business objects.
4949

50-
#### Modify
51-
The example below demonstrates how to create a sales order using EML in an abap2UI5 application:
52-
```abap
53-
METHOD z2ui5_if_app~main.
54-
55-
MODIFY ENTITIES OF i_salesordertp
56-
ENTITY salesorder
57-
CREATE
58-
FIELDS ( salesordertype
59-
salesorganization
60-
distributionchannel
61-
organizationdivision
62-
soldtoparty )
63-
WITH VALUE #( ( %cid = '0001'
64-
%data = VALUE #(
65-
SalesOrderType = 'TA'
66-
SalesOrganization = '1010'
67-
DistributionChannel = '10'
68-
OrganizationDivision = '00'
69-
SoldToParty = '0033500056' ) ) )
70-
MAPPED DATA(ls_mapped)
71-
FAILED DATA(ls_failed)
72-
REPORTED DATA(ls_reported_modify).
73-
74-
COMMIT ENTITIES BEGIN
75-
RESPONSE OF i_salesordertp
76-
FAILED DATA(ls_save_failed)
77-
REPORTED DATA(ls_save_reported).
78-
COMMIT ENTITIES END.
79-
80-
ENDMETHOD.
81-
```
82-
83-
Key Considerations:
84-
* EML calls in abap2UI5 apps are executed outside the RAP framework. Therefore, don't forget to explicitly commit transactions using `COMMIT ENTITIES`
85-
* RAP enforces strict limitations, such as disallowing direct calls to posting function modules or explicit commits within its framework. These restrictions do not apply when using EML in abap2UI5 apps, allowing greater flexibility in commit management
86-
8750
#### Read
88-
You can also use the `READ ENTITY` command:
51+
Use the `READ ENTITY` command and display the result in an UI5 tabel control:
8952
```abap
9053
CLASS z2ui5_cl_sample_eml_read DEFINITION
9154
PUBLIC
@@ -123,3 +86,41 @@ CLASS z2ui5_cl_sample_eml_read IMPLEMENTATION.
12386
ENDMETHOD.
12487
ENDCLASS.
12588
```
89+
90+
#### Modify
91+
Create a sales order using EML in an abap2UI5 application:
92+
```abap
93+
METHOD z2ui5_if_app~main.
94+
95+
MODIFY ENTITIES OF i_salesordertp
96+
ENTITY salesorder
97+
CREATE
98+
FIELDS ( salesordertype
99+
salesorganization
100+
distributionchannel
101+
organizationdivision
102+
soldtoparty )
103+
WITH VALUE #( ( %cid = '0001'
104+
%data = VALUE #(
105+
SalesOrderType = 'TA'
106+
SalesOrganization = '1010'
107+
DistributionChannel = '10'
108+
OrganizationDivision = '00'
109+
SoldToParty = '0033500056' ) ) )
110+
MAPPED DATA(ls_mapped)
111+
FAILED DATA(ls_failed)
112+
REPORTED DATA(ls_reported_modify).
113+
114+
COMMIT ENTITIES BEGIN
115+
RESPONSE OF i_salesordertp
116+
FAILED DATA(ls_save_failed)
117+
REPORTED DATA(ls_save_reported).
118+
COMMIT ENTITIES END.
119+
120+
ENDMETHOD.
121+
```
122+
Key Considerations:
123+
* EML calls in abap2UI5 apps are executed outside the RAP framework. Therefore, don't forget to explicitly commit transactions using `COMMIT ENTITIES`
124+
* RAP enforces strict limitations, such as disallowing direct calls to posting function modules or explicit commits within its framework. These restrictions do not apply when using EML in abap2UI5 apps, allowing greater flexibility in commit management
125+
126+

0 commit comments

Comments
 (0)