|
ABAP Tutorials -
Dynamic Programming
|
|
Written by Varun Verma
|
|
Sunday, 17 August 2008 06:57 |
|
In ABAP, field symbols are equivalent to de-referenced pointers in C++. They act like place holders or symbolic names for other fields. They do not occupy any space in memory but they point to a memory area that contains contents. So they act like pointers in C++ (for e.g int *a). A field symbol can point to any data object in ABAP. Field symbols are very useful because they provide great flexibility while programming in ABAP. They are very useful especially in dynamic programming. However, sometimes they do result in many runtime errors also if not handled properly. PS: The real equivalent of pointers in ABAP are reference variables. Reference variables contains memory addresses.
Declaring field symbols
Field symbols are declared like this: FIELD-SYMBOLS : <fs> TYPE [any type structure or internal table] The above example shows that a field symbol is typed to a predefined data type in ABAP. You can also have untyped field symbols like this: FIELD-SYMBOLS : <fs> TYPE ANY. To see the usage of field symbols in programming, refer to the Example Codes section.
|
|
Last Updated ( Monday, 18 August 2008 18:29 )
|