Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

OO ALV pf-status problem

Hi friends,

in oo alv when after you run the report, you see the default pf-elements like 'copy text','insert with overwrite','insert row', 'delete row',duplicate row',etc...

I dont want these items to display. How can i get rid of them? Any way please?

Thanks in advance.

Former Member
Former Member replied

Hi,

Before Displaying the ALV list you can write a subroutine to hide the toolbar buttons.

Here is the sample code:-

perform f_set_grid_toolbar changing g_t_toolbar_func.

FORM f_set_grid_toolbar CHANGING p_toolbar_func TYPE ui_functions.

DATA : g_t_toolbar_func TYPE ui_functions,

wa_toolbar_func TYPE UI_FUNC.

wa_toolbar_func = CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.

APPEND wa_toolbar_func TO p_toolbar_func.

wa_toolbar_func = CL_GUI_ALV_GRID=>MC_FC_LOC_DELETE_ROW.

APPEND wa_toolbar_func TO p_toolbar_func.

wa_toolbar_func = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY_ROW.

APPEND wa_toolbar_func TO p_toolbar_func.

wa_toolbar_func = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE_NEW_ROW.

APPEND wa_toolbar_func TO p_toolbar_func.

"you can find more attributes in the CL_GUI_ALV_GRID class"

ENDFORM.

and write call method set_table_for_first_display

CALL METHOD o_grid->set_table_for_first_display " o_grid is the instance for class CL_GUI_ALV_GRID

EXPORTING

is_variant = wa_variant

i_save = 'A'

is_layout = "work area for layout

it_toolbar_excluding = g_t_toolbar_func

CHANGING

it_outtab = "output table for display

it_fieldcatalog = " internal table for field catalog

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

Let me know if it is helpful.

Thanks.....

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question