Code: Alles auswählen.
wa_excluding = cl_gui_alv_grid=>MC_FC_MAINTAIN_VARIANT.
APPEND wa_excluding TO it_excluding.
CALL METHOD gr_alv_grid->set_table_for_first_display
EXPORTING
is_layout = gs_layout
is_variant = gs_variant
i_save = ' '
it_toolbar_excluding = it_excluding
CHANGING
it_fieldcatalog = gt_feldkatalog
it_outtab = gt_ausgabe.
grid->m_cl_menu_button_variant->hide_functions( VALUE #( ( '&COL0' ) ) )
Danke für die Antwort,black_adept hat geschrieben: Du musst den Funktionscode aus dem zugehörigen Untermenü ausblenden.
grid->m_cl_menu_button_variant->hide_functions( VALUE #( ( '&COL0' ) ) )
Code: Alles auswählen.
wa_excluding = cl_gui_alv_grid=>MC_FC_CURRENT_VARIANT.
APPEND wa_excluding TO it_excluding.
Folgende Benutzer bedankten sich beim Autor black_adept für den Beitrag:
RIG
Code: Alles auswählen.
*&---------------------------------------------------------------------*
*& Report z_alv_layout_load_only
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT z_alv_layout_load_only.
CLASS: lcl_my_gui_alv_grid DEFINITION DEFERRED.
DATA: gr_alv_grid TYPE REF TO lcl_my_gui_alv_grid.
DATA: gs_layout TYPE lvc_s_layo,
gs_variant TYPE disvariant.
DATA: gt_feldkatalog TYPE lvc_t_fcat,
gt_daten TYPE STANDARD TABLE OF sflight,
gt_excluding TYPE ui_functions.
CLASS lcl_my_gui_alv_grid DEFINITION INHERITING FROM cl_gui_alv_grid.
PUBLIC SECTION.
METHODS hide_functions_public
IMPORTING it_excluding TYPE ui_functions.
ENDCLASS.
CLASS lcl_my_gui_alv_grid IMPLEMENTATION.
METHOD hide_functions_public.
CALL METHOD me->m_cl_menu_button_variant->hide_functions( it_excluding ).
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
SELECT * FROM sflight INTO TABLE gt_daten UP TO 25 ROWS.
IF gr_alv_grid IS NOT BOUND.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_buffer_active = ''
i_structure_name = 'SFLIGHT'
CHANGING
ct_fieldcat = gt_feldkatalog
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
CREATE OBJECT gr_alv_grid
EXPORTING
i_parent = cl_gui_custom_container=>screen0. "gr_alv_container.
gs_variant-report = sy-repid.
gs_layout-sel_mode = 'D'.
CALL METHOD gr_alv_grid->set_table_for_first_display
EXPORTING
is_layout = gs_layout
is_variant = gs_variant
i_save = ''
CHANGING
it_fieldcatalog = gt_feldkatalog
it_outtab = gt_daten.
APPEND cl_gui_alv_grid=>mc_fc_current_variant TO gt_excluding.
gr_alv_grid->hide_functions_public( it_excluding = gt_excluding ).
ENDIF.
Call Screen 0100.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
LEAVE PROGRAM.
ENDMODULE.