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
atsy, 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.