You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/development/cds.md
+39-38Lines changed: 39 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,45 +47,8 @@ ENDCLASS.
47
47
### EML
48
48
The Entity Manipulation Language simplifies the read, creation, update, and deletion of RAP business objects.
49
49
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
-
87
50
#### 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:
89
52
```abap
90
53
CLASS z2ui5_cl_sample_eml_read DEFINITION
91
54
PUBLIC
@@ -123,3 +86,41 @@ CLASS z2ui5_cl_sample_eml_read IMPLEMENTATION.
123
86
ENDMETHOD.
124
87
ENDCLASS.
125
88
```
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
0 commit comments