sapdev logo background
sapdev logo sapdev logo
Comments

SAP FIELD-SYMBOL INLINE documentation, setup help and example usage



Return to SAP documentation index


ARTICLE

FIELD-SYMBOL - Inline Declaration

Syntax
... FIELD-SYMBOL( fs ) ...

Effect
A declaration expression with the declaration operator FIELD-SYMBOL
declares a field symbol
fs to which a memory area is assigned in the current operand position. The declared field symbol is visible statically in the program
from FIELD-SYMBOL( fs ) and is valid in the current context . The declaration is made when the program is compiled, regardless of whether the statement is actually executed.
The declaration operator FIELD-SYMBOL can be specified in every valid declaration position (this involves assignments of the memory area only). The typing of the field symbol is determined using the statically recognized type of the assigned memory area. It can be generic and complete.
Wenn das Feldsymbol mehrmals innerhalb der Anweisung
mit dem Deklarationsausdruck FIELD-SYMBOL( ) vorkommt,
muss dieser vor den anderen Nennungen aufgef�hrt sein.
A field symbol fs declared inline cannot be used in a reader position of the same statement.
ABAP_PGL Only use inline declarations locally .

Notes
  • A valid statement with an inline declaration of a field symbol can generally be interpreted as a short form for a declaration statement used as a direct prefix.

  • FIELD-SYMBOLS fs TYPE ...
    ... fs ...
    Exceptions to this rule occur only if an identically named field symbol from a more global context is used in the same statement. This field symbol is still valid and is only hidden after the statement.
  • Just like the statement FIELD-SYMBOLS , an inline declaration does not open a local context for the current statement block. An inline declaration for a field symbol can only be made once within a context and the field symbol cannot yet be declared there using

  • FIELD-SYMBOLS .

    Example
    Inline declaration of a field symbol for an internal table in an
    ASSIGN statement and inline declaration of a field symbol for the rows of the table in a LOOP .
    TYPES t_itab TYPE TABLE OF i
    WITH NON-UNIQUE KEY table_line.

    DATA(dref) = NEW t_itab( ( 1 ) ( 2 ) ( 3 ) ).

    ASSIGN dref->* TO FIELD-SYMBOL(<(><<)>itab>).

    LOOP AT <(><<)>itab> ASSIGNING FIELD-SYMBOL(<(><<)>line>).
    ...
    ENDLOOP.
    Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




    EXTRACT_SUM_ABEXA
    FIELD_EXIT_GLOSRY




    comments powered by Disqus