OOALV kullanırken araç çubuğundan butonları nasıl çıkaracağımızı öğrenelim.
( E : Let's learn at how to exclude buttons from the toolbar while using OOALV. )
⭐ Gerekli veri tanımlamaları ( E : Required data definitions )
DATA : gs_exclude TYPE ui_func,
gt_exclude TYPE ui_functions.
⭐ CL_GUI_ALV_GRID sınıfının özniteliklerinde 'MC' ile başlayan bazı öznitelikler vardır. Bu öznitelikler sabittir ve bir initial değere sahiptir. Bu initial değerler butonlara atanan fonksiyon kodunu (Fct Code) tutar. Çıkarmak istediğimiz butonların fonksiyon kodlarını aşağıdaki gibi bir tabloya ekleyelim.
( E : In the attributes of the CL_GUI_ALV_GRID class there are some attributes that start with 'MC'. These attributes are constant and have an initial value. These initial values hold the function code (Fct Code) assigned to the buttons. Let's add the function codes of the buttons we want to remove to a table as follows. )
METHOD exclude_buttons.
APPEND gs_exclude TO gt_exclude.
gs_exclude = cl_gui_alv_grid=>mc_fc_views.
APPEND gs_exclude TO gt_exclude.
APPEND gs_exclude TO gt_exclude.
APPEND gs_exclude TO gt_exclude.
ENDMETHOD.
CALL METHOD grd->set_table_for_first_display
EXPORTING
i_save = 'A'
is_layout = gs_layout
it_toolbar_excluding = gt_exclude
CHANGING
it_outtab = gt_data[]
it_fieldcatalog = gt_fcat.
ENDMETHOD.
SET PF-STATUS 'STATUS100'.
SET TITLEBAR 'TTLBAR100'.
IF go_custom_container IS INITIAL.
go_data->create_container( ).
go_data->set_fieldcatalog( ).
go_data->set_layout( ).
go_data->exclude_buttons( ).
go_data->display_data( ).
ELSE.
CALL METHOD go_alv_grid->refresh_table_display.
ENDIF.
ENDMODULE.
⭐ ALV toolbardan buton çıkarma ile ilgili demo programın kodlarını Github hesabımda paylaştım.
( E : I shared the codes of the demo program for excluding buttons from the ALV toolbar on my Github account. )
⭐ Bu yazımda değindiğim ALV toolbardan buton çıkarmaya dair kodlara ZDEV_R_EXCLUDE_BUTTONS programından erişebilirsiniz.
( E : You can access the codes for excluding buttons from the ALV toolbar, which I mentioned in this article, from the ZDEV_R_EXCLUDE_BUTTONS program. )
⭐ Demo programa ait ekran görüntüsü aşağıdaki gibidir.
( E : The screenshot of the demo program is as follows. )
Yorumlar
Yorum Gönder