Skip to Content
Author's profile photo Former Member

How to close main window in Webdynpro for ABAP ?

 I was looking a way to close Webdynpro for ABAP application by a click of a button on my main view.  I found one blog (How to close parent window in Webdynpro applications?. How to close parent window in Webdynpro applications?.) by Mohammed Anzy. Though the method described in this blog works but it requires to create 3 navigational plugs.

The webdynpro window can be closed by using only one navigational plug and little code. The following steps will perform this task.

  • Create an outbound exit plug at your window. Please make the plug type as type 1 ( exit).

 image

  •  Create a button on your view and assign an action to the event onAction.
  • Create the method for the action with following code. 

 image

 First in this method, your view controller instance is created

 l _view_cntr = wd_this->wd_get_api( ).

Then the instance of window controller is obtained from embedded view controller.

  l_win_cntr  = l_view_cntr->get_embedding_window_ctlr( ).

At last, this code calles the window controller’s method Fire_plug to fire the outbound exit plug with parameter CLOSE_WINDOW. That makes the application window close.

This example was tested on ECC 6.0 with service pack 14.

Assigned Tags

      8 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo B. Meijs
      B. Meijs
      Thank you very much. This was exactly what I was looking for.

      Regards,
      Ben Meijs

      Author's profile photo Guillaume GARCIA
      Guillaume GARCIA
      Many thanks for sharing this!

      The previous way was complicated for us as only the administrators have authorizations on the SICF transaction (which was needed to close the window)

      Author's profile photo Former Member
      Former Member
      Hi has anyone implemented for service pack 12.  I tried this method and it didn't work for me.

      Instead of closing the window.  It it leaves behind a blank window.

      thanks

      Author's profile photo Former Member
      Former Member
      i am a newbbie to WD ABAP. I have tried this out in my application and I was getting a dump saying "Parameters of exit plugs and suspend plugs must be of type STRING or TIHTTPNVP". Do you have any idea?
      Author's profile photo Former Member
      Former Member
      I am getting the same error: Parameters of exit plugs and suspend plugs must be of type STRING or TIHTTPNV

      Please advise.

      Author's profile photo Former Member
      Former Member
      I changed the line
        CREATE DATA l_val TYPE c.
      into
        CREATE DATA l_val TYPE string.

      Now it's a different error: URL parameters specified for an exit or suspend plug, but no URL specified

      Author's profile photo Former Member
      Former Member

      This code works fine to me. Thank you very much.

      Author's profile photo Kenneth Moore
      Kenneth Moore

      Works great!  Thanks!