Show TOC

Stopping ApplicationsLocate this document in the navigation structure

There are three ways of terminating a Web Dynpro application:

  • Triggering an exit plug from an interface view. When the application is stopped using the exit plug, the navigation controlled by the application is called one last time to display a user-defined last page.
  • Executing a redirect when using an exit plug. In this case, the value of the application property LogoffURL must be passed as the parameter URL for the exit plug. Note that the user is not logged off when the Web Dynpro application is terminated by an exit plug call.
  • Calling the methodWDClientUser.forceLogoffClientUser(null). This method determines the Web address defined in LogoffURL and redirects the user to this address.The user is automatically logged off. If the application property LogOffURL is not defined, the logoff page predefined by Web Dynpro is displayed.
Prerequisites

Web Dynpro DC, the required component with interface view as well as the view user interface units have been defined.

Procedure

The following steps describe how to terminate the application using an exit plug with a parameter defined for the URL. This procedure is recommended by SAP, because after the termination of a Web Dynpro application the user is not logged off when executing a Web Dynpro application on the SAP NetWeaver Portal.

  1. Define an exit plug in an interface view of your local component interface which is displayed in the Web Dynpro Explorer view. Either use the default interface view, or create a new one. Open the Controller Editor with its plugs, and create an exit plug within the outbound plug table (via New).
  2. Follow the wizard, and enter the name Url for the parameter and select string as the type. This parameter is case-sensitive and must be entered exactly this way.
  3. Repeat step 1 and 2 for the window.
  4. Go to your view, define an action with name Exit and use the default event handler named onActionExit().
  5. In the view layout, define a button and bind its onAction event to the Exit action. To do so, start the View Designer on the view unit (Open → View Editor, choose Layout tab).
  6. Select any empty area in the View Designer. The Properties for the current view unit appears.
  7. In the Reference tab, define usage of the Component Controller of your WD Component.
  8. Switch to the view controller coding; Choose tab Methods, and then press F3 on method name to start the editor with the implementation (.java file). Add the following method coding:
      //@@begin onActionExit(ServerEvent)
      StringlogoffURL = wdComponentAPI.getApplication().getApplicationInfo().findInApplicationProperties("sap.logoffURL").getValue();
    wdThis.wdGetTimeCompInterfaceViewController().wdFirePlugExit(logoffURL);
     //@@end
    Note

    When using predefined application properties, the name must be passed as the parameter that appears in the Application properties.