Webdynpro弹窗提醒

实现效果如上图

类似SAP GUI界面的函数 POPUP_TO_CONFIRM

CALL FUNCTION 'POPUP_TO_CONFIRM'

 EXPORTING

   text_question = qus

 IMPORTING

   ANSWER = ans

WDA界面程序:

  l_component_api    = wd_comp_controller->wd_get_api( ).
  l_window_manager   = l_component_api->get_window_manager( ).

  INSERT text INTO TABLE l_message_text .

  l_popup_window = l_window_manager->create_popup_to_confirm(
    text            = l_message_text
    button_kind     = if_wd_window=>co_buttons_yesno
    message_type    = if_wd_window=>co_msg_type_question
    window_title    = title
    window_position = if_wd_window=>co_center
    default_button = if_wd_window=>co_button_yes
    ).
  l_view_controller_api  = wd_this->wd_get_api( ).

  l_popup_window->subscribe_to_button_event(
    button            =   if_wd_window=>co_button_yes
    action_name       =   'SUBMIT_REQUEST'
*    button_text       =   button_text
    action_view       =   l_view_controller_api
    is_default_button =   abap_true ).

  l_popup_window->open( ).

消息文本写入text即可