12-13-2005 4:14 PM
Hi,
is it possible to hide button in standard ALV ?
Thanks
Regards,
12-13-2005 4:18 PM
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).
*
<b> PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.</b>
*
* Set selection mode to "D" -- Multiple Lines
LAYOUT-SEL_MODE = 'D'.
CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = LAYOUT
<b> IT_TOOLBAR_EXCLUDING = LT_EXCLUDE</b>
IS_VARIANT = VARIANT
I_SAVE = 'A'
I_STRUCTURE_NAME = 'IALV'
CHANGING
IT_OUTTAB = IALV[]
IT_FIELDCATALOG = FIELDCAT[].
*
*
<b>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.</b>
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*
Regards,
Rich Heilman
12-13-2005 4:18 PM
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).
*
<b> PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.</b>
*
* Set selection mode to "D" -- Multiple Lines
LAYOUT-SEL_MODE = 'D'.
CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = LAYOUT
<b> IT_TOOLBAR_EXCLUDING = LT_EXCLUDE</b>
IS_VARIANT = VARIANT
I_SAVE = 'A'
I_STRUCTURE_NAME = 'IALV'
CHANGING
IT_OUTTAB = IALV[]
IT_FIELDCATALOG = FIELDCAT[].
*
*
<b>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.</b>
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*
Regards,
Rich Heilman
12-13-2005 4:22 PM
Hi
Yes! but 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.
Max
12-13-2005 5:10 PM