2012/01/10

Internal Table: declare

types ARR type I occurs 10.                   " 定義長度為10的數值table/array

types: begin of CONTACT,                      " 定義CONTACT為work area, 並以CONTACT定義內表
         FIRST_NAME(15),
         LAST_NAME(15),
         EMAIL(30),
         TEL type N length 12,
       end of CONTACT,
       CTAB type CONTACT occurs 0.


data S1 type I occurs 10 with header line.    " 宣告包含header line(work area)的表變數
data S2 type I occurs 10.                     " 宣告無header line的表變數
data S3 type standard table of I.             " 取代舊occurs語法的宣告方式

data: begin of EMPLOYEE occurs 10,            " 宣告EMPLOYEE的表變數, 並定義其欄位
        FIRST_NAME(15),
        LAST_NAME(15),
        TEL type N length 12,
      end of EMPLOYEE.