• 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

  • 相关阅读:
    linux扩展分区
    linux开机出现initramfs无法进入系统
    openCV编译安装-MSCV-Windows10-Qt
    Qt一键部署配置(Qt程序打包)
    Part8 升序排序 和降序排序
    Part7-.简单查询1
    Part6-向表中插入数据
    Part5-修改表(添加字段、删除字段、查看删除是否成功)
    Part4-删除表
    Part3-复制表
  • 原文地址:https://www.cnblogs.com/eric0701/p/2314195.html
Copyright © 2020-2023  润新知