创建包含其它structure的structure

1: 如果要创建一个structure,其中带有属性的类型为sturcture。需要用到include

代码创建:

REPORT ZHAN_TEST_USING_INCLUDE.

TYPES:
        BEGIN OF user,
          username(10) TYPE c,
          userid(10) type c,
        END OF user,
        BEGIN OF info,
          age TYPE i.
        INCLUDE TYPE user.
TYPES:  END OF info.

DATA my_info TYPE info.

my_info-username = 'mike'.
my_info-USERID = '0001'.

WRITE: my_info-username,my_info-USERID.

result:

2:

https://www.cnblogs.com/jiangzhengjun/p/4265707.html

https://my.oschina.net/MikeLiuzheqiang/blog/84839

猜你喜欢

转载自www.cnblogs.com/liyafei/p/11127566.html
今日推荐