Using Supply Function Method in Web Dynpro

...Previous 

Now create a Node under FLIGHT_LIST called BOOKINGS refers to SBOOK Dictionary Structure and give the Supply Function called GET_BOOKINGS.

Now click Add Attribute from structure. 

 

Select these from the list and click ok. 

 

Now you can see the BOOKING node under the FLIGHT_LIST 

 

Now create a view called FLIGHTLISTVIEW 

 

Now on the context tab of the FLIGHTLISTVIEW drag and drop the nodes from the component controller. 

 

Now Design the Layout as shown below

Create a button called SEARCH and action is GET_FLIGHTS 

Create two table called TABLE1 and TABLE2.

Bind the Table

  • TABLE1 with FLIGHT_LIST

  • TABLE2 with BOOKINGS

Now write the code in the GET_BOOKINGS  in the COMPONENTCONTROLLER.

METHOD GET_BOOKINGS .
  DATA: ITAB_BOOKINGS TYPE IF_COMPONENTCONTROLLER=>ELEMENTS_BOOKINGS,
        STRU_BOOKINGS LIKE LINE OF ITAB_BOOKINGS,
        STRU_FLIGHTLIST TYPE IF_COMPONENTCONTROLLER=>ELEMENT_FLIGHT_LIST.
  PARENT_ELEMENT->GET_STATIC_ATTRIBUTES(
        IMPORTING STATIC_ATTRIBUTES = STRU_FLIGHTLIST ).
  ITAB_BOOKINGS = ZCL_WDABAP_FLIGHT_MODEL=>GET_BOOKINGS(
        CARRID = STRU_FLIGHTLIST-AIRLINEID
        CONNID = STRU_FLIGHTLIST-CONNECTID
        FLDATE = STRU_FLIGHTLIST-FLIGHTDATE ).
  NODE->BIND_TABLE( ITAB_BOOKINGS ).
ENDMETHOD.
Now write the code in the ONACTIONGET_FLIGHTS  Event Handler in the FLIGHTLISTVIEW.
method ONACTIONGET_FLIGHTS .
WD_COMP_CONTROLLER->EXECUTE_BAPI_FLIGHT_GETLIST(  ).
endmethod.

Now Create a Web Dynpro Application and save and activate all. 

Output

 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image