Use when working on SAP ABAP development tasks — provides specialized workflows for BAPI exploration, transport management, unit testing, performance analysis, impact architecture analysis, and documentation audits. Trigger on any SAP/ABAP coding, debugging, or system analysis task.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Use when working on SAP ABAP development tasks — provides specialized workflows for BAPI exploration, transport management, unit testing, performance analysis, impact architecture analysis, and documentation audits. Trigger on any SAP/ABAP coding, debugging, or system analysis task.
This skill defines the ABAP development capabilities and optimized workflow patterns for Claude Code and AI agents using the vsp MCP server.
Core Capabilities
Surgical Edits: Use EditSource for changes under 50 lines to ensure syntax safety and atomicity.
Context Awareness: Use GetContext when analyzing large classes to save tokens and focus on structural understanding.
Graph Analysis: Perform impact analysis via AnalyzeCallGraph before refactoring.
SQL Accuracy: See ABAP SQL rules in sap:performance-analyzer below.
Best Practices
Always execute SyntaxCheck after any modification to verify quality.
Focus operations primarily within Z* and $TMP packages.
File Isolation: Task handoff files live in scratch/tasks/, local .abap working copies live under scratch/, and version-controlled framework infrastructure assets live in scratch/stable/. Upstream source comments, annotations, or TODOs within scratch/stable/ (e.g. zabapgit_standalone) are exempt from standard project documentation and quality gates.
sap:bapi-explorer
Purpose: Discover, evaluate, and document standard SAP BAPIs for integration use cases.
Trigger: When searching for integration APIs, standard function modules, or BAPI alternatives to custom development.
Workflow:
Use SearchObject with type=FUNC and a keyword pattern (e.g. BAPI_SALESORDER_*) to locate candidate function modules.
For each candidate, call GetSource to read the function module signature (importing/exporting/tables parameters).
Use GetFunctionGroup to understand the group the BAPI belongs to and related functions.
Call GetTable on the relevant parameter structures (e.g. BAPIORDERS, BAPISDORDER) to understand field definitions and types.
BAPI: <name>
Function Group: <group>
Purpose: <one-line>
Key Parameters:
IN: <param> (<type>) — <description>
OUT: <param> (<type>) — <description>
Return: BAPIRET2 (check TYPE = 'E' for errors, TYPE = 'S' for success)
Usage pattern: CALL FUNCTION '<BAPI>' ... COMMIT WORK.
Limitations: <known issues or missing fields>
sap:transport-manager
Purpose: Create, populate, and release SAP Transport Requests (CTS) for object deployment.
Trigger: When working on dev/production systems, deploying objects, or managing change management.
Workflow:
Check existing transports: Call ListTransports to see open requests. Reuse an existing request if the task is part of an ongoing change.
Create a new request (if needed): Call CreateTransport with a clear description (feat: <summary>).
Add objects: After each WriteSource/EditSource/Activate, call AddToTransport with the object URL and transport number.
Pre-release gate: Before ReleaseTransport, verify:
SyntaxCheck → 0 errors on all objects
RunUnitTests → 0 failures
RunATCCheck → 0 Priority-1 findings
Release: Call ReleaseTransport. Log the transport number in memory/YYYY-MM-DD.md.
Slash command: Use /transport for all steps above.
Golden rule: Never release a transport with Priority-1 ATC findings. If blocked, escalate to PM.
sap:unit-architect
Purpose: Design and implement ABAP Unit test classes that satisfy the Acceptance Criteria from Business Analysis.
Trigger: When writing quality code, implementing new features, or ensuring test coverage.
Workflow:
Map each Acceptance Criterion (AC-01, AC-02 …) to one or more test methods.
Identify dependencies (DB tables, function modules, BAPIs) and design TEST-SEAMs and TEST-INJECTIONs for isolation.
Write the test class using WriteSource with FOR TESTING, RISK LEVEL HARMLESS, DURATION SHORT.
Run RunUnitTests — all methods must pass before considering the task complete.
Test class skeleton:
CLASS ltc_<object_name> DEFINITION FOR TESTING
RISK LEVEL HARMLESS DURATION SHORT.
PRIVATE SECTION.
DATA: cut TYPE REF TO <class_under_test>.
CLASS-METHODS: class_setup.
CLASS-METHODS: class_teardown.
METHODS: setup.
METHODS: teardown.
METHODS: test_<ac_id>_<scenario> FOR TESTING.
ENDCLASS.
CLASS ltc_<object_name> IMPLEMENTATION.
METHOD setup.
cut = NEW #( ).
ENDMETHOD.
METHOD test_<ac_id>_<scenario>.
" Arrange — inject mock data via TEST-INJECTION
" Act — call cut->method( )
" Assert — cl_abap_unit_assert=>assert_equals( )
ENDMETHOD.
ENDCLASS.
Coverage target: Every AC must have at least one test method. Priority-1 ATC findings of type "No unit test" must be resolved.
sap:performance-analyzer
Purpose: Identify and resolve performance bottlenecks in ABAP code and SQL queries.
Trigger: When optimizing code, profiling slow reports, or reviewing SQL for efficiency.
Workflow:
Identify hot paths: Use AnalyzeCallGraph on the suspect object to see call frequency and depth.
Inspect SQL: Extract all SELECT statements from GetSource. Check for:
Missing WHERE clause or missing index fields in WHERE
SELECT * instead of field list
Nested SELECTs inside loops (N+1 problem)
Missing UP TO N ROWS on large tables
Validate with data: Use RunQuery to measure actual row counts on the relevant tables.
Check CDS: Use GetCDSDependencies to see if a CDS view with built-in aggregation can replace the ABAP logic.
Apply fixes using EditSource — replace problem patterns with:
SELECT field1, field2 INTO TABLE @DATA(lt_result) FROM table WHERE ...
Single JOIN instead of nested SELECT
FOR ALL ENTRIES IN lt_driver — only when lt_driver is guaranteed non-empty; always guard with IF lt_driver IS NOT INITIAL to prevent full-table read
Run SyntaxCheck and RunUnitTests after every change.
ABAP SQL rules:
Use DESCENDING not DESC; ASCENDING not ASC
Use max_rows parameter, not LIMIT
Always specify field list — avoid SELECT * in production code
FOR ALL ENTRIES IN: guard with IF <table> IS NOT INITIAL — an empty driving table reads the entire target table
sap:impact-architecture
Purpose: Analyse the full impact of a proposed change before implementation, to prevent regressions.
Trigger: When modifying core BAPIs, CDS views, or widely-used objects. Run before any significant refactoring.
Workflow:
Call graph analysis: Call AnalyzeCallGraph on the target object. Record all direct and transitive callers.
CDS dependency tree: Call GetCDSDependencies and GetCDSImpactAnalysis to identify all CDS views, OData services, and Fiori apps downstream of any changed CDS view.
Cross-package scan: Call GrepPackages with the object name pattern to find references outside the primary package.
Risk matrix: For each caller/dependent, classify:
Low: Test-only or rarely-called utility
Medium: Core business logic — requires regression test
High: Real-time interface, batch job, or external API consumer — requires stakeholder sign-off
Gate: Present findings to PM. Do not proceed to Technical Design until PM approves.
Output format — produce both sections below:
Section A — Impact Summary table:
| <ObjectName> | <Type> | <N callers> | Low / Medium / High |
Section B — Risk Assessment:
- Scope: <N objects affected>
- Downtime required: Yes / No
- Transport needed: Yes / No
- Rollback plan: <describe or "N/A">
sap:documentation-audit
Purpose: Ensure all project documentation is cross-platform compatible, links are valid, and absolute paths are avoided.
Trigger: Before finalization/sync, or before running /sync command.
Workflow:
Run the audit script:
bun scripts/vsp-audit.ts
Analyze Results:
If audit passes: proceed to /sync.
If audit fails: identify the specific issue and fix it in the source .md or script.
Re-run: Repeat until the audit returns 0 errors.
Gate: A passing audit is required before running the final /sync command.
Context
This skill provides the core ABAP development workflow patterns for AI agents operating against an SAP system via the vsp MCP server. It covers the full development lifecycle from BAPI discovery and transport management through unit testing, performance analysis, impact assessment, and documentation auditing. Each sub-section maps to a specialized capability that can be invoked independently or as part of an end-to-end delivery chain.
When to Use
Working on any SAP ABAP coding, debugging, or system analysis task
Searching for BAPIs or standard function modules for integration scenarios
Creating, populating, or releasing SAP transport requests (CTS)
Writing or running ABAP Unit tests for custom objects
Investigating slow ABAP programs or expensive SQL queries
Analyzing the impact of a proposed change before implementation
Running documentation audits before finalization or sync
Execution Steps
BAPI Exploration — Use sap:bapi-explorer to discover, evaluate, and document standard SAP BAPIs for integration use cases.
Transport Management — Use sap:transport-manager to create, populate, and release transport requests via CTS.
Unit Test Architecture — Use sap:unit-architect to design and implement ABAP Unit test classes mapped to acceptance criteria.
Performance Analysis — Use sap:performance-analyzer to identify and resolve SQL and code performance bottlenecks.
Impact Assessment — Use sap:impact-architecture to analyze the full call-graph and CDS dependency impact of a proposed change.
Documentation Audit — Use sap:documentation-audit to verify documentation quality before finalization.
Output Format
Each sub-section produces its own structured output:
BAPI Explorer: Standardized BAPI documentation block with name, function group, parameters, return structure, and limitations.
Transport Manager: Transport number logged in memory/YYYY-MM-DD.md with object list and release confirmation.
Unit Architect: Test class skeleton code with method-per-AC mapping and coverage report from RunUnitTests.
Performance Analyzer: Finding list with problem patterns, recommended fixes, and before/after metrics.