Data Reference.
Data reference are pointers to data objects and it contains the memory address of
data object.
* When we are going to dynamic programming we go for this.
* It is can't be used at operand position directly it should be dereferenced
first.
Syntax: data: <var> type ref to <datatype>
Create data<var>(this same variable name)
<var>->* = <value>
New Syntax: data: <var> type ref to <datatype>
var = new #().
Assigning existing data object to data reference => here we can use GET REFERENCE.
data: var type i value 2.
data: var1 type ref to i.
GET REFERENCE OF var into var1.
var1->* = 4.
write: / var.
Working with Internal table: while processing internal table row, we can use
REFERENCE INTO statement to set reference to table rows.
data: lr_var type ref to mara.
data: lt_var type ref to mara.
select * from mara into table lt_var up to 10 rows.
Loop at REFERENCE INTO lr_var.
write: / lr_var->matnr.
Endloop.
Generic Data Reference:
-----------------------
Other than elementary data type we are mentioning any type of data reference which
is called as Generic data reference.