SAPDiagnose
Diagnose ABAP objects with syntax checks, unit tests, and ATC code quality checks. Analyze runtime errors, dumps, and traces to identify and resolve issues.
Instructions
Run diagnostics on ABAP objects and analyze runtime errors.
Actions:
"syntax": Syntax check an ABAP object. Requires name + type. Optional: version ("active" or "inactive", defaults to active). Optional: source — when supplied, SAP compiles the given content as if it lived at the object's URI (pre-write dry-run, nothing is written). Omit source to check what is stored.
"unittest": Run ABAP unit tests. Requires name + type.
"atc": Run ATC code quality checks. Requires name + type. Optional: variant.
"quickfix": Get SAP quick fix proposals for a specific source position. Requires name + type + source + line. Optional: column.
"apply_quickfix": Apply one quick fix proposal and return text deltas (does not write source). Requires name + type + source + line + proposalUri + proposalUserContent. Optional: column.
"dumps": List or read ABAP short dumps (ST22). Without id: lists recent dumps (filter by user, maxResults). With id: returns focused chapter sections by default; set includeFullText=true to include the full formatted dump blob. Optional sections=[kap0,kap3,...] to request specific chapter IDs.
"traces": List or analyze ABAP profiler traces. Without id: lists trace files. With id + analysis: returns trace analysis (hitlist = hot spots, statements = call tree, dbAccesses = database access statistics).
"system_messages": List SM02 system messages via ADT feed (filter by user, maxResults, from, to).
"gateway_errors": List SAP Gateway error log entries (/IWFND/ERROR_LOG, on-prem). For detail mode provide detailUrl (preferred) or id+errorType.
Quickfix workflow: run syntax/ATC first to identify issues and line positions, then call quickfix to retrieve SAP-verified proposals, then apply_quickfix to get exact text deltas, and finally write the updated source via SAPWrite.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Diagnostic action | |
| name | No | Object name (for syntax/unittest/atc) | |
| type | No | Object type (PROG, CLAS, etc.) (for syntax/unittest/atc) | |
| source | No | Current source code (required for quickfix/apply_quickfix). | |
| line | No | Source line number for quickfix evaluation (required for quickfix/apply_quickfix). | |
| column | No | Source column number for quickfix evaluation (default 0 for quickfix actions). | |
| version | No | Source version for syntax check (default "active"). Use "inactive" to validate pending changes. | |
| proposalUri | No | Quickfix proposal URI from quickfix action (required for apply_quickfix). | |
| proposalUserContent | No | Opaque userContent from quickfix action (required for apply_quickfix). | |
| variant | No | ATC check variant (for atc action) | |
| id | No | Dump or trace ID (for dumps/traces actions). Omit to list, provide to get details. | |
| detailUrl | No | ADT detail URL for gateway_errors detail mode (preferred over id+errorType). Accepts absolute or /sap/bc/adt/... path. | |
| errorType | No | Gateway error type for gateway_errors detail by id (for example "Frontend Error"). Required when using id without detailUrl. | |
| user | No | Filter dumps by SAP user (for dumps action) | |
| from | No | Optional lower time boundary for feed-based diagnostics actions (system_messages/gateway_errors). | |
| to | No | Optional upper time boundary for feed-based diagnostics actions (system_messages/gateway_errors). | |
| maxResults | No | Maximum results to return for dumps/system_messages/gateway_errors (default 50, bounded to a safe cap). | |
| sections | No | Dump chapter IDs to include for dumps detail mode (for example ["kap0","kap3","kap8"]). Omit to use focused defaults. | |
| includeFullText | No | For dumps detail mode only: include full formattedText blob. Default false to reduce token usage. | |
| analysis | No | Trace analysis type (for traces action with id). hitlist = execution hot spots, statements = call tree, dbAccesses = database access stats. |