sap-gen-abap-unit

Generate ABAP Unit tests for existing ABAP objects with seam analysis.

7|1|Updated May 11, 2026
One-click install
npx skills add https://github.com/sapdev-ai/sap-dev --skill sap-gen-abap-unit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sap-gen-abap-unit
Source: https://github.com/sapdev-ai/sap-dev/tree/main/plugins/sap-gen-code/skills/sap-gen-abap-unit
Command: npx skills add https://github.com/sapdev-ai/sap-dev --skill sap-gen-abap-unit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generates ABAP Unit tests for an existing object (global class / function module / report) and then loops through deployment, activation, and runtime with coverage to identify and fix failures until green. It reads the active source (RPY for program/FM; SE24 GUI download for class), builds a call/data map, and performs seam analysis to classify reads and external calls into doubles or flags non-testable surfaces, emitting an honest test class.

Core Features & Use Cases

  • Generates ABAP Unit test containers for existing ABAP objects (class, FM, program) and pairs with sap-run-abap-unit for execution.
  • Performs seam analysis to determine feasible test doubles (OSQL doubles, CL_ABAP_TESTDOUBLE) or mark inseparable dependences, then outputs testability documentation.
  • Deploys, activates, runs tests with coverage, and iterates fixes until target coverage is achieved; supports GUI-based SAP steps and gating rules.

Quick Start

Provide an ABAP object name and optional flags to start generating ABAP unit tests for an existing object.

Frequently Asked Questions about sap-gen-abap-unit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate ABAP Unit tests for an existing class or function module?

To generate ABAP Unit tests for existing ABAP objects, provide the object name and optional flags. The tool reads the active source via RFC or SAP GUI, performs seam analysis, and outputs a test class with appropriate test doubles.

How does seam analysis work for ABAP Unit testing?

Seam analysis classifies dependencies into testable doubles or flags non-testable surfaces. It determines where to use CL_OSQL_TEST_ENVIRONMENT for database reads and CL_ABAP_TESTDOUBLE for injected dependencies to isolate ABAP code.

Can I automate ABAP Unit test deployment and activation through SAP GUI?

Yes, the process automates deployment and activation using named SAP GUI interactions like SE24 downloads and SE38 transport requests. It loops through deployment, activation, and execution until tests pass with green status.

Do I need SAP GUI to run automated ABAP unit tests with coverage?

Yes, SAP GUI is required to execute named interactions like SE24 downloads and SE38 transport requests. The deploy loop orchestrates these GUI-based steps alongside pre-checks to execute tests and measure runtime coverage.

What are the limitations when generating ABAP Unit tests for existing reports?

The tool marks inseparable dependencies as non-testable surfaces during seam analysis. While it reads report source code via RPY and attempts iterative fixes, it cannot guarantee target coverage if external calls cannot be isolated by test doubles.