调用 RFC_READ_TABLE 时出现 DATA_BUFFER_EXCEEDED 错误? [英] DATA_BUFFER_EXCEEDED error when calling RFC_READ_TABLE?

查看:30
本文介绍了调用 RFC_READ_TABLE 时出现 DATA_BUFFER_EXCEEDED 错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 java/groovy 程序从用户输入中接收表名和表字段,它查询 SAP 中的表并返回其内容.

My java/groovy program receives table names and table fields from the user input, it queries the tables in SAP and returns its contents.

用户输入可能涉及表CDPOSCDHDR.在阅读 SAP 文档和谷歌搜索后,我发现这些是存储更改文档日志的表.但是我没有找到任何可以在java中使用的远程调用函数来执行这种查询.

The user input may concern the tables CDPOS and CDHDR. After reading the SAP documentations and googling, I found these are tables storing change document logs. But I did not find any remote call functions that can be used in java to perform this kind of queries.

然后我使用了已弃用的 RFC 功能模块 RFC_READ_TABLE 并尝试仅根据此 RFC 构建自定义查询.但是,我发现如果我传递给此 RFC 的所需字段数超过 2,即使我限制了最大行数,我也总是收到 DATA_BUFFER_EXCEEDED 错误.

Then I used the deprecated RFC Function Module RFC_READ_TABLE and tried to build up customized queries only depending on this RFC. However, I found if the number of desired fields I passed to this RFC are more than 2, I always got the DATA_BUFFER_EXCEEDED error even if I limit the max rows.

本人无权成为SAP系统中的ABAP开发人员,无法在现有系统中添加任何FM,所以只能用JAVA编写代码来完成这个需求.

I am not authorized to be an ABAP developer in the SAP system and can not add any FM to existing systems, so I can only write code to accomplish this requirement in JAVA.

我做错了吗?你能给我一些关于这个问题的提示吗?

Am I doing something wrong? Could you give me some hints on that issue?

推荐答案

DATA_BUFFER_EXCEEDED 仅当您要读取的字段的总宽度超过DATA 参数,可能因 SAP 版本而异 - 当前系统为 512 个字符.它与行数无关,而与单个数据集的大小有关.

DATA_BUFFER_EXCEEDED only happens if the total width of the fields you want to read exceeds the width of the DATA parameter, which may vary depending on the SAP release - 512 characters for current systems. It has nothing to do with the number of rows, but the size of a single dataset.

那么问题来了:FIELDS参数的内容是什么?如果为空,则表示读取所有字段".CDHDR 的宽度为 192 个字符,因此我假设问题是 CDPOS 的宽度为 774 个字符.主要问题是字段 VALUE_OLDVALUE_NEW,均为 245 个字符.

So the question is: What are the contents of the FIELDS parameter? If it's empty, this means "read all fields." CDHDR is 192 characters in width, so I'd assume that the problem is CDPOS which is 774 characters wide. The main issue would be the fields VALUE_OLD and VALUE_NEW, both 245 Characters.

即使您没有获得开发人员的访问权限,您也应该促使某人获得只读字典访问权限,以便能够详细检查结构.

Even if you don't get developer access, you should prod someone to get read-only dictionary access to be able to examine the structures in detail.

无耻的插件:RCER 包含一个负责处理 RFC_READ_TABLE 的包装类字段处理,并确保所选字段的总宽度低于功能模块施加的限制.

Shameless plug: RCER contains a wrapper class for RFC_READ_TABLE that takes care of field handling and ensures that the total width of the selected fields is below the limit imposed by the function module.

还要注意,这些表在生产环境中可能很大 - 想想数十亿个条目.通过对这些表执行过多的读取操作,您可以轻松地使您的数据库陷入停顿.

Also be aware that these tables can be HUGE in production environments - think billions of entries. You can easily bring your database to a grinding halt by performing excessive read operations on these tables.

PS:RFC_READ_TABLE 根据 SAP 说明 382318 和注释 758278 建议创建自己的功能模块,并提供逻辑改进的模板.

PS: RFC_READ_TABLE is not released for customer use as per SAP note 382318, and the note 758278 recommends to create your own function module and provides a template with an improved logic.

这篇关于调用 RFC_READ_TABLE 时出现 DATA_BUFFER_EXCEEDED 错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆