mcpField
A
abap

abap

github.com/likweitanTesting & quality72131 installsUpdated 2w ago
Repository

About abap

A skill for checking ABAP code with abaplint static analysis and Clean ABAP manual review. It helps developers choose the appropriate check and present prioritized, actionable findings.

Key features

  1. 01abaplint syntax and type checks
  2. 02Configurable lint rules
  3. 03Clean ABAP style review
  4. 04Prioritized findings with recommendations
  5. 05Clean core level context

Use cases

  1. 01Linting an ABAP project
  2. 02Reviewing code against Clean ABAP
  3. 03Running a combined quality check

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/likweitan/abap-skills --skill abap

After installing, type/abapin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
abaplint.md
checklist.md
CleanABAP.md
quick-reference.md

Details

From the project README

ABAP

Check and improve ABAP code quality using two complementary approaches:

  • abaplint: Automated static analysis via CLI, checking syntax, types, and configurable rules
  • Clean ABAP: Manual review against Clean ABAP style guide principles

Workflow

  1. Determine check type based on user request:

    • If the user asks to lint, run abaplint, or check syntax: use abaplint
    • If the user asks for clean code review, best practices, or code quality: use Clean ABAP review
    • If unclear or the user asks for a full check: use both
  2. For abaplint checks:

    • Verify abaplint is installed (npx @abaplint/cli --version or abaplint --version)
    • If not installed, install with: npm install @abaplint/cli -g
    • Check if abaplint.json exists in the project root
    • If no config exists, help the user create one (see starter configs in references/abaplint.md)
    • Run abaplint in the project root directory
    • Parse and present findings to the user
  3. For Clean ABAP reviews:

    • Read the ABAP code provided by the user
    • Check against Clean ABAP categories: Names, Language, Constants, Variables, Tables, Strings, Booleans, Conditions, Ifs, Classes, Methods, Error Handling, Comments, Formatting, Testing
    • Identify violations with specific line references
    • Provide actionable recommendations with code examples
    • Prioritize issues by impact (critical, major, minor)

abaplint Quick Start

Run in project root:

abaplint

Generate default config (all rules):

abaplint -d > abaplint.json

For detailed abaplint configuration including starter configs for On-Premise, Steampunk/BTP, and HANA compatibility, read references/abaplint.md.

Clean ABAP Check Categories

Names
  • Use descriptive names, snakecase, no Hungarian notation (iv, lv*, lt*)
  • Nouns for classes, verbs for methods, no noise words
Language
  • Prefer OO over procedural, functional over imperative
  • Use modern syntax: NEW, inline declarations, table expressions
Constants
  • No magic numbers, use ENUM or grouped constants
Variables
  • Prefer inline declarations, no chained DATA
Tables
  • No DEFAULT KEY, use INSERT INTO TABLE, LINE_EXISTS, WHERE clauses
Strings
  • Backticks for literals, pipes for string templates
Booleans
  • Use ABAP_BOOL, ABAP_TRUE/ABAP_FALSE, XSDBOOL
Conditions
  • Positive conditions, IS NOT over NOT IS, predicative method calls
Ifs
  • No empty IF branches, CASE over ELSE IF, nesting depth <= 3
Methods
  • Instance over static, RETURNING over EXPORTING, <= 3 parameters, <= 20 lines
Error Handling
  • Exceptions over return codes, class-based exceptions, no catching CX_ROOT
Comments
  • Explain why not what, " over *, no commented-out code
Formatting
  • One statement per line, <= 120 chars, consistent indentation
Testing
  • Given-when-then structure, focused assertions, dependency injection

Output Format

Structure analysis results as:

# ABAP Check Results

## abaplint Findings
[abaplint output, grouped by severity]

## Clean ABAP Review

### Summary
- Total Issues: [count]
- Critical: [count] | Major: [count] | Minor: [count]

### Critical Issues
#### [Category] - [Issue Title]
**Location:** Line [X] / Method [name]
**Problem:** [description]
**Recommendation:** [how to fix]

### Major Issues
[Same format]

### Minor Issues
[Same format]

### Positive Observations
- [Things done well]

Clean Core Level Context

Code quality findings can be mapped to SAP's clean core levels when the code is destined for or evaluated against ABAP Cloud:

  • Level A — released APIs only; Clean ABAP + abaplint clean
  • Level B — classic APIs; stable but requires classic ABAP language version
  • Level C — internal SAP objects; migrate to a successor
  • Level D — direct SAP table writes, EXEC SQL, released-for-internal-use APIs; eliminate

Treat clean core findings separately from style findings: a well-formatted SELECT on an SAP table is still Level C. See the abap-cloud skill for level definitions and atc-cloudification for automated checks.

References

  • abaplint config & setup: Read references/abaplint.md for installation, configuration options, and starter configs
  • Complete Clean ABAP guide: Read references/CleanABAP.md for full style guide with rationale and examples
  • Quick patterns: Read references/quick-reference.md for condensed good/bad code examples
  • Review checklist: Read references/checklist.md for systematic review checklist

Related Skills

  • abap-cloud: Use for clean core levels and ABAP Cloud compliance
  • abap-unit-testing: Use for writing unit tests that follow Clean ABAP principles
  • abap-sql-amdp: Use for modernizing ABAP SQL during code quality improvements

Comments

Markdown supported