1. ... STRUCTURE s DEFAULT wa
2. ... TYPE type
3. ... TYPE LINE OF type
4. ... LIKE s
5. ... LIKE LINE OF s
This statement declares a symbolic field called <fs>. At
runtime, you can assign a concrete field to the field symbol using
. All operations performed with the field symbol then directly
affect the field assigned to it.
You can only use one of the additions.
Output aircraft type from the table SFLIGHT using a field symbol:
FIELD-SYMBOLS <PT>. TABLES SFLIGHT. ... ASSIGN SFLIGHT-PLANETYPE TO <PT>. WRITE <PT>.
Assigns any (internal) field string or
structure to the field symbol from the ABAP/4
Dictionary (s). All fields of the structure can be addressed by
name: <fs>-fieldname. The structured field symbol points
initially to the work area wa specified after DEFAULT.
The work area wa must be at least as long as the structure s. If s contains fields of the type I or F, wa should have the structure s or at least begin in that way, since otherwise alignment problems may occur.
Address components of the flight bookings table SBOOK using a field symbol:
DATA SBOOK_WA LIKE SBOOK. FIELD-SYMBOLS <SB> STRUCTURE SBOOK DEFAULT SBOOK_WA. ... WRITE: <SB>-BOOKID, <SB>-FLDATE.
You can use additions 2 to 5 to type field symbols in the same way as FORM parameters (see also Type assignment of subroutine parameters). ASSIGN performs the same type checks as with USING parameters of FORMs.