Skip to Content
Technical Articles

Automagic standalone renaming of ABAP objects

Renaming ABAP objects is a tedious task, but can be necessary eg when sharing template code to avoid name clashes, or when changing the namespaces of objects.

abaplint can help to rename CLAS and INTF objects, it can run standalone on most CI pipelines like GitHub Actions. Code changes are performed by looking at semantics, ie. not regex-based.

Just setup the configuration,

"rename": {
  "output": "renamed",
  "skip": [],
  "patterns": [{"type": "CLAS|INTF", "oldName": "(.*)_rename", "newName": "$1_foobar"}]
},

 

and execute “abaplint –rename” via command line. As this is a generic tool, it can be used for various purposes, as the following example,

 

Practical Example: Orchestrating Changes

abapGit utilizes the ajson project by Alexander Tsybulsky, but it should still be possible to build the standalone report, not imposing requirements on the customer system.

This is solved by copying the ajson code, automatically renaming it, and opening a pull request with changes,

 

Overview

 

There is a daily job in the ajson_mirror repository which checks for code changes, renames, and pushes changes directly to ajson_mirror.

Similarly, for the abapGit repository, a job runs and opens a pull request with the updated renamed ajson code.

A developer can then review the changes and merge to the main branch, if there are any breaking changes, abaplint will find these and block the possibility to merge.

/
5 Comments
You must be Logged on to comment or reply to a post.
  • Thanks (again) for this illuminating blog post. I am a complete noob and I wanted to understand how it works. I have looked carefully at all the files you mention, and I don't find in the ajson_mirror action where do you indicate "abaplint --rename" so that to trigger automatically the renaming. If I understand well "abaplint --rename" uses the configuration in abaplint.json but I don't see where is the rename configuration; I found it in abaplint_rename.json but I don't understand how "abaplint --rename" can refer to a different json file. Could you explain a little bit more how it works or give some links? Thank you very much!