How To Use Inbound And Outbound Plugs In SAP Web Dynpro ABAP Programs

In a previous article we have seen how to create a simple SAP Web Dynpro ABAP application with only one view. Now, in this article we modify that application by adding one more view and learn how to navigate between two views using inbound and outbound plugs.

Step 1. Adding Views

1.1 Go to Transaction SE80, choose Web-Dynpro-Comp. / Intf. in the object list and enter the name of your Web Dynpro application (Y_FIRST_WEBDYNPRO) and click on Display.

Adding Views To Object Navigator


1.2 Right click on Views node and select Create.

Right click on Views node and select Create


1.3 Give a name and description to your View and click on “CONTINUE” Continue button.

Entering Name And Description


1.4 Click on “SAVE” button. Now you can see your newly created view.

 

Step 2. Creating Inbound and Outbound plugs

Inbound and outbound plugs are used for navigating between different views.
Inbound plugs define the possible entry points for a view and we use outbound plugs to navigate to another view.

2.1 Click on the Main View and select the ‘Outbound Plugs’ tab.

Selecting The "Outbound Plugs" On The Main View


2.2 Give a name and description to the outbound plug.

Input Name And Description


2.3. Click on “SAVE“.

2.4 Now click on Second_View and select the ‘Inbound Plugs’ tab.

Proceeding To Second_View


2.5 Give a name and description to the outbound plug.

2.6. Click on “SAVE”.

 

Step 3. Embedding the newly created ‘View’ in the ‘Window’

3.1 Double click on the ‘Windows’ node.

On Windows Node Section


3.2 Right click on window ‘Y_FIRST_WEBDYNPRO’ and select ‘Embed View

Selecting "Embed View"


3.3 Now you will see the ‘Embed View’ pop up, and click on the f4 help for the field ‘View to be Embedded’, double click on Second_View.

Clicking On F4 Help For‘View To Be Embedded’ And Double Click On Second_View


3.4 Click on “CONTINUE” button.

 

Step 4. Creating Navigation Link

To be able to navigate from one view to another, an outbound plug of the first view must be linked with the inbound plug of the second view in each case using navigation links.

The navigation links are not defined in the view, but in the window.

4.1 Right click on the ‘Outbound Plug’ ‘TO_SECOND_VIEW’ and select Create Navigation Link.

How To Create Navigation Link


4.2 In the pop up choose destination for navigation by clicking on f4 help of field Dest. View and selecting SECOND_VIEW.

Choosing Destination For Navigation

Choosing Destination For Navigation

Choosing Destination For Navigation

Step 5. Creating a button and assigning action to it

5.1 Go to main view and insert a button UI element.

Inserting A Button UI Element


5.2 Click on create button to add the action to the button.

Adding Action To The Button


5.3 In the Create Action pop-up, give an action name and description.

5.4 Click on Implementation button to insert coding.

How To Insert Coding On The Implementation Button


5.5 Insert the following code between method and end method.

wd_this->fire_to_second_view_plg(    ).

Inserting Code Between Method And End Method


5.5 Click on save and activate.

Output: Right click on the application and select Test to run your application.

How To Test Your Application


Go To Next View


Click on Next View button to go to next view.

Viewing Application


In this tutorial we have seen how to navigate between two views. Similarly, using inbound and outbound plugs we can navigation between any number of views depending on our requirement.

I hope you find this article interesting and of use. If you do, leave me a comment below.

Thanks.

Categories

About the Author:

Pete has been working with SAP technologies for over 10 years. He started out as an ABAP consultant and then moved on to BW where he has worked many different clients covering a wide variety of industries. "I love introducing SAP technology (especially BI) to new clients and showing them how they can go from zero to hero within their business in super fast time". Contact me on twitter @PeterMoxon

4 Comments
  1. siva

    hi Pete it is very help full what u have posted, i have a doubt about pop up windows i.e how to raise pop up windows with out using create_window method of if_wd_window_manager .

  2. sukaniya mishra

    Hey, Thanks for this wonderful explanation with examples.
    Hope it helps me out with a lot of queries in mind.