0% found this document useful (0 votes)
2 views1 page

Understanding Data References in Programming

Uploaded by

pandavidyasp
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Understanding Data References in Programming

Uploaded by

pandavidyasp
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

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.

You might also like