检索SAP表数据的通用功能模块 [英] Universal function module to retrieve SAP table data

查看:29
本文介绍了检索SAP表数据的通用功能模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从 SAP 系统访问表数据的最佳方式是什么?

What is the best way to access table data from a SAP system?

我用它 RFC_READ_TABLE 尝试过它,但是这个 RFC 在单个列中以串联形式返回数据,并且对行数据有大小限制.

I tried it with it RFC_READ_TABLE, but this RFC returns the data in concatenated form within a single column and has a size restriction for row data.

是否有更好的方法以通用形式访问 SAP 数据,而无需在系统中创建自定义 RFC?

Is there a better way to access SAP data in generic form without creating custom RFCs into the system?

我正在寻找标准的 RFC 解决方案,而不是自定义脚本.

I am searching for a standard RFC solution, not a custom script.

推荐答案

如果我理解你的问题,你想读一个表,但在编程的时候,你不知道是哪个表.使用 Select * from (tablename) 您可以读取动态表名.目标字段可以通过 create data 动态定义.

If I understand your question right, you want to read a table, but at time of programming, you don't know which table. With Select * from (tablename)you can read with a dynamic table name. The target field can be defined dynamic with create data.

示例(未经测试,目前我无法访问 SAP 系统):

An example (untested, currently I have no access to an SAP-system):

  DATA: lv_tablename TYPE string,
        ev_filelength TYPE i.

  lv_tablename = 'mara'. "e.g. a parameter

  DATA dref TYPE REF TO data.
  CREATE DATA dref TYPE TABLE OF (lv_tablename).

  FIELD-SYMBOLS: <wa> TYPE ANY TABLE.
  ASSIGN dref->* to <wa>.
  SELECT * FROM (lv_tablename) INTO TABLE <wa>. "Attention for test, may be large result
  "<wa> is like a variable with type table mara

这篇关于检索SAP表数据的通用功能模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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