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).
- Create a button on your view and assign an action to the event onAction.
- Create the method for the action with following code.
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.


Regards,
Ben Meijs
The previous way was complicated for us as only the administrators have authorizations on the SICF transaction (which was needed to close the window)
Instead of closing the window. It it leaves behind a blank window.
thanks
Please advise.
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
This code works fine to me. Thank you very much.
Works great! Thanks!