0% found this document useful (0 votes)
48 views17 pages

ABAP Cleaner - User Manual

ABAP Cleaner is a configurable tool designed to automate the cleaning of ABAP code, enhancing readability and maintaining coding standards. It requires Eclipse with ABAP Development Tools for installation and offers features like error reduction, modernization, and collective code ownership. The tool supports over 95 clean-up rules and allows for customization of profiles to suit organizational needs.

Uploaded by

aarathy1989
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views17 pages

ABAP Cleaner - User Manual

ABAP Cleaner is a configurable tool designed to automate the cleaning of ABAP code, enhancing readability and maintaining coding standards. It requires Eclipse with ABAP Development Tools for installation and offers features like error reduction, modernization, and collective code ownership. The tool supports over 95 clean-up rules and allows for customization of profiles to suit organizational needs.

Uploaded by

aarathy1989
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

ABAP Cleaner

Table of Contents
Introduction
Prerequisites and Installation
Working Demo
References

Date: 03-05-2025

Time: 06:00 pm

Documentation: Gaurav Singh


Introduction

ABAP cleaner is a configurable tool that aims to automate whatever can be automated
concerning ABAP code style.

It can be used to clean up ABAP code by applying various clean-up rules.

In short, it is an advanced version of Pretty Printer that you may have used in SAP GUI, with
more options and features for maintaining optimal coding standards.

Here are some features of ABAP Cleaner Tool:

 Automation: The ABAP Cleaner tool automates the process of cleaning up ABAP
code, saving you time and effort.

 Uniformity: By using the ABAP Cleaner tool, you can ensure that your code follows a
consistent style and structure. This improves code readability and makes it easier
for other developers to understand and maintain the code. Also, if you’re working as
an organization, it is helpful for maintaining certain standards helpful for everyone
working as a team.

 Error reduction: Following clean ABAP principles, which the ABAP Cleaner tool
helps enforce, can reduce the number of errors and misunderstandings in your
code. Clear and well-structured code is less prone to bugs and easier to debug.

 Modernization: The ABAP Cleaner tool encourages the use of modern language
features and coding techniques. This is important if your organization plans to
migrate to newer technologies like S/4HANA or the Cloud.

 Collective code ownership: Adopting clean ABAP practices fosters a culture of


collective code ownership and feedback. It encourages collaboration and allows
multiple developers to work on the same codebase more effectively.

 Maintainability: Clean ABAP code is easier to maintain and modify. It follows best
code organization and readability practices, making it easier to add new features or
make changes without introducing bugs.

2
Prerequisites

 ABAP Cleaner Tool is a plug-in for ABAP Development Tools (ADT), which means, you
must have Eclipse (version 2025-03 4.35.0 refer screenshot) installed on your
system to use it.
 You must have ADT (ABAP Development Tools) added to the Eclipse (click on the
references link to add ADT tools to eclipse)

Installation

1. Open Eclipse with ABAP perspective.


2. Go to Help option and click on Install New Software.

3
3. Enter the link provided below then hit the enter key and check the ABAP Cleaner for
ABAP Development Tools (ADT). Then click Next.
https://sap.github.io/abap-cleaner/updatesite

4
4. Accept the terms of the license agreement and click on Finish.

5. Click on Trust Selected for Trust Authorities and Trust Artifacts.

5
6. Once your installation is ready, a pop asks you to restart Eclipse IDE. Click on
Restart Now and your ABAP Cleaner plugin is ready to use.

Working Demo

Open any of your programs in the Eclipse.

Let’s suppose I open one of my test programs for demo purposes.

6
Now go to Source Code option and click on Clean up with Interactive ABAP Cleaner. You
can also use the short key Ctrl + Shift + 4.

Once you click on it, a new window opens. Here if you’re using it for the first time, it will
show default profile. Let us configure a new profile by clicking on the Configure button.

7
Once we click on the Configure, a new window pops up and you can see Profile and Rules
associated with the profile.

There are two most common profiles that are already set up for you. They are default and
essential. You can customize the existing profiles either or you can import a file from your
own system with rules defined for your organization.

8
We click on import to add a new profile.

Select the file from your system.

9
Once you import the file successfully, click on the Save Profiles and Exit button.

Then click on Apply and Close button in the previous window.

10
Once your profile is configured, you can go to Source Code and click on Clean Up With
Automated Cleaner to clean your ABAP code or you can simply use Ctrl + 4.

11
I click Ctrl + 4 and you can notice the difference between the older version and the current
version of code.

Old Version (Before using ABAP Cleaner):

New Version (After using ABAP Cleaner)

You can spot these differences, right?

12
What are some of the other differences? Can you tell?

Also, if you want to skip some of the changes, then it is also possible.

Let us suppose, I have declared the variables in my program in a single statement using the
single data keyword.

We go to Source Code and click on Clean Up with Interactive ABAP Cleaner, and it
shows a new pop-up window.

13
Now we can see there are two screens with a Before cleanup and After cleanup
description.

I click on the left screen declaration statement which I would like to keep as it is and we see
it shows the rule applied on the bottom right part of the screen. We can simply uncheck
this to skip this rule from applying in our code.

14
Once you uncheck this rule, you can see that it skips that rule for the particular statement
and the rest of the changes are applied.

Click on Apply and Close.

This tool has a lot of other features which can be utilized to make your ABAP code better
readable and clean.

15
For example, you can go to Show Read-Only Preview With ABAP Cleaner option in the
Source Code or use Ctrl + Shift + 5.

It opens a new window where you can go to Code and the From File or From Clipboard
option to import your code on the screen and clean up the code in the preview mode.

16
With more than 95+ rules, it is a helpful tool for shipping some clean code to the
production.

References:

https://community.sap.com/t5/application-development-and-automation-blog-
posts/abap-cleaner-streamline-your-code-for-enhanced-quality-and-productivity/ba-
p/13573823

https://developers.sap.com/tutorials/abap-install-adt.html

https://github.com/SAP/abap-cleaner

17

You might also like