A Python library for interacting with SAP systems using the ADT (ABAP Development Tools) protocol.
Project description
abap-adt-py
abap-adt-py is a Python client library to interact with SAP systems via the ABAP Development Tools (ADT) REST API. It allows you to programmatically manage ABAP artifacts and workflows directly from Python.
Features
- Authenticate and log in to SAP systems securely
- Create, read, edit, and activate ABAP objects
- Search ABAP repositories and metadata
- Run ABAP unit tests and retrieve results
- Seamless integration with Python for automation and scripting
Installation
Install the package from PyPI:
pip install abap-adt-py
Or install from source:
git clone https://github.com/yourusername/abap-adt-py.git
cd abap-adt-py
pip install .
Usage
# Test Report
report_name = "z_test"
report_uri = "/sap/bc/adt/programs/programs/z_test"
# establish connection to SAP system
client = AdtClient(
sap_host="http://localhost:50000",
username="DEVELOPER",
password="ABAPtr2022#01",
client="001",
language="EN",
)
# login
response = client.login()
# search
results: list = client.search_object(report_name, 50)
print(results)
# create report object
client.create(
object_type="PROG/P",
name=report_name,
description="Test Program",
parent="$TMP",
)
# read source code
src: str = client.get_object_source(f"{report_uri}/source/main")
print(src)
# configure pretty printing
pretty_print_settings: PrettyPrintSettings = {"indentation": True, "style": "keywordUpper"}
client.prettyprint_settings(pretty_print_settings)
# pretty print source code
src: str = f"Report {report_name}. Write 'test'."
pretty_src = client.prettyprint(src)
# write source code
lock_handle: str = client.lock(report_uri)
client.set_object_source(f"{report_uri}/source/main", pretty_src, lock_handle)
client.unlock(report_uri, lock_handle)
# activate object
client.activate(report_name, report_uri)
# delete object
lock_handle: str = client.lock(report_uri)
client.delete(report_uri, lock_handle)
client.unlock(report_uri, lock_handle)
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file abap_adt_py-0.1.4.tar.gz.
File metadata
- Download URL: abap_adt_py-0.1.4.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66918a24deb5f4fc7ad45c55ee6766a520b570afe64cbddbaa5e5f5b487c5520
|
|
| MD5 |
075b4237d3dea2d1927a20c81cb35802
|
|
| BLAKE2b-256 |
84907a43fd5f38b5607d84ab55090c3aca5b463711c102d33591beff7499660b
|
File details
Details for the file abap_adt_py-0.1.4-py3-none-any.whl.
File metadata
- Download URL: abap_adt_py-0.1.4-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e50460ac9b57639523d15b144a8a7f9c5855536f08af15b363f6a2ef6a90db1
|
|
| MD5 |
6c5e61d8eb2a1a93f650fb684a9f8003
|
|
| BLAKE2b-256 |
27c1e8887d2249298ef9a612d75419ec9ca432dc9613f02562b8e778e3ebe076
|