Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Declarations →  Declaration Statements 

Field Symbols

Field symbols are placeholders or symbolic names for existing data objects (or parts of existing data objects), declared by the statement FIELD-SYMBOLS or by the declaration operator FIELD-SYMBOL. A memory area is assigned to a field symbol at program runtime. A field symbol does not reserve physical space in the data area of a program like with a data object. Instead, it works as a dynamic name of a memory area, where a specific data object or part of an object is located. A field symbol can be used instead of data objects at operand positions of statements. When a statement of this type is executed, a memory area must be assigned to the field symbol by the statement ASSIGN or the addition ASSIGNING when processing internal tables.

Field symbols can point to almost any data object. A field symbol is the equivalent of a data reference variable dereferenced using ->*. Unlike data reference variables, value semantics are used to access a field symbol Accessing a field symbol is like accessing the named data object (or part of the object). For data reference variables, however, reference semantics apply.

Field symbols are implemented both for generic work with data objects and for explicit casting of data objects (only possible using field symbols).

Other versions: 7.31 | 7.40 | 7.54

Programming Guideline

Use field symbols and data references in appropriate ways


Notes

  • Field symbols to which data objects or parts of data objects are assigned in the heap are memory-preserving, like heap references.

  • From a technical perspective, the field symbols are implemented by references or pointers, which are comparable to references in data reference variables. A data reference variable is declared in the same way as every other data object und the memory area for the reference contained in the variable is located in the data area of the ABAP program. However, the pointer assigned to a field symbol is exclusively managed by the ABAP runtime environment and is located in the memory area, which cannot be accessed directly in an ABAP program.

Continue

FIELD-SYMBOLS