2007 Mar 14 1:21 PM
Hello all,
I am writing an ALV report using classes and methods. I have two status bars. In the first one I placed custom buttons. The second standard status bar has all the buttons like Refresh , Add / Delete rows, Sorting and so on.....
I want to exclude(do not show) some of these buttons like sort buttons and refresh button. How can I do this?
2007 Mar 14 1:44 PM
Hi Raju,
CL_GUI_ALV_GRID=>MC_FC_REFRESH
CL_GUI_ALV_GRID=>MC_FC_SORT_ASC
CL_GUI_ALV_GRID=>MC_FC_SORT_DSC
You can look via se24 and CL_GUI_ALV_GRID and than parameters.
There are some more.
Hope it helps.
regards, Dieter
Hi Dieter,
Can you give me the function codes(methods) for Refresh button, sort in ascending and sort in descending. I just want to exclude these three buttons.
2007 Mar 14 1:25 PM
Hello Raju,
Check this:
method handle_context.
data:
t_fcode_list type UI_FUNCTIONS.
if t_fcode_list is initial.
append CL_GUI_ALV_GRID=>MC_FC_SORT_ASC TO T_FCODE_LIST.
append CL_GUI_ALV_GRID=>MC_FC_SORT_DSC TO T_FCODE_LIST.
endif.
CALL METHOD OBJ_CT->HIDE_FUNCTIONS
EXPORTING
FCODES = t_fcode_list.
call method cl_gui_cfw=>flush.
endmethod
2007 Mar 14 1:27 PM
2007 Mar 14 1:28 PM
CLASS LCL_EVENT_RECEIVER DEFINITION DEFERRED.
CLASS LCL_EVENT_RECEIVER DEFINITION.
PUBLIC SECTION.
*method to handle toolbar
HANDLE_TOOLBAR
FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
IMPORTING E_OBJECT E_INTERACTIVE.
ENDCLASS.
CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.
METHOD HANDLE_TOOLBAR.
DATA: WA_TOOLBAR TYPE STB_BUTTON.
CLEAR WA_TOOLBAR.
LOOP AT E_OBJECT->MT_TOOLBAR INTO WA_TOOLBAR.
IF WA_TOOLBAR-FUNCTION = '&&SEP01' OR
WA_TOOLBAR-FUNCTION = '&LOCAL&CUT' OR
WA_TOOLBAR-FUNCTION = '&LOCAL©' OR
WA_TOOLBAR-FUNCTION = '&LOCAL&PASTE' OR
WA_TOOLBAR-FUNCTION = '&LOCAL&UNDO' OR
WA_TOOLBAR-FUNCTION = '&LOCAL&APPEND' OR
WA_TOOLBAR-FUNCTION = '&LOCAL&INSERT_ROW' OR
WA_TOOLBAR-FUNCTION = '&LOCAL&DELETE_ROW' OR
WA_TOOLBAR-FUNCTION = '&LOCAL©_ROW' OR
WA_TOOLBAR-FUNCTION = '&MB_SUBTOT' OR
WA_TOOLBAR-FUNCTION = '&MB_SUM'.
<b>DELETE E_OBJECT->MT_TOOLBAR INDEX SY-TABIX.</b>
ENDIF.
ENDLOOP.
ENDMETHOD. "handle_toolbar
ENDCLASS. "lcl_event_receiver IMPLEMENTATION
*sets double click event
SET HANDLER W_EVENT_RECEIVER->HANDLE_DOUBLE_CLICK FOR W_GRID.
2007 Mar 14 1:33 PM
hi Raju,
i do it in this way:
<b> PERFORM EXCL_BUTTON.</b>
*
Grid aufrufen
CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
<b> IT_TOOLBAR_EXCLUDING = GT_EXCLUDE</b>
IS_LAYOUT = GS_LAYOUT
IS_VARIANT = GS_VARIANT
I_SAVE = 'X'
CHANGING
IT_FIELDCATALOG = GT_FIELDCAT
IT_OUTTAB = ITAB.
*
<b>FORM EXCL_BUTTON.
Buttons ausschliessen
Sall
GS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_SELECT_ALL.
APPEND GS_EXCLUDE TO GT_EXCLUDE.
Dall
GS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_DESELECT_ALL.
APPEND GS_EXCLUDE TO GT_EXCLUDE.
Summ
GS_EXCLUDE = CL_GUI_ALV_GRID=>MC_MB_SUM.
APPEND GS_EXCLUDE TO GT_EXCLUDE.
Zwischensumme
GS_EXCLUDE = CL_GUI_ALV_GRID=>MC_MB_SUBTOT.
APPEND GS_EXCLUDE TO GT_EXCLUDE.
*
ENDFORM. "excl_button</b>
Regards, Dieter
2007 Mar 14 1:36 PM
Hi Dieter,
Can you give me the function codes(methods) for Refresh button, sort in ascending and sort in descending. I just want to exclude these three buttons.
2007 Mar 14 1:48 PM
2007 Mar 14 1:44 PM
Hi Raju,
CL_GUI_ALV_GRID=>MC_FC_REFRESH
CL_GUI_ALV_GRID=>MC_FC_SORT_ASC
CL_GUI_ALV_GRID=>MC_FC_SORT_DSC
You can look via se24 and CL_GUI_ALV_GRID and than parameters.
There are some more.
Hope it helps.
regards, Dieter
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |