SAP Tutorials Blog


*&---------------------------------------------------------------------*

*& Report  Z_REFERENCE

*&---------------------------------------------------------------------*

*& Program Written by GEEKSFORGEEKS

*&---------------------------------------------------------------------*


REPORT  Z_REFERENCE.


* local variable lv_number declaration

DATA: lv_number TYPE I VALUE 7.


* local reference variable lr_number declaration

DATA: lr_number TYPE REF TO I.


* Displaying the local variable number before referencing

WRITE : 'lv_number value before referencing ', lv_number.


* Referencing lr_number to lv_number

GET REFERENCE OF lv_number INTO lr_number.


* Changing the value of lv_number using the reference variable lr_number

lr_number->* = 9.


* Displaying the local variable number after referencing & value change

WRITE : /'lv_number value after referencing  ', lv_number.


Serkan AKKAVAK

Computer Engineer BSc

SAP Department Manager

Contact : serkurumsal@yandex.com