SAP: ALV的布局管理

ALV中,欲保存布局,须在REUSE_ALV_GRID_DISPLAY函数中添加I_SAVE参数。I_SAVE定义为C数据类型,值如下:

    ‘ ‘ = display variants cannot be saved
    Defined display variants (e.g. delivered display variants) can be selected for presentation independently of this flag. Changes can not be saved.

    ‘X’ = standard save
    Display variants can be saved as standard display variants. User-specific saving is not possible.

    ‘U’ = only user-specific saving
    The user can only save display variants user-specifically

    ‘A’ = standard and user-specific saving
    The user can save a display variant user-specifically and as standard display variant. The user chooses in the display variant save popup.

为了进一步管理布局,则需要加入IS_VARIANT参数,其数据结构参考DISVARIANT,一般需要定义其中的REPORT=SY-REPID,VARIANT为布局保存格式。有三个有用函数供调用保存的格式布局,分别为:

REUSE_ALV_VARIANT_DEFAULT_GET 读取默认的布局
REUSE_ALV_VARIANT_EXISTENCE 检测指定布局是否存在
REUSE_ALV_VARIANT_F4 显示布局格式选择对话窗

你可能感兴趣的:(SAP: ALV的布局管理)