AI Agent #
ABAPer includes an AI assistant that can read, analyze, and modify ABAP code. The assistant communicates with your SAP system through MCP (Model Context Protocol) tools — it can fetch objects, run syntax checks, execute unit tests, format code, and create or update objects on your behalf.
Opening the AI Panel #
Toggle the AI panel with Ctrl+L or click the Bot icon in the left sidebar. The panel opens on the right side with:
- Status bar — MCP connection indicator, tool count, model name, stop/clear buttons
- Messages area — scrollable conversation history
- Quick action buttons — one-click operations for common tasks
- Text input — free-text prompt at the bottom
MCP Connection Status #
| Indicator | Meaning |
|---|---|
| Green dot + tool count (e.g., “12 tools”) | Connected — AI can interact with SAP |
| Orange dot + “Offline” | Disconnected — general ABAP questions only |
Quick Actions #
Six buttons above the text input trigger analysis on the currently open object:
Format Code (Shift+Alt+F) #
Formats the source using the SAP pretty printer. Replaces the editor content.
Review Code (Ctrl+Shift+R) #
Comprehensive code review covering quality, design patterns, naming, error handling, and performance. Results appear as structured findings with severity and clickable line numbers.
S/4HANA Check (Ctrl+Shift+4) #
Analyzes S/4HANA compatibility. Identifies obsolete statements, deprecated function modules, direct table access that should use CDS views, and other migration issues.
Results appear as issue cards:
| Severity | Meaning |
|---|---|
| HIGH | Must fix before S/4HANA migration |
| MEDIUM | Should address for best practices |
| LOW | Optional improvement |
Each card includes the issue description, clickable line reference, and before/after code snippets.
Explain Code #
Plain-language explanation of the current source: line count, comments, methods, SELECT statements, and a summary of what the code does.
Run Unit Tests #
Executes ABAP unit tests for the active object (must be activated first). Shows total tests, pass/fail counts, and error details per method.
Optimize #
Suggests performance improvements for database queries, loops, memory usage, and redundant operations.
Custom Prompts #
Type any instruction in the text input:
Refactor this class to use the factory pattern
Add error handling for the RFC call on line 45
Write ABAP unit tests for the calculate_tax method
Press Enter to send. The AI receives your prompt along with the current source code and object metadata (name, type). Shift+Enter inserts a newline.
Tool Execution #
During a conversation, MCP tool calls appear in the messages area:
✓ get-object (0.8s) — fetched ZCL_SALES_ORDER
✓ syntax-check (1.2s) — no errors
✗ activate-object (0.5s) — syntax errors found
Available MCP Tools #
| Tool | Description |
|---|---|
get-object | Retrieve source for any ABAP object type |
search-objects | Search by name pattern |
list-packages | Browse packages |
create-program | Create a new program with source |
create-class | Create a new class with source |
update-program | Update program source |
update-class | Update class source |
create-and-activate | Create/update and activate in one step |
activate-object | Activate an object |
syntax-check | Check for syntax errors |
format-code | SAP pretty printer |
run-unit-tests | Execute unit tests |
analyze-s4-remediation | S/4HANA compatibility check |
transport-info | Get transport request info |
create-transport | Create a transport request |
test-connection | Verify SAP connectivity |
Fixing Errors with AI #
In the Problems panel, each error has a Fix button. Clicking it sends the error details (message, line, column) to the AI, which analyzes the issue in context and suggests a fix.
Streaming Responses #
Responses stream in real time via SSE. Text appears incrementally, tool execution steps show as they happen, and you can click Stop at any time to cancel.
Response Formatting #
AI responses render as Markdown with ABAP syntax-highlighted code blocks (each with a copy button), tables, lists, blockquotes, and clickable links.
Limitations #
- The AI works with the source code visible in the editor. It does not have access to your entire SAP catalog unless it explicitly fetches objects via tools.
- Tool operations like
update-classsend complete source, not diffs. - The AI cannot release transports or perform system administration.
- Always review AI-generated code before activating in production systems.
- Context does not persist between sessions.
Best Practices #
- Be specific — “Add error handling for the RFC call in method GET_CUSTOMER” works better than “Fix this code”
- Use quick actions first — Review, S/4 Check, and Explain are tuned for common workflows
- Review before activating — always read changes before saving to SAP
- Run unit tests — after AI modifications, verify correctness
- Use Fix for errors — the Problems panel Fix button gives the most targeted assistance