Skip to content

Commit 132cae6

Browse files
authored
Update odata.md
1 parent 44ac433 commit 132cae6

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

docs/development/specific/odata.md

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ 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_TRAVEL_U_V2/` )
12-
( `TRAVEL` ) ) ) ).
11+
( `/sap/opu/odata/DMO/API_FLIGHT_R_V2/` )
12+
( `FLIGHT` ) ) ) ).
1313
```
1414
### Bind Data
1515
Next, bind this OData model to your view definition. Since we’re using a non-default model, we must explicitly specify the model name for each binding. Here's an example:
@@ -38,32 +38,26 @@ Here’s the complete source code for one OData model:
3838
METHOD z2ui5_if_app~main.
3939
4040
DATA(tab) = z2ui5_cl_xml_view=>factory( )->page( )->table(
41-
items = `{TRAVEL>/BookingSupplement}`
41+
items = `{FLIGHT>/Airport}`
4242
growing = abap_true ).
43-
43+
4444
tab->columns(
45-
)->column( )->text( 'TravelID' )->get_parent(
46-
)->column( )->text( 'BookingID' )->get_parent(
47-
)->column( )->text( 'BookingSupplementID' )->get_parent(
48-
)->column( )->text( 'SupplementID' )->get_parent(
49-
)->column( )->text( 'SupplementText' )->get_parent(
50-
)->column( )->text( 'Price' )->get_parent(
51-
)->column( )->text( 'CurrencyCode' )->get_parent( ).
45+
)->column( )->text( 'AirportID' )->get_parent(
46+
)->column( )->text( 'Name' )->get_parent(
47+
)->column( )->text( 'City' )->get_parent(
48+
)->column( )->text( 'CountryCode' ).
5249
5350
tab->items( )->column_list_item( )->cells(
54-
)->text( '{TRAVEL>TravelID}'
55-
)->text( '{TRAVEL>BookingID}'
56-
)->text( '{TRAVEL>BookingSupplementID}'
57-
)->text( '{TRAVEL>SupplementID}'
58-
)->text( '{TRAVEL>SupplementText}'
59-
)->text( '{TRAVEL>Price}'
60-
)->text( '{TRAVEL>CurrencyCode}' ).
51+
)->text( '{FLIGHT>AirportID}'
52+
)->text( '{FLIGHT>Name}'
53+
)->text( '{FLIGHT>City}'
54+
)->text( '{FLIGHT>CountryCode}' ).
6155
6256
client->follow_up_action( client->_event_client(
6357
val = z2ui5_if_client=>cs_event-set_odata_model
6458
t_arg = value #(
65-
( `/sap/opu/odata/DMO/API_TRAVEL_U_V2/` )
66-
( `TRAVEL` ) ) ) ).
59+
( `/sap/opu/odata/DMO/API_FLIGHT_R_V2/` )
60+
( `FLIGHT` ) ) ) ).
6761
6862
ENDMETHOD.
6963
```

0 commit comments

Comments
 (0)