PyRFC 适用于 Python 的异步、非阻塞 SAP NetWeaver RFC SDK 绑定

news/2024/10/2 18:36:16

Asynchronous, non-blocking SAP NetWeaver RFC SDK bindings for Python.
适用于 Python 的异步、非阻塞 SAP NetWeaver RFC SDK 绑定

PyRFC 适用于 Python 的异步、非阻塞 SAP NetWeaver RFC SDK 绑定

Call for Maintainers

This project is currently looking for new maintainers. Please see this issue for details.

Features

  • Client and Server bindings
  • Automatic conversion between Python and ABAP datatypes
  • Stateless and stateful connections (multiple function calls in the same ABAP session / same context)
  • Sequential and parallel calls, using one or more clients
  • Throughput monitoring

Supported platforms

  • All platforms supported by SAP NWRFC SDK are supported by build from source installation (build instructions)

  • In addition, pre-built wheels are provided for Windows, Darwin and Ubuntu Linux, attached to PyRFC GitHub release

  • Docker containers: SAP fundamental-tools/docker

  • Linux wheels supported by build from source installation only

  • Pre-built portable Linux wheels

    • are not supported, neither issues related to portable Linux wheels

    • must not be distributed with embedded SAP NWRFC SDK binaries, only private use permitted

  • Ansible Module for use of SAP PyRFC

  • Microsoft IIS, see #359

Requirements

SAP NW RFC SDK 7.50 Patch Level 12

  • see SAP Note 3337381: SAP NetWeaver RFC SDK 7.50 -- Patch Level 12 for a list of bug fixes and enhancements made with this patch release.
  • Only the latest patch level is supported by SAP
  • The latest version is fully backwards compatible, from today S4, down to R/3 release 4.6C.
  • Can be downloaded from SAP Software Download Center of the SAP Support Portal, like described at SAP NetWeaver Remote Function Call (RFC) Software Development Kit (SDK).
  • If you are lacking the required authorization for downloading software from the SAP Service Marketplace, please follow the instructions of SAP Note 1037575 for requesting this authorization.

Linux

PyRFC is using source distribution (sdist) installation on Linux systems and Cython is required on Linux system to build the PyRFC package from source. See Installing Cython

Windows

  • Visual C++ Redistributable Package for Visual Studio 2013 is required for run-time, see SAP Note 2573790 - Installation, Support and Availability of the SAP NetWeaver RFC Library 7.50

  • Build toolchain for Python requires Microsoft C++ Build Tools, the latest version recommended

  • Due to a change introduced with Python 3.8 for Windows, PATH directories are no longer searched for DLL. The SAP NWRFC SDK lib path is no longer required on PATH, for Python >= 3.8.

macOS

  • Remote paths must be set in SAP NWRFC SDK for macOS: documentation

  • When the PyRFC is started for the first time, the popups may come-up for each NWRFC SDK library, to confirm the usage. If SAP NW RFC SDK is installed in admin folder, the app shall be first time started with admin privileges, eg. sudo -E

Docker

  • Docker container examples for Linux, Intel and ARM based Darwin: SAP/fundamental-tools/docker. SAP NWRFC SDK libraries are not included.

Getting started

Note: The package must be installed before use.

Call ABAP Function Module from Python

In order to call remote enabled ABAP function module (ABAP RFM), first a connection must be opened.

from pyrfc import Connection
conn = Connection(ashost='10.0.0.1', sysnr='00', client='100', user='me', passwd='secret')
# ABAP variables are mapped to Python variables
result = conn.call('STFC_CONNECTION', REQUTEXT=u'Hello SAP!')
print (result)
{u'ECHOTEXT': u'Hello SAP!',u'RESPTEXT': u'SAP R/3 Rel. 702   Sysid: ABC   Date: 20121001   Time: 134524   Logon_Data: 100/ME/E'}# ABAP structures are mapped to Python dictionaries
IMPORTSTRUCT = { "RFCFLOAT": 1.23456789, "RFCCHAR1": "A" }# ABAP tables are mapped to Python lists, of dictionaries representing ABAP tables' rows
IMPORTTABLE = []result = conn.call("STFC_STRUCTURE", IMPORTSTRUCT=IMPORTSTRUCT, RFCTABLE=IMPORTTABLE)print result["ECHOSTRUCT"]
{ "RFCFLOAT": 1.23456789, "RFCCHAR1": "A" ...}print result["RFCTABLE"]
[{ "RFCFLOAT": 1.23456789, "RFCCHAR1": "A" ...}]

https://dhexx.cn/news/show-5426489.html

相关文章

SpringBoot:Web开发(基于SpringBoot使用MyBatis-Plus+JSP开发)

目录 前期准备 构建项目(IDEA2023.1.2,JDK21,SpringBoot3.3.3) 添加启动器 Model准备 这里我们利用MybatisX插件生成我们所需要的实体类、数据访问层以及服务层 注意选择MyBatis-Plus3以及Lombok 然后再在service接口中定义…

解决VSCode文件的中文GBK和UTF-8编码之间乱码问题

NOTE:近日笔者在使用VSCode编码环境的时候,出现了中文和UTF-8两者之间乱码的问题,特编写本片文章,以作学习记录。 1.需求 用VSCode打开外部的GBK2312编码文件,想在VSCode中统一以UTF-8编码查看(笔者推荐U…

Java 线程相关 总结

1. 简介 本文总结一下Java中线程相关的知识。 2.线程的状态 ‌Java线程有六种状态‌: ‌NEW状态‌:线程对象已被创建,但尚未启动。 ‌RUNNABLE状态‌:1.线程已经准备好,随时可以被CPU执行。2.线程正在执行。TERMI…

Oracle从入门到放弃

Oracle从入门到放弃 左连接和右连接Where子查询单行子查询多行子查询 from子句的子查询select子句的子查询oracle分页序列序列的应用 索引PL/SQL变量声明与赋值select into 赋值变量属性类型 异常循环游标存储函数存储过程不带传出参数的存储过程带传出参数的存储过程 左连接和…

利用pandas为海量数据添加UUID并实现精准筛选

文章目录 摘要引言环境准备构建示例数据添加UUID列精准筛选数据成果展示 摘要 在数据处理中,为每条数据记录赋予独特身份标识至关重要。本文通过引入UUID 作为全局唯一标识符,结合强大的pandas库,详细介绍了如何为数据表轻松添加UUID&#x…

Deep Learning-Based Object Pose Estimation:A Comprehensive Survey

论文:https://arxiv.org/pdf/2405.07801v3 项目:https://github.com/CNJianLiu/Awesome-Object-Pose-Estimation 年份:2024 方向:姿态估计 1. 目标姿态估计定义 估计图像中目标相对于相机的姿态, 目标姿态估计是增…

TDengine 与 SCADA 强强联合:提升工业数据管理的效率与精准

随着时序数据库(Time Series Database)的日益普及,越来越多的工业自动化控制(工控)人员开始认识到其强大能力。然而,时序数据库在传统实时数据库应用领域,特别是在过程监控层的推广仍面临挑战&a…

Java标识符、关键字和保留字

Java中的标识符、关键字和保留字 标识符概念标识符命名规则(必须遵守)标识符命名规范(更加专业)关键字保留字 标识符概念 1.Java对各种变量、方法和类等命名时使用的字符序列称为标识符。 2.凡是自己可以起名字的地方都叫标识符 …

“华为杯”第二十一届中国研究生数学建模竞赛开赛须知

↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ 1.加密赛题开始下载时间:2024年9月20日8:00&am…

不断挑战才有不断机遇!Eagle Trader等你来加入!

2024“Eagle Trader杯”全国职业交易联赛S1赛季已火热进行一个多月,吸引了超过355名交易员的积极参与!目前,每天都有新的交易员踊跃报名参加! 经过严格地交易考核,13名选手成功通过初试,正进入下一阶段的挑…