2007 Oct 01 2:03 PM
hello,
can some body please explain me (with relevant proofs if any) which of the above two is best and more advantageous??
Looking forward for ur replies.
Thanks in advance.
2007 Oct 01 3:15 PM
Hi Pramod,
One quick reply to this is
Field symbol is a dereferenced pointer.
Referenced variable is a pointer.
Field symbol holds the data.
Ref. var holds the address of the data.
Using Field symbol u can not instantiate a class.
Reward points if useful,
Aleem.
2007 Oct 01 3:17 PM
Hi,
reference variablies -> This wil Hold the address number of the data
field symbols --> Will point to the Address number and it will hold the data
Regards
Sudheer
2007 Oct 01 5:24 PM
Hello Pramod
If you need a reference variable which has "field symbol" like properties simply use:
DATA:
lo_object TYPE REF TO object. " root of all ABAP classes
This variable will hold instances of any ABAP class or interface.
In order to use any method you have to do the appropriate casting, e.g.:
DATA:
lo_class TYPE REF TO cl_oo_class.
CREATE OBJECT lo_object TYPE ('CL_OO_CLASS'). " or:
CREATE OBJECT lo_class
EXPORTING
...
lo_object = lo_class.
lo_class ?= lo_object. " casting
CALL METHOD lo_class->...( ).
Regards
Uwe