SAP Tutorials Blog

 

 


Unlike a static variables, reference variables does not reserve a data range in main memory. Before using reference variables, you need to reserve data for them by using the create data or create object statement.


To declare a reference variable, you use the type ref to keywords. For example:


data gr_amount type ref to f.

Inline declarations

Since ABAP release 7.4, you can use inline declarations to both declare and assign a value to a variable at the same time.


Prior to ABAP release 7.4, you have to declare a variable and assign it a value using separate lines:


data gv_status type i.

gv_status = lcl_sales_order=>get_status( ).

Now, you can use the inline declaration as follows:


data(gv_status) = lcl_sales_order=>get_status( ).

In this syntax, the gv_status will take the type of the return value of the lcl_sales_order=>get_status( ) method.


Serkan AKKAVAK

Computer Engineer BSc

SAP Department Manager

Contact : serkurumsal@yandex.com