pyapi4abap
A template that pairs a Python FastAPI service with ABAP demo reports calling it through an SM59 RFC destination, with a step-by-step guide from the first endpoint to a container image.
Three demo endpoints and the ABAP that calls them: /hello as an HTTP GET, /check as a GET with parameters and /process as a POST, with one ABAP report per method in the abap folder, installed with SE38 and pointed at an SM59 destination of type G. The guide runs from creating the Python project, through exposing the service and maintaining the destination with SSL where the service uses HTTPS, to building a container image and deploying it. The ABAP half uses the B-Tocs ABAP SDKB-Tocs ABAP SDKAn ABAP package that carries the outbound web service call for an SAP ABAP server, with the utility and security classes it needs under it and one plugin per integration on top.independent, abap, and the reports show creating a connector object, setting the endpoint, reading the response and its content type, and building and parsing JSON. Where no network route runs from the SAP system to the service, the maintainer names an ngrok tunnel as a workaround for developer scenarios, and an ABAPer with no Python interest can skip the Python part and start the stack as a local container.
Facts
Where it sits
Who is behind it
In the atlas: maintains 6, contributes to 5@b-tocsmaintainer
What it declares
Every artifact
- Type
- Sample
- Origin
- Independently maintained
As a sample
- Form
- does not say
Connections
Web service client and connector layer for calling out of ABAP
A container engine that packages software with the tools it needs and runs it isolated from the host. Things here that ship as an image need it installed, so the reader installs the engine rather than each of the command line tools inside the container.
Download
README
quoted from b-tocs/pyapi4abap under MIT, readB-Tocs Python API Template for SAP ABAP

This repository is a simple template for building Python based APIs for SAP ABAP and multi target scenarios. The python API based on FastAPI. For the ABAP part the B-Tocs ABAP SDK is used.
Big Picture
This project handles the following aspects:
- Create a python based API
- Call this API from SAP ABAP systems
- Create a cloud native container for multi target deployment
Step-By-Step Guide
- Create a python based API
- Call this API from SAP ABAP systems
- Create a cloud native container for multi target deployment
For ABAPers without Python interests
You can skip part 1 of the Step-By-Step Guide and start the python stack as local container as described in 3.3. Continue with 2.1 "Expose API ...".
FAQ
Where I can get more examples for using the B-Tocs ABAP SDK?
Check the project site of the B-Tocs ABAP SDK. There are some other projects listed using this SDK. The projects LibreTranslate and Ollama are recommended for this.
How I can add more description and configuration to the swagger UI?
Check the FastAPI documentation.
last updated: 16.05.2024 mdjoerg
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
History in the atlas
- First seen.
For your agent
- Ref
artifact:b-tocs-pyapi4abap- JSON
- /artifacts/b-tocs-pyapi4abap.json
- MCP
- Connecting an agent