code pal for ABAP > Documentation > Comment Position
This check finds comments starting with "
that are not indented at the same level as the statements that follow them. Comments should generally refer to the code that follows them, and hence should be indented at the same level.
The check does not report findings for comments that are in-line comments inside of a multi-line statement or that are the only "code" inside an empty branch of a conditional statement. In-line comments are reported when they occur at the end of a statement.
You should indent comments along with the statements they are commenting.
There are no pseudo comments for this check since you cannot put pseudo comments on the same line as an actual comment.
Before the check:
" comment 1
output = calculate_result( input ).
var_1 = var_2. " comment 2
select * from tab
" comment 3
where field_1 = var_3.
After the check:
" comment 1
output = calculate_result( input ).
" comment 2
var_1 = var_2.
select * from tab
" comment 3
where field_1 = var_3.
or