cancel
Showing results for 
Search instead for 
Did you mean: 

Closing popup in web dynpro

Former Member
0 Kudos

Hi,

i am new to web dynpro , can somebody tell hoe can i close a custom popup from a close button which is available in the same popup.

Thanks in advance

Regards,

JM

Accepted Solutions (1)

Accepted Solutions (1)

Gowtham
Contributor
0 Kudos

Hi John,

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

Answers (2)

Answers (2)

harsha_jalakam
Active Contributor
0 Kudos

Hi John,

If you are looking to close a pop up window on a particular button event, please implement the following code in the event handler method.

DATA:

    lo_api          TYPE REF TO if_wd_view_controller,

    lo_window_ctlr  TYPE REF TO if_wd_window_controller,

    lo_popup        TYPE REF TO if_wd_window.

  lo_api         = wd_this->wd_get_api( ).

lo_window_ctlr = lo_api->get_embedding_window_ctlr( ).

  IF lo_window_ctlr IS BOUND.

    lo_popup = lo_window_ctlr->get_window( ).

    lo_popup->close( ).

  ENDIF.

Regards,

Harsha

santhu_gowdaz
Active Contributor
0 Kudos