# ABAP Support in Maguyva: Class Graphs for SAP Custom Code

Canonical source: https://maguyva.ai/languages/abap

License: text under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/); code samples under [MIT-0](https://opensource.org/license/mit-0); the Maguyva name, logos, brand assets and other code are not covered. Details: [maguyva.ai/license](https://maguyva.ai/license).

Maguyva parses ABAP with AST, symbol, and graph support, so AI agents can map classes, interfaces, redefinitions, and exceptions in SAP custom code.

## Support snapshot

- Tier: AST and symbol support
- Programming
- Extensions: .abap
- Real AST parsing for syntax-aware search and structural context.
- Named symbols feed semantic lookup and cross-reference. Graph navigation is available when relationship extraction is enabled.
- This language contributes symbols and relationships to graph-aware search; supported edge types vary with its native constructs.
- AST parsing and symbol extraction are both available.

## Best fit

- SAP teams that keep custom ABAP in Git as `.abap` source files and need to understand it before a migration or clean-core review.
- Object-oriented ABAP estates where class hierarchies, interfaces, and redefinitions hide which implementation actually runs.
- Agent-assisted impact analysis where the question is "what breaks if this class changes?"

## Agent workflows

- Map which classes inherit from a base class and which methods they redefine.
- Find every class that implements an interface before changing its method signatures.
- Trace where an exception class is raised and where it is caught.

## Why ABAP is worth mapping before you change it

Custom ABAP often carries decades of business rules. The code is object-oriented in places and procedural in others, and the inheritance and interface structure decides which method runs. Reading one class at a time hides that.

Maguyva gives an agent the class graph first, so a change plan starts from what depends on a class rather than from a guess.

## What Maguyva extracts in ABAP

Maguyva parses `.abap` source with a dedicated ABAP grammar. Symbols include class definitions and implementations, interfaces, method declarations and implementations, and `FORM` routines.

The graph records the relationships ABAP developers care about:

- Inheritance from `CLASS ... INHERITING FROM`.
- Interface implementation from `INTERFACES`.
- Overrides from `METHODS ... REDEFINITION`.
- Exceptions from `RAISE EXCEPTION` and `CATCH`.
- Method calls (`obj->m( )`, `cls=>m( )`, `CALL METHOD`), type references from `TYPE` and `TYPE REF TO`, and public-section method exports attributed to their class.
- Reads, writes, and control flow (`IF`, `CASE`, `LOOP`, `TRY`) inside method bodies.

## Example agent prompts

- "Which classes inherit from `zcl_order_base`, and which of its methods do they redefine?" (`find_symbol`, then `dependency_search` incoming)
- "Where is `zcx_pricing_error` raised, and who catches it?" (`dependency_search`)
- "Summarise how the delivery-creation flow moves from the report to the persistence class." (`get_task_context`)

## Known limits

- Open SQL (`SELECT ... FROM ... INTO`), `EXEC SQL`, and `AUTHORITY-CHECK` do not parse in the current ABAP grammar, so table reads through SQL are not graph edges yet. Use `text_pattern_search` for table names.
- `INTERFACES` clauses are implementation relationships, not imports. Only `INCLUDE` statements are selected as imports in structural search.
- Maguyva indexes ABAP that lives in a Git repository as `.abap` files. It does not connect to an SAP system.

## Next steps

Connect a repository with the [quickstart](/docs/quickstart), then check the support matrix on the [compatibility page](/docs/compatibility). For other legacy estates, see the [COBOL guide](/languages/cobol).

## Engine details

- ABAP is parsed with a dedicated grammar. Classes, interfaces, method declarations and implementations, and `FORM` routines are symbols.
- The graph records `INHERITING FROM` inheritance, `INTERFACES` implementation, `REDEFINITION` overrides, `RAISE EXCEPTION` and `CATCH`, and calls such as `obj->m( )` and `cls=>m( )`.
- Open SQL, `EXEC SQL`, and `AUTHORITY-CHECK` do not parse in the current grammar, so table reads through SQL are not graph edges yet.

## Useful MCP entry points

- `find_symbol`: Use it for a class, interface, or method name when you need its definition and references.
- `dependency_search`: Use incoming traversal on a base class or interface to find subclasses, implementers, and callers before a change.
- `text_pattern_search`: Use it for database table names and SQL statements, which the graph does not cover yet.
