‎2007 Jun 20 4:31 PM
how can i add a command button to an alv application toolbar. i am using REUSE_ALV_GRID_DISPLAY
‎2007 Jun 20 4:40 PM
Hi,
Check in this thread for my reply..
https://forums.sdn.sap.com/click.jspa?searchID=3308234&messageID=3279312
Thanks
Naren
‎2007 Jun 20 4:40 PM
Hi,
Check in this thread for my reply..
https://forums.sdn.sap.com/click.jspa?searchID=3308234&messageID=3279312
Thanks
Naren
‎2007 Jun 20 4:45 PM
You must copy the status from the standard in function group SALV and modify it. Then you need to pass the name of call back form routine in which you will set the new status.
For example. see in this call we are passing the SET_PF_STATUS_SDO to the i_callback_pf_status-set as well as the REPID to the i_callback_program. This tells the alv to comeback to this program to set the status.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = repid
i_callback_pf_status_set = 'SET_PF_STATUS_SDO'
i_callback_user_command = 'HANDLE_USER_COMMAND_SDO'
is_layout = ilayout
it_fieldcat = ifc
it_sort = isort
i_grid_title = xgrid_title
tables
t_outtab = ialv_sdo
exceptions
program_error = 1
others = 2.
Then you need to have the FORM routine in this program.
form set_pf_status_sdo using rt_extab type slis_t_extab.
set pf-status 'STANDARD'.
endform.
Again make sure to copy the standard ALV toolbar from the funciton group SALV into your program and modify it. Then call this status like in the FORM above.
Regards,
Rich Heilman
‎2007 Jun 21 5:34 AM
hi,
check these ones:
Standard Buttons:
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/webDynproABAP-ALVControllingStandard+Buttons&
alv-pfstatus:
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_pfstatus.htm
then how to capture that button click.
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_ucomm.htm
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_rowsel.htm
‎2007 Jun 21 5:44 AM
Hi
Following are the steps for the same...
1) Define the button in se41 with ur program and status name.
2) use the command set pf status <status name>
3) code as per ur requirement...
Hope this helps to solve ur problem....
<b>do reward if useful....</b>
regards
dinesh
‎2007 Jun 21 6:01 AM
Hi,
follow this sample program.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
<b> I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'</b>
i_grid_title = lc_grid_title
is_layout = lc_layout
it_fieldcat = gt_fieldcat
it_sort = sort
i_save = l_save
is_reprep_id = l_bbs_id
is_variant = l_variant
tables
t_outtab = <internal-table> " output table
exceptions
program_error = 1
others = 2.
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZSTANDARD'.
ENDFORM. "Set_pf_status
The parameters in capitals are the extra ones that need to be added.
<b>or</b>
follow this sample program.
<b>BCALV_GRID_08</b>
regards,
Ashokreddy.
‎2007 Jun 21 6:47 AM
Willard,
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = W_REPID
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
FORM SET_PF_STATUS
USING P_EXTAB TYPE SLIS_T_EXTAB. "#EC CALLED
Set the pf status for CHG BOM button
SET PF-STATUS 'STAT1' EXCLUDING P_EXTAB.
ENDFORM. "top_of_page
FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
P_SELFLD TYPE SLIS_SELFIELD.
case p_ucomm.
when '<FCODE for your button'.
do somethind
endcase.
ENDFORM.
YOu must create the pf status STAT1 in se41 by copying a pf status STANDARD of the program saplkkbl and adding an extra button to the copied pf status.
Don't forget to reward if useful...