‎2010 May 03 9:51 AM
hi every one,
what is the difference between a field symbol and a reference.
Moderator Message: Interview-type questions are not allowed.
Edited by: kishan P on Dec 6, 2010 1:29 PM
‎2010 May 03 11:47 AM
Data references are pointers to data objects. You can only de-reference a data reference using a special assignment to a field symbol.
Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents.
‎2010 Dec 06 7:34 AM
Hi
Sorry for my delayed response.
I will explain what you have asked with a example.
(1) Declare a variable -> lv_var Type Integer Value 5.
This means a variable is created and it holds a value 5.
(2) Declare a variable -> lv_ref Type ref to Integer.
This is a not a normal variable rather a special variable bcoz it is capable of holding the address of another Integer type variable
(3)Get the refence of lv_var Into lv_ref.
Now lv_ref holds the memory address of lv_var
(4) Declare a field symbol and assign the refernce variable to that field symbol.
Why is this required ? Bcoz although you get the refence of the variable lv_var in lv_ref you can't directly get the value.
First you have to derefernec it using a field symbol and then access its value.
So reference var. holds the memory address and field symbol is the dereference var and it points to only the content of the varable (in our case, 5)
Thanks,
deb