2007 Oct 23 6:57 AM
Hi ABAPers,
I am replcing the standard action of BACK button of an ALV report with number of editable field.I want , whenever users press BACK button , it will ask wheteher want to save the changes of the record of the editable field of the ALV report or not.
I am using the following code for this purpose.
gs_event_exit-ucomm = '&F03'.
gs_event_exit-before = 'X'.
append gs_event_exit to gt_event_exit.
data answer(3).
CASE r_ucomm.
WHEN '&F03'. " BACK BUTTON
CALL FUNCTION 'POPUP_TO_CONFIRM_DATA_LOSS'
EXPORTING
* DEFAULTOPTION = 'J'
titel = ' '
* START_COLUMN = 25
* START_ROW = 6
IMPORTING
ANSWER = answer.
if answer ne 'J'.
leave program.
else.
r_ucomm = '&DATA_SAVE'.
endif.
<b><u>But the problem is that -
the popup is coming twice .</u>
Can anybody help me to make it single time.</b>
<i><b>Regards
Debjani</b></i>
Hi ABAPers,
I am replcing the standard action of BACK button of an ALV report with number of editable field.I want , whenever users press BACK button , it will ask wheteher want to save the changes of the record of the editable field of the ALV report or not.
I am using the following code for this purpose.
gs_event_exit-ucomm = '&F03'.
gs_event_exit-before = 'X'.
append gs_event_exit to gt_event_exit.
data answer(3).
CASE r_ucomm.
WHEN '&F03'. " BACK BUTTON
CALL FUNCTION 'POPUP_TO_CONFIRM_DATA_LOSS'
EXPORTING
* DEFAULTOPTION = 'J'
titel = ' '
* START_COLUMN = 25
* START_ROW = 6
IMPORTING
ANSWER = answer.
if answer ne 'J'.
leave program.
else.
r_ucomm = '&DATA_SAVE'.
endif.
<b><u>But the problem is that -
the popup is coming twice .</u>
Can anybody help me to make it single time.</b>
<i><b>Regards
Debjani</b></i>
2007 Oct 23 7:01 AM
2007 Oct 23 7:04 AM
CASE r_ucomm.
WHEN '&F03'. " BACK BUTTON
sy-lsind = 1. "Please add this code
CALL FUNCTION 'POPUP_TO_CONFIRM_DATA_LOSS'
EXPORTING
* DEFAULTOPTION = 'J'
titel = ' '
* START_COLUMN = 25
* START_ROW = 6
IMPORTING
ANSWER = answer.
if answer ne 'J'.
leave program.
else.
r_ucomm = '&DATA_SAVE'.
endif.
2007 Oct 23 8:03 AM
2007 Oct 23 8:10 AM
It's because you are keep on appending the data in gt_event_exit.
You need to append this entry only once. Bexcause with user interaction this event is getting appended multiple times and that's why the pop-up is coming again and again.
Please check it in debug mode.
2007 Oct 23 8:22 AM
Hi Richa,
i have debug the code. but the problem is not that u are saying.
the problem is when r_ucomm is not going to chage from &F03 to &DATASAVE in first run.
debjani.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |