Professional Documents
Culture Documents
05 3 Solution Table 2
05 3 Solution Table 2
Solution
3 Developing
3-3 Create the supply function for the newly created context node
BOOKINGTAB
1
Singleton
Solution
Stay on the Context tab of the component controller and enter
BOOKINGS_READ as Supply Function for context node BOOKINGTAB.
Double-click on the supply function BOOKINGS_READ to navigate into the
editor.
Insert the source code for doing the following:
- Get the attributes of the parent element (= node FLIGHTTAB)
- Read the appropriate bookings from database table SBOOK into an
internal table.
Hint: Use carrid, connid and fldate in the where clause.
- Bind the internal table to the context node BOOKINGTAB.
method BOOKINGS_READ .
data:
Stru_flight type IF_COMPONENTCONTROLLER=>Element_Flightinfo,
Itab_Booking type IF_COMPONENTCONTROLLER=>Elements_Bookingtab.
* read bookings
select * from sbook
into corresponding fields of table Itab_Booking
where carrid = Stru_flight-carrid
and connid = Stru_flight-connid
and fldate = Stru_flight-fldate.
endmethod.
2
Singleton
Solution
3
Singleton
Solution