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 work field which cannot be controlled by the program. You are recommended to declare your own work field and process it with the IF control structure.

Overview:

Replacement for Obsolete Statements ABAP Objects