• OO 技术实现简单的ALV显示


    REPORT  Z_ALV_ERIC.

    data: ok_code type sy-ucomm,
          save_ok like ok_code.


    data wa_spfli type table of spfli.

    select * into table wa_spfli from spfli.

    data: wa_container type scrfname value 'ALV',
          alv_grid type ref to cl_gui_alv_grid,
          wa_custom_container TYPE ref to cl_gui_custom_container.

       call SCREEN 1001.


    *&---------------------------------------------------------------------*
    *&      Module  STATUS_1001  OUTPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    MODULE STATUS_1001 OUTPUT.
    *  SET PF-STATUS 'xxxxxxxx'.
    *  SET TITLEBAR 'xxx'.
      if wa_custom_container is initial.

        create object wa_custom_container
                EXPORTING container_name = wa_container.
        create object alv_grid
               EXPORTING i_parent = wa_custom_container.
        call method alv_grid->set_table_for_first_display
            EXPORTING i_structure_name = 'SPFLI'
               CHANGING it_outtab = wa_spfli.
      endif.

    ENDMODULE.                 " STATUS_1001  OUTPUT
    *&---------------------------------------------------------------------*
    *&      Module  USER_COMMAND_1001  INPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    MODULE USER_COMMAND_1001 INPUT.
      save_ok = ok_code.
      clear ok_code.

      case save_ok.
        when 'XT'.
          LEAVE PROGRAM.
       ENDCASE.

    ENDMODULE.                 " USER_COMMAND_1001  INPUT

  • 相关阅读:
    Arch Linux 安装 ibus-rime
    macOS安装Python MySQLdb
    CentOS 7 安装 gcc 4.1.2
    Windows 10安装Python 2.7和MySQL-python
    小米Air安装Arch Linux之图形界面配置(Gnome 和 sway)持续更新中……
    小米Air 13.3 安装Arch Linux
    Linux Shell脚本攻略总结(1)
    Ubuntu下删除配置错误或者失败的安装包
    oProfile的安装与使用
    动态链接库VS静态链接库
  • 原文地址:https://www.cnblogs.com/eric0701/p/2314195.html
Copyright © 2020-2023  润新知