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

problem in messages

Former Member
0 Likes
557

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???

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
537

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

5 REPLIES 5
Read only

Former Member
0 Likes
537

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.

Read only

Former Member
0 Likes
537

Use 'POPUP_TO_CONFIRM' function module.

Read only

faisalatsap
Active Contributor
0 Likes
537

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

Read only

Former Member
0 Likes
537

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

Read only

Former Member
0 Likes
538

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