首页 > 解决方案 > RFC_READ_TABLE 上的数据表为空

问题描述

各位程序员早安,

我正在尝试从 SAP (ABAP) 中的“远程”系统读取表。
使用 RFC_READ_TABLE 函数正确返回字段表,但不返回数据

data: options type table of rfc_db_opt with header line.
data: fields type table of rfc_db_fld with header line.
data: data type table of tab512 with header line.

CALL FUNCTION 'RFC_READ_TABLE'
DESTINATION xxxx        "" Name of rfc connection
  EXPORTING
     query_table   = 'BUT100'  ""Just for testing purposes""
 TABLES
     options = options  "" contains filters etc.
     fields = fields    "" contains table structure
     data = data        "" contains data of table

loop at data.
  write: data.
endloop.                "" This doesn't show anything either.

如果我在调试器中运行这段代码,我会得到表字段,但数据表总是空的。
我对ABAP很陌生,所以我想也许这里有人有想法,为什么我的数据表是空的?
我也尝试过与 BUT100 不同的表,但结果始终相同。

非常感谢您!

最好的问候,保持健康!;)
尼科

标签: abapsaprfcopensql

解决方案


推荐阅读