cancel
Showing results for 
Search instead for 
Did you mean: 

Closing of IE window

SagarSontakke
Active Participant
0 Kudos

Hello All,

I have an application where WD4A is lauched from UWL. Its approval form application developed with Approve and Reject button. Whenever user approve or reject application, IE window should close automatically.

Regards,

Sagar S

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi SVS,

Use the Exit Plug and define a close_window parameter of associated type wdy_boolean, for that Exit Plug.

And whenever you want the window to be closed, use the below code.

DATA: l_ref_form TYPE REF TO ig_form.

l_ref_form = wd_this->get_form_ctr( ).

l_ref_form->fire_go_exit_plg(

close_window = abap_true ).

Hope, this works.

Regards,

-Syed.

Answers (3)

Answers (3)

SagarSontakke
Active Participant
0 Kudos

Hello Mohamed,

Pls find below details of my WD application.

View Name = "MAIN".

Window name = "W_WINDOW".

View main is embedded in window "W_WINDOW". There is also button on the view named "CLOSE WINDOW". on this button action i have writtrn the code given by you. but refence to window lo_Window always comes null. am i missing something?

Regards,

Sagar

Former Member
0 Kudos

Hi,

Define one outbound EXIT plug in window.

Define a close_window parameter of associated type wdy_boolean, for that Exit Plug.

Write the following code in event handler method for u r button "CLOSE WINDOW".

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 = 'EXIT_PLUG' parameters = l_parameter_list ).

Hope this will help.

Thanks & Regards

Naveen.

Former Member
0 Kudos

DATA: lo_api TYPE REF TO if_wd_view_controller,

lo_window TYPE REF TO if_wd_window,

lo_window_ctlr TYPE REF TO if_wd_window_controller.

lo_api = wd_this->wd_get_api( ).

lo_window_ctlr = lo_api->get_embedding_window_ctlr( ).

  • get the control for window to be closed

lo_window = lo_window_ctlr->get_window( ).

  • this will close the window

lo_window->close( ).

You can add this code after doing all your processing in both the buttons.

This may help you.

Edited by: Mohamed Aslam on Feb 10, 2010 6:12 AM

Former Member
0 Kudos

Hi,

If approve and reject button are on the application itself then you can close the app by you using following piece of code

data lo_api_controller type ref to if_wd_view_controller.
  data lo_window type REF TO IF_WD_WINDOW.

  lo_api_controller = wd_this->wd_get_api( ).
  lo_window = lo_api_controller->GET_EMBEDDING_WINDOW( ).

*close window
  lo_window->CLOSE( ).

Regards

Manas Dua