Hi,
Please find the screenshot below:
You should create a custom class in your program with a method say "HANDLE_USER_COMMAND". the method needs to be declared as per the event in the above screenshot.
Eg: HANDLE_USER_COMMAND FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID. For the parameters to be passed, refer the parameters of the event "USER_COMMAND".
After all the above steps, implement the method HANDLE_USER_COMMAND inside the class implementation.
METHOD HANDLE_USER_COMMAND
CASE E_UCOMM. "E_UCOMM is the parameter of the event USER_COMMAND.
WHEN 'Your Function Code".
""Do the needful code as per the requirement.
ENDCASE.
ENDMETHOD.
Thank You.