SAP Tutorials Blog


"Declaring field symbols using the FIELD-SYMBOLS statement

"and providing a complete/generic type


"Examples for complete types

FIELD-SYMBOLS: <fs_i>        TYPE i,

               <fs_fli>      TYPE zdemo_abap_fli,

               <fs_tab_type> TYPE LINE OF some_table_type,

               <fs_like>     LIKE some_data_object.


"Examples for generic types (see more examples further down)

FIELD-SYMBOLS <fs_c>         TYPE c.           "Text field with a generic length

FIELD-SYMBOLS <fs_cseq>      TYPE csequence.   "Text-like (c, string)

FIELD-SYMBOLS <fs_data>      TYPE data.        "Any data type

FIELD-SYMBOLS <fs_any_table> TYPE any table.   "Internal table with any table type


"Declaring field symbols inline

"In an inline declaration, the typing of the field symbol is done 

"with the generic type data.

"Example use case: Inline declaration of a field symbol for an internal table.

LOOP AT itab ASSIGNING FIELD-SYMBOL(<line>).

  ...

ENDLOOP.


Serkan AKKAVAK

Computer Engineer BSc

Head of SAP & Software Department

Contact : serkurumsal@yandex.com