|Home • Trainings • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us|
Reusability of components in Web Dynpro for ABAP
and Configure View Controller and Interface Controller:
Before you can call the Interface
Controller method of the used component you have to declare that the view
controller can use the Interface Controller of the used component. By default
only the component controller can access used components directly, view
controllers have to specify this explicitly. Therefore go to the tab Properties
of the SEARCH, click the button Create
Controller Use and select the INTERFACECONTROLLER
of the FLIGHTS component
Now go to methods tab of SEARCH view and
implement the method ONACTIONSEARCH.
To get the flights information based on input
information we will write below code.
we need Carrier Id and Connection Id then we will pass these values to Method
GET_FLIGHT_DETAILS of used component ZDEMO_FLIGHTS to retrieve the flights
details. To get the value of the Context node SEARCH use code wizard of
Application tool bar.
Context Node/Attribute and click the input help (1). Select SEARCH (2)
node in the appearing context viewer.
wizard will generate the necessary coding to get the carrier id and connection
id from the input fields and stores it in a structure STRU_SEARCH.
Position the cursor at the end of the
generated code and call the code wizard again to generate the coding to call the
Interface Controller method. Choose Method Call in Used Controller (1) Select
the INTERFACECONTROLLER of the used component (2) Select the input help of the
Method input field (3) and choose the GET_FLIGHT_DETAILS method (4)
wizard will generate the coding for calling the Interface Controller’s
GET_FLIGHT_DETAILS method and pass the parameters to the method.
Creation of a Web Dynpro Application and Execution:
Activate all objects of Web Dynpro component ZDEMO_SEARCH_FLIGHTS.
Click on the Web Dynpro component ZDEMO_SEARCH_FLIGHTS in the object tree and
open the context menu to create a new application.
Test the Application.
The result of the application is like:
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM
©2006-2007 SAPTechnical.COM. All rights reserved.
product names are trademarks of their respective companies. SAPTechnical.COM
is in no way affiliated with SAP AG.
Graphic Design by Round the Bend Wizards