Fire Methods SAP ABAP Web Dynpro

A Fire method is a special kind of method generated by the Framework when we define an outbound plug.We need inbound plugs and outbound plugs to define the navigation between two views.These plugs are the entry and the exit point for each view.We create an example,a WD component that has two Views. The WD component structure is presented.

WD component structure

WD component structure

In this case, we want to navigate from the view V_VIEW1 to the view V_VIEW2, when the Framework triggers an event handler method, respective when the user presses a button.In the COMPONENTCONTROLLER,we create a context node PERSON, Cardinality 1...1,Singleton and one attribute NAME of string type.

Context structure

Context structure

The data stored in the context of the component controller are used within the two views V_VIEW1 and V_VIEW2, through context mapping.

View V_VIEW1 layout

View V_VIEW1 layout

View V_VIEW2 layout

View V_VIEW2 layout

When the user presses the Next button,we want to navigate from the view V_VIEW1 to the view V_VIEW2.The view V_VIEW1 will be replaced with the view V_VIEW2. This navigation is possible through a navigation link between the views, in the window.

Plugs and navigation

Plugs and navigation

To set up navigation between our views, we must create an inbound plug for the view V_VIEW2 and an outbound plug for the V_VIEW1.In the Outbound Plug tab of the view V_VIEW1, we create an outbound plug named OP_TO_V_VIEW2.

Out bound plug

Out bound plug

In the Inbound plug tab of the view V_VIEW2,we create an inbound plug named IP_V_VIEW2.

In bound plug

In bound plug

When the user presses the Next button,the Framework triggers the event handler method onactionnext.Every time we create an outbound plug for a view,a special method is added to its interface. This method has the statement FIRE_<NAME_OUTBOUND_PLUG>_PLG. To fire this method, we can use the Web Dynpro CodeWizard or select an outbound plug when creating an Action.

The event handler method has the following statement:

METHOD onactionnext .
wd_this->fire_op_to_v_view2_plg( ).
ENDMETHOD.

Creating an action

Creating an action

We use the self-reference WD_THIS of the view controller to fire the method FIRE_OP_TO_V_VIEW2_PLG that was added to this interface when we have created the outbound plug.

All the views within a window can be connected to each other by using navigation links.To be able to create the navigation,we embed the views in the window and then we drag & drop the outbound plug to the inbound plug. We can also create navigation by right-clicking on the output plug name.

Creating navigation link

Creating navigation link

At runtime, when the user interacts with the view V_VIEW1, his interaction will cause a request to the server.In response, the view V_VIEW1 will be replaced with the view V_VIEW2. This is possible through the navigation link defined between these views.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

SAP ABAP Web Dynpro Topics