SAP FIELD SYMBOLS STRUC ABEXA

Get Example source ABAP code based on a different SAP table
  


ARTIClE

Field Symbols - Casting Structures
This example demonstrates how field symbols are casted.

ABAP_SOURCE_CODE
ABAP_EXEC

ABAP_DESCRIPTION
The numerical sequence '0123456789' is casted on the structures line1 and line2. Then the structure is accessed using the corresponding field symbol, and the components are individually output. Note that the date component contains an invalid date after the assignment, which is only used here for demonstration purposes.
The structures are casted using the ASSIGN CASTING statement. The obsolete STRUCTURE addition of the FIELD-SYMBOLS statement, which is replaced by ASSIGN CASTING, is shown here as an annotation.