Skip to content

Commit 817b879

Browse files
authored
Update cds.md
1 parent 0c6d7c8 commit 817b879

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

docs/development/cds.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,42 @@ ENDMETHOD.
8080
Key Considerations:
8181
* Transaction Management: EML calls in abap2UI5 apps are executed outside the RAP framework. Therefore, don't forget to explicitly commit transactions using `COMMIT ENTITIES`
8282
* Commit Limitations: 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
83+
84+
You can also do an `READ ENTITY`:
85+
```abap
86+
CLASS z2ui5_cl_sample_eml_read DEFINITION
87+
PUBLIC
88+
CREATE PUBLIC.
89+
90+
PUBLIC SECTION.
91+
INTERFACES z2ui5_if_app.
92+
DATA mt_salesorder TYPE TABLE FOR READ RESULT i_salesordertp\\salesorder.
93+
94+
ENDCLASS.
95+
96+
CLASS z2ui5_cl_sample_eml_read IMPLEMENTATION.
97+
METHOD z2ui5_if_app~main.
98+
99+
READ ENTITIES OF I_SalesOrderTP
100+
ENTITY SalesOrder
101+
ALL FIELDS WITH
102+
VALUE #( ( SalesOrder = `0000000001` ) )
103+
RESULT mt_salesorder.
104+
105+
DATA(view) = z2ui5_cl_xml_view=>factory( )->page( ).
106+
DATA(table) = view->table( client->_bind( mt_salesorder ) ).
107+
table->columns(
108+
)->column( )->text( 'SalesOrder' )->get_parent(
109+
)->column( )->text( 'SalesOrderType' )->get_parent(
110+
)->column( )->text( 'SalesOrganization' ).
111+
112+
table->items( )->column_list_item( )->cells(
113+
)->text( '{SALESORDER}'
114+
)->text( '{SALESORDERTYPE}'
115+
)->text( '{SALESORGANIZATION}' ).
116+
117+
client->view_display( view->stringify( ) ).
118+
119+
ENDMETHOD.
120+
ENDCLASS.
121+
```

0 commit comments

Comments
 (0)