Hi,
for your requirementd you have to create a view where you have to put your text message, then create the window (e.g. W_POPUP) and embed the view in it. On the view, also create the actions for buttons Yes and No .
After that, on the action you want to call the popup, put this 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_buttons TYPE wdr_popup_button_list.
*DATA ls_buttons LIKE LINE OF lt_buttons.
*DATA ls_canc_action TYPE wdr_popup_button_action.
DATA w TYPE REF TO if_wd_window.
DATA:L_TEXT TYPE STRING_TABLE,
ls_text LIKE LINE OF l_text.
DATA:l_api TYPE REF TO if_wd_view_controller.
lo_api_component = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
lo_window = lo_window_manager->CREATE_WINDOW(
window_name = 'W_POPUP'
title = 'Error'
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_ok
).
lo_window->open( ).
l_api = wd_this->wd_get_api( ).
lo_window->subscribe_to_button_event(
EXPORTING
button = if_wd_window=>co_button_yes
* button_text =
* tooltip =
action_name = 'YES'
action_view = l_api " Web Dynpro: View Controller
is_default_button = ABAP_FALSE
).
lo_window->subscribe_to_button_event(
EXPORTING
button = if_wd_window=>co_button_no
* button_text =
* tooltip =
action_name = 'NO'
action_view = l_api " Web Dynpro: View Controller
is_default_button = ABAP_FALSE
).
lo_window->open( ).
Hope it helps,
Dora