Skip to content

Avoid CHECK in other positions

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.

For example, CHECK in a LOOP ends the current iteration and proceeds with the next one; people might accidentally expect it to end the method or exit the loop. Prefer using an IF statement in combination with CONTINUE instead, since CONTINUE only can be used in loops.

Based on the section Exiting Procedures in the ABAP Programming Guidelines. Note that this contradicts the keyword reference for CHECK in loops.

From SAP/styleguides under CC BY 3.0 — more details
Last updated on