‎2007 Dec 18 9:53 AM
Hi,
I am using ALV Grid display function module to display data. I have set the parameter 'I_CALLBACK_USER_COMMAND to 'User_Command' in the FM.
Now i am defining as->
Form User_Command Using R_Ucomm like SY-UCOMM.
CASE R_Ucomm.
WHEN 'RET' (Fn code for button)
LEAVE TO LIST-PROCESSING.
ENDCASE.
The program creates a dump with the error:
'The subroutine USER_COMMAND has 1 formal parameters while it is called with more than two actual parameters.
Plz help to solve the issue.
‎2007 Dec 18 10:45 AM
Hi
See the example code
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = i_repid
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = header
is_layout = gt_layout
i_callback_top_of_page = 'TOP-OF-PAGE1'
i_grid_title = text-t35
it_sort = gt_sort[]
i_default = 'X'
i_save = 'U'
is_variant = gt_variant
it_events = gt_events
TABLES
t_outtab = ITAB.
clear itab.
----
FORM USER_COMMAND
----
FORM USER_COMMAND USING u_ucomm LIKE sy-ucomm
us_selfield TYPE slis_selfield."#EC CALLED
CASE u_ucomm.
when '&IC1'.
if us_selfield-fieldname = 'BELNR'.
read table ITAB index us_selfield-tabindex.
set parameter id 'PER' field ITAB-PERNR.
set parameter id 'BLN' field us_selfield-value.
set parameter id 'GJR' field itab-gjahr.
set parameter id 'BUK' field itab-bukrs.
call transaction 'FB03' and skip first screen.
endif.
ENDCASE.
ENDFORM. " USER_COMMAND_PERNR
Regards
Pavan
‎2007 Dec 18 3:04 PM
the form name must be 'USER_COMMAND' in the Fun. module. It is a case sensitive.
and routine for this is:
FORM user_command USING r_ucomm LIKE sy-ucomm
lv_selfield TYPE slis_selfield.
endform.
‎2008 Oct 16 8:17 AM
Hi
See the example code
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = i_repid
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = header
is_layout = gt_layout
i_callback_top_of_page = 'TOP-OF-PAGE1'
i_grid_title = text-t35
it_sort = gt_sort[]
i_default = 'X'
i_save = 'U'
is_variant = gt_variant
it_events = gt_events
TABLES
t_outtab = ITAB.
clear itab.
----
FORM USER_COMMAND
----
FORM USER_COMMAND USING u_ucomm LIKE sy-ucomm
us_selfield TYPE slis_selfield."#EC CALLED
CASE u_ucomm.
when '&IC1'.
if us_selfield-fieldname = 'BELNR'.
read table ITAB index us_selfield-tabindex.
set parameter id 'PER' field ITAB-PERNR.
set parameter id 'BLN' field us_selfield-value.
set parameter id 'GJR' field itab-gjahr.
set parameter id 'BUK' field itab-bukrs.
call transaction 'FB03' and skip first screen.
endif.
ENDCASE.
ENDFORM. " USER_COMMAND_PERNR
Regards
Pavan
‎2008 Oct 16 8:29 AM
‎2008 Oct 16 9:54 AM
I've asked the moderators to investigate that question. I wonder if someone has got hold of his id?