Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

To Display message box.

Former Member
0 Likes
2,464

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,188

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

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

4 REPLIES 4
Read only

Former Member
0 Likes
1,189

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

Read only

Former Member
0 Likes
1,188

Hi,

You may use function module: DD_POPUP_TO_CONFIRM_CANCEL

Hope it helps,

Chang

Read only

Former Member
0 Likes
1,188

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

Read only

Former Member
0 Likes
1,188

Hi,

Usef this function module POPUP_TO_CONFIRM.

Cheers.

...Reward if useful