ABAP Blog Posts
cancel
Showing results for 
Search instead for 
Did you mean: 

Overview

ABAP Cleaner is an open-source code formatting and cleanup tool for SAP's ABAP programming language.

What it does: It automatically applies  cleanup rules to ABAP code, improving readability, consistency to modern ABAP standards without changing the code's logic.

Challenges

The main challenge with ABAP Cleaner is getting everyone on the team to use it consistently. Different developers have their own coding habits, and agreeing on a single set of rules isn't always easy. There's also a risk when applying it to old legacy code, as unexpected changes can create problems. Additionally, since it only works with ADT (Eclipse), developers who still use SAP GUI cannot benefit from it at all.

Key Features:

  • Over 100+ configurable cleanup rules.
  • Works as a plugin for ABAP Development Tools (ADT) in Eclipse, or as a standalone app.
  • Rules can be individually enabled/disabled and configured to match team standards.
  • Supports interactive preview you see what changes will be made before applying them.
  • Can clean a single file or entire packages/projects at once.

Common Cleanups it performs:

  • Fixes indentation and alignment.
  • Replaces obsolete ABAP syntax with modern equivalents .
  • Standardises spacing around operators and keywords.
  • Removes unnecessary code.
  • Enforces consistent use of DATA, FINAL, FIELD-SYMBOLS, etc.

Requirement

Before installing ABAP Cleaner, make sure you have:

  • Eclipse IDE (latest version recommended)
  • ADT (ABAP Development Tools) already installed in Eclipse

 

Step-by-Step Installation

Step 1:  Open Eclipse with ADT

Launch your Eclipse IDE where ADT is already installed and set up.

Ujwal_Boddu_0-1774877222352.png

 

Step 2: Open Install New Software

Go to the menu bar and click: Help → Install New Software.

Ujwal_Boddu_1-1774877289825.png

 

Step 3: Enter the ABAP Cleaner Update Site

In the "Work with" field at the top, paste the following URL and press Enter:

https://sap.github.io/abap-cleaner/updatesite

Ujwal_Boddu_4-1774877359091.png

Step 4: Select ABAP Cleaner

Wait for the list to load. You will see ABAP Cleaner appear in the list below. Check the checkbox next to it to select it.

Ujwal_Boddu_6-1774877472144.png

Step 5: Click Next

Click Next > to proceed to the installation details screen.

 Step 6:  Review and Click Next Again

Review the items to be installed and click Next > again.

Step 7:  Accept the License Agreement

Read and accept the license agreement by selecting "I accept the terms of the license agreement", then click Finish.

 Step 8: Trust the Content

A security warning may appear saying the content is unsigned. This is expected. Click Install Anyway or Trust Selected to continue.

Step 9:  Restart Eclipse

Once installation completes, Eclipse will prompt you to restart. Click Restart Now to apply the changes.

 

How to Use After Installation.

Once Eclipse restarts, open any ABAP code file and access ABAP Cleaner from:

Right click > source code > You can find installed ABAP cleaner options.

Ujwal_Boddu_7-1774877566959.png

1.Automated Cleaning

Instantly applies all enabled cleanup rules to your code without requiring a preview or confirmation. It simply cleans and is finished.

  • Quick and quiet
  • No opportunity to review modifications prior to application
  •  It works best when you have complete faith in your configured rules.

2. Interactive Cleaning

Opens a window that compares your original code with the cleaned version side by side. Before applying, you have the option to accept or reject specific changes.

  • Complete control over the modifications.

  • Certain rules can be instantly enabled or disabled.
  • A little slower but extremely secure.

 

3. Read-Only Sample

Demonstrates how the cleaned code would appear but makes no use of it. Your code remains unaltered in pure preview mode.

  • No danger, no alteration.
  • Excellent for piqued interest or discovering the functionality of the tool.
  • Beneficial prior to code sharing in reviews.

 

Most ABAPers should default to Interactive Cleanup . It gives you the safety of reviewing changes while still automating the heavy lifting. Only you can switch to Automated once you have configured and trust your cleanup profile fully.

Ujwal_Boddu_8-1774878398039.png

 

ABAP Cleaner read your old-style code on the left, applied modern ABAP rules, and showed the cleaned version on the right.

Ujwal_Boddu_9-1774878445779.png

 

Cleanup Settings Panel

 Two profiles are available:

 

Profiles

What it does

Default

Applies a broad set of rules formatting, case, spacing, Best for full code cleanup

Essential

Applies only the most critical rules minimal, safe changes only. Best for production code.

 

 

Ujwal_Boddu_11-1774878538990.png

 

Profiles & Rules Configuration

The Profiles & Rules page is the most powerful part of ABAP Cleaner it gives full control over which rules apply, How they transform code, and lets teams share consistent cleanup profiles across projects. This is the final step before running the cleaner on your real ABAP codebase.

 

ABAP Cleaner's 100 Rules

ABAP Cleaner's 100 rules are essentially an automated code reviewer that converts years of legacy old-syntax ABAP into clean, readable, modern code in just a few clicks. For any ABAP developer wanting to implement Clean ABAP standards, this is a must have tool.

Ujwal_Boddu_12-1774878602046.png

 

Conclusion

Writing clear and readable code is essential in modern ABAP development. By automatically enhancing outdated code, following to Clean ABAP guidelines, and maintaining consistency, ABAP Cleaner supports developers. Developers can concentrate on creating better solutions instead of spending time manually fixing code. Using ABAP Cleaner supports high code quality over time in along with saving time.

1 Comment
Labels in this area