TYPES BEGIN OF struc_type.
TYPES comp ...
TYPES comp TYPE struc_type BOXED. "参照另一结构类型
INCLUDE { {
TYPE struc_type} | {
STRUCTURE struc} } "将另一结构包括进来
[AS name [RENAMING WITH SUFFIX suffix]].
TYPES END OF struc_type.
INCLUDE { {
TYPE struc_type} | {
STRUCTURE struc} }
[AS name [RENAMING WITH SUFFIX suffix]].
DATA: BEGIN OF gt_result OCCURS 0,
c1 TYPE c."直接定义组件字段,但前面语句后面使用逗号
INCLUDE STRUCTURE comm1."直接将结构对象包括进来
INCLUDE TYPE comm2."直接将结构类型包括进来
DATA:comm LIKE comm1,"直接参照
c2 TYPE c. "直接定义组件字段,但前面语句后面使用逗号
DATA: END OF gt_result.
类型复用
TYPES: BEGIN OF street_type,
name TYPE c LENGTH 40,
no TYPE c LENGTH 4,
END OF street_type.
DATA: BEGIN OF comm1 OCCURS 0,
bukrs TYPE bseg-bukrs,
END OF comm1.
TYPES: BEGIN OF address_type,
name1 TYPE c LENGTH 30."直接定义类型,但前面语句需使用逗号
TYPES:street TYPE street_type,"参照另一结构类型
c TYPE c."直接定义类型,但前面语句需使用逗号
INCLUDE STRUCTURE comm1.
INCLUDE TYPE street_type.
TYPES: END OF address_type.