Skip to main content

refactor: Refactoring and quick fixes

Evaluate and apply refactorings: quick fixes, rename, extract method, and move-to-package. Apply operations write.

Related guides: edit-source.

4 commands.

abapctl refactor quickfix

DESTR

Evaluate/apply quick fixes at a cursor position (rename, extract, convert). For an ATC finding's fix, use check atc-fix.

read-only without --apply; flag opts in to execution (no --yes needed)

OptionRequiredDescription
object (positional)yesobject (object/name argument)
--lineyesline number (1-based)
--colyescolumn number (1-based)
--connectionnoconnection profile name
--includenoclass include type
--applynoapply the Nth quick fix (1-based)
--adt-typenoADT object type (e.g. PROG/P, DDLS/DF, CLAS/OC). Use when a name is shared by multiple object types
abapctl refactor quickfix ZCL_FOO

abapctl refactor rename

DESTR

Rename a symbol across the codebase

read-only without --new-name; flag opts in to execution (no --yes needed)

OptionRequiredDescription
object (positional)yesobject (object/name argument)
--lineyesline number (1-based)
--colyescolumn number (1-based)
--connectionnoconnection profile name
--end-colnoend column (defaults to --col)
--includenoclass include type
--new-namenonew name for the symbol (triggers preview + execute)
--transportnotransport request number
--adt-typenoADT object type (e.g. PROG/P, DDLS/DF, CLAS/OC). Use when a name is shared by multiple object types
abapctl refactor rename ZCL_FOO

abapctl refactor extract-method

DESTR

Extract a code range into a new method

read-only without --name; flag opts in to execution (no --yes needed)

OptionRequiredDescription
object (positional)yesobject (object/name argument)
--start-lineyesstart line number (1-based)
--start-colyesstart column number (1-based)
--end-lineyesend line number (1-based)
--end-colyesend column number (1-based)
--connectionnoconnection profile name
--includenoclass include type
--namenomethod name (triggers preview + execute)
--transportnotransport request number
--adt-typenoADT object type (e.g. PROG/P, DDLS/DF, CLAS/OC). Use when a name is shared by multiple object types
abapctl refactor extract-method ZCL_FOO

abapctl refactor move

DESTR

Move one or more objects to a different package

read-only without --package; flag opts in to execution (no --yes needed)

OptionRequiredDescription
objects (positional)yesobjects (object/name argument)
--connectionnoconnection profile name
--packagenotarget package (triggers preview + execute)
--transportnotransport request number
--adt-typenoADT object type (e.g. PROG/P, DDLS/DF, CLAS/OC). Use when a name is shared by multiple object types
abapctl refactor move ZCL_FOO ZCL_BAR