Steps to add a refresh button in ALV grid display.
1. Copying status "STANDARD" from program "SAPLKKBL". Go to transaction code SE41 and follow the screenshot to copy the status.
2. Assign refresh button in the status. Go to SE41. Put the custom program and status name we have just copied. Click on the "Change" button. Add the refresh button with function code and icon.
3. Set PF STATUS in the program just before the "REUSE_ALV_GRID_DISPLAY" function module.
4. Enable i_callback_user_command and i_callback_pf_status_set in the "REUSE_ALV_GRID_DISPLAY" function module
5. Write the subroutine for get data which will populate the internal table after click on refresh button.
6. Write the subroutine for "USER_COMMAND_LOG".
r_selfield TYPE slis_selfield. "#EC CALLED
CASE u_ucomm.
WHEN '&REF'.
PERFORM get_data. " Refresh data, get the latest data from database to the output table.
r_selfield-refresh = 'X'.
r_selfield-col_stable = 'X'.
r_selfield-row_stable = 'X'.
ENDCASE.
ENDFORM. "user_command
7. You will find the new button in the application toolbar.
Comments
Post a Comment