‎2009 Sep 01 7:31 PM
Hi
How to add an own abap code to standard ALV refresh button?
I don't want to add a new button but use standard.
‎2009 Sep 01 8:03 PM
Your question is not clear.
Do you wanted to add your own code in the standard alv refresh button ? I think sy-ucomm for refresh is &REFRESH.
Pl provide more details
a®
‎2009 Sep 02 5:36 AM
‎2009 Sep 02 5:46 AM
Hi,
Try this code ==>
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND' " Write your subroutine for this as shown below
it_fieldcat = t_fielcat_modify_data
TABLES
t_outtab = t_lineitemdisplay
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&REFRESH'.
"----Your Code Here------"
WHEN OTHERS.
ENDCASE.
‎2009 Sep 02 6:05 AM
Hi,
I think you remove the standard Referesh Button from the PF Status. Add your own button and write the logic in the PAI Event.
Regards
Sunil
‎2009 Sep 02 6:50 AM
Hi Kosmo,
you can achieve that very easily by using the events table if you are using 'REUSE_ALV_GRID_DISPLAY' function module to display the ALV grid....
declare and fill the events table this way...
data t_events type table of SLIS_T_EVENT.
data fs_events like line of t_events.
fs_events-name = 'REFRESH'.
FS_EVENTS-FORM = 'USER_COMMAND'.Now in the function module REUSE_ALV_GRID_DISPLAY
under theexporting parameter mention
IT_EVENTS = t_eventsalso note that you must have the subroutine with the name user_command
Regards,
Siddarth
‎2009 Sep 02 7:07 AM