Get Example source ABAP code based on a different SAP table
ARTICLE
Syntax Revisions for Logical Expressions and Control Structures ABAP Code Snippet ARTICLE
Incorrect Logical Operators You cannot use the ><(><<)> , =<(><<)> und => logical operators in ABAP Objects. This also applies to logical expressions in the WHERE addition of the LOOP statement for internal tables and the WHERE cause of Open-SQL statements.
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). ABAP Code Snippet ABAP Code Snippet ARTICLE
ON CHANGE OF - ENDON not Permitted The pseudo control structure ON CHANGE OF - ENDON is not permitted in ABAP Objects.
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. ABAP Code Snippet ABAP Code Snippet ARTICLE
Incorrect Statement After CASE In ABAP Objects WHEN must be the first 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. ABAP Code Snippet