08-31-2007 3:06 PM
How can we code the back button of this alv?
When the user clicked on F3 or clicked on back button I want to do something else.
But I do not know how to code it.Thanks.
08-31-2007 3:15 PM
Hi deniz,
1. Things won't work if we do normal things.
2. The important things are :
a) New PF-STATUS is required , say 'ABCD'.
b) Handle user_commmand
3. First of all, from Function group SALV,
copy the STANDARD gui status to your program,
from SE80, by right clicking.
4. come to your program.
start-of-selection.
SET PF-STATUS 'ABCD'.
5. Double click ABCD and activate the gui status.
6. In gui status,
in those green buttons and yellow buton,
write BACK1 in both.
ie. buttons with fcode BACK1.
Save and activate.
6. AT USER-COMMAND.
IF sy-ucomm = 'BACK1'.
DATA : answer TYPE c.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Do You Want To Exit ?'
text_question = 'Do You Want To Exit ?'
IMPORTING
answer = answer
EXCEPTIONS
text_not_found = 1
OTHERS = 2.
IF answer = '1'.
SET USER-COMMAND 'BACK'.
ENDIF.
ENDIF.
This will solve your problem.
I tried at my end, it works fantastic.
regards,
amit m.
08-31-2007 3:21 PM
Just a little confused here, so you are calling the function module REUSE_DISPLAY_ALV_GRID, which when you do so actually throws another screen with its own gui status. When you click "BACK" or "EXIT" from this screen, you want to do some additional processing, right? So here is my confustion, if you call the functino module and the only way to get out of the function call is to click the back button, then why not simply put your addiontial logic directly after the call to REUSE_DISPLAY_ALV_GRID. Please let me know if I'm missing something.
Regards,
Rich Heilman
08-31-2007 3:27 PM
Thank you rich, you are right.
I mean to how use ES_EXIT_CAUSED_BY_USER
It has some values for back exit cancel buttons of alv.
When the user clicked on, for example back button, I want to do some additional thing, such as freeing ftp.
Thanks all.
08-31-2007 3:21 PM
hi
good
i think you can use the menu painter to create a back button on your alv screen.
thanks
mrutyun^