‎2006 Jul 15 6:25 AM
‎2006 Jul 15 8:22 AM
Hi, use 'IT_EXCLUDING' option to exclude buttons.
here is an example
DATA: IT_EXCL_BUTT type SLIS_T_EXTAB.
data: wa_excl_buttons type SLIS_EXTAB.
wa_excl_buttons-fcode = '&OUP'.
append wa_excl_buttons to it_excl_butt.
wa_excl_buttons-fcode = '&ODN'.
append wa_excl_buttons to it_excl_butt.
wa_excl_buttons-fcode = '&ILT'.
append wa_excl_buttons to it_excl_butt.
wa_excl_buttons-fcode = '&UMC'.
append wa_excl_buttons to it_excl_butt.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'ITAB_USER_COMMAND'
is_layout = gs_layout
i_background_id ='CGA'
IT_EXCLUDING = it_excl_butt
i_grid_title ='Employee Cheque Advice'
it_fieldcat = it_fieldcat[]
i_save = g_save
is_variant = g_variant
it_events = gt_events[]
TABLES
t_outtab = itab_post
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.Regards,
Wasim Ahmed
‎2006 Jul 15 8:22 AM
Hi, use 'IT_EXCLUDING' option to exclude buttons.
here is an example
DATA: IT_EXCL_BUTT type SLIS_T_EXTAB.
data: wa_excl_buttons type SLIS_EXTAB.
wa_excl_buttons-fcode = '&OUP'.
append wa_excl_buttons to it_excl_butt.
wa_excl_buttons-fcode = '&ODN'.
append wa_excl_buttons to it_excl_butt.
wa_excl_buttons-fcode = '&ILT'.
append wa_excl_buttons to it_excl_butt.
wa_excl_buttons-fcode = '&UMC'.
append wa_excl_buttons to it_excl_butt.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'ITAB_USER_COMMAND'
is_layout = gs_layout
i_background_id ='CGA'
IT_EXCLUDING = it_excl_butt
i_grid_title ='Employee Cheque Advice'
it_fieldcat = it_fieldcat[]
i_save = g_save
is_variant = g_variant
it_events = gt_events[]
TABLES
t_outtab = itab_post
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.Regards,
Wasim Ahmed
‎2006 Jul 15 8:23 AM
Hi,
pass excluding buttons list to IT_TOOLBAR_EXCLUDING parameter of the Grid display method (Grid->SET_TABLE_FOR_FIRST_DISPLAY), fill the table IT_TOOLBAR_EXCLUDING with values MC_FC_SORT, MC_FC_SORT_ASC, MC_FC_SORT_DSC.. etc .
Regards
Appana
‎2006 Jul 15 8:55 AM
Hi,
GO through the link,
http://help.sap.com/saphelp_47x200/helpdata/en/8d/e994374c9cd355e10000009b38f8cf/frameset.htm
Regards,
Azaz Ali.
‎2006 Jul 15 1:11 PM
Hi Pavan,
If u r using FM u can use the above code but if u r using class do this way-
CALL METHOD ALV->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME =
IS_LAYOUT = GS_LAYOUT
IT_TOOLBAR_EXCLUDING = T_FILTER[]
CHANGING
IT_OUTTAB = T_EQUI_DET[]
IT_FIELDCATALOG = T_FIELDCAT[].
Hope this helps u.
Regards,
Seema.
‎2006 Jul 15 1:51 PM
‎2006 Jul 15 5:54 PM
hi pavan,
Yes. Use the exclude functionality.
Optionally restrict generic functions to 'change only'.
DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
*
(The user shall not be able to add new lines).
*
PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.
*
Set selection mode to "D" -- Multiple Lines
LAYOUT-SEL_MODE = 'D'.
CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = LAYOUT
IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
IS_VARIANT = VARIANT
I_SAVE = 'A'
I_STRUCTURE_NAME = 'IALV'
CHANGING
IT_OUTTAB = IALV[]
IT_FIELDCATALOG = FIELDCAT[].
*
*
FORM EXCLUDE_TB_FUNCTIONS CHANGING PT_EXCLUDE TYPE UI_FUNCTIONS.
Only allow to change data not to create new entries (exclude
generic functions).
DATA LS_EXCLUDE TYPE UI_FUNC.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_DELETE_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_APPEND_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_MOVE_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
ENDFORM.
You can find all of the function codes for the buttons in the class CL_GUI_ALV_GRID, look at the attributes tab, and check out all of the attributes that start with MC_FC*
or
depend on whick kind of ALV you're using.
In REUSE_ALV_LIST_DISPLAY and REUSE_ALV_GRID_DISPLAY you can use the parameter IT_EXCLUDING to indicate which buttons hve to be disactived.
In method SET_TABLE_FOR_FIRST_DISPLAY (of class CL_GUI_ALV_GRID) you can use the parameter IT_TOOLBAR_EXCLUDING.
Regards,
Naveen