Comparing SAP ABAP Field symbols and data reference with Pointers in C


Field symbol resembles pointer in C but there is one main difference: you can use Field Symbol only to access the values present in it but not the memory address. Similar to a pointer in actual, it stores the memory address of the variable that was assigned to it. You can see the data held by the variable but you cannot fetch the memory address. Similar to a pointer, in case if you make changes to data referenced by field symbol, it changes the value at the original place too.

Data reference too resembles pointer at a high level. You can access memory address too in this case. You can compare two field references to verify whether both of them refer to the same memory reference. But you cannot use increment or decrement operations on the memory address, unlike pointers. Memory allocation can be done dynamically in this case if you use CREATE DATA command.

Updated on 30-Jul-2019 22:30:20