cancel
Showing results for 
Search instead for 
Did you mean: 

Close a popup and open a new one

Former Member
0 Kudos

I've to open a new pop up from an already opened popup and close the open popup. Bleow is my code . But it closes the open pop up but not opening the new pop up. what should be done to open the new one and close the exiting one?

lr_component = wd_comp_controller->wd_get_api( ).

lr_window_manager = lr_component->get_window_manager( ).

lr_popup = lr_window_manager->create_window(

modal = abap_true

window_name = 'REQ_ITEM_WD'

button_kind = if_wd_window=>co_buttons_close

title = 'Info' ).

CHECK lr_popup IS BOUND.

lr_popup->set_window_position( position = if_wd_window=>co_center ).

lr_popup->set_close_in_any_case( abap_true ).

lr_popup->open( ).

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( ).

lo_window->close( ).

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Got it working. Just changed the way I call the close and open. It should be close first and then open.

Former Member
0 Kudos

Hi Ramesh ,

i think you have to specify the window name when you controling more that one windows try by passing the windo name in that close method .

DATA: l_api TYPE REF TO if_wd_view_controller,

l_window_ctlr TYPE REF TO if_wd_window_controller,

l_popup TYPE REF TO if_wd_window.

l_api = wd_this->wd_get_api( ).

l_window_ctlr = l_api->get_embedding_window_ctlr( ).

IF l_window_ctlr IS BOUND.

l_popup = l_window_ctlr->get_window( ).

l_popup->close( 'L_POPUP' ).

ENDIF.

REAGARDS

CHINNAIYA . P