From the class name in the definition of an ABAP class, you can create a public instance method called constructor.
If the class has attributes, a dialog is opened where you can select the attributes that should be instantiated by the constructor. Afterwards, the constructor is created with the selected parameters.
Example
The car class has the name attribute:
CLASS cl_car_constructor_generator DEFINITION PUBLIC CREATE PUBLIC . PUBLIC SECTION. ENDCLASS. CLASS cl_car_constructor_generator IMPLEMENTATION. ENDCLASS.
In the definition, the constructor method is added. For each selected attribute, the corresponding parameter is created.
In the implementation part, each parameter is assigned to the corresponding attribute.
Example
ABAP class after generating
CLASS cl_car_constructor_generator DEFINITION PUBLIC CREATE PUBLIC . PUBLIC SECTION. CLASS-METHODS class_constructor. ENDCLASS. CLASS cl_car_constructor_generator IMPLEMENTATION. METHOD class_constructor. ENDMETHOD. ENDCLASS.