ABAP常用基本语法

数据定义 data:  a type c.

               data: a like  b.

     data: a like  talbe-name.

数据合并

C1='AB'.

C2='CD'.

C3='EF'.

C4='GH'.

C9='+'.

CONCATENATE C1 C2 C3 C4 INTO C5.

WRITE C5.

CONCATENATE CI C2 C3 C4 INTO C5 SEPARATED BY C9.

WRITE / C5.

数据拆分

SPLIT C5 AT C9 INTO C1 C2 C3 C4.

 

内表有表头

TABLE:T_TBL.

T_TBL-ID='1'.

T-TBL-NAME='FF'.

APPEND T_TBL.

内部无表头

TYPES:START OF R_TBL.

  DATA: ID TYPE C(2),

  DATA: NAME TYPE C(20),

 ENDOF  R_TBL.

DATA: W LIKE R_TBL.

W-ID='1'.

W-NAME='FF'.

APPEND W TO T_TBL.

格式化输出

SELECT * INTO WA FROM SPFLI.
WRITE: / WA-CARRID UNDER '航班承运人',
WA-CONNID UNDER '航班连接',
WA-COUNTRYFR UNDER '国家代码',
WA-CITYFROM UNDER '起飞城市',
WA-AIRPFROM UNDER '起飞机场'.
ENDSELECT.

 

posted @ 2018-04-26 14:00  mingxiu  阅读(2002)  评论(0编辑  收藏  举报