Connect to S/4HANA CDS View Entities through ODBC.
Project description
ODBC for ABAP (odbc4abap)
ODBC for ABAP is a Python library that provides an Open Database Connectivity (ODBC) driver for ABAP systems. This library is designed to plug into SQLAlchemy 2.0 and allows for external SQL read access to CDS objects owned by the ABAP system.
Why an ODBC Driver for ABAP?
Direct SQL read access to the underlying SAP HANA database of an ABAP system is not recommended due to several issues outlined in SAP Note 2511210. These include unstable names and internal structures, incorrect typecasts, and bypassed ABAP-level security concepts.
By treating the ABAP system itself as a database and accessing it directly using ODBC, these problems are mitigated. Authentication and authorization are handled using an ABAP user, and full ABAP SQL semantics apply. This approach also enables the use of application-server-level buffering, ABAP-level access control, and read access logging.
Compared to the ODATA interface, the ODBC interface provides unrestricted SQL access to all exposed ABAP CDS view entities, allowing for ad-hoc joins and data aggregation for analytical queries.
Features
- Supports the use of a technical user in the ABAP system with privileged access (no DCLs).
- Allows only read access to the exposed ABAP CDS objects.
- Integrates with SQLAlchemy 2.0 for easy use within Python applications.
Installation
To install odbc4abap
, you can use pip
:
pip install odbc4abap
Configuration
Please refer to SAP Note '3076454 - ODBC driver for ABAP: Configuration' for detailed configuration instructions.
Usage
After installing and configuring the library, you can use it within your Python application to query ABAP CDS view entities. Here is an example of how to use odbc4abap
with SQLAlchemy:
from sqlalchemy import create_engine
# Create an engine that connects to the ABAP system
engine = create_engine('odbc4abap+pyodbc://username:password@dsn')
# Query the ABAP system using SQLAlchemy ORM or Core
# ...
Limitations
- Currently, only read access is supported.
- The library supports the use of a technical user with privileged access only.
License
odbc4abap
is released under the MIT License. See the LICENSE file for more details.
Contributions
Contributions are welcome! Please submit pull requests or open issues on the project's GitHub repository.
Support
For support and further assistance, please refer to the SAP community forums or open an issue on the GitHub repository.
Disclaimer
This project is not affiliated with SAP SE or its group of companies.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sqlalchemy-odbc4abap-0.0.3.tar.gz
.
File metadata
- Download URL: sqlalchemy-odbc4abap-0.0.3.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc5db383521d1313c708f80dacb120ead2ba4649924e43bec5a33479f85e7d99 |
|
MD5 | b7544c5152da7901c8efcc7f9610008c |
|
BLAKE2b-256 | 7fb55ff70f39968fc2267239705510f1cce82081d7ef6026cda638169cbeec2a |
File details
Details for the file sqlalchemy_odbc4abap-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: sqlalchemy_odbc4abap-0.0.3-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ac8c0baf49d10b82fe78dc5b7118ce60d8efdf8540fca887b8aa3a69c49617f |
|
MD5 | a1a4a9d67f8ee808893d76222d86220b |
|
BLAKE2b-256 | 1990293fd60644246b6cb07a94b73e08160b80e675e122359ac278e02894280c |