Skip to Content
avatar image
Former Member

Popup Confirmation....!!!!!

Hi SAP CRM Experts,

This is sudhakar, i am new to CRM. I got requirement like, create a toolbar delete button, when i click on delete button it must ask popup confirmation like " Are you want to delete" message in popup  window with yes or no options... i know how to create toolbar delete button and  how to delete the selected record without popup confirmation window. Now i want to know how to get popup confirmation window when i click on delete button, and how can delete the selected record by click on yes option in popup window, where i have to write the code? plz explain with code...

Thanks in advance

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Mar 16, 2013 at 04:29 AM

    Hi Sudhakar,

    In the DELETE Button

      

    DATA: lv_title TYPE string,

    lv_text TYPE string.

    ( confirm_popup is ref to if_bsp_wd_popup   )

    ( windw manager is ref to if_bsp_wd_window_manager   )

    ( create_popup_2_confirm is from if_bsp_wd_window_manager )

    IF confirm_popup IS NOT BOUND.

    lv_title = 'Confirmation'.

    lv_text = 'Do you want to Delete this?'.

    CALL METHOD comp_controller->window_manager->create_popup_2_confirm

    EXPORTING

    iv_title = lv_title

    iv_text = lv_text

    iv_btncombination = if_bsp_wd_window_manager=>co_btncomb_yesno

    RECEIVING

    rv_result = confirm_popup.

    confirm_popup->set_on_close_event( iv_event_name =                                      'CONFIRM'      iv_view = me ).

    ENDIF.

    ( in the above we are making to trigger an event CONFIRM  )

    ( in the confirm event we call the oubound plug )

    data : lv_decision type string.

    lv_decision = lv_popup->get_fired_outbound_plug( ).

    if lv_decision = 'YES'.    "this will get the action from POPUP

    Now Create a event CONFIRM

    In the Confirm write the DELETE code which you have already done

    Regards,

    Satya Prakash

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Harshit Jain

      Hi Harshit,

      Define the popup variable at implementation class level and not a local variable.

      Try following in event handler of accept

        IF gv_popup IS NOT BOUND.

          gv_popup = me->comp_controller->window_manager->CREATE_POPUP_2_CONFIRM(  ).

        ENDIF.

        IF gv_popup IS BOUND.

          gv_popup->open(  ).

          gv_popup->set_on_close_event(  ).

        ENDIF.

  • Mar 16, 2013 at 09:18 AM

    Hi

    CALL FUNCTION 'POPUP_TO_CONFIRM'
                   EXPORTING
    *   TITLEBAR                    = ' '
    *   DIAGNOSE_OBJECT             = ' '
                     text_question               = 'Document No is generated'
                    text_button_1               = 'Yes'(001)
    *   ICON_BUTTON_1               = ' '
                    text_button_2               = 'No'(002)
    *   ICON_BUTTON_2               = ' '
    *   DEFAULT_BUTTON              = '1'
                    display_cancel_button       = ' '
    *   USERDEFINED_F1_HELP         = ' '
    *   START_COLUMN                = 25
    *   START_ROW                   = 6
    *   POPUP_TYPE                  =
    *   IV_QUICKINFO_BUTTON_1       = ' '
    *   IV_QUICKINFO_BUTTON_2       = ' '
                  IMPORTING
                    answer                      = lv_ans
    * TABLES
    *   PARAMETER                   =
                  EXCEPTIONS
                    text_not_found              = 1
                    OTHERS                      = 2
                           .
                 IF sy-subrc <> 0.

               ELSEIF lv_ans EQ '1'.


                ENDIF.

    Regards,

    Prakash.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Prakash,

      Thanks for your reply,

      Let me know Where can i write the code which you send. i mean can i write the code in the Event handler of the Delete button or in any method.

      Once i click on the "Yes" option on Popup Confirmation window, how it goes to delete the record. i mean how we are going provide linkage between yes option and selected field through this FM.

      In Above FM,Which parameters i have to pass in order to satisfy the above two requirements.

      or is there any alternate code to satisfy the above two things.

      Plz reply...

      Regards,

      Sudhakar.