Skip to content

Code Editing

stud0709 edited this page Oct 12, 2026 · 15 revisions

Code Editing Tools

This set of tools enables the agent to effectively edit and syntax-check ABAP sources. The editing workflow:

  • Fetch the file from SAP
  • Edit and check syntax in a local file
  • With write permission: push, activate. Without write permission: the user is responsible for pushing the source to SAP
  • Automated Shell Creation:
    • Dictionary Objects (DDIC): Pushing XML structures for Dictionary objects (Data Elements DTEL, Domains DOMA, Tables/Structures TABL, Table Types TTYP) via sap_push (using aspect 'metadata') automatically creates their backend shells upon encountering a 404 (not found) error.
    • Textual Repository Objects: Pushing plain-text source code via sap_push (using aspect 'source') requires the object shell to exist on the backend first. However, the agent can create this shell automatically by pushing the object's XML metadata definition using the sap_push tool (using aspect 'metadata').
    • Classic Dynpros (Screen Painter): Dynpro screens (PROG/P) are represented and edited locally.
  • Every code push is recorded in the internal version control system.

Version Control

  • You can diff the versions and restore them to SAP system whenever needed.

Diff

Available MCP Tools

Tool Name Description
sap_activate_object Activates inactive ABAP development objects in the SAP backend and returns syntax or activation messages.
sap_check_syntax Runs a native ADT syntax check matching Eclipse engine logic to validate ABAP code without saving.
sap_diff_versions Computes unified diffs between revisions of an ABAP object (local draft vs. active, or between historical version numbers).
sap_fetch_inactive_objects Fetches the list of all inactive objects currently held by the authenticated user from the SAP backend.
sap_fetch Stages complete repository artifacts. Returns file_path, artifact hash/size/line count and bounded ABAP index; revision is the backend signature. Use sap_inspect_source for bounded local inspection.
sap_inspect_source Inspects staged text: ABAP block index, exact block, lines or literal search with context. Bounds output by lines and bytes; continue with page.next_offset, next_byte_offset and expected_sha256.
sap_get_creation_template Retrieves the structural creation template or XML skeleton for a specified SAP object type.
sap_push Pushes local workspace artifacts (source, metadata, translations, dynpro) to the SAP backend. Set activate=true to trigger activation after saving.
sap_run_tests Executes ABAP Unit (AUnit) tests for classes, programs, or packages and returns test results.
sap_syntax_quick_fix Retrieves or applies syntax quick-fix suggestions for ABAP compiler diagnostic messages.

Clone this wiki locally