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()
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.1.tar.gz (10.5 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.1-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: abap_adt_py-0.1.1.tar.gz
  • Upload date:
  • Size: 10.5 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.1.tar.gz
Algorithm Hash digest
SHA256 5532b3c5881b2e81df65d54e5d2f0bd837c8d63f6068834f1a002a57d2cd0254
MD5 1222d82ac794acf51e5a15c0c5dfd9ce
BLAKE2b-256 2adc7b4aacea2f48e0028c1714b2a94ffaa25c9bb8ed362df2c4168cc5ea1878

See more details on using hashes here.

File details

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

File metadata

  • Download URL: abap_adt_py-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 47cc18d1f93eba2761a24cdb2b258c26cff6ba8892aeb7871e926f193c1d1adb
MD5 60e0297158b8a3d6b00b1b1bf3436aee
BLAKE2b-256 d5d3a18e04e39c593e14d3f6ca683d7b9f0e6c78c289291330796f48db16e100

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