• ALV的报表对用户定义格式的控制(ALV I_SAVE)


    很多ALV的报表都需要手动的进行设置格式以使数据看上去更有意义和条理,如果每次进来都重新操作一遍是很烦人的,所以SAP有提供了一个保存格式的功能,保存格式可以是 ‘缺省设置’ 和 ‘特定用户’ 两种 至于这两种功能的激活是在程序中指定的。

    I_SAVE 参数有四个可选值 分别是 空(两个功能都关闭,只能选择更改不能保存)  X(只保留缺省默认的) U(只保留特定用户功能) A(缺省默认和特定用户都可以),


    1.FUN ALV

    在调用显示ALV函数的时候有个I_SAVE 参数

      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = g_repid
          is_layout          = gs_layout
          it_fieldcat        = gt_fieldcat[]
          i_save             = 'A'
          is_variant         = v_stru_disvar
          it_events          = git_events[]
          it_sort            = it_sort[]
          is_print           = gs_print
        TABLES
          t_outtab           = gt_data
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.

    2.OO ALV 的方式和FUN的有点不同
    DATA:g_variant TYPE disvariant.
    g_variant-report = sy-repid.
    CALL METHOD gcl_alv->set_table_for_first_display
        EXPORTING
          is_layout                     = gs_layout
          is_variant                    = g_variant
          i_save                        = 'A'
          it_toolbar_excluding          = gt_exclude
        CHANGING
          it_outtab                     = gt_data[]
          it_fieldcatalog               = gt_fieldcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
     

    下面是SAP对 I_SAVE 这个参数的官方介绍。
    ' ' = Display variants cannot be saved
    Defined display variants (such as delivered display variants) can be selected for presentation regardless of this indicator. However, changes cannot be saved.
    'X' = Standard save mode
    Display variants can be saved as standard display variants.
    Saving display variants as user-specific is not possible.
    'U' = User-specific save mode
    Display variants can only be saved as user-specific.
    'A' = Standard and user-specific save mode
    Display variants can be saved both as user-specific and as standard
    variants. Users make their choice on the dialog box for saving the
    display variant.

  • 相关阅读:
    【产品】Pony三问
    【数据平台】阿里dataphin
    【数据中台】阿里数据中台架构
    关于 Qt 5,你所需要了解的基础知识
    Skynet 游戏服务器开发实战
    关于自然语言处理,有一本通关手册待接收
    ROS 机器人操作系统进阶实战
    面试官不讲武德,问我如何实现分布式缓存?
    高 star 开源项目来实验楼啦,深度学习强推教材
    Spring Boot 2.4.0 全新发布,还不快来实战
  • 原文地址:https://www.cnblogs.com/mingdashu/p/6120890.html
Copyright © 2020-2023  润新知