# abap-cleaner: 100+ cleanup rules applied to ABAP code from your IDE

> ABAP cleaner is a Java tool hosted by SAP that applies more than 100 style rules to ABAP source, either as a one keystroke action in Eclipse ADT or VS Code, or through a stand-alone app that watches the clipboard. It automates formatting, alignment, obsolete statement replacement and some nesting reduction, and it deliberately leaves naming and modularization to you.

**SAP/abap-cleaner** — ABAP cleaner applies 100+ cleanup rules to ABAP code at a single keystroke

- Repository: https://github.com/SAP/abap-cleaner
- Stars: 673 · Forks: 74
- Language: Java
- License: Apache-2.0
- Published: 2026-10-21 · Updated: 2026-10-21 · Language: en
- Canonical page: https://hysenlabs.com/projects/sap-abap-cleaner

## The styleguide says what to do, abap-cleaner does it

ABAP has no shortage of rules. The README points at the Clean ABAP Styleguide, at the Clean Code Checks as implemented in the Code Pal for ABAP project, and at team-specific programming guidelines. The gap it identifies is that these guidelines leave the work of writing or cleaning clean code entirely to the developer.

ABAP cleaner takes the mechanical part. The tool applies 100 or more cleanup rules to a code section, and the README states that it can clean anything from a single statement to an entire code document with one keystroke, at roughly 500 KB of code per second. The kinds of work it automates are named in the same paragraph: formatting, alignment, replacing obsolete commands, and reducing some nesting depth.

What the README is equally clear about is the boundary. An automated tool cannot replace all clean code effort, and the remaining work is described as modularization, testability and good naming. Those are judgement calls that a rule engine has no way to make for you, and pretending otherwise would defeat the purpose.

The audience is ABAP developers on large legacy estates, where code has accumulated over two decades of syntax changes and the gap between what the styleguide wants and what the code looks like is enormous. A single cleanup pass over a package is the kind of task that is otherwise unbudgeted.

## The essential profile covers 40 percent of the rules, on purpose

Profiles are the mechanism that decides how much of the styleguide becomes code, and the two shipped profiles make opposite bets.

The default profile activates most of the available cleanup rules with settings the project considers good defaults, aligned with the Clean ABAP Styleguide and, in the README's words, going beyond its demands. The essential profile is the conservative one: only the rules that the styleguide explicitly requires are active, which the README puts at approximately 40 percent of the available rules.

That difference is the interesting part, because it is a policy decision rather than a technical one. The essential profile can be defended to a team that will not accept style changes beyond the written standard, since every rule in it can be traced to the document. The default profile is the one to use if you are cleaning up alone or on legacy code where nobody will read the diff.

Beyond the two, you can build your own profile. In each profile you select which cleanup rules are active and configure the options and thresholds for them. The README also names the team workflow: a team aligns on a common configuration and creates a team profile from it. That is the mechanism that makes the tool's output consistent across a codebase, and it is a config file you can put under version control and review.

## Installing the plugin, then running it with Ctrl + 4 in ADT

The README does not contain step-by-step installation commands, and it says where that information lives instead: a Devtoberfest 2023 session on YouTube is offered as a demo of how to install, use and configure the tool. What the repository layout does tell you is the shape of the install. There is an Eclipse update site in com.sap.adt.abapcleaner.updatesite, an Eclipse feature in com.sap.adt.abapcleaner.feature, a stand-alone application in com.sap.adt.abapcleaner.app, and a separate vscode-extension/ directory for the VS Code side. A developer therefore picks the packaging that matches their editor.

Once installed, the cleanup is offered in three modes with different keys, and the difference is about how much authority the tool has over your editor.

The automatic mode runs with a single keystroke, Ctrl + 4 in Eclipse or the command ABAP Cleaner: Format Selection in VS Code. The interactive mode opens the ABAP cleaner UI with Ctrl + Shift + 4 in Eclipse, or the command ABAP Cleaner: Format Interactively in VS Code, and there you can review each change, revert the ones you dislike with a single mouse click, and then apply or discard the result.

The third mode is the one that gets forgotten. Ctrl + Shift + 5 in Eclipse, or ABAP Cleaner: Show Read-Only Preview in VS Code, shows the cleanup result without locking or changing the code. The README gives the reason: it works when you do not have development authorization in the current system. That makes it the safe choice on a production-like system where you can read but not write.

The three Eclipse key bindings are the quickest way to remember the modes:

```bash
Ctrl + 4
Ctrl + Shift + 4
Ctrl + Shift + 5
```

The same three actions also exist as menu entries under Source Code, named Source Code / Clean Up With Automated ABAP Cleaner, Source Code / Clean Up With Interactive ABAP Cleaner and Source Code / Show Read-Only Preview With ABAP Cleaner, which is useful when a key binding collides with something else in your profile.

## The stand-alone app and the clipboard path for SAP GUI

Not everyone works in ADT. The README describes a stand-alone ABAP cleaner app for the case where your code lives in SAP GUI, the classic SAP interface.

In the simplest form you copy the code from your IDE, which here means SAP GUI, into ABAP cleaner, and copy the cleaned result back. The app can also watch the clipboard and replace its contents with cleaned up code directly. The README describes the effect of that mode as staying in SAP GUI and doing the cleanup with Ctrl + C and Ctrl + V.

This is a meaningfully different integration model from the ADT plugins. There is no editor hook, no language server, no per-keystroke action. The tool acts on whatever text is in the clipboard when you invoke it, which means it also works on code from any other source, including a snippet from a ticket, and it means you lose the line-level diff view that the interactive ADT mode gives you.

The details live in the project's usage documentation, which the README links as docs/usage.md. The repository root confirms the structure: com.sap.adt.abapcleaner.app for the stand-alone application, com.sap.adt.abapcleaner.gui for the user interface, and com.sap.adt.abapcleaner.updatesite for the Eclipse update site, alongside the core com.sap.adt.abapcleaner package.

## One Java repository, three delivery shapes

The layout tells you how the tool is packaged. The root carries pom.xml, a .mvn/ directory and a .project file, so the core is a Maven project and also importable into Eclipse as a project. The Java packages are named com.sap.adt.abapcleaner for the core, .app for the stand-alone application, .gui for the UI, .feature for the Eclipse feature and .updatesite for the update site. A separate vscode-extension/ directory holds the VS Code side, and test/ holds the tests.

That last split is the notable engineering decision. The Eclipse integration and the VS Code extension are not the same artifact with a different skin, they are separate front ends over one cleanup engine, which is why the ADT keystrokes and the VS Code commands are named differently in the README while doing the same work.

Around the code sit the ordinary project files: docs/, a LICENSE, a LICENSES/ directory, REUSE.toml, CONTRIBUTING.md, renovate.json, .github/ and _site/. The REUSE tooling and the REUSE status badge at the top of the README indicate the project tracks and declares its own licensing metadata, and Renovate is present for dependency updates.

A user does not need to build any of this to use the tool, but the structure is worth knowing if you plan to run it inside your own build or to add a rule.

## Code Pal for ABAP checks the same styleguide, but does not rewrite

The natural comparison is with Code Pal for ABAP, the SAP project the README itself cites for the Clean Code Checks. The two sit on the same styleguide and therefore appear to overlap. The difference in approach is what separates them.

Code Pal is a checker. It reports on code that violates the checks, and the developer goes and fixes it. ABAP cleaner is a rewriter. It applies the rules to the source and hands you the result, which the README describes as automating as many of these rules as possible while giving you full control over which rules are used and how.

That difference is a large one in practice, because a reported violation still costs a developer an edit, and a large legacy code base contains a great many of them. A tool that applies 100 or more rules in one pass across a whole document changes the economics of a cleanup task.

The limitation to keep in mind is that automation only covers a subset of the rules, and the README names that subset as formatting, alignment, replacing obsolete commands and some nesting reduction. The rest of the styleguide, modularization, testability and naming, is unaffected by either project. If your goal is a compliance report, use a checker. If your goal is to move the code, use the rewriter.

## Apache-2.0, a public release history and a recent commit

abap-cleaner is Apache-2.0 licensed and hosted in the SAP GitHub organisation, which for a tool that rewrites production ABAP source is a meaningful trust signal.

The release history shows a steady cadence rather than a burst. Three recent versions are visible: v1.28.4 on 2026-07-02, v1.28.5 on 2026-07-09 and v1.29.0 on 2026-07-24. The last push to the repository was on 2026-10-15, which is later than the newest release, so the main branch carries work that has not been packaged into a numbered version yet. For an Eclipse plugin and a VS Code extension, that gap decides whether you run a released artifact or something built from the branch.

The cost of adopting the tool is mostly configuration rather than code. A team that wants the tool to be a no-brainer for developers will standardise on one profile, distribute it as a team profile, and treat the read-only preview as the safe fallback for environments where developers lack development authorization.

One documentation gap is worth flagging: the README links the rules documentation as docs/rules.md but does not enumerate the 100 or more rules inline, so the exact behaviour of a given rule has to be read in the repository or in the interactive preview before you trust it with a large refactoring.

## Conclusion

abap-cleaner suits ABAP developers who inherit legacy code, work in teams that want a shared style configuration, or need to clean large volumes of code before a release. It does not suit you if you expect it to restructure programs, improve naming or raise testability, since the README says those remain manual work, and it does not suit projects already standardized on a different formatter, because the essential profile deliberately limits itself to what the Clean ABAP Styleguide demands. Check three things before adopting it: which profile you will standardize on, since default enables most rules while essential covers roughly 40 percent of them, whether your developers are on Eclipse ADT, VS Code or SAP GUI, since the three run through different interfaces, and whether the cleanup you want is visible in the read-only preview. The last push to the repository was on 2026-10-15 and the newest release is v1.29.0 from 2026-07-24, so a build from main may differ from the packaged plugin.

## FAQ

### How do I run abap-cleaner on ABAP code?

In Eclipse ADT the automatic cleanup runs with Ctrl + 4, the interactive UI opens with Ctrl + Shift + 4, and a read-only preview is available with Ctrl + Shift + 5. In VS Code the equivalent commands are ABAP Cleaner: Format Selection, ABAP Cleaner: Format Interactively and ABAP Cleaner: Show Read-Only Preview.

### What is the difference between the default and the essential profile?

The default profile activates most available cleanup rules with settings aligned to the Clean ABAP Styleguide, while the essential profile only enables rules the styleguide explicitly demands, which the README puts at approximately 40 percent of the available rules.

### Does abap-cleaner work in SAP GUI instead of Eclipse ADT?

Yes, through the stand-alone app. The README describes copying code in and out with the clipboard, and a mode where the app watches the clipboard and replaces it with cleaned up code so you can work with Ctrl + C and Ctrl + V.

### How does abap-cleaner differ from Code Pal for ABAP?

Code Pal for ABAP reports on violations of the Clean Code Checks, while abap-cleaner applies the rules and rewrites the code, with 100 or more cleanup rules applied in one pass. Both cite the same styleguide, and both leave modularization, testability and naming to the developer.

### What licence is abap-cleaner released under?

The project is licensed under Apache-2.0, with a LICENSE file and a LICENSES/ directory at the root of the repository and a REUSE.toml for the licensing metadata.

## Sources

- [Issues](https://github.com/SAP/abap-cleaner/issues)
- [License: Apache-2.0](https://github.com/SAP/abap-cleaner/blob/main/LICENSE)
- [README](https://github.com/SAP/abap-cleaner/blob/main/README.md)
- [Releases](https://github.com/SAP/abap-cleaner/releases)
- [SAP/abap-cleaner on GitHub](https://github.com/SAP/abap-cleaner)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/sap-abap-cleaner
