FIELD-SYMBOLS是字段符号,类似于FOXPRO的宏,FOXPRO能把一段程序存入一个字符串中,再通过某种方式使该字符串运行。SAP的FIELD-SYMBOLS,把一个结构定义分配给字段符号,通过字段符号来引用结构中的成员。
【例3.1】
【例3.1】
REPORT YTEST001.
DATA:BEGIN OF MAN,
NAME(30) TYPE C,
HIGH TYPE P DECIMALS 2,
WEIGHT TYPE P DECIMALS 2,
END OF MAN.
FIELD-SYMBOLS <FSA> LIKE MAN.
DATA MAN1 LIKE MAN.
MAN1-NAME = '张林'.
MAN1-HIGH = '1.78'.
MAN1-WEIGHT = 140.
ASSIGN MAN1 TO <FSA>.
WRITE: / <FSA>-NAME,
<FSA>-HIGH,
<FSA>-WEIGHT.