cancel
Showing results for 
Search instead for 
Did you mean: 

PopUp Window

Former Member
0 Kudos

Hi All,

I am new to Web DynPro ABAP. I am trying to do Popup window application.

Can anyone provide me steps to create a popup window when clicking a button.here popup window contains YES and NO buttons.

Thanks in Advance!

Accepted Solutions (1)

Accepted Solutions (1)

shaik_sajid
Active Contributor
0 Kudos

hi

on some action u want to display popup...

hope this code will help u understand...

"method ONACTIONPOP .
  data:lo_win_manager TYPE REF TO if_wd_window_manager,
        lo_api_component TYPE REF TO if_wd_component,
        lo_window TYPE REF TO if_wd_window.

  lo_api_component = wd_comp_controller->wd_get_api( ).
  lo_win_manager = lo_api_component->get_window_manager( ).
*  lo_window = lo_win_manager->create_window(
*    window_name = 'POP1'
*    title = 'flight details'
*    button_kind = 1 ).
  data: ls_string type STRING_table,
        lv_string type string.
  lv_string = 'r u sure'.
*ls_string = 'W' .
*  insert 'r u sure' INTO TABLE ls_string.
APPEND lv_string to ls_string.
  lo_window = lo_win_manager->create_popup_to_confirm(
    text = ls_string
    button_kind = 1 ).
  lo_window->open( ).

regards

sajid

Former Member
0 Kudos

Hi Sajid,

Thanks for your reply. I got the popup window.But i would like know the coding.

Can you Please explain why to use "ls_string type STRING_table" in the code.

Please give me idia on this.

Thanks !

Former Member
0 Kudos

Hi,

That string table has the value(sitring) that you want to display some text on the POPUP window to give some information to user.

Regards,

Lekha.

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks!

Former Member
0 Kudos

Hi,

Create a button & implement the below code in its action method.

method onactionpopup.

data: l_cmp_api type ref to if_wd_component,

l_window_manager type ref to if_wd_window_manager,

l_popup type ref to if_wd_window,

l_text type string_table,

l_api type ref to if_wd_view_controller.

l_cmp_api = wd_comp_controller->wd_get_api( ).

l_window_manager = l_cmp_api->get_window_manager( ).

insert `Data where changed` into table l_text.

insert `Do you want to save?` into table l_text.

l_popup = l_window_manager->create_popup_to_confirm(

text = l_text

button_kind = if_wd_window=>co_buttons_yesnocancel

message_type = if_wd_window=>co_msg_type_question

window_title = 'Test: Popup to confirm'

window_position = if_wd_window=>co_center ).

l_api = wd_this->wd_get_api( ).

l_popup->subscribe_to_button_event(

button = if_wd_window=>co_button_yes

action_name = 'YES'

action_view = l_api

is_default_button = abap_true ).

l_popup->subscribe_to_button_event(

button = if_wd_window=>co_button_no

action_name = 'NO'

action_view = l_api

is_default_button = abap_false ).

l_popup->subscribe_to_button_event(

button = if_wd_window=>co_button_cancel

action_name = 'CANCEL'

action_view = l_api

is_default_button = abap_false ).

l_popup->open( ).

endmethod.

Hope this will help.

Regards

Shruti