Skip to Content
Former Member
Nov 24, 2012 at 10:24 AM

Pop Up window not getting closed.


Hi experts,

I have a main window W1 and a view V1 embedded in it, popup window W2 and view V2 embedded in it.

On a click of button B1 from view V1 popup window W2 will get open with view V2 having button B2.

Now my requirement is that on click of button B2 form the popup screen i have to fire an event,

which is declared in the component controller and handled in view V1.

Below are the details:

gv_popup type ref to if_wd_window. (Defined in component controller attributes)

Z_EVENT : Declared in component controller.

On action B1 in main window W1:

DATA: lr_view TYPE REF TO if_wd_view_controller,
lr_api_main TYPE REF TO if_wd_component,
lr_window_man TYPE REF TO if_wd_window_manager.

lr_view = wd_this->wd_get_api( ).
lr_api_main = wd_comp_controller->wd_get_api( ).
lr_window_man = lr_api_main->get_window_manager( ).

*Creating the Popup Window

CALL METHOD lr_window_man->create_window
* modal = abap_false
window_name = 'W2'
title = 'Pop Up'
close_button = abap_true
window = wd_comp_controller->gv_popup.

* Opening popup window
wd_comp_controller->gv_popup->open( ).

On action B2 in popup window W2:

wd_comp_controller->gv_popup->close( ).
wd_comp_controller->fire_Z_EVENT_evt( ).

Now the problem here is that event is getting triggered but popup window is not getting closed.

If i am simply closing the window and not firing the event, it is getting closed.

I have tried closing the window in the event handler in view V1 but no success.

In side the event handler m calling another application which will leave this application on suspended mode,

i think here is the problem. Because when i commented the code to call the another application the window gets closed.

Thanks in advance..