Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

popup_to_confirm and popup_to_inform in webdynpro

Hi all,

My requirement is when a user clicks on 'DELETE' button I need to show a confirmation message having options 'yes' & 'No' similar to using function module 'popup_to_confirm'.

I know how to display normal error/success messages but not sure how to do it.

I have checked message manger methods but there is no such type of message.

I have tried calling function module 'popup_to_confirm' directly but it is not working.

Also, once user clicks on Yes/No, I need to show and information message in small popup

( similar to message i000 with 'text to be shown' )

I have tried calling popup_to_inform for this but it is going for short dump.

Please suggest me how can I achieve these functionalities in webdynpro.

Note: I have searched forums but could not get solution for my requirement.

Thanks!

Former Member
replied

Please follow below sample code:

DATA:
    lrf_component                  TYPE REF TO if_wd_component,
    lrf_window_manager       TYPE REF TO if_wd_window_manager.


  lrf_component      = wd_this->wd_get_api( ).
  lrf_window_manager = lrf_component->get_window_manager( ).


  IF wd_this->rf_popup_info IS INITIAL.

    wd_this->rf_popup_info = lrf_window_manager->create_window(
             window_name   = 'W_POPUP_INFO'
             title         = lh_text
             button_kind   = if_wd_window=>co_buttons_okcancel
             message_type  = if_wd_window=>co_msg_type_none
             close_button  = abap_false ).

    wd_this->rf_popup_info->subscribe_to_button_event(
      button            = if_wd_window=>co_button_ok
      action_name       = ih_action_yes
      action_view       = irf_view_api
      is_default_button = abap_false ).

    lh_text = 'text'.

    wd_this->rf_popup_info->subscribe_to_button_event(
      button            = if_wd_window=>co_button_cancel
      action_name       = ih_action_no
      action_view       = irf_view_api
      button_text       = lh_text
      is_default_button = abap_true ).

    wd_this->rf_popup_info->set_remove_on_close( abap_false ).
    wd_this->rf_popup_info->set_window_position( position = if_wd_window=>co_center ).

  ENDIF.

  wd_this->rf_popup_info->open( ).

HERE: RF_POPUP_INFO TYPE REF TO IF_WD_WINDOW and declared in attributes.

You W_POPUP_INFO an window.

You can follow the same approach but method would be "create_popup_to_confirm" with an input if table

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question