ABAP中tables的用法和替换用法


以下是来自SAP官方的解释, 就是声明一个数据对象与table一样的作为工作区。

1.Syntax

TABLES table_wa.

2.Effect

This statement is not allowed in classes and declares a data object table_wa as a table work area whose data type is adopted from the identically named structured data type table_wa from the ABAP Dictionary. table_wa must be defined as a flat structure in ABAP Dictionary. Either database tables or views can be specified for table_wa.

Table work areas declared with TABLES are interface work areas and should only be declared in the global declaration section of a program for the following purpose:
• The statement TABLES is required for exchanging data between dynpro fields defined in a program dynpro by being taken from ABAP Dictionary, and the ABAP program. For the dynpro event PBO, the content of the table work area is passed to identically named dynpro fields; for PAI, the system takes the data from identically named dynpro fields.

• In executable programs, flat table work areas can be used to copy data that is provided for the event GET table_wa from an associated logical database. TABLES is synonymous with the statement NODES for this purpose.

由于tables的用法已经很旧了,这里定义了一个全局变量。但实际可以定义了一个局部变量就可以,还是在alv展示中一个用法 。

tables的用法

TABLES ZZLD.
SELECT-OPTIONS:
                  S_ZPSDH FOR ZLLD-ZPSDH, " 单据号码

替代用法

DATA DUMMY_ZLLD  TYPE ZLLD.
SELECT-OPTIONS:
                  S_ZPSDH FOR DUMMY_ZLLD-ZPSDH, " 单据号码
3. tables的用法

Tables在旧的SAP系统重还大量存在这样的用法
为什么自己建表可以当变量用
在这里插入图片描述原因
在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值