Abap/4制作报表(12)

时间:2022-11-16 16:06:18

*&---------------------------------------------------------------------*
*& Report  Z_CPT6_12                                                   *
*&                                                                     *
*&---------------------------------------------------------------------*
*&          隐藏列表字段        没实现隐藏字段的效果                 *
*&                                                                     *
*&---------------------------------------------------------------------*

REPORT  Z_CPT6_12                                                   .


TABLES: SPFLI,SFLIGHT.

START-OF-SELECTION.
    SKIP.
*输出表头
ULINE AT /(91).
WRITE: / SY-VLINE,(15)'航线承运人',SY-VLINE,(15)'航班连接',SY-VLINE,
(15)'国家代码',SY-VLINE,(15)'起飞城市',SY-VLINE,(15)'起飞机场',SY-VLINE.
ULINE AT /(91).

 

*输出内容
SELECT * FROM SPFLI.
WRITE: / SY-VLINE,(15)SPFLI-CARRID,
         SY-VLINE,(15)SPFLI-CONNID,
         SY-VLINE,(15)SPFLI-COUNTRYTO,
         SY-VLINE,(15)SPFLI-CITYFROM,
         SY-VLINE,(15)SPFLI-AIRPFROM,SY-VLINE.

*隐藏字段    没效果
HIDE: SPFLI-CARRID,SPFLI-CONNID.
ULINE AT /(91).
ENDSELECT.

 


AT LINE-SELECTION.
*只输出第一页
IF SY-LSIND = 1.
    SELECT * FROM SFLIGHT
             WHERE CARRID = SPFLI-CARRID AND CONNID = SPFLI-CONNID.
        WRITE: / SFLIGHT-CARRID,SY-VLINE,
                 SFLIGHT-CONNID,SY-VLINE,
                 SFLIGHT-FLDATE,SY-VLINE,
                 SFLIGHT-PRICE.
    ENDSELECT.
ENDIF.