cancel
Showing results for 
Search instead for 
Did you mean: 

Window PopUp Close

Former Member
0 Kudos

Hi Experts,

I want to close the popup window through the action in webdynpro abap???

I have created the button in that view, but i could n't able to write the code.

I got code through SCN, but i didn't understand, how they write it. below mentioned the code.

DATA lv_wc TYPE REF TO IF_WD_WINDOW_CONTROLLER.


data lv_view TYPE REF TO IF_WD_VIEW_CONTROLLER.


data lo_window  type ref to if_wd_window.


lv_view = wd_this->wd_get_api( ).


 
lv_wc = lv_view->GET_EMBEDDING_WINDOW_CTLR( ).

   lo_window = 
lv_wc ->GET_WINDOW( ).

   lo_window->CLOSE( ).


Can anyone explain the code pls????


Thanks

Aditya

Accepted Solutions (0)

Answers (2)

Answers (2)

anurag_abbi_tm
Participant
0 Kudos

Hi,

Step by Step Explanation:


Following is declaration :

DATA lv_wc TYPE REF TO IF_WD_WINDOW_CONTROLLER.

data lv_view TYPE REF TO IF_WD_VIEW_CONTROLLER.

data lo_window  type ref to if_wd_window.


Following is the logic:

" Get the reference of current API and pass it to view.

lv_view = wd_this->wd_get_api( ).  " This is the assumed to be the view in which action is triggered.



" Find out in which window controller is this view controlled and give the reference of that window to lv_wc.
 
lv_wc = lv_view->GET_EMBEDDING_WINDOW_CTLR( ).


" Find the respective window and assign the reference to lo_window.

" This is the window which needs to be closed and also the same window which contains

" the view in which action was triggered.
   lo_window = 
lv_wc ->GET_WINDOW( ).


" Close the window,
   lo_window->CLOSE( ).




Suggestion: Write the above code in the action method.



Gowtham
Contributor
0 Kudos

Hi Aditya,

Create an attribute for the popup window under attributes tab with the type of IF_WD_WINDOW in the desired View.

Then open the popup window with the following code ,

    wd_comp_controller->popup_window  = lo_window_manager->create_window(

                        window_name            = 'W_APP_REJ_POPUP'

                        title                  = 'CAS Approval'

                        close_in_any_case      = abap_false

                        message_display_mode   = if_wd_window=>co_msg_display_mode_selected

                        close_button           = abap_true

                        button_kind            = if_wd_window=>co_buttons_yesno

                        message_type           = if_wd_window=>co_msg_type_none

                        default_button         = if_wd_window=>co_button_yes ).


For closing the popup call this code from the close button:


wd_comp_controller->popup_window->close( ).


- Gowtham