05-27-2008 3:13 PM
Hi,
In ALV Grid Display we have Sort Ascending, Sort Descending, Totals, Subtotals ,Print Preview, mail recipient,ABC analysys and Graphic etc buttons.Now I want to remove mail recipient,ABC analysys and Graphic buttons in ALV Grid Display.How can I do this One?.
05-27-2008 3:24 PM
Hi,
YOu can prepare one internal table of type 'SLIS_T_EXTAB OPTIONAL' and append the Fcodes which you want to remove from your grid. YOu can simply get the Function codes by putting '/H' in command field then click enter then after click the button which you want to delete, then check the sy-ucomm and append the value to the newly created above said internal table. Pass this table to exporting parameters (IT_EXCLUDING) of FM 'REUSE_ALV_GRID_DISPLAY'.
Rgds,
Bujji
05-27-2008 3:18 PM
You can achieve this by filling appropriate function codes in the table parameter : IT_EXCLUDING of the FM REUSE_ALV_GRID_DISPLAY.
Regards,
Naimesh Patel
05-27-2008 3:18 PM
Hello,
Please see this: .
PERFORM alv_excl. ( g_r_excl TYPE ui_functions . )
FORM alv_excl.
APPEND cl_gui_alv_grid=>mc_mb_sum TO g_r_excl.
APPEND cl_gui_alv_grid=>mc_mb_subtot TO g_r_excl.
APPEND cl_gui_alv_grid=>mc_fc_graph TO g_r_excl.
APPEND cl_gui_alv_grid=>mc_fc_info TO g_r_excl.
APPEND cl_gui_alv_grid=>mc_fc_print_back TO g_r_excl.
ENDFORM. " alv_excl
CALL METHOD g_r_grid->set_table_for_first_display
EXPORTING
is_layout = g_r_layo
is_variant = g_r_variant
it_toolbar_excluding = g_r_excl
i_save = 'X'
CHANGING
it_outtab = g_t_yetprint[]
it_fieldcatalog = g_t_fieldcat.
You can get the user-command constants in the class CL_GUI_ALV_GRID.
Regards.
05-27-2008 3:21 PM
hi,
You have to create a exclude list to your PF-STATUS.
try like this :
set pf-status 'MY-PF excluding NO_PF
You can create the internal table NO_PF like below
DATA:BEGIN OF NO_PF OCCURS 10,
FCODE,
END OF NO_PF.
then you can add you ucomms whichi you do not want and set the PF.
Regards,
Himanshu Verma
05-27-2008 3:22 PM
Hi, declare a class in your program like this...
INCLUDE <icon>.
DATA: gs_toolbar TYPE stb_button.
DATA: event_receiver TYPE REF TO lcl_event_receiver.
----
CLASS lcl_event_receiver DEFINITION
----
*
----
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive.
PRIVATE SECTION.
ENDCLASS. "lcl_event_receiver DEFINITION
----
CLASS lcl_event_receiver IMPLEMENTATION
----
*
----
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_toolbar.
Here put your condition to delete or add buttons, in this example
delete according to icon name
DELETE e_object->mt_toolbar
WHERE icon <> icon_sort_up AND
icon <> icon_sort_down AND
icon <> icon_select_detail AND
icon <> icon_filter AND
icon <> icon_search AND
icon <> icon_search_next.
ENDMETHOD. "handle_toolbar
ENDCLASS. "lcl_event_receiver IMPLEMENTATION
Implement the class after show the ALV
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_toolbar FOR ALL INSTANCES.
05-27-2008 3:24 PM
Hi,
YOu can prepare one internal table of type 'SLIS_T_EXTAB OPTIONAL' and append the Fcodes which you want to remove from your grid. YOu can simply get the Function codes by putting '/H' in command field then click enter then after click the button which you want to delete, then check the sy-ucomm and append the value to the newly created above said internal table. Pass this table to exporting parameters (IT_EXCLUDING) of FM 'REUSE_ALV_GRID_DISPLAY'.
Rgds,
Bujji