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

Back button in classical ALV

Former Member
0 Likes
655

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>

5 REPLIES 5
Read only

Former Member
0 Likes
623

Hi,

Clear the ok code once you call the popup.

Regards,

Niyaz

Read only

Former Member
0 Likes
623


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.


Read only

0 Likes
623

Hi Niyaz and Prashant,

still it is coming twice.

regards

Debjani

Read only

Former Member
0 Likes
623

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.

Read only

0 Likes
623

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.