code-pal-for-abap
code-pal-for-abap copied to clipboard
New check - modification of importing parameter via field-symbol
methods EXECUTE
importing
!IR_OPERAND1 type ref to DATA
!IR_OPERAND2 type ref to DATA
!IR_RESULT type ref to DATA.
METHOD execute.
CHECK ir_operand1 IS BOUND AND
ir_operand2 IS BOUND AND
ir_result IS BOUND.
ASSIGN ir_operand1->* TO FIELD-SYMBOL(<operand1>).
ASSIGN ir_operand2->* TO FIELD-SYMBOL(<operand2>).
ASSIGN ir_result->* TO FIELD-SYMBOL(<result>).
TRY.
<result> = <operand1> - <operand2>.
CATCH cx_root.
ENDTRY.
ENDMETHOD.
I found this method which treats an importing parameter as if it were changing/returning.
Thanks Frederik!! We'll take a closer look.