SAP:REUSE_ALV_LIST_DISPLAY 函数实现此类型ALV

*& Report-1 类型程序的主要功能是通过 WRITE语句为用户提供方便的报表数据.
*& 与此功能类似的就是利用FUNCTION ALV创建的报表。利用
*& REUSE_ALV_LIST_DISPLAY 函数实现此类型ALV。

*&---------------------------------------------------------------------*
*& Report  Z16_01
*&
*&---------------------------------------------------------------------*
*&
*& Report-1 类型程序的主要功能是通过 WRITE语句为用户提供方便的报表数据.
*&   与此功能类似的就是利用FUNCTION ALV创建的报表。利用
*&   REUSE_ALV_LIST_DISPLAY 函数实现此类型ALV。
*&---------------------------------------------------------------------*

REPORT Z16_01.

DATA gt_itab TYPE TABLE OF  sflight.

SELECT * FROM sflight INTO TABLE gt_itab UP TO 45 ROWS.

*& 调用函数 REUSE_ALV_LIST_DISPLAY .
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
   EXPORTING
*     I_INTERFACE_CHECK              = ' '
*     I_BYPASSING_BUFFER             =
*     I_BUFFER_ACTIVE                = ' '
*     I_CALLBACK_PROGRAM             = ' '
*     I_CALLBACK_PF_STATUS_SET       = ' '
*     I_CALLBACK_USER_COMMAND        = ' '
     I_STRUCTURE_NAME               = 'SFLIGHT'
*     IS_LAYOUT                      =
*     IT_FIELDCAT                    =
*     IT_EXCLUDING                   =
*     IT_SPECIAL_GROUPS              =
*     IT_SORT                        =
*     IT_FILTER                      =
*     IS_SEL_HIDE                    =
*     I_DEFAULT                      = 'X'
*     I_SAVE                         = ' '
*     IS_VARIANT                     =
*     IT_EVENTS                      =
*     IT_EVENT_EXIT                  =
*     IS_PRINT                       =
*     IS_REPREP_ID                   =
*     I_SCREEN_START_COLUMN          = 0
*     I_SCREEN_START_LINE            = 0
*     I_SCREEN_END_COLUMN            = 0
*     I_SCREEN_END_LINE              = 0
*     IR_SALV_LIST_ADAPTER           =
*     IT_EXCEPT_QINFO                =
*     I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
*   IMPORTING
*     E_EXIT_CAUSED_BY_CALLER        =
*     ES_EXIT_CAUSED_BY_USER         =
    TABLES
      T_OUTTAB                       = gt_itab  " ALV上要输出的数据。
*   EXCEPTIONS
*     PROGRAM_ERROR                  = 1
*     OTHERS                         = 2
            .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.

  效果图:

 

posted @ 2024-05-28 21:26  samrv  阅读(47)  评论(0编辑  收藏  举报