Show TOC

Background documentationWindow Plugs: Startup and Exit Locate this document in the navigation structure

 

Like Web Dynpro views, each Web Dynpro window has Inbound and Outbound Plugs. Any number of these plugs can be defined as startup or exit plugs.

startup plug

The startup plug is a special inbound plug.

The Startup property, which you can define on the Inbound Plugs tab page in the window editor, declares for the inbound plug the option to instantiate a component and to start a new application. For this reason a startup plug can be used only if it is also available to the window interface.

Components can be accessed by external programs using plugs that were defined as startup plugs. So if you want to create a Web Dynpro application for this interface view, only plugs that can be flagged as startup plugs can be provided for the application. Since at least one inbound plug of a Web Dynpro window must always be defined as a startup plug, you can find a startup plug with the name DEFAULT on the Inbound Plugs tab page.

Exit Plug

The exit plug is a special outbound plug.

If a Web Dynpro window is closed by means of an exit plug, the associated application is ended automatically. For this reason an exit plug can only be used if it is available to the interface view of the window.

An exit plug always closes an application. This can happen in the following ways:

  • The application is closed.

  • The application and the browser window are closed.

    You do this using the CLOSE_WINDOW function (parameter CLOSE_WINDOW).

  • The application is closed and the system navigates to another URL.

Caution Caution

In a portal environment only CLOSE_WINDOW can be used; exit plugs are not permitted.

End of the caution.
Close and CLOSE_WINDOW Parameter

You can add parameter CLOSE_WINDOW of type WDY_BOOLEAN to an exit plug, and when the plug is triggered you enter value ABAP_TRUE, which the framework uses to close the window.

You can use method GET_IS_CLOSE_WINDOW_SUPPORTED of interface IF_WD_APPLICATION to query whether or not the prerequisites for using CLOSE_WINDOW are fulfilled.

You can find an example in the system in the Web Dynpro application WDR_TEST_EXIT_WITH_CLOSE.

Caution Caution

CLOSE_WINDOW overrides the WorkProtect mode in the portal, that is, for CLOSE_WINDOW=TRUE there is no WorkProtect popup (for example, message: You have unsaved data).

End of the caution.

More Information: Restrictions in CLOSE WINDOW Functions

Close and URL Navigation

Exit plugs have the special property that they use the defined URL parameter. After you have created the URL parameter in the parameter list on the Outbound Plugs tab page in the window editor, you can specify a value for this parameter in the method that calls the exit plug.

The parameter is optional; a value does not have to be defined for it.

Syntax Syntax

In the following source code a windows exit plug is called by an event handler method in the controller of an embedded view, and it specifies an external URL:

  1. method ONACTIONGO_EXIT .
  2. data: L_REF_MAIN_WINDOW type ref to IG_MAIN_WINDOW . 
  3.   L_REF_MAIN_WINDOW =   WD_THIS->GET_MAIN_WINDOW_CTR( ). 
  4.   L_REF_MAIN_WINDOW->FIRE_MY_EXIT_PLUG_PLG(     URL =   'http://www.sap.com' ). 
  5. endmethod.
End of the source code.

An application that closes in this way closes the active component instance and goes to the specified Web application.

You also can leave an application to go to a second application, while not closing the first application, but suspending it in order to return to it later.

More Information: Suspend Calls.

Inbound and Outbound Plug Parameters

As with all window plugs you can use startup and exit plugs with mandatory or optional parameters. These parameters must be of type STRING or TIHTTPNVP.

More Information: Window: Inbound and Outbound Plug Parameters