Skip to content

Commit 256cfaa

Browse files
committed
docs: split CDS, EML page into CDS and EML
Extract the EML section into a new eml.md page, keep cds.md focused on CDS only, add an EML sidebar entry, and update the Draft Handling cross-reference.
1 parent e0def8b commit 256cfaa

4 files changed

Lines changed: 93 additions & 86 deletions

File tree

docs/.vitepress/config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ export default defineConfig({
150150
text: "RAP, EML",
151151
collapsed: true,
152152
items: [
153-
{ text: "CDS, EML", link: "/development/specific/cds" },
153+
{ text: "CDS", link: "/development/specific/cds" },
154+
{ text: "EML", link: "/development/specific/eml" },
154155
{ text: "Draft Handling", link: "/development/specific/draft" },
155156
],
156157
},

docs/development/specific/cds.md

Lines changed: 2 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
outline: [2, 4]
33
---
4-
# CDS, EML
4+
# CDS
55

6-
All examples in these docs work without CDS or EML. But on a recent ABAP release, you can also use these features in abap2UI5 apps.
6+
All examples in these docs work without CDS. But on a recent ABAP release, you can also use this feature in abap2UI5 apps.
77

88
### ABAP CDS
99
ABAP Core Data Services (CDS) let you define structured views and read data straight from the database. The example below fetches sales orders from the `I_SalesOrder` view of the Virtual Data Model (VDM) and shows them in a UI5 table:
@@ -45,85 +45,3 @@ CLASS z2ui5_cl_sample_cds IMPLEMENTATION.
4545
ENDMETHOD.
4646
ENDCLASS.
4747
```
48-
49-
### EML
50-
The Entity Manipulation Language simplifies work with RAP business objects by giving a consistent way to read, create, update, and delete entities.
51-
52-
#### Read
53-
Use `READ ENTITIES` to fetch sales orders and show them in a UI5 table:
54-
```abap
55-
CLASS z2ui5_cl_sample_eml_read DEFINITION PUBLIC.
56-
57-
PUBLIC SECTION.
58-
INTERFACES z2ui5_if_app.
59-
DATA mt_salesorder TYPE TABLE FOR READ RESULT i_salesordertp\\salesorder.
60-
61-
ENDCLASS.
62-
63-
CLASS z2ui5_cl_sample_eml_read IMPLEMENTATION.
64-
METHOD z2ui5_if_app~main.
65-
66-
IF client->check_on_init( ).
67-
68-
READ ENTITIES OF I_SalesOrderTP
69-
ENTITY SalesOrder
70-
ALL FIELDS WITH
71-
VALUE #( ( SalesOrder = `0000000001` ) )
72-
RESULT mt_salesorder.
73-
74-
DATA(view) = z2ui5_cl_xml_view=>factory( )->page( ).
75-
DATA(table) = view->table( client->_bind( mt_salesorder ) ).
76-
table->columns(
77-
)->column( )->text( `SalesOrder` )->get_parent(
78-
)->column( )->text( `SalesOrderType` )->get_parent(
79-
)->column( )->text( `SalesOrganization` ).
80-
81-
table->items( )->column_list_item( )->cells(
82-
)->text( `{SALESORDER}`
83-
)->text( `{SALESORDERTYPE}`
84-
)->text( `{SALESORGANIZATION}` ).
85-
86-
client->view_display( view->stringify( ) ).
87-
88-
ENDIF.
89-
90-
ENDMETHOD.
91-
ENDCLASS.
92-
```
93-
94-
#### Modify
95-
The example below creates a sales order with `MODIFY` inside an abap2UI5 app:
96-
97-
```abap
98-
METHOD z2ui5_if_app~main.
99-
100-
MODIFY ENTITIES OF i_salesordertp
101-
ENTITY salesorder
102-
CREATE
103-
FIELDS ( salesordertype
104-
salesorganization
105-
distributionchannel
106-
organizationdivision
107-
soldtoparty )
108-
WITH VALUE #( ( %cid = `0001`
109-
%data = VALUE #(
110-
SalesOrderType = `TA`
111-
SalesOrganization = `1010`
112-
DistributionChannel = `10`
113-
OrganizationDivision = `00`
114-
SoldToParty = `0033500056` ) ) )
115-
MAPPED DATA(ls_mapped)
116-
FAILED DATA(ls_failed)
117-
REPORTED DATA(ls_reported_modify).
118-
119-
COMMIT ENTITIES BEGIN
120-
RESPONSE OF i_salesordertp
121-
FAILED DATA(ls_save_failed)
122-
REPORTED DATA(ls_save_reported).
123-
COMMIT ENTITIES END.
124-
125-
ENDMETHOD.
126-
```
127-
Key Points:
128-
- EML calls in abap2UI5 apps run outside the RAP framework, so explicit transaction commits (COMMIT ENTITIES) are needed.
129-
- Restrictions inside the RAP framework, like disallowing direct calls to posting function modules or explicit commits, don't apply to abap2UI5 EML operations. You get more flexibility when handling commits and other actions.

docs/development/specific/draft.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ outline: [2, 4]
33
---
44
# Draft Handling
55

6-
Draft handling lets users save unfinished work — for example a half-filled form — without writing through to the active database state. In abap2UI5 apps you drive RAP draft-enabled business objects directly through EML, just like any other entity (see also [CDS, EML](./cds.md)).
6+
Draft handling lets users save unfinished work — for example a half-filled form — without writing through to the active database state. In abap2UI5 apps you drive RAP draft-enabled business objects directly through EML, just like any other entity (see also [EML](./eml.md)).
77

88
#### Create a Draft
99
Use `MODIFY ENTITIES` with `%is_draft = if_abap_behv=>mk-on` to create a new draft instance:

docs/development/specific/eml.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
outline: [2, 4]
3+
---
4+
# EML
5+
6+
All examples in these docs work without EML. But on a recent ABAP release, you can also use this feature in abap2UI5 apps.
7+
8+
### EML
9+
The Entity Manipulation Language simplifies work with RAP business objects by giving a consistent way to read, create, update, and delete entities.
10+
11+
#### Read
12+
Use `READ ENTITIES` to fetch sales orders and show them in a UI5 table:
13+
```abap
14+
CLASS z2ui5_cl_sample_eml_read DEFINITION PUBLIC.
15+
16+
PUBLIC SECTION.
17+
INTERFACES z2ui5_if_app.
18+
DATA mt_salesorder TYPE TABLE FOR READ RESULT i_salesordertp\\salesorder.
19+
20+
ENDCLASS.
21+
22+
CLASS z2ui5_cl_sample_eml_read IMPLEMENTATION.
23+
METHOD z2ui5_if_app~main.
24+
25+
IF client->check_on_init( ).
26+
27+
READ ENTITIES OF I_SalesOrderTP
28+
ENTITY SalesOrder
29+
ALL FIELDS WITH
30+
VALUE #( ( SalesOrder = `0000000001` ) )
31+
RESULT mt_salesorder.
32+
33+
DATA(view) = z2ui5_cl_xml_view=>factory( )->page( ).
34+
DATA(table) = view->table( client->_bind( mt_salesorder ) ).
35+
table->columns(
36+
)->column( )->text( `SalesOrder` )->get_parent(
37+
)->column( )->text( `SalesOrderType` )->get_parent(
38+
)->column( )->text( `SalesOrganization` ).
39+
40+
table->items( )->column_list_item( )->cells(
41+
)->text( `{SALESORDER}`
42+
)->text( `{SALESORDERTYPE}`
43+
)->text( `{SALESORGANIZATION}` ).
44+
45+
client->view_display( view->stringify( ) ).
46+
47+
ENDIF.
48+
49+
ENDMETHOD.
50+
ENDCLASS.
51+
```
52+
53+
#### Modify
54+
The example below creates a sales order with `MODIFY` inside an abap2UI5 app:
55+
56+
```abap
57+
METHOD z2ui5_if_app~main.
58+
59+
MODIFY ENTITIES OF i_salesordertp
60+
ENTITY salesorder
61+
CREATE
62+
FIELDS ( salesordertype
63+
salesorganization
64+
distributionchannel
65+
organizationdivision
66+
soldtoparty )
67+
WITH VALUE #( ( %cid = `0001`
68+
%data = VALUE #(
69+
SalesOrderType = `TA`
70+
SalesOrganization = `1010`
71+
DistributionChannel = `10`
72+
OrganizationDivision = `00`
73+
SoldToParty = `0033500056` ) ) )
74+
MAPPED DATA(ls_mapped)
75+
FAILED DATA(ls_failed)
76+
REPORTED DATA(ls_reported_modify).
77+
78+
COMMIT ENTITIES BEGIN
79+
RESPONSE OF i_salesordertp
80+
FAILED DATA(ls_save_failed)
81+
REPORTED DATA(ls_save_reported).
82+
COMMIT ENTITIES END.
83+
84+
ENDMETHOD.
85+
```
86+
Key Points:
87+
- EML calls in abap2UI5 apps run outside the RAP framework, so explicit transaction commits (COMMIT ENTITIES) are needed.
88+
- Restrictions inside the RAP framework, like disallowing direct calls to posting function modules or explicit commits, don't apply to abap2UI5 EML operations. You get more flexibility when handling commits and other actions.

0 commit comments

Comments
 (0)