Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

what is the difference between a field symbol and a reference.

0 Likes
1,390

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

2 REPLIES 2
Read only

Former Member
0 Likes
779

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.

Read only

Former Member
0 Likes
779

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