SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
Syntax Revisions for Logical Expressions and Control Structures
Incorrect Logical Operators
In ABAP Objects, the following statement causes an error message:
... >< ... =< ... => ...
Correct syntax:
... <> ... <= ... >= ...
Cause:
These operators for not equal to, less than or equal to, and more than or equal to. <>
, <=, and >= perform the same function. (as do NE, LE, and GE).
ON CHANGE OF - ENDON not Permitted
ABAP Objects error message at:
ON CHANGE OF f.
...
ENDON.
Correct syntax:
DATA g LIKE f.
IF f <> g.
...
g = f.
ENDIF.
Reason:
The system internally creates a global invisible auxiliary field which cannot be controlled
by the program. You are recommended to declare your own auxiliary field and process it with the IF control structure.
Incorrect Statement After CASE
Error message in ABAP Objects if the following syntax is used:
CASE a.
MOVE 5 TO a.
WHEN 5.
WRITE a.
ENDCASE.
Correct syntax:
MOVE 5 TO a.
CASE a.
WHEN 5.
WRITE a.
ENDCASE.
Reason:
The CASE control structure must always reflect the semantics
of an IF - ELSEIF control structure, which is not ensured if a statement could occur between CASE and WHEN.