如何从SAP ABAP系统提取数据? [英] How to extract data from a SAP ABAP system?

查看:550
本文介绍了如何从SAP ABAP系统提取数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要以一种随后可以加载到Oracle数据库(xlsx,csv,dmp等)的格式从SAP ABAP系统中提取数据

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)

一旦提取了数据,我将使用Pentaho将其上传到Oracle数据库中.

Once the data is extracted I'll use Pentaho to upload it into the Oracle database.

是否有从SAP提取数据的方法?我还需要将其自动化(提取),但是现在这不是一个太大的问题,稍后我可以弄清楚/担心这部分.

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!

推荐答案

您有很多选择可以做到这一点.

You have a number of options to do this.

如果您正在运行SAP BW,则有许多标准工具可帮助您进行提取和使流程自动化.

If you are running SAP BW, there are many standard tools to help you do extractions and automate the processes.

否则,您可以编写一个简单的ABAP程序(类型1)以从表中读取数据并将其放入平面文件中.

Otherwise, you can write a simple ABAP program (type 1) to read data from tables and put it into a flat file.

否则,您可以编写一个启用远程功能的功能模块(RFC),并使用SAP的RFC库对其进行调用.

Otherwise, you could write a remote-enabled function module (RFC) and call it using SAP's RFC library.

您还可以将RFC函数与Web服务一起包装,然后通过SOAP/HTTP进行调用.

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:

report ZEXTRACT_EXAMPLE.

data: lt_t001 type table of t001.
data: ls_t001 type t001.
data: lv_filename type string value '/tmp/outfile.txt'.

select * from t001 into table lt_t001.

open dataset lv_filename for output in text mode encoding default.

loop at lt_t001 into ls_t001.
  transfer ls_t001-bukrs to lv_filename.
endloop.

close dataset lv_filename.

这确实很原始,但是您明白了.它从数据库表中选择数据到内部表(在内存中),然后将其写入服务器上名为/tmp/outfile.txt的文件中,从中可以进行提取. (您必须将输出更改为所需的格式).

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).

然后,您可以使用SM36计划程序,使其作为后台作业定期运行.

You could then schedule your program with SM36 to run periodically as a background job.

这篇关于如何从SAP ABAP系统提取数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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