Show TOC

Window Plugs: Startup and ExitLocate this document in the navigation structure

Use

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 should be used only if it is also available to the window interface.

Components can be accessed externally using any plug that is defined as a startup plug. When you create a Web Dynpro application for this interface view, only those plugs defined as startup plugs are available 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.

In the latter two cases the LOGOFF parameter is available (see below).

Caution

In a portal environment, the exit plug may be used only with the CLOSE_WINDOW parameter. It is not permitted to navigate to another application by passing a URL.

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 pass the 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

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 ).

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.

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:

method ONACTIONGO_EXIT .
data: L_REF_MAIN_WINDOW type ref to IG_MAIN_WINDOW . 
  L_REF_MAIN_WINDOW =   WD_THIS->GET_MAIN_WINDOW_CTR( ). 
  L_REF_MAIN_WINDOW->FIRE_MY_EXIT_PLUG_PLG(     URL =   'http://www.sap.com' ). 
endmethod.
            

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, without closing the first application, but simply suspending it in order to return to it later.

More information : Suspend Calls .

Closing with the Logoff Parameter

You can pass the LOGOFF parameter to an exit plug. The security session is deleted in the back end. With stand-alone cases the SS02 ticket is also deleted.

Note

Note that if the security session is active, it is always deleted.

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