ABAP Declaration

There are different ways to declare a variable in ABAP. It is possible to declare data types, data objects, classes, interfaces, and field symbols.

Declaration via a defined type

DATA lv_var TYPE abap_bool.
1

Declaration via a LIKE reference to another variable

DATA lv_othervar LIKE lv_var.
1

Declaration of a Constant

CONSTANTS lv_con TYPE abap_bool VALUE 'X'.
1

Declaration with REFERENCE to a class

DATA lref_var TYPE REF TO cl_class.
1

Declare Field-Symbol

FIELD-SYMBOLS: <fs_var> TYPE abap_bool.
1

Inline Declaration

DATA(lv_var) = abap_true.
1