释疑の语法LOCAL
来源:互联网 发布:淘宝怎样找妹子服务 编辑:程序博客网 时间:2024/06/06 12:44
作用就是把当前对象保存在一个临时存储空间,它只能用到子程序或者FUNTION MODULE里,在程序结束的时候数据对象重新分配在临时空间的值。
如果用LOCAL对同一个对象执行了好几遍,那么只有第一次执行起作用。
语法:LOCAL dobj.
The statement LOCAL (not allowed in classes) saves the current content of a data objectdobj in an internal buffer. It can be used only in subroutines or function modules. At the end of the procedure, the data objectdobj is reassigned to the value in the buffer. If LOCAL is executed in a procedure for a data object more than once, only the first execution is taken into account.
All data objects possible in write positions can be specified fordobj. If dobj is an internal table, the procedure should not be called within aLOOP loop that processes the table.
Modifiable formal parameters of the procedure, field symbols, or dereferenced data references are also possible afterLOCAL. If formal parameters are specified, the assigned actual parameter is set to the value in the buffer at the end of the procedure. For field symbols, the field reference and the content of the referenced fields are saved.
例子:
DATA TEXT TYPE STRING VALUE 'Global text'.
CL_DEMO_OUTPUT=>WRITE_TEXT( TEXT ).
PERFORM SUBR1.
CL_DEMO_OUTPUT=>DISPLAY_TEXT( TEXT ).
FORM SUBR1.
LOCAL TEXT.
TEXT = 'Text in subr1'.
CL_DEMO_OUTPUT=>WRITE_TEXT( TEXT ).
PERFORM SUBR2 USING TEXT.
CL_DEMO_OUTPUT=>WRITE_TEXT( TEXT ).
ENDFORM.
FORM SUBR2 USING PARA TYPE STRING.
LOCAL PARA.
PARA = 'Text in subr2'.
CL_DEMO_OUTPUT=>WRITE_TEXT( TEXT ).
ENDFORM.
输出:
- 释疑の语法LOCAL
- 释疑の语法Unpack&pack
- 释疑の语法 ON CHANGE OF
- $(if $(KBUILD_VERBOSE:1=),@) 语法释疑
- $(if $(KBUILD_VERBOSE:1=),@) 语法释疑
- 释疑のCONTEXTS
- 释疑の函数POPUP_TO_CONFIRM
- 释疑のSAP请求号
- 释疑の资源短缺DATASET_CANT_CLOSE
- 释疑の字段符号 FIELD-SYMBOLS
- 释疑のSAP库位的创建
- 释疑の采购Invoice常用参数设置
- 释疑のSmartforms点打印无反应
- 释疑の修改SAP标准表内容
- 释疑のABAP内表的比较
- 释疑の作业分割的理解
- 释疑の采购订单的批量修改
- 释疑の舍入参数文件介绍
- Leetcode 525 python 解题报告
- 部署NuGet服务器和发布自己的NuGet包
- Linux常用命令
- 利用mybatis-generator自动生成代码
- Hive与Hbase的区别
- 释疑の语法LOCAL
- Maven的pom.xml示例
- 图标地址
- KMP算法详解
- Trafodion LOB大对象
- 大型软件下载网址
- 面试求职:数据库常见面试题(数据库优化思路)
- 蓝桥杯 历届试题 回文数字
- Caffe源码中Pooling Layer文件分析