SAP FIELD-SYMBOLS ABAP Statements



Get Example source ABAP code based on a different SAP table
  


ID FIELD-SYMBOLS
• FIELD-SYMBOLS ABAP Statement

FIELD-SYMBOLS
Short Reference

ABAP_SYNTAX
FIELD-SYMBOLS <(><)> ${ typing $| obsolete_typing $}.

ABAP Addition
... typing

What does it do?
The statement FIELD-SYMBOLS declares a field symbol <(><)>. The naming conventions apply to the name fs. The angle brackets distinguish field symbols from data objects and are mandatory. Field symbols can be declared in any procedure and in the global declaration part of an ABAP program, but not in the declaration part of a class or an interface. A field symbol can be used in all operand positions where it is visible and that fit the typing defined using typing.
A field symbol is initial directly after its declaration
BEGIN_SECTION VERSION 5 OUT (exception: obsolete typings without an explicit type)
END_SECTION VERSION 5 OUT , which means that it does not refer to a memory area. A memory area must be assigned to it (normally using the statement ASSIGN) before it can be used as an operand. Otherwise an exception is raised.



Latest notes:

An inline declaration of field symbols can be made using the declaration operator FIELD-SYMBOL.
The angle brackets are a part of the name, which means that a field symbol could potentially be called <>. Such a field symbol cannot be used at all operand positions and leads to syntax errors from case to case. Therefore, the name <> should be avoided.
NON_V5_HINTS
ABAP_HINT_END

ABAP_EXAMPLE_VX5
Declaring a field symbol <(><)> and using it at operand positions.
ABEXA 01749
ABAP_EXAMPLE_END

ABAP_EXAMPLE_VX5
Declaring a field symbol with the invalid name <>. The example shows, that the field symbol cannot be used at all operand positions. Besides CLEAR shown here, especially modern expressions are affected.
ABEXA 01750
ABAP_EXAMPLE_END

ABAP Addition

What does it do?
The addition typing is used to type the field symbol. The syntax of typing is described under Typing. The typing specifies which memory areas can be assigned to the field symbol and in which operand positions it can be used.



Latest notes:

NON_V5_HINTS
In addition to the defined typing with typing, an obsolete typing obsolete_typing is also possible outside of methods.
ABAP_HINT_END

ABAP_EXAMPLE_VX5
Typing of a field symbol < itab> as an internal table and a field symbol < wa> with a completely generic type.
ABEXA 00261
ABAP_EXAMPLE_END

Return to menu