我是靠谱客的博主 精明小兔子,这篇文章主要介绍sap变量的定义,现在分享给大家,希望可以做个参考。

*&---------------------------------------------------------------------*
*& Report  ZDM_FIRST
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT ZDM_FIRST.
data sss type i value 5.
write sss.
write / text-sss.
* /表示换行
data: begin of Student,
       name(20) type c,
       age type i,
       sex type i,

      end of Student.


   Student-name = 'cherry'.
   Student-age = 22.
   Student-sex = 1.

 write: / 'student:',Student-name,',age->',Student-age,'sex->',Student-sex.

* like表示变量stu的数据类型是参考Student 修改stu的值 不会修改Student的值

 data stu like  Student.
   stu-name ='jiaozi'.
   stu-age = 22.
   stu-sex = 0.
   write:'student:',stu-name,',age->',stu-age,'sex->',stu-sex.
   write: / 'student:',Student-name,',age->',Student-age,'sex->',Student-sex.
 types: begin of StudentType,
           name(20) type c,
           age type i,
           sex type i,
        end of StudentType.
 data stu1 type StudentType.
 stu1-name = 'ggg'.
 write stu1-name.
*FIELD-SYMBOLS是宏 表示引用一个变量 宏修改变量的值也跟着修改
 FIELD-SYMBOLS <s> like stu1.
 assign stu1 to <s>.
 <s>-name = 'cherry'.
 write <s>-name.
 write stu1-name.

最后

以上就是精明小兔子最近收集整理的关于sap变量的定义的全部内容,更多相关sap变量内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(266)

评论列表共有 0 条评论

立即
投稿
返回
顶部