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.5.tar.gz
.
File metadata
- Download URL: sqlalchemy-odbc4abap-0.0.5.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 | 1873f6eb86eacac86537546a63c2557ab4ad21c8760d2865ec80aeb71c02e96b |
|
MD5 | 669af53b21094a7f424c935a9544b66f |
|
BLAKE2b-256 | 30dd4b35f35d8e4de09747809bee72cc380f045d32297bb726c8838f5750701a |
File details
Details for the file sqlalchemy_odbc4abap-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: sqlalchemy_odbc4abap-0.0.5-py3-none-any.whl
- Upload date:
- Size: 14.7 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 | a0c5df62f6be06eee59040e9d01bdd4e7812d5348d51e79fcf1e4367acde8136 |
|
MD5 | c08b07a0906419e39a95562794e952e8 |
|
BLAKE2b-256 | ad7cda825de98715fb01a408ccdbccbfef2d1f952146091ed1a8c8074c121eb4 |