如何从 SAP ABAP 系统中提取数据?
我需要以某种格式从 SAP ABAP 系统中提取数据,然后将其加载到 Oracle 数据库中(xlsx、csv、dmp 等)。
提取数据后,我将使用 Pentaho 将其上传到 Oracle 数据库中。
有没有办法从SAP中提取数据?我还需要自动化它(提取),但这现在不是太大的问题,我可以稍后再考虑/担心这部分。
如果不可能这样做,解释原因会很有帮助!
I need to extract data from a SAP ABAP system in a format that can then be loaded into an Oracle database (xlsx,csv,dmp.. etc)
Once the data is extracted I'll use Pentaho to upload it into the Oracle database.
Is there a way to extract the data from SAP? I will also need to automate it (the extraction) but that is not too much of a problem right now, I can figure/worry about that part later.
If it is not possible to do so, an explanation why would be helpful!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您有多种选择来执行此操作。
如果您正在运行 SAP BW,有许多标准工具可以帮助您进行提取和自动化流程。
否则,您可以编写一个简单的 ABAP 程序(类型 1)来从表中读取数据并将其放入平面文件中。
否则,您可以编写远程功能模块 (RFC) 并使用 SAP 的 RFC 库调用它。
您还可以使用 Web 服务包装 RFC 函数并通过 SOAP/HTTP 调用它。
最后,如果您有权访问数据库,您甚至可以编写脚本来提取所需的数据。
从数据库表中提取内容的程序的简单示例:
这确实很原始,但您明白了。它将数据库表中的数据选择到内部表(在内存中)中,并将其写入服务器上名为
/tmp/outfile.txt
的文件中,您可以从其中获取数据。 (您必须将输出更改为您所需的格式)。然后,您可以使用 SM36 安排您的程序作为后台作业定期运行。
You have a number of options to do this.
If you are running SAP BW, there are many standard tools to help you do extractions and automate the processes.
Otherwise, you can write a simple ABAP program (type 1) to read data from tables and put it into a flat file.
Otherwise, you could write a remote-enabled function module (RFC) and call it using SAP's RFC library.
You could also wrap your RFC function with a web service and call it via SOAP/HTTP.
Lastly, if you have access to the database, you might even be able to write a script to extract the data you need.
A simple example of a program to extract something from a DB table:
This is really primitive, but you get the idea. It selects data from a DB table into an internal table (in memory) and writes it to a file called
/tmp/outfile.txt
on the server, from where you can pick it up. (You would have to alter the output to be in your required format).You could then schedule your program with SM36 to run periodically as a background job.
您还可以使用远程启用功能模块“RFC_READ_TABLE”,您可以给它任何表名称和分隔符,它将返回为您格式化的内部表。
You can also use the remote enabled function module 'RFC_READ_TABLE', you can give it any table name and a separator and it will return the internal table nicely formatted for you.
解决此问题的一种选择是找到 SAP ERP 数据的 JDBC 驱动程序,该驱动程序通过查看 SAP 逻辑表级别来收集表。
一旦您拥有正确的 JDBC 驱动程序,您就可以使用 Pentaho 中的驱动程序。
我已经使用 Talend 尝试过这种基于 SAP ERP 的 JDBC 解决方案,效果非常好。
正如前面的评论所指出的,RFC_READ_TABLE 在表字段数量和记录数量方面非常有限,更不用说转换问题了。
One option to solve this is to find an JDBC driver to the SAP ERP data that gathers the tables by looking at the SAP logical table level.
Once you have the right JDBC driver you can use that from Pentaho.
I have tried this kind of JDBC over SAP ERP solution with Talend and it works great.
RFC_READ_TABLE as pointed out by previous comments is pretty limited in terms of the number of table fields and also the number of records, not to mention conversion issues.