2006 Feb 15 12:28 PM
Hi,
I'm attempting to exclude certain functions from the toolbar of an (editable) alv grid (of class cl_gui_alv_grid).
The problem is that the buttons still show on the toolbar.
My program is based on the SAP example program 'BCALV_EDIT_03'. It would seem that even this example doesn't work as expected.
This is an extract of my code:
-[EXTRACT <b></b>BEGIN]--
*---Restrict generic functions to 'change only'.
* (i.e The user should not be able to add new lines).
DATA ls_exclude TYPE ui_func.
DATA: lt_exclude TYPE ui_functions.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
APPEND ls_exclude TO lt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
APPEND ls_exclude TO lt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
APPEND ls_exclude TO lt_exclude.
*...initialize alv grid
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
is_layout = ps_layout
it_toolbar_excluding = lt_exclude
CHANGING
it_fieldcatalog = pt_fieldcat
it_outtab = pt_outtab.-[EX<b></b>TRACT END]--
Thank You In Advance,
Nhlanhla
2006 Feb 15 12:38 PM
Hi,
i've done similar one, i am able to exclude.
DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.
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.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_CUT.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE_NEW_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_UNDO.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
ENDFORM. " EXCLUDE_TB_FUNCTIONS"can you check the LT_EXCLUDE in debug mode.
regards
vijay
Hi,
I'm attempting to exclude certain functions from the toolbar of an (editable) alv grid (of class cl_gui_alv_grid).
The problem is that the buttons still show on the toolbar.
My program is based on the SAP example program 'BCALV_EDIT_03'. It would seem that even this example doesn't work as expected.
This is an extract of my code:
-[EXTRACT <b></b>BEGIN]--
*---Restrict generic functions to 'change only'.
* (i.e The user should not be able to add new lines).
DATA ls_exclude TYPE ui_func.
DATA: lt_exclude TYPE ui_functions.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
APPEND ls_exclude TO lt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
APPEND ls_exclude TO lt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
APPEND ls_exclude TO lt_exclude.
*...initialize alv grid
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
is_layout = ps_layout
it_toolbar_excluding = lt_exclude
CHANGING
it_fieldcatalog = pt_fieldcat
it_outtab = pt_outtab.-[EX<b></b>TRACT END]--
Thank You In Advance,
Nhlanhla
2006 Feb 15 12:35 PM
2006 Feb 15 1:01 PM
Durairaj,
I've actually had a look at this thread before I logged mine. However, it didn't help.
But thanks for the speedy response.
2006 Feb 15 12:38 PM
Hi,
i've done similar one, i am able to exclude.
DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.
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.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_CUT.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE_NEW_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_UNDO.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
ENDFORM. " EXCLUDE_TB_FUNCTIONS"can you check the LT_EXCLUDE in debug mode.
regards
vijay
2006 Feb 15 12:53 PM
Thank You Kindly Vijay Babu Dudla,
This has solved my problem but I suppose I should ask why?
Clearly there is an intricate combination to excluding these functions.
Nhlanhla
2006 Feb 15 12:57 PM
Hi,
all these are interlinked, so you should exclude all of them together.
regards
vijay
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |