{"id":15148579,"url":"https://github.com/sap/abap-cleaner","last_synced_at":"2026-02-25T15:19:59.051Z","repository":{"id":153900764,"uuid":"630896010","full_name":"SAP/abap-cleaner","owner":"SAP","description":"ABAP cleaner applies 95+ cleanup rules to ABAP code at a single keystroke","archived":false,"fork":false,"pushed_at":"2025-03-24T17:48:40.000Z","size":14866,"stargazers_count":494,"open_issues_count":107,"forks_count":51,"subscribers_count":26,"default_branch":"main","last_synced_at":"2025-04-08T00:36:02.129Z","etag":null,"topics":["abap","adt","clean-code","formatter","pretty-printer"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SAP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-21T12:07:31.000Z","updated_at":"2025-04-04T03:38:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"48956de8-d11b-4ccd-b67a-b85208b99ee5","html_url":"https://github.com/SAP/abap-cleaner","commit_stats":{"total_commits":374,"total_committers":7,"mean_commits":53.42857142857143,"dds":0.05614973262032086,"last_synced_commit":"f046f9d2efcb1ead150cb6844c19878009ab40b8"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP%2Fabap-cleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP%2Fabap-cleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP%2Fabap-cleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP%2Fabap-cleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SAP","download_url":"https://codeload.github.com/SAP/abap-cleaner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755560,"owners_count":20990620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abap","adt","clean-code","formatter","pretty-printer"],"created_at":"2024-09-26T13:20:32.225Z","updated_at":"2026-02-25T15:19:59.044Z","avatar_url":"https://github.com/SAP.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ABAP Cleaner\r\n[![REUSE status](https://api.reuse.software/badge/github.com/SAP/abap-cleaner)](https://api.reuse.software/info/github.com/SAP/abap-cleaner)\r\n\r\n\r\n| \u003cimg src=\"docs/images/abap-cleaner.png\" width=\"100\"\u003e | *ABAP cleaner* is a configurable tool with the ambition to *automate \u003cbr /\u003e whatever can be automated* with respect to ABAP code style. |\r\n| --- | :--- |\r\n\r\n\r\n## What the ABAP Cleaner Tool Offers\r\n\r\nWhile there is no lack of guidelines and rules on what clean ABAP code should look like...\r\n\r\n- the [Clean ABAP Styleguide](https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md), \r\n- the [Clean Code Checks](https://github.com/SAP/code-pal-for-abap/blob/master/docs/check_documentation.md), \r\n  as implemented in the [Code Pal for ABAP](https://github.com/SAP/code-pal-for-abap/) project, \r\n- team-specific programming guidelines etc. \r\n\r\n... these guidelines leave the work of *writing* clean code (or *cleaning* existing code) entirely to you. \r\n\r\nThe ABAP cleaner tool does a lot of this work *for you* by **automating** as many of these rules as possible, \r\nwhile giving you full control over which rules are used and how. \r\n\r\n![ABAP cleaner - code cleanup at a keystroke](docs/images/cleanup-example.png \"ABAP cleaner - code cleanup at a keystroke\")\r\n\r\nWith ABAP cleaner, you can clean any amount of code from a single statement to an entire code document \r\nwith **one keystroke**. ABAP cleaner then applies **100+ different [cleanup rules](docs/rules.md)** to your code section, \r\ncleaning approx. 1 MB of code per second.\r\n\r\n\u003e Please don't get us wrong: Of course, an automated tool can NOT replace all other clean code efforts. \r\n\u003e Obviously, automation is only possible for a subset of the clean code rules - but for a significant one, \r\n\u003e including formatting, alignment, replacing obsolete commands, and even reducing some nesting depth. \r\n\u003e This saves you tedious work, leaving you more time to focus on more complex requirements, such as \r\n\u003e modularization, testability, and good naming. \r\n\r\nABAP cleaner is installed with two **profiles**: \r\n\r\n- in the '**default**' profile, most available cleanup rules are activated with what we believe are good default settings \r\n  in alignment with the [Clean ABAP Styleguide](https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md) \r\n  (and even going beyond its demands);\r\n- in the '**essential**' profile, only those cleanup rules are active which are explicitly demanded by the \r\n  [Clean ABAP Styleguide](https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md); \r\n  this applies to approx. 40% of the available cleanup rules. \r\n\r\nAdditionally, you can create your own profiles:  In each profile, you can **select** which cleanup rules shall be active, \r\nand **configure** options and thresholds for these rules. \r\nYour team may align on a common configuration and create a **team profile** from it.\r\n\r\n\r\n## Demo of ABAP Cleaner\r\n\r\n\u003ctable\u003e\r\n  \u003ctr\u003e\r\n    \u003cth width=\"50%\"\u003eHow to install, use, and configure\u003c/th\u003e\r\n    \u003cth width=\"50%\"\u003eHow ABAP cleaner has evolved\u003c/th\u003e\r\n  \u003c/tr\u003e\r\n  \u003ctr\u003e\r\n    \u003ctd width=\"50%\"\u003e\r\n      For a demo of what ABAP cleaner offers, how it is installed, used and configured, \r\n      you can watch this \u003ca href=\"https://www.youtube.com/watch?v=0mp0FuJV5_k\"\u003eDevtoberfest 2023 session on YouTube\u003c/a\u003e:\r\n    \u003c/td\u003e\r\n    \u003ctd width=\"50%\"\u003e\r\n      In the \u003ca href=\"https://youtu.be/jcux6BlkyIA?t=1193\" target=\"_blank\"\u003eDevtoberfest 2024 session\u003c/a\u003e, \r\n      Jörg-Michael shows how ABAP cleaner has evolved since its initial Open Source release \r\n      (\u003ca href=\"https://dam.sap.com/mac/app/p/pdf/asset/preview/wDK3Gbs?ltr=a\u0026rc=10\u0026doi=SAP1127022\" target=\"_blank\"\u003eslides\u003c/a\u003e):\r\n    \u003c/td\u003e\r\n  \u003c/tr\u003e\r\n  \u003ctr\u003e\r\n    \u003ctd width=\"50%\"\u003e\u003ca href=\"https://www.youtube.com/watch?v=0mp0FuJV5_k\" target=\"_blank\"\u003e\u003cimg src=\"docs/images/recording_devtoberfest_2023.png\" width=\"640\"\u003e\u003c/a\u003e\u003c/td\u003e\r\n    \u003ctd width=\"50%\"\u003e\u003ca href=\"https://youtu.be/jcux6BlkyIA?t=1193\" target=\"_blank\"\u003e\u003cimg src=\"docs/images/recording_devtoberfest_2024.png\" width=\"640\"\u003e\u003c/a\u003e\u003c/td\u003e\r\n  \u003c/tr\u003e\r\n  \r\n  \u003ctr\u003e\r\n    \u003cth width=\"50%\"\u003eThe open source journey of ABAP cleaner\u003c/th\u003e\r\n    \u003cth width=\"50%\"\u003e\u003c/th\u003e\r\n  \u003c/tr\u003e\r\n  \u003ctr\u003e\r\n    \u003ctd width=\"50%\"\u003e\r\n      To hear about the story behind ABAP cleaner and its journey to open source, \r\n      watch this \u003ca href=\"https://vods.dm.ux.sap.com/webinars/ospo-webinar-series/vods/abap_cleaner_webinar_edited_recording-edited.mp4\" target=\"_blank\"\u003ewebinar\u003c/a\u003e \r\n      hosted by the SAP Open Source Program Office (\u003ca href=\"https://d.dam.sap.com/a/m7QFgad/Open-Source%20Project%20ABAP%20Cleaner.pdf\" target=\"_blank\"\u003eslides\u003c/a\u003e):\r\n    \u003c/td\u003e\r\n    \u003ctd width=\"50%\"\u003e\r\n    \u003c/td\u003e\r\n  \u003c/tr\u003e\r\n  \u003ctr\u003e\r\n    \u003ctd width=\"50%\"\u003e\u003ca href=\"https://vods.dm.ux.sap.com/webinars/ospo-webinar-series/vods/abap_cleaner_webinar_edited_recording-edited.mp4\" target=\"_blank\"\u003e\u003cimg src=\"docs/images/recording_open_source.png\" width=\"640\"\u003e\u003c/a\u003e\u003c/td\u003e\r\n    \u003ctd width=\"50%\"\u003e\u003c/td\u003e\r\n  \u003c/tr\u003e\r\n\u003c/table\u003e\r\n\r\n\r\n## How ABAP Cleaner is Used\r\n\r\n### Automated or Interactive Cleanup from ADT\r\n\r\nUsing ABAP cleaner from ADT, the cleanup can be done \r\n\r\n- either **automatically** with a single keystroke (***Ctrl + 4*** or menu 'Source Code / Clean Up With Automated ABAP Cleaner'), \r\n- or **interactively** by opening the ABAP cleaner UI (***Ctrl + Shift + 4*** or menu 'Source Code / Clean Up With Interactive ABAP Cleaner...') \r\n  which allows you to check the changes, revert those that you don't like with a single mouse click, \r\n  and finally apply (or discard) the result. \r\n- A third option shows a **read-only preview** of the cleanup result without locking or changing the code, \r\n  e.g. if you don't have development authorization in the current system \r\n  (***Ctrl + Shift + 5*** or menu 'Source Code / Show Read-Only Preview With ABAP Cleaner...')\r\n  \r\n  ![ABAP cleaner integration into ABAP Development Tools (ADT)](docs/images/adt-integration.png \"ABAP cleaner integration into ABAP Development Tools (ADT)\")\r\n\r\n### Using the Stand-alone App with SAP GUI\r\n\r\nUsing the stand-alone ABAP cleaner app, you may use the clipboard to copy the code from your IDE \r\n(i.e. SAP GUI) into ABAP cleaner, and to copy the cleaned code back to your IDE. \r\n\r\nYou can also make the ABAP cleaner app [watch the clipboard](docs/usage.md) and directly replace it with cleaned up code, \r\nallowing you to stay in SAP GUI and do the cleanup with *Ctrl + C*, *Ctrl + V*.\r\n\r\n### Scope of the Tool\r\n\r\nABAP cleaner can be used to clean up both existing and new code, both product code and test code, \r\nboth with a \"broadband\" approach (simultaneously applying 100+ different rules) \r\nand a focused approach (cleaning with a limited selection of rules). \r\n\r\nABAP cleaner was implemented with object-oriented ABAP in mind, but it may also be used for code in reports and functions. \r\nEML statements are not yet supported (meaning that most cleanup rules simply leave them unchanged). \r\n\r\n\r\n## Requirements and Installation\r\n\r\nTo install and use the **ABAP cleaner plug-in for ABAP Development Tools** (ADT) on Windows or macOS, \r\n\r\n1. Install ABAP Development Tools as described in the [Install ADT Tutorial (Step 1)](https://developers.sap.com/tutorials/abap-install-adt.html),\r\n   using an Eclipse installation that is [compatible with ADT](https://tools.hana.ondemand.com/).\r\n2. Start ADT, select menu 'Help / Install New Software...', \r\n   copy the link https://sap.github.io/abap-cleaner/updatesite to the 'Work with' field, press Enter \r\n   and follow the installation steps, confirming to install ABAP cleaner (content is currently unsigned). ([Known issues](docs/installation-issues.md))\r\n\r\n   ![ABAP cleaner plug-in for ABAP Development Tools - installation](docs/images/adt-installation.png \"ABAP cleaner plug-in for ABAP Development Tools - installation\")\r\n\r\n3. After restarting ADT, open an ABAP code document in an editor, and use the menu \r\n   'Source Code / Clean Up With Interactive ABAP Cleaner...' \r\n   (shortcuts *Ctrl + 4* or *Ctrl + Shift + 4*), see [usage](docs/usage.md).\r\n\r\nThe **stand-alone version of ABAP cleaner** (for Windows, macOS or Linux) \r\nrequires Java 21 or 17 (e.g. [SapMachine](https://sap.github.io/SapMachine/) or [Adoptium Temurin](https://adoptium.net/)). \r\nTo install the stand-alone version, please download and extract the latest [Release](../../releases) \r\nand follow the installation instructions given there.\r\n\r\n\r\n## Engaging in Our Project \r\n\r\n### Reporting Issues and Ideas\r\n\r\nIf you come across any (suspected) bugs or issues, expect ABAP cleaner to behave differently than it does, \r\nmiss an option to configure a cleanup rule, or have an idea for a great new cleanup rule, \r\nplease **create a [GitHub issue](../../issues)**, \r\nproviding a small code snippet of both the original and the cleaned code, \r\nand explaining how the result differs from your expectations.\r\n\r\nThe general approach of ABAP cleaner is to only modify statements that match the expected syntax \r\nand leave statements unmodified if any unexpected syntax is found (e.g. comments in weird places inside a statement). \r\n\r\n\r\n### Contributing\r\n\r\nYou are welcome to [**contribute to ABAP cleaner development**](CONTRIBUTING.md) - implementing new cleanup rules, new UI features, bugfixes etc.!\r\n\r\n\r\n### Code of Conduct\r\n\r\nWe as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. \r\nBy participating in this project, you agree to abide by its [Code of Conduct](https://github.com/SAP/.github/blob/main/CODE_OF_CONDUCT.md) at all times.\r\n\r\n\r\n## Limitations and Known Issues\r\n\r\nThe ABAP cleaner plug-in (as any other plug-in) can only be installed from extensible versions of ABAP Development Tools (ADT), \r\nin which menu 'Help / Install New Software...' is available. \r\n\r\nSince ABAP cleaner does not perform additional backend calls, cleanup is restricted to what can be done within the current code document, \r\nwithout retrieving additional DDIC information, signatures, includes etc.\r\n\r\nABAP cleaner strives to offer cleanup rules that automatically detect what can be improved in the given ABAP code, \r\nso after some initial configuration, users shall be able to apply \"everything everywhere\" with just one keystroke. \r\nABAP cleaner is therefore restricted to cleanup rules that keep functionality unchanged and can be applied without \r\nany additional user interaction, or need for subsequent inspection of changes. \r\n\r\nAt any given time, known and unresolved issues are shown as \"Open\" issues with label \"bug\" in the \r\n[Issues](../../issues) section.\r\n\r\n\r\n## Upcoming Changes\r\n\r\nAs long as we do not run out of ideas for automatable cleanup (or contributors to implement these ideas), \r\nABAP cleaner shall be enhanced with \r\n\r\n- further **cleanup rules**,\r\n- further **configuration options**,\r\n- further **UI features**,\r\n- possibly, support for code sections in **other languages**, esp. SQL Script. \r\n\r\nAs shown in the [Profiles and Rules](docs/profiles.md) documentation, you can choose yourself \r\nwhether or not to 'Automatically activate new features after updates' (per profile). \r\nNew features will be listed in the [Release notes](docs/release-notes.md).\r\n\r\n\r\n## Detailed Documentation\r\n\r\n- [How to use ABAP cleaner](docs/usage.md)\r\n- [Main window](docs/main-window.md)\r\n- [Profiles and rules](docs/profiles.md)\r\n- [Release notes](docs/release-notes.md)\r\n- [Available cleanup rules](docs/rules.md)\r\n\r\n\r\n## Licensing\r\n\r\nCopyright 2023 SAP SE or an SAP affiliate company and ABAP cleaner contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/SAP/abap-cleaner).\r\n\r\n**Continue reading**: [How to use ABAP cleaner](docs/usage.md)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsap%2Fabap-cleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsap%2Fabap-cleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsap%2Fabap-cleaner/lists"}