Skip to main content

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.

Metadata

Release files for sqlalchemy-odbc4abap 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlalchemy-odbc4abap 0.0.5
File Size Uploaded
sqlalchemy-odbc4abap-0.0.5.tar.gz 14.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sqlalchemy-odbc4abap 0.0.5
File Interpreter ABI Platform
sqlalchemy_odbc4abap-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 29.1 kB

Release files / sqlalchemy-odbc4abap-0.0.5.tar.gz

Download URL sqlalchemy-odbc4abap-0.0.5.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1873f6eb86eacac86537546a63c2557ab4ad21c8760d2865ec80aeb71c02e96b
BLAKE2b-256 checksum
How to use checksums
30dd4b35f35d8e4de09747809bee72cc380f045d32297bb726c8838f5750701a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / sqlalchemy_odbc4abap-0.0.5-py3-none-any.whl

Download URL sqlalchemy_odbc4abap-0.0.5-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a0c5df62f6be06eee59040e9d01bdd4e7812d5348d51e79fcf1e4367acde8136
BLAKE2b-256 checksum
How to use checksums
ad7cda825de98715fb01a408ccdbccbfef2d1f952146091ed1a8c8074c121eb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page