cancel
Showing results for 
Search instead for 
Did you mean: 

How to close the browser window

Former Member
0 Kudos

Hi ,

I have a button in a view and on the click of that button i need to close the browser window.

I wrote the below code

data: l_ref_wdr_test_exit_plug type ref to ig_wdr_test_exit_plug .

l_ref_wdr_test_exit_plug = wd_this->get_wdr_test_exit_plug_ctr( ).

  • l_ref_wdr_test_exit_plug->fire_exit_plg(

  • url = ''

  • ).

l_ref_wdr_test_exit_plug->fire_exit_plg(

close_window = abap_true

). " I am using the exit plug

it opens one popup and says that do you want to close the browser and yes or no.If i click yes it closes the browser but if i click No it shows blank page,but if i click no i want to show the original window

Please let me know the solution

Thanks

Bala Duvvuri

Accepted Solutions (1)

Accepted Solutions (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Exit plug is already fired, hence you cannot get back to your original applicaiton state.

use Suspend and Resume Plugs and navigate to a BSP page in the BSP show the confirmation popup and if NO, fire the resume plug.

http://help.sap.com/saphelp_nw04s/helpdata/en/45/19bf8c16f25d7ae10000000a11466f/frameset.htm

Abhi

Former Member
0 Kudos

Abhi,

I cannot use suspend and resume plugs if i integrate the application in portal.Any other solution

Thanks

Bala Duvvuri

Former Member
0 Kudos

Hi Bala,

Please check the below blog written by Mohammad Anzi, which is exactly suits for your requirement.

/people/mohammed.anzys/blog/2007/06/05/how-to-close-parent-window-in-webdynpro-applications

Answers (3)

Answers (3)

former_member262988
Active Contributor
0 Kudos

Hi,

DATA: l_view_cntr TYPE REF TO if_wd_view_controller.
  DATA: l_win_cntr TYPE REF TO if_wd_window_controller.
  DATA: l_parameter TYPE wdr_event_parameter.
  DATA: l_parameter_list TYPE wdr_event_parameter_list.
  DATA: l_val TYPE REF TO data.

  FIELD-SYMBOLS <fs> TYPE ANY.

  l_view_cntr = wd_this->wd_get_api( ).
  l_win_cntr = l_view_cntr->get_embedding_window_ctlr( ).
  l_parameter-name ='CLOSE_WINDOW'.

  CREATE DATA l_val TYPE c.
  ASSIGN l_val->* TO <fs>.
  <fs> = 'X'.
  l_parameter-value = l_val.

  INSERT l_parameter INTO TABLE l_parameter_list.
  l_win_cntr->if_wd_view_controller~fire_plug(
   EXPORTING plug_name = 'OP_EXIT'
          parameters = l_parameter_list ).

Thanks,

Shailaja Ainala.

Former Member
0 Kudos

This can be solved using an exit plug. Please go through th below steps:

1. Create an outbound plug in the Window. This should be of type Exit plug.

2. Specify a parameter to the plug-> Parameter CLOSE_WINDOW TYPE BOOLEAN.

3. Create Usage of this Window in the view in which you require the Close window button.

4. Go to Onaction method of Clos window (Any name) button in your view and give the following coding.

DATA lo_ytest_filter TYPE REF TO ig_your web dynpro component name.

lo_ytest_filter = wd_this->get_your web dynpro component name_ctr( ).

lo_ytest_filter->fire_Your plug name_plg(

close_window = 'X' " boolean

).

Former Member
0 Kudos

Hi,

These are similar threads

May be of some help to you

[]

[]

[]

[]