
This quick assist is provided if the statement has a result.
You can create an attribute or local variable in order to assign the result of a functional method call. A functional method provides a returning parameter.
Example
The new variable new_speed is to be added to replace the call of the speed_control method:
CLASS cl_car DEFINITION PUBLIC.
PUBLIC SECTION.
METHODS: drive
IMPORTING
i_speed TYPE i.
PRIVATE SECTION.
ENDCLASS.
CLASS cl_car IMPLEMENTATION.
METHOD drive.
nmin( val1 = 220 val2 = i_speed ).
ENDMETHOD.
ENDCLASS.In the implementation part of the method, the new variable (new_variable) is declared.
At the cursor position, the new variable is added and assigned to the existing statement.
Now, you can change the new name (for example, new_speed).
Example
ABAP class after the assignment:
CLASS cl_car DEFINITION PUBLIC.
PUBLIC SECTION.
METHODS: drive
IMPORTING
i_speed TYPE i.
PRIVATE SECTION.
ENDCLASS.
CLASS cl_car IMPLEMENTATION.
METHOD drive.
DATA: new_speed TYPE i.
new_speed = nmin( val1 = 220 val2 = i_speed ).
nmin( val1 = 220 val2 = i_speed ).
ENDMETHOD.
ENDCLASS.