Skip to Content
author's profile photo Former Member
Former Member

Global variables in SAP ABAP

Hi,

What is global variables and how to declare it?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 11, 2008 at 04:10 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 11, 2008 at 04:08 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 11, 2008 at 04:33 PM

    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?|data dictionary;

    [How many phases in a project?|in project devlopment;

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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.