Field symbol never assigned

 home  single file   example  edit

field_symbol_never_assigned

Description

Reports a local field symbol that is used, but never assigned in its method, form or function module

Extended Information

A field symbol declared with FIELD-SYMBOLS in a method, form or function module can only be
assigned in that procedure. If no ASSIGN ... TO or ... ASSIGNING of it exists there,
reading or writing it raises the runtime error GETWA_NOT_ASSIGNED. This is typically a copy-paste
error, where a statement uses a field symbol other than the one assigned before it.

Assignments are ASSIGN, ASSIGN LOCAL COPY, and ASSIGNING of LOOP, READ TABLE, INSERT, APPEND,
MODIFY and COLLECT, anywhere in the procedure. The order of the statements is not checked.

Not reported: field symbols only used in IS [NOT] ASSIGNED or UNASSIGN, field symbols declared
with DEFAULT, inline declarations, global field symbols, and procedures that contain a macro
call, an INCLUDE or a statement that cannot be parsed.

Default Configuration

Hover to see descriptions, Ctrl+Space for suggestions

Examples