Abap/4制作报表(1)

时间:2021-09-21 16:06:47

*&---------------------------------------------------------------------*
*& Report  Z_CPT6_1                                                    *
*&                                                                     *
*&---------------------------------------------------------------------*
*&          简单的报表                                 *
*&                                                                     *
*&---------------------------------------------------------------------*

REPORT  Z_CPT6_1                                                    .

DATA: header(30) TYPE c,
      spfli_tab TYPE SORTED TABLE OF spfli
                         WITH UNIQUE KEY cityto carrid connid,
      spfli_line TYPE spfli.

 

INITIALIZATION.
    header = 'Demo program for report event'.

START-OF-SELECTION.
    SELECT *  FROM spfli
              INTO CORRESPONDING FIELDS OF spfli_line.
             INSERT spfli_line INTO TABLE spfli_tab.
    ENDSELECT.

 

END-OF-SELECTION.
    LOOP AT spfli_tab INTO spfli_line.
        WRITE: / spfli_line-cityfrom,
                 spfli_line-cityto,
                 spfli_line-carrid,
                 spfli_line-connid.
    ENDLOOP.


TOP-OF-PAGE.
    WRITE: header.
    SKIP.