{"id":22792179,"url":"https://sap.github.io/PyRFC","last_synced_at":"2025-08-09T20:31:43.259Z","repository":{"id":13923902,"uuid":"16623330","full_name":"SAP/PyRFC","owner":"SAP","description":"Asynchronous, non-blocking SAP NW RFC SDK bindings for Python","archived":false,"fork":false,"pushed_at":"2024-07-16T16:06:13.000Z","size":42526,"stargazers_count":515,"open_issues_count":16,"forks_count":141,"subscribers_count":62,"default_branch":"main","last_synced_at":"2024-12-05T10:48:22.174Z","etag":null,"topics":["abap","nwrfc","pyrfc","python","rfc","sap","sap-nwrfc-sdk","sapnwrfc"],"latest_commit_sha":null,"homepage":"http://sap.github.io/PyRFC","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SAP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-02-07T18:25:16.000Z","updated_at":"2024-12-02T08:52:21.000Z","dependencies_parsed_at":"2024-06-19T11:19:34.012Z","dependency_job_id":"c8836e20-8e5d-48e7-b068-5e4460ff9cf7","html_url":"https://github.com/SAP/PyRFC","commit_stats":{"total_commits":274,"total_committers":11,"mean_commits":24.90909090909091,"dds":0.07664233576642332,"last_synced_commit":"5422368c6d50c837d8854c5e7f09e6b46dbbf8aa"},"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP%2FPyRFC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP%2FPyRFC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP%2FPyRFC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP%2FPyRFC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SAP","download_url":"https://codeload.github.com/SAP/PyRFC/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229322954,"owners_count":18055080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abap","nwrfc","pyrfc","python","rfc","sap","sap-nwrfc-sdk","sapnwrfc"],"created_at":"2024-12-12T03:10:00.659Z","updated_at":"2025-08-09T20:31:43.238Z","avatar_url":"https://github.com/SAP.png","language":"Python","readme":"## Deprecation Notice\n\nThis public repository is no longer maintained. Please see [this issue](https://github.com/SAP/PyRFC/issues/372) for details.\n\n![](https://img.shields.io/badge/STATUS-NOT%20CURRENTLY%20MAINTAINED-red.svg?longCache=true\u0026style=flat)\n\n---\n\n\u003ch1\u003ePyRFC\u003c/h1\u003e\n\nAsynchronous, non-blocking [SAP NetWeaver RFC SDK](https://support.sap.com/en/product/connectors/nwrfcsdk.html) bindings for Python.\n\n[![PyPI - Wheel](https://img.shields.io/pypi/wheel/pyrfc)](https://pypi.org/project/pyrfc/)\n[![PyPI - Version](https://img.shields.io/pypi/v/pyrfc)](https://pypi.org/project/pyrfc/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyrfc)](https://pypi.org/project/pyrfc/)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/pyrfc)](https://pypistats.org/packages/pyrfc)\n[![REUSE status](https://api.reuse.software/badge/github.com/SAP/PyRFC)](https://api.reuse.software/info/github.com/SAP/PyRFC)\n[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4349/badge)](https://bestpractices.coreinfrastructure.org/projects/4349)\n\n- [Features](#features)\n- [Supported platforms](#supported-platforms)\n- [Requirements](#requirements)\n  - [SAP NW RFC SDK 7.50 Patch Level 12](#sap-nw-rfc-sdk-750-patch-level-12)\n  - [Linux](#linux)\n  - [Windows](#windows)\n  - [macOS](#macos)\n  - [Docker](#docker)\n- [Download and installation](#download-and-installation)\n- [Getting started](#getting-started)\n  - [Call ABAP Function Module from Python](#call-abap-function-module-from-python)\n  - [Call Python function from ABAP](#call-python-function-from-abap)\n- [SPJ articles](#spj-articles)\n- [How to obtain support](#how-to-obtain-support)\n- [Contributing](#contributing)\n- [Code of Conduct](#code-of-conduct)\n\n## Features\n\n- Client and Server bindings\n- Automatic conversion between Python and ABAP datatypes\n- Stateless and stateful connections (multiple function calls in the same ABAP session / same context)\n- Sequential and parallel calls, using one or more clients\n- Throughput monitoring\n\n## Supported platforms\n\n- All [platforms supported by SAP NWRFC SDK](https://launchpad.support.sap.com/#/notes/2573790) are supported by build from source installation ([build instructions](http://sap.github.io/PyRFC/build.html))\n\n- In addition, pre-built wheels are provided for Windows, Darwin and Ubuntu Linux, attached to PyRFC GitHub [release](https://github.com/SAP/PyRFC/releases/latest)\n\n- Docker containers: [SAP fundamental-tools/docker](https://github.com/SAP/fundamental-tools/tree/main/docker)\n\n- Linux wheels supported by build from source installation only\n\n- Pre-built [portable Linux wheels](https://www.python.org/dev/peps/pep-0513/)\n  - are not supported, neither issues related to portable Linux wheels\n\n  - **must not** be distributed with embedded SAP NWRFC SDK binaries, only private use permitted\n\n- [Ansible Module for use of SAP PyRFC](https://docs.ansible.com/ansible/latest/collections/community/sap_libs/sap_pyrfc_module.html)\n\n- Microsoft IIS, see [#359](https://github.com/SAP/PyRFC/issues/359)\n\n## Requirements\n\n### SAP NW RFC SDK 7.50 Patch Level 12\n\n- see [SAP Note 3337381: SAP NetWeaver RFC SDK 7.50 -- Patch Level 12](https://me.sap.com/notes/3337381) for a list of bug fixes and enhancements made with this patch release.\n- **NOTE: This patch level is no longer supported by SAP! The latest patch level might not work with this project!**\n- The latest version can be downloaded from SAP Software Download Center of the SAP Support Portal, like described at https://support.sap.com/nwrfcsdk.\n- If you are lacking the required authorization for downloading software from the SAP Service Marketplace, please follow the instructions of [SAP Note 1037575](https://launchpad.support.sap.com/#/notes/1037575) for requesting this authorization.\n\n### Linux\n\nPyRFC is using source distribution (sdist) installation on Linux systems and [Cython](https://cython.readthedocs.io/en/latest/index.html) is required on Linux system to build the PyRFC package from source. See [Installing Cython](https://cython.readthedocs.io/en/latest/src/quickstart/install.html#installing-cython)\n\n### Windows\n\n- [Visual C++ Redistributable Package for Visual Studio 2013](https://www.microsoft.com/en-US/download/details.aspx?id=40784) is required for run-time, see [SAP Note 2573790 - Installation, Support and Availability of the SAP NetWeaver RFC Library 7.50](https://launchpad.support.sap.com/#/notes/2573790)\n\n- Build toolchain for Python requires [Microsoft C++ Build Tools](https://aka.ms/buildtools), the latest version recommended\n\n- Due to a [change introduced with Python 3.8 for Windows](https://docs.python.org/3.8/whatsnew/3.8.html#bpo-36085-whatsnew), PATH directories are no longer searched for DLL. The SAP NWRFC SDK lib path is no longer required on PATH, for Python \u003e= 3.8.\n\n### macOS\n\n- Remote paths must be set in SAP NWRFC SDK for macOS: [documentation](http://sap.github.io/PyRFC/install.html#macos)\n\n- 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`\n\n### Docker\n\n- Docker container examples for Linux, Intel and ARM based Darwin: [SAP/fundamental-tools/docker](https://github.com/SAP/fundamental-tools/tree/main/docker). SAP NWRFC SDK libraries are not included.\n\n## Download and installation\n\n```shell\npip install pyrfc\n```\n\nOn Windows and macOS platforms pre-built binary wheel is installed, without local compilation. On Linux platform the package is locally built from source distribution.\n\nBuild from source distribution can be requested also on other platforms:\n\n```shell\npip install --no-binary pyrfc pyrfc\n# or\npip install https://files.pythonhosted.org/packages/.../pyrfc-3.1.0.tar.gz\n```\n\nAlternative build from source installation:\n\n```shell\ngit clone https://github.com/SAP/PyRFC.git\ncd PyRFC\n# if you use tox\ntox -e py311 # for Python 3.11\n# or\npython -m pip install .\n# or\npython -m build --wheel --sdist --outdir dist\n# or\nPYRFC_BUILD_CYTHON=yes python -m build --wheel --sdist --outdir dist\npip install --upgrade --no-index --find-links=dist pyrfc\n```\n\nRun ``python`` and type ``from pyrfc import *``. If this finishes silently, without oputput, the installation was successful.\n\nUsing virtual environments you can isolate Python/PyRFC projects, working without administrator privileges.\n\nSee also the [pyrfc documentation](http://sap.github.io/PyRFC),\ncomplementing _SAP NWRFC SDK_[documentation](https://support.sap.com/nwrfcsdk), especially [SAP NWRFC SDK 7.50 Programming Guide](https://support.sap.com/content/dam/support/en_us/library/ssp/products/connectors/nwrfcsdk/NW_RFC_750_ProgrammingGuide.pdf).\n\n## Getting started\n\n**Note:** The package must be [installed](#download-and-installation) before use.\n\n### Call ABAP Function Module from Python\n\nIn order to call remote enabled ABAP function module (ABAP RFM), first a connection must be opened.\n\n```python\nfrom pyrfc import Connection\nconn = Connection(ashost='10.0.0.1', sysnr='00', client='100', user='me', passwd='secret')\n```\n\nConnection parameters are documented in `sapnwrfc.ini` file, located in the _SAP NWRFC SDK_ `demo` folder. Check also section `4.1.2 Using sapnwrfc.ini` of [SAP NWRFC SDK 7.50 Programming Guide](https://support.sap.com/content/dam/support/en_us/library/ssp/products/connectors/nwrfcsdk/NW_RFC_750_ProgrammingGuide.pdf).\n\nUsing an open connection, remote function modules (RFM) can be invoked. More info in [pyrfc documentation](http://sap.github.io/PyRFC/client.html#client-scenariol).\n\n```python\n# ABAP variables are mapped to Python variables\nresult = conn.call('STFC_CONNECTION', REQUTEXT=u'Hello SAP!')\nprint (result)\n{u'ECHOTEXT': u'Hello SAP!',\n u'RESPTEXT': u'SAP R/3 Rel. 702   Sysid: ABC   Date: 20121001   Time: 134524   Logon_Data: 100/ME/E'}\n\n# ABAP structures are mapped to Python dictionaries\nIMPORTSTRUCT = { \"RFCFLOAT\": 1.23456789, \"RFCCHAR1\": \"A\" }\n\n# ABAP tables are mapped to Python lists, of dictionaries representing ABAP tables' rows\nIMPORTTABLE = []\n\nresult = conn.call(\"STFC_STRUCTURE\", IMPORTSTRUCT=IMPORTSTRUCT, RFCTABLE=IMPORTTABLE)\n\nprint result[\"ECHOSTRUCT\"]\n{ \"RFCFLOAT\": 1.23456789, \"RFCCHAR1\": \"A\" ...}\n\nprint result[\"RFCTABLE\"]\n[{ \"RFCFLOAT\": 1.23456789, \"RFCCHAR1\": \"A\" ...}]\n```\n\nFinally, the connection is closed automatically when the instance is deleted by the garbage collector. As this may take some time, we may either call the close() method explicitly or use the connection as a context manager:\n\n```python\nwith Connection(user='me', ...) as conn:\n    conn.call(...)\n# connection automatically closed here\n```\n\nAlternatively, connection parameters can be provided as a dictionary:\n\n```python\ndef get_connection(conn_params):\n    \"\"\"Get connection\"\"\"\n    print 'Connecting ...', conn_params['ashost']\n    return Connection(**conn_param)\n\nfrom pyrfc import Connection\n\nabap_system = {\n    'user'      : 'me',\n    'passwd'    : 'secret',\n    'ashost'    : '10.0.0.1',\n    'saprouter' : '/H/111.22.33.44/S/3299/W/e5ngxs/H/555.66.777.888/H/',\n    'sysnr'     : '00',\n    'client'    : '100',\n    'trace'     : '3', #optional, in case you want to trace\n    'lang'      : 'EN'\n}\n\nconn = get_connection(**abap_system)\nConnecting ... 10.0.0.1\n\nconn.alive\nTrue\n```\n\nSee also pyrfc documentation for [Client Scenario](http://sap.github.io/PyRFC/client.html)\n\n### Call Python function from ABAP\n\n```python\n# create server for ABAP system ABC\nserver = Server({\"dest\": \"gateway\"}, {\"dest\": \"MME\"}, {\"port\": 8081, \"server_log\": False})\n\n# expose python function my_stfc_connection as ABAP function STFC_CONNECTION, to be called from ABAP system\nserver.add_function(\"STFC_CONNECTION\", my_stfc_connection)\n\n# start server\nserver.start()\n\n# get server attributes\nprint(\"Server attributes\", server.get_server_attributes())\n\n# stop server\ninput(\"Press Enter to stop servers...\")\n\nserver.stop()\nprint(\"Server stoped\")\n```\n\nSee also pyrfc documentation for [Server Scenario](http://sap.github.io/PyRFC/server.html) and server example [source code](https://github.com/SAP/PyRFC/blob/main/examples/server).\n\n## SPJ articles\n\nHighly recommended reading about RFC communication and SAP NW RFC Library, published in the SAP Professional Journal (SPJ)\n\n- [Part I RFC Client Programming](https://wiki.scn.sap.com/wiki/x/zz27Gg)\n\n- [Part II RFC Server Programming](https://wiki.scn.sap.com/wiki/x/9z27Gg)\n\n- [Part III Advanced Topics](https://wiki.scn.sap.com/wiki/x/FD67Gg)\n\n## How to obtain support\n\nIf you encounter an issue or have a feature request, you can create a [ticket](https://github.com/SAP/PyRFC/issues).\n\nCheck out the [SAP Community](https://community.sap.com/) (search for \"pyrfc\") and stackoverflow (use the tag [pyrfc](https://stackoverflow.com/questions/tagged/pyrfc)), to discuss code-related problems and questions.\n\n## Contributing\n\nWe appreciate contributions from the community to **PyRFC**!\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for more details on our philosophy around extending this module.\n\n## Code of Conduct\n\nSee [Code of Conduct](./CODE_OF_CONDUCT.md)\n","funding_links":[],"categories":["Integration"],"sub_categories":["Connectors"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/sap.github.io%2FPyRFC","html_url":"https://awesome.ecosyste.ms/projects/sap.github.io%2FPyRFC","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/sap.github.io%2FPyRFC/lists"}