Skip to content

Commit 74f256c

Browse files
authored
Update tables.md
1 parent 3a69566 commit 74f256c

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

docs/development/model/tables.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,22 @@ CLASS z2ui5_cl_sample_tab DEFINITION PUBLIC.
1414
value TYPE string,
1515
descr TYPE string,
1616
END OF ty_row.
17-
DATA t_tab TYPE STANDARD TABLE OF ty_row WITH EMPTY KEY.
17+
DATA mt_itab TYPE STANDARD TABLE OF ty_row WITH EMPTY KEY.
1818
1919
ENDCLASS.
2020
2121
CLASS z2ui5_cl_sample_tab IMPLEMENTATION.
2222
METHOD z2ui5_if_app~main.
2323
2424
DO 100 TIMES.
25-
DATA ls_row TYPE ty_row.
26-
ls_row-count = sy-index.
27-
ls_row-value = 'red'.
28-
ls_row-descr = 'this is a description'.
29-
INSERT ls_row INTO TABLE t_tab.
25+
INSERT value #(
26+
count = sy-index.
27+
value = 'red'.
28+
descr = 'this is a description' ) INTO TABLE mt_itab.
3029
ENDDO.
3130
3231
DATA(tab) = z2ui5_cl_xml_view=>factory( )->page(
33-
)->table( client->_bind( t_tab ) ).
32+
)->table( client->_bind( mt_itab ) ).
3433
tab->columns(
3534
)->column( )->text( 'Counter' )->get_parent(
3635
)->column( )->text( 'Value' )->get_parent(
@@ -52,15 +51,14 @@ Making a table editable is a simple change. You just need to switch the binding
5251
METHOD z2ui5_if_app~main.
5352
5453
DO 100 TIMES.
55-
DATA ls_row TYPE ty_row.
56-
ls_row-count = sy-index.
57-
ls_row-value = 'red'.
58-
ls_row-descr = 'this is a description'.
59-
INSERT ls_row INTO TABLE t_tab.
54+
INSERT value #(
55+
count = sy-index.
56+
value = 'red'.
57+
descr = 'this is a description' ) INTO TABLE mt_itab.
6058
ENDDO.
6159
6260
DATA(tab) = z2ui5_cl_xml_view=>factory( )->page(
63-
)->table( client->_bind_edit( t_tab ) ).
61+
)->table( client->_bind_edit( mt_itab ) ).
6462
tab->columns(
6563
)->column( )->text( 'Count' )->get_parent(
6664
)->column( )->text( 'Value' )->get_parent(

0 commit comments

Comments
 (0)