What is the difference between a field symbol and a data reference, and when do you use each?
Say your answer out loud first.
Practise another way
A field symbol is an alias for a piece of memory that already exists. I assign it to a table line and change the line in place, with no copy.
A data reference is a real variable that holds an address, so I can store it, pass it, put it in a table, check it with IS BOUND, and create anonymous data with NEW.
I use field symbols for local processing and data references when the pointer must live somewhere or be handed over.
Both give access to data without copying it, but they behave differently.
Field symbol
- A placeholder for a memory area. After
ASSIGN, reading or writing<fs>reads or writes the original data. - It cannot be a component of a structure or a class attribute, so it cannot be stored or returned.
- Using an unassigned field symbol is a runtime error, so check
IS ASSIGNEDwhen the assignment may fail. - Typical use:
LOOP AT itab ASSIGNING FIELD-SYMBOL(<line>)to change lines in place.
Data reference
- A reference variable (
TYPE REF TO ...) holds the address. It is a normal variable: it can sit in a table, in an attribute, or be passed as a parameter. - Dereference with
ref->*, components withref->comp. - Create anonymous data with
NEWand take a reference to existing data withREF #( ). - Test with
IS BOUND. Dereferencing an initial reference raisesCX_SY_REF_IS_INITIAL.
LOOP AT orders ASSIGNING FIELD-SYMBOL(<order>).
<order>-status = 'C'. " changes the table line
ENDLOOP.
DATA(counter) = NEW i( 5 ). " anonymous data object
counter->* = counter->* + 1.
DATA refs TYPE STANDARD TABLE OF REF TO i WITH EMPTY KEY.
APPEND counter TO refs. " impossible with a field symbol
IF counter IS BOUND.
DATA(value) = counter->*.
ENDIF.
Performance: both avoid the copy that LOOP AT ... INTO wa makes. For wide lines or big tables, ASSIGNING or REFERENCE INTO is cheaper, and it is the way to modify the line directly.
Rule of thumb: field symbols for short local processing; data references when the pointer must outlive the statement, be passed, be stored, or the type is created at runtime (CREATE DATA).
Field symbols also have dynamic forms such as ASSIGN (name) TO <fs>; keep dynamic code to a minimum, as Clean ABAP asks for functional, typed code.
Explains that a data reference is a real variable and a field symbol is not, gives a case for each, and mentions the unassigned and not-bound errors.
Says 'field symbols are pointers' and cannot explain why you would not just use a reference everywhere.
Calling a field symbol a pointer variable. It has no storage of its own, which is why it cannot be stored or passed in a structure.
- What happens if you access an unassigned field symbol?
- Why is LOOP ... ASSIGNING faster than INTO?
- How do you create a data object whose type is known only at runtime?
- Can you store a field symbol in an attribute?
2 official pages and 4 prep guides. Confidence: high. Checked 21 Nov 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Prep guide Gives the question.
- Prep guide Gives the question.
- Prep guide Gives the question.
- Prep guide Gives the question.