Fonction SAP ALV_OPTIMIZE_OUTPUT - Suppress Blank Columns in ALV Output

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
IS_VARIANT DISVARIANT u 122 X Layout
IT_ALV_DATA TABLE T 0 ALV Data Sheet
IT_ALV_ITEM_DATA TABLE T 0 X ALV Item Table (Hierarchical Sequence List)
IT_FIELDS_NO_OPTIMIZATION STRING_TABLE h 8 X Fields to Be Excluded from Optimization
IV_STRUCTURE_NAME CLIKE C 0 X Structure Name for ALV Field Catalog Creation

Paramètre Reférence Type Long. Description
EX_FIELDCAT_CHANGED XFELD C 1 'X' = Field Catalog Has Been Changed by Optimizer

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
CH_FIELDCAT LVC_T_FCAT h 1196 X Field Catalog for List Viewer Control
CH_FIELDCAT_OLD SLIS_T_FIELDCAT_ALV 0 X Field Catalog for ListViewer in Reuse ALV Format

Exception Description
FAILED Field Catalog(s) and Structure Name Are Blank

Functionality
Optimization of output of an ALV list (grid control or reuse).
This function module examines the data source of an ALV list and setsall columns that only contain initial values (or the value ICON_SPACEwith icon fields) to hidden (field catalog attribute no_out = "X").
Columns that are hidden (no_out = "X") can be made visible again as longas there is data that is not the same as the initial value.
Use of parameter IT_FIELDS_NO_OPTIMIZATION means that certain fields canbe disregarded during an optimization procedure.
The name of the column as it appears in the ALV field catalog(FIELDNAME) is stored in this internal table.
This module can be used for ALV lists that were created using classCL_GUI_ALV_GRID or using function modules REUSE_ALV_LIST_DISPLAY,REUSE_ALV_GRID_DISPLAY or REUSE_ALV_HIERSEQ_LIST_DISPLAY.

  • With ALV grid controls, the parameters CH_FIELDCAT and IT_ALV_DATA need
  • to be provided with data.
    • With REUSE_ALV_GRID_DISPLAY and REUSE_ALV_LIST_DISPLAY, the parameters
    • CH_FIELDCAT and IT_ALV_DATA need to be provided with data.
      • With REUSE_ALV_HIERSEQ_DISPLAY, the parameters CH_FIELDCAT_OLD,
      • IT_ALV_DATA, and IT_ALV_ITEM_DATA need to be provided with data.
        If this module is also to assume the structure of the field catalog,then parameter IV_STRUCTURE_NAME also needs to be provided with data.
        In this case, parameters CH_FIELDCAT and/or CH_FIELDCAT_OLD can betransferred in a blank state.

        Example
        Report R_ALV_GRID_TOOLBAR_MANAGER
        Report R_ALV_LIST_TOOLBAR_MANAGER