cancel
Showing results for 
Search instead for 
Did you mean: 

How To Open "PopupTo Confirm" dialog window from a normal popup window?

suman_kumar16
Participant
0 Kudos

Hi,

   My requirement is to open a confirmation window after closing popup window on the screen......So when i click submit button on Browser(main screen) a popup view should display with some custom buttons(e.g close/yes etc etc) ...And again when I click on a button for instance "yes" ....then the 1st popup window should  close and a confirmation window should come with some messages on it.... how to do it..

Thanks

Suman Kumar 

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Suman,

Your requirement can be achieved as below

  • Create an action 'YES' in your view
  • Create an attribute GO_WINDOW of type IF_WD_WINDOW in view
  • Create a window "W_POPUP" for showing as popup
  • To open a popup window write the below code  


  DATA lo_window_manager TYPE REF TO if_wd_window_manager.

  DATA lo_api_component  TYPE REF TO if_wd_component.

  DATA lo_window         TYPE REF TO if_wd_window.

  lo_api_component  = wd_comp_controller->wd_get_api( ).

  lo_window_manager = lo_api_component->get_window_manager( ).

  wd_this->go_window         = lo_window_manager->create_window(

                     window_name            = 'W_POPUP'

*                    title                  =

                    close_in_any_case      = abap_FALSE

                     message_display_mode   = if_wd_window=>co_msg_display_mode_none

*                    close_button           = abap_true

                     button_kind            = if_wd_window=>co_buttons_ok

                     message_type           = if_wd_window=>co_msg_type_none

                     default_button         = if_wd_window=>co_button_ok

                     ).

   

"subscribe to the action "YES'

        wd_this->go_window->subscribe_to_button_event(
     
EXPORTING
        button           
= if_wd_window=>co_button_ok
        action_name      
= 'YES'
        action_view      
= wd_this->wd_get_api( )

   
).

  wd_this->go_window->open( ).

  • Now, Go to event handler method ONACTIONYES and write the below code

        " to close window

               wd_this->go_window->close( ).

          " to open popup window write the below code

  DATA lo_window_manager TYPE REF TO if_wd_window_manager.

  DATA lo_api_component  TYPE REF TO if_wd_component.

  DATA lo_window         TYPE REF TO if_wd_window.

  DATA lt_message TYPE string_table.

  DATA ls_message TYPE string.

  ls_message = 'Do you want to continue'.

  APPEND ls_message TO lt_message.

  lo_api_component  = wd_comp_controller->wd_get_api( ).

  lo_window_manager = lo_api_component->get_window_manager( ).

  lo_window         = lo_window_manager->create_popup_to_confirm(

      text                 = lt_message

      button_kind          = 3

          message_type         = if_wd_window=>co_msg_type_warning

      close_button         = abap_false

      window_title = 'Confirmation box'

  ).

     lo_window->open( ).

Hope this resolves your issue.

Regards,

Rama

suman_kumar16
Participant
0 Kudos

Hi Rama,

           Thank you very much this is my exact requirement. Its working fine.

former_member5006
Participant
0 Kudos

Hi,

    for  your requirement requirement search in google.com with

create popup to confirm sap webdynpro

so that you will find a first pdf docuement .

In this document you can get everything about your requirement ..

This link will direct  to  opening your pdf file..

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40bbbbf6-4fec-2e10-4fa1-b57866732...

Answers (0)