Skip to main content

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

abap_adt_py-0.1.3.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abap_adt_py-0.1.3-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file abap_adt_py-0.1.3.tar.gz.

File metadata

  • Download URL: abap_adt_py-0.1.3.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for abap_adt_py-0.1.3.tar.gz
Algorithm Hash digest
SHA256 609e714efe303f6ebd27e0576f0ef77e494b0c30597d1eeae43917a1de5bf68e
MD5 7fa45896502f7cbeeb2bcdfe621d8316
BLAKE2b-256 b37384c131d63ca5702d006a3660fe78d94ef231dbd5a61abc3680c3ebef8773

See more details on using hashes here.

File details

Details for the file abap_adt_py-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: abap_adt_py-0.1.3-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

Hashes for abap_adt_py-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 da93ca1bcb0b87635d05a0cb99cfb13647bb17f2b9ef9d12cf91477f59e9f5fc
MD5 8eedbb8a857cdf20b1ce95c5e1630437
BLAKE2b-256 6095547dd2013e3dd9c4632df95f923a162c5da96feeb6812ade068302397d33

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page