Creating Actions and Declaring Methods

To trigger display of the flight data from the SAP system, in the SearchView, you need to create an action that can be bound to a UI element, such as a button. You can then implement the event handler, which reacts to this action.

Prerequisites

The structure of your project TutWD_FlightList_Init is currently displayed in the Web Dynpro Explorer.

Procedure

Creating the Search action

...

       1.      Open the View Designer for the SearchView.

       2.      Choose the Actions tab.

       3.      Choose the New pushbutton.

You can create a new action in the wizard that appears.

       4.      Enter the name Search for this new action, leave the other settings unchanged, and choose Finish.

An event handler, onActionSearch, is automatically created for this new action.

Declaring the executeBapi_Flight_Getlist_Input() method

       1.      Open the editor for the custom controller FlightListCust again.

       2.      Choose the Methods tab.

       3.      Choose New.

       4.      Select the Method option and choose Next.

       5.      In the wizard screen that appears, enter the name executeBapi_Flight_Getlist_Input for this new method and assign it the return type void. Choose Finish.

The method executeBapi_Flight_Getlist_Input is added to the custom controller.

       6.      Save the new metadata by choosing the icon  (Save All Metadata) from the toolbar.

Result

You have created the Search action for the SearchView. In the next step, you will bind it to the appropriate button using the Source property.

You have also declared a new method executeBapi_Flight_Getlist_Input for the custom controller. Later, you will use this method to implement the adaptive RFC to the SAP system.

Next step:

Editing the UI Elements