2008 May 20 12:55 PM
Dear All,
I want to insert a message box, title 'Do you want to proceed' 'which has two buttons 'yes' and 'no', before saving a document.When user press 'yes' the document should be saved and for 'no' the transaction should be terminated. Is it possible to develop such a message box using ABAP? If yes, please tell how.
Regards,
nikhil
2008 May 20 12:59 PM
Something like this
PERFORM ask_to_update.
CASE popup_ans.
WHEN '1'. " Yes
* Save your document
* WHEN 'A'. " Cancel "<== If you add a Cancel Button
WHEN OTHERS.
LEAVE TO SCREEN 0.
ENDCASE.
*&---------------------------------------------------------------------*
*& Form ask_to_update
*&---------------------------------------------------------------------*
FORM ask_to_update.
CLEAR popup_ans.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Lead Lender Maintenance'
text_question = 'Changes not saved, Do you want to Save?'
text_button_1 = 'Yes'
text_button_2 = 'No'
DISPLAY_CANCEL_BUTTON = space
IMPORTING
answer = popup_ans.
ENDFORM. " ask_to_update
Edited by: Paul Chapman on May 20, 2008 8:00 AM
2008 May 20 12:59 PM
Something like this
PERFORM ask_to_update.
CASE popup_ans.
WHEN '1'. " Yes
* Save your document
* WHEN 'A'. " Cancel "<== If you add a Cancel Button
WHEN OTHERS.
LEAVE TO SCREEN 0.
ENDCASE.
*&---------------------------------------------------------------------*
*& Form ask_to_update
*&---------------------------------------------------------------------*
FORM ask_to_update.
CLEAR popup_ans.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Lead Lender Maintenance'
text_question = 'Changes not saved, Do you want to Save?'
text_button_1 = 'Yes'
text_button_2 = 'No'
DISPLAY_CANCEL_BUTTON = space
IMPORTING
answer = popup_ans.
ENDFORM. " ask_to_update
Edited by: Paul Chapman on May 20, 2008 8:00 AM
2008 May 20 1:00 PM
Hi,
You may use function module: DD_POPUP_TO_CONFIRM_CANCEL
Hope it helps,
Chang
2008 May 20 1:03 PM
Hi Nikhil,
Check this sample code.
********************************************************************
CALL FUNCTION 'POPUP_WITH_2_BUTTONS_TO_CHOOSE'
EXPORTING
defaultoption = text-005 u201C 1
diagnosetext1 = text-006 u201CDo you want to SAVE the
data
textline1 = text-007 u201CClick Yes to save the data/No to
cancel the saving
text_option1 = text-011 u201C yes
text_option2 = text-012 u201C no
titel = text-008 u201C For saving
IMPORTING
answer = n_1.
IF n_1 <> 1.
-
ELSE.
-
ENDIF.
**********************************************************************
Hope this is helpful to you. If you need further information, revert back.
Reward all the helpful answers.
Regards
Nagaraj T
2008 May 20 1:04 PM
Hi,
Usef this function module POPUP_TO_CONFIRM.
Cheers.
...Reward if useful