Pysaprfc is a wrapper around SAP librfc (librfc32.dll on Windows, librfccm.so or librfc.so on Linux). It uses the excellent ctypes extension package by Thomas Heller to access librfc and to define SAP compatible datatypes.
Modern SAP versions go the Web Service way - you could build a SAP Web Service and consume it from Python.
With SAP NetWeaver, developers can connect applications and data sources to integrate processes using Web services.
In particular, developers can use one infrastructure to define, implement, and use Web services in an industry standards based way. SAP NetWeaver supports synchronous, asynchronous, stateful and stateless web service models - enabling developers to support different integration scenarios.
sapnwrfc supports this SAP NetWeaver functionality, supersedes the older RFC SDK, and is actively maintained.
"The pyrfc Python package provides Python bindings for SAP NetWeaver RFC Library, for a comfortable way of calling ABAP modules from Python and Python modules from ABAP, via SAP Remote Function Call (RFC) protocol."
这是我可以附加到“SAP 作为数据库引擎”的唯一含义——您想要访问 SAP MaxDB。其他答案做出不同的假设,并且(我相信)也是正确的......在这些不同的假设下。
If you're talking about (what used to be named) the SAP Database AKA SapDb, and is now MaxDB (for a while distributed also by MySql Inc, now again by SAP only -- and so named SAP MaxDB), it comes with several Python access modules, documented here.
This is the only meaning I can attach to "SAP as the database engine" -- that you want to access SAP MaxDB. Other answers make different assumptions and (I believe) are also correct... under those different assumptions.
SAP 不是数据库服务器。 但使用 Python SAP RFC 模块,您可以非常轻松地查询大多数表。它正在使用一些 sap 不支持的功能(全世界都在使用)。并且该函数对字段大小和数据类型有一定的限制。
Sap is NOT a database server. But with the Python SAP RFC module you can query most table quite easily. It is using some sap unsupported function ( that all the world is using). And this function has some limitation on field size and datatypes.
对于更正式的方式,您可以将 SAP 的 JCO 连接器与 Jython 结合使用,或者将 SAP 的 .Net 连接器与 Ironpython 结合使用;这两个连接器都可以从 SAP 的服务市场下载,并且都允许调用 RFC 功能,包括上面列出的两个调用。
如上所述,SAP 提出的访问后端功能的方式是通过 SAP 庞大的 SOA 基础设施。在这里,您可以将 Jython 与 Axis 库一起使用,或将 Ironpython 与 Microsoft 的 WCF 一起使用。请注意,SAP 提供的服务显然不允许您访问普通表,而您只能调用服务提供的内容。 SAP 已经提供了大约 3000 个服务(请参阅 SDN 上的 ES Wiki),一旦您在支持远程的功能模块中拥有业务逻辑,创建您自己的服务实际上非常简单。
As stated above, when you just want to read tables or do RFC or BAPI calls, you can use CPython with the unmaintained Python SAP RFC module or Piers Harding's SAP RFC. The RFC calls to just read a table are RFC_GET_TABLE_ENTRIES or RFC_READ_TABLE, where the former is preferred, but also not released to customers.
For a more official way, you can use SAP's JCO connector with Jython or SAP's .Net Connector with Ironpython; both connectors can be downloaded from SAP's service marketplace and both allow to call the RFC functionality including the two calls listed above.
As also stated above, the way proposed by SAP to access backend functionality is via SAP's vast SOA infrastructure. Here you can use Jython with e.g. the Axis library or Ironpython with Microsofts WCF. Note, that the services provided by SAP obviously won't allow you to access the plain tables, instead you just can call, what a service provides. SAP already delivers about 3.000 services (see the ES Wiki on SDN), and creating your own service is in fact dead simple, once you have your business logic in a remote-enabled function module.
为了在 SAP 中使用 Python,我们需要安装 Python SAP RFC 模块,即 PyRFC。它的可用方法之一是 RFC_READ_TABLE,可以调用它从 SAP 数据库的表中读取数据。
此外,PyRFC 包提供了各种绑定,可用于以任何一种方式进行调用。我们可以使用 ABAP 模块到 Python 模块进行调用,或者反过来。人们可以定义用于数据交换的等效 SAP 数据类型。
另外,我们可以用Python创建Web Service,用于相互通信。 SAP NetWeaver 与全状态或无状态的 Web 服务完全兼容。
Python is one of the most used object-oriented programming languages which is very easy to code and understand.
In order to use Python with SAP, we need to install Python SAP RFC module which is known as PyRFC. One of its available methods is RFC_READ_TABLE which can be called to read data from a table in SAP database.
Also, the PyRFC package provides various bindings which can be utilized to make calls either way. We can use to make calls either from ABAP modules to Python modules or the other way round. One can define equivalent SAP data types which are used in data exchange.
Also, we can create Web Service in Python which can be used for inter-communication. SAP NetWeaver is fully compatible with web services either state full or stateless.
发布评论
评论(7)
Python SAP RFC 模块 似乎不活动 - 最后一次(无关紧要的)提交 2年前 - 但可能为您服务:
现代 SAP 版本采用
Web 服务
方式 - 您可以构建SAP Web Service
并通过Python
使用它。sapnwrfc
支持此SAP NetWeaver
功能,取代较旧的 RFC SDK,并得到积极维护。Python SAP RFC module seems inactive - last (insignificant ) commit 2 years ago - but may serve you:
Modern SAP versions go the
Web Service
way - you could build aSAP Web Service
and consume it fromPython
.sapnwrfc
supports thisSAP NetWeaver
functionality, supersedes the older RFC SDK, and is actively maintained.Python RFC 连接器现已作为开源提供:PyRFC
Python RFC connector is now available as open source: PyRFC
SAP 现在有一个名为 Pyrfc 的 Python RFC 连接器。这取代了 sapnwrfc。
这可以在以下位置找到: https://github.com/SAP/PyRFC
“pyrfc Python 包提供SAP NetWeaver RFC 库的 Python 绑定,通过 SAP 远程函数调用 (RFC) 协议,以一种舒适的方式从 Python 调用 ABAP 模块和从 ABAP 调用 Python 模块。”
SAP now has a Python RFC connector called pyrfc. This supersedes sapnwrfc.
This can be found at: https://github.com/SAP/PyRFC
"The pyrfc Python package provides Python bindings for SAP NetWeaver RFC Library, for a comfortable way of calling ABAP modules from Python and Python modules from ABAP, via SAP Remote Function Call (RFC) protocol."
如果您谈论的是(以前的名称)SAP 数据库,又名 SapDb,现在是 MaxDB(一段时间内也由 MySql Inc 分发,现在再次由 SAP 提供 - 并如此命名 SAP MaxDB),它附带了几个Python访问模块,记录此处。
这是我可以附加到“SAP 作为数据库引擎”的唯一含义——您想要访问 SAP MaxDB。其他答案做出不同的假设,并且(我相信)也是正确的......在这些不同的假设下。
If you're talking about (what used to be named) the SAP Database AKA SapDb, and is now MaxDB (for a while distributed also by MySql Inc, now again by SAP only -- and so named SAP MaxDB), it comes with several Python access modules, documented here.
This is the only meaning I can attach to "SAP as the database engine" -- that you want to access SAP MaxDB. Other answers make different assumptions and (I believe) are also correct... under those different assumptions.
SAP 不是数据库服务器。
但使用 Python SAP RFC 模块,您可以非常轻松地查询大多数表。它正在使用一些 sap 不支持的功能(全世界都在使用)。并且该函数对字段大小和数据类型有一定的限制。
Sap is NOT a database server.
But with the Python SAP RFC module you can query most table quite easily. It is using some sap unsupported function ( that all the world is using). And this function has some limitation on field size and datatypes.
如上所述,当您只想读取表格或执行 RFC 或 BAPI 调用时,可以将 CPython 与未维护的 Python SAP RFC 模块或 Piers Harding 的 SAP RFC.仅读取表的 RFC 调用是 RFC_GET_TABLE_ENTRIES 或 RFC_READ_TABLE,其中前者是首选,但也不会发布给客户。
对于更正式的方式,您可以将 SAP 的 JCO 连接器与 Jython 结合使用,或者将 SAP 的 .Net 连接器与 Ironpython 结合使用;这两个连接器都可以从 SAP 的服务市场下载,并且都允许调用 RFC 功能,包括上面列出的两个调用。
如上所述,SAP 提出的访问后端功能的方式是通过 SAP 庞大的 SOA 基础设施。在这里,您可以将 Jython 与 Axis 库一起使用,或将 Ironpython 与 Microsoft 的 WCF 一起使用。请注意,SAP 提供的服务显然不允许您访问普通表,而您只能调用服务提供的内容。 SAP 已经提供了大约 3000 个服务(请参阅 SDN 上的 ES Wiki),一旦您在支持远程的功能模块中拥有业务逻辑,创建您自己的服务实际上非常简单。
As stated above, when you just want to read tables or do RFC or BAPI calls, you can use CPython with the unmaintained Python SAP RFC module or Piers Harding's SAP RFC. The RFC calls to just read a table are RFC_GET_TABLE_ENTRIES or RFC_READ_TABLE, where the former is preferred, but also not released to customers.
For a more official way, you can use SAP's JCO connector with Jython or SAP's .Net Connector with Ironpython; both connectors can be downloaded from SAP's service marketplace and both allow to call the RFC functionality including the two calls listed above.
As also stated above, the way proposed by SAP to access backend functionality is via SAP's vast SOA infrastructure. Here you can use Jython with e.g. the Axis library or Ironpython with Microsofts WCF. Note, that the services provided by SAP obviously won't allow you to access the plain tables, instead you just can call, what a service provides. SAP already delivers about 3.000 services (see the ES Wiki on SDN), and creating your own service is in fact dead simple, once you have your business logic in a remote-enabled function module.
Python 是最常用的面向对象编程语言之一,非常易于编码和理解。
为了在 SAP 中使用 Python,我们需要安装 Python SAP RFC 模块,即 PyRFC。它的可用方法之一是 RFC_READ_TABLE,可以调用它从 SAP 数据库的表中读取数据。
此外,PyRFC 包提供了各种绑定,可用于以任何一种方式进行调用。我们可以使用 ABAP 模块到 Python 模块进行调用,或者反过来。人们可以定义用于数据交换的等效 SAP 数据类型。
另外,我们可以用Python创建Web Service,用于相互通信。 SAP NetWeaver 与全状态或无状态的 Web 服务完全兼容。
Python is one of the most used object-oriented programming languages which is very easy to code and understand.
In order to use Python with SAP, we need to install Python SAP RFC module which is known as PyRFC. One of its available methods is RFC_READ_TABLE which can be called to read data from a table in SAP database.
Also, the PyRFC package provides various bindings which can be utilized to make calls either way. We can use to make calls either from ABAP modules to Python modules or the other way round. One can define equivalent SAP data types which are used in data exchange.
Also, we can create Web Service in Python which can be used for inter-communication. SAP NetWeaver is fully compatible with web services either state full or stateless.