Skip to content

Commit 62287fa

Browse files
Update check-statement-position.md
1 parent 3a70903 commit 62287fa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/checks/check-statement-position.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ This check verifies whether the `CHECK` statement is the very first statement wi
88
The [Clean ABAP](https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#avoid-check-in-other-positions) says:
99
> Do not use `CHECK` outside of the initialization section of a method. The statement behaves differently in different positions and may lead to unclear, unexpected effects.
1010
11+
REMARKS:
12+
1. CHECK statement inside of LOOPs will be disregard by check (for that, refer to: CHECK_IN_LOOP).
13+
2. The usage of CLEAR statement prior to CHECK statement is considered to be a bad coding practice! This is actually a workaround in bad designed code (against OO scope principles).
14+
3. DATA declarations (DATA / FIELD-SYMBOLS when not dynamic declared – inline declarations), might also come before the keyword CHECK.
15+
1116
### How to solve the issue?
1217
The `CHECK` statement shall be the first statement of a method. If it is not possible, try to substitute this keyword with an IF-statement instead.
1318

0 commit comments

Comments
 (0)