Skip to content

Commit 63a7661

Browse files
authored
Update odata.md
1 parent 132cae6 commit 63a7661

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

docs/development/specific/odata.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ As an example, we will use the test OData service `/sap/opu/odata/DMO/API_TRAVEL
88
client->follow_up_action( client->_event_client(
99
val = z2ui5_if_client=>cs_event-set_odata_model
1010
t_arg = value #(
11-
( `/sap/opu/odata/DMO/API_FLIGHT_R_V2/` )
11+
( `/sap/opu/odata/DMO/UI_FLIGHT_R_V2/` )
1212
( `FLIGHT` ) ) ) ).
1313
```
1414
### Bind Data
@@ -56,7 +56,7 @@ METHOD z2ui5_if_app~main.
5656
client->follow_up_action( client->_event_client(
5757
val = z2ui5_if_client=>cs_event-set_odata_model
5858
t_arg = value #(
59-
( `/sap/opu/odata/DMO/API_FLIGHT_R_V2/` )
59+
( `/sap/opu/odata/DMO/UI_FLIGHT_R_V2/` )
6060
( `FLIGHT` ) ) ) ).
6161
6262
ENDMETHOD.
@@ -65,26 +65,26 @@ ENDMETHOD.
6565
### Multiple OData Models
6666
You can also bind multiple OData models simultaneously by defining additional OData models. Here’s an example:
6767
```abap
68-
tab = page->table(
69-
items = `{FLIGHT>/Airport}`
70-
growing = abap_true ).
71-
72-
tab->columns(
73-
)->column( )->text( 'AirportID' )->get_parent(
74-
)->column( )->text( 'Name' )->get_parent(
75-
)->column( )->text( 'City' )->get_parent(
76-
)->column( )->text( 'CountryCode' )->get_parent( ).
77-
78-
tab->items( )->column_list_item( )->cells(
79-
)->text( '{FLIGHT>AirportID}'
80-
)->text( '{FLIGHT>Name}'
81-
)->text( '{FLIGHT>City}'
82-
)->text( '{FLIGHT>CountryCode}' ).
68+
DATA(tab) = z2ui5_cl_xml_view=>factory( )->page( )->table(
69+
items = `{TRAVEL>/BookingSupplement}`
70+
growing = abap_true ).
8371
84-
client->follow_up_action( client->_event_client(
85-
val = z2ui5_if_client=>cs_event-set_odata_model
86-
t_arg = value #(
87-
( `/sap/opu/odata/DMO/ui_flight_r_v2/` )
88-
( `FLIGHT` ) ) ) ).
72+
tab->columns(
73+
)->column( )->text( 'TravelID' )->get_parent(
74+
)->column( )->text( 'BookingID' )->get_parent(
75+
)->column( )->text( 'BookingSupplementID' )->get_parent(
76+
)->column( )->text( 'SupplementID' )->get_parent( ).
77+
78+
tab->items( )->column_list_item( )->cells(
79+
)->text( '{TRAVEL>TravelID}'
80+
)->text( '{TRAVEL>BookingID}'
81+
)->text( '{TRAVEL>BookingSupplementID}'
82+
)->text( '{TRAVEL>SupplementID}' ).
83+
84+
client->follow_up_action( client->_event_client(
85+
val = z2ui5_if_client=>cs_event-set_odata_model
86+
t_arg = value #(
87+
( `/sap/opu/odata/DMO/API_TRAVEL_U_V2/` )
88+
( `TRAVEL` ) ) ) ).
8989
```
9090
For a fully functional code snippet, check out the sample `Z2UI5_CL_DEMO_APP_315`.

0 commit comments

Comments
 (0)