Application Development 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: 

Global variables in SAP ABAP

0 Kudos

Hi,

What is global variables and how to declare it?

3 REPLIES 3

former_member188685
Active Contributor
0 Kudos

Global variables are variable which are accessible every where inside with in the program.

REPORT ZTEST.

data: var type c.  "this is global variable.

perform get_data.

form get_data.
data: loc type c. "local variable.
"
write var. "accessing global variable 
endform.

Former Member

Hi,

Global variables are those which can be accessed from any place of the progam.

You can Declare it with the Keyword DATA.Like-

Data: w_variable type i.

But if you declare it inside Form ....Endform i.e then it becomes local variable and you can not access it outside the subroutine.

Regards,

sujit

Former Member
0 Kudos

Interview questions => threads deleted and points removed.

PS @ everyone: If you see someone spamming interview questions, please report it as an Abuse and do not provide answers which a simple search could have found anyway if used.

Bobby already had 2 warnings:

[What happens when MARA is deleted from the database?|;

[How many phases in a project?|;

Edited by: Julius Bussche on Aug 11, 2008 4:38 PM