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 #

IndicatorMeaning
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:

SeverityMeaning
HIGHMust fix before S/4HANA migration
MEDIUMShould address for best practices
LOWOptional 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 #

ToolDescription
get-objectRetrieve source for any ABAP object type
search-objectsSearch by name pattern
list-packagesBrowse packages
create-programCreate a new program with source
create-classCreate a new class with source
update-programUpdate program source
update-classUpdate class source
create-and-activateCreate/update and activate in one step
activate-objectActivate an object
syntax-checkCheck for syntax errors
format-codeSAP pretty printer
run-unit-testsExecute unit tests
analyze-s4-remediationS/4HANA compatibility check
transport-infoGet transport request info
create-transportCreate a transport request
test-connectionVerify 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-class send 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 #

  1. Be specific — “Add error handling for the RFC call in method GET_CUSTOMER” works better than “Fix this code”
  2. Use quick actions first — Review, S/4 Check, and Explain are tuned for common workflows
  3. Review before activating — always read changes before saving to SAP
  4. Run unit tests — after AI modifications, verify correctness
  5. Use Fix for errors — the Problems panel Fix button gives the most targeted assistance