‎2009 Feb 18 12:55 PM
hello,
i wanted to know if we can have a confirmation message...
eg, i have a screen through which i change the data of a database table... when i press the 'SAVE'
button, the data is changed in the table and an information pops up saying 'DATA SAVED
SUCCESSFULLY!!!', but if i make changes in screen and then press 'BACK' button, the data is
not saved in the database table... at this point before leaving for previous page i want to have a
confirmation message asking if 'the changed data has to be saved or not'...
on the dailog if user says 'yes' then the same page should remain, and if user says 'no',
then leave to previous page... this happens in notepad and e1 in word...
can this be done in abap???
‎2009 Feb 18 1:10 PM
Try FM
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Pop Up to confirm'
text_question = w_question
text_button_1 = 'Yes'(001)
text_button_2 = 'No'(002)
default_button = '2'
display_cancel_button = ' '
start_column = 40
start_row = 10
IMPORTING
answer = l_answer " Retuns which button is preesed ie. YES or NO
EXCEPTIONS
text_not_found = 1
OTHERS = 2.Now based on the importing parameter l_answer write you logic
‎2009 Feb 18 12:58 PM
Hi Aarthi,
Yes. It is possible in ABAP. When you press BACK, you can call the FM: POPUP_TO_CONFIRM.
This will raise a message (You can decide what is the message) and aYES/ NO button.
Based on that you can either save the data or show the previous page.
Thank you.
Best Regards,
Ram.
‎2009 Feb 18 1:00 PM
‎2009 Feb 18 1:00 PM
Hi,
I think you need to Check just after update table.
IF sy-subrc EQ 0.
MESSAGE: 'OK' TYPE 'I'.
ELSE.
MESSAGE: 'Not OK' TYPE 'I'.
ENDIF.Hope will solve out your problem,
Kind Regards,
Faisal
‎2009 Feb 18 1:00 PM
Hello Aarti,
Yes it can be achived in ABAP too. Take a look at the ergonomic examples in the Object Navigator ( SE80 ) in the menu Environment>Examples>Ergonomic examples --> Screens.
In there, look for Prompts under the title Dynamics.
regards,
Advait
Edited by: Advait Gode on Feb 18, 2009 2:01 PM
‎2009 Feb 18 1:10 PM
Try FM
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Pop Up to confirm'
text_question = w_question
text_button_1 = 'Yes'(001)
text_button_2 = 'No'(002)
default_button = '2'
display_cancel_button = ' '
start_column = 40
start_row = 10
IMPORTING
answer = l_answer " Retuns which button is preesed ie. YES or NO
EXCEPTIONS
text_not_found = 1
OTHERS = 2.Now based on the importing parameter l_answer write you logic