cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Confirm Message

Former Member
0 Kudos

Hi All,

How to create delete confirm message in Webdynpro ABAP.

Regards,

Arun

Accepted Solutions (1)

Accepted Solutions (1)

former_member230839
Participant
0 Kudos

Hi Arun,

If you want to create the confimrmation message for deletion option follow the code here to create a window which will display a popup to the user for confirmation with 'YES' and 'NO' buttons.

DATA:
    api_component TYPE REF TO if_wd_component,
    window_manager TYPE REF TO if_wd_window_manager,
    window TYPE REF TO if_wd_window.

    api_component = wd_comp_controller->wd_get_api( ).

    window_manager = api_component->get_window_manager( ).


    DATA : msg_tbl TYPE string_table,
           wa_msg LIKE LINE OF msg_tbl.

    MESSAGE w120(mmw_adm_mon) INTO wa_msg. "get the message you want to display in the *popup from a message class
 
   APPEND wa_msg TO msg_tbl. " append that to msg_tbl

    window = window_manager->create_popup_to_confirm(
                   text            = msg_tbl
                   button_kind     = if_wd_window=>co_buttons_yesno "4
                   message_type    = if_wd_window=>co_msg_type_warning "5
                   window_title    = 'Confirmation'
                   window_position = if_wd_window=>co_center )."#EC *

    DATA: view_controller TYPE REF TO if_wd_view_controller.

    view_controller = wd_this->wd_get_api( ).

    DATA: button_text TYPE string,
          tooltip TYPE string.

    button_text = wd_assist->if_wd_component_assistance~get_text(
  '026' ).
    tooltip = wd_assist->if_wd_component_assistance~get_text( '111'
  ).
    CALL METHOD window->subscribe_to_button_event
      EXPORTING
        button            = if_wd_window=>co_button_yes "6
        button_text       = button_text
        tooltip           = tooltip
        action_name       = 'ON_YES'
        action_view       = view_controller
        is_default_button = abap_true.

    button_text = wd_assist->if_wd_component_assistance~get_text(
  '027' ).

  tooltip = space.

*          tooltip = wd_assist->if_wd_component_assistance~get_text( '040'
*  ).
    CALL METHOD window->subscribe_to_button_event
      EXPORTING
        button            = if_wd_window=>co_button_no "7
        button_text       = button_text
        tooltip           = tooltip
        action_name       = 'ON_NO'
        action_view       = view_controller
        is_default_button = abap_false.
    window->open( ).

and create the action methods ON_YES and ON_NO to handle the events.

Regards,

Anil kumar G

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can first create associated actions for these 3 buttons & then you can create the action handlers for these actions. Take a look at the code snippet below:

* Data declaration
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 `Estimation Variant already exist` INTO TABLE L_TEXT.
INSERT `Do you want to modify?` 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 ). "#EC *
 
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( ).

Create Action with the name 'yes', 'no', 'cancel' and write coding as per the requirement.

Regards,

Anusha V.

Former Member
0 Kudos

Thanks for information,

I want to reduce the size of the confirm message.

how can i do that.could you please tell me.

Thanks and Regards,

Arun

Former Member
0 Kudos

dear All,

How can i reduce the size of the confirm message window.

Advance Thanks,

Arun

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Popup windows resize automatically to the inner content. There are some API methods for controlling the size of the popup window, but they do not work yet within the HTML rendering.

Former Member
0 Kudos