Skip to Content
avatar image
Former Member

Global Variables

Hi,

How to create and use global variable?

Advance thanks.

Regards,

V Balaji.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 23, 2004 at 09:19 PM

    Hi Balaji,

    Do you meant you want to use a variables that can be access by different programs? If you want to use this, you can use parameter id. To create one use transaction SM30 and use table TPARA. You should create parameter id that start with Z. Then in your Abap program you can use SET to save the values into this parameter or use GET statement to retrieve values from this parameter. The values of a parameter id stays as long as you login SAP.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 23, 2004 at 04:44 PM

    Hi Balaji

    Your question seems about basics of ABAP programming or do I misunderstand?

    Hoping not, you can define a global variable in ABAP using especially with <b>DATA</b> statement and you can define so-called field-symbols like dereferenced pointers using <b>FIELD-SYMBOLS</b> statement. To define a constant you can use <b>CONSTANTS</b> statement.

    e.g.

    DATA gv_date1 TYPE datum .

    DATA gv_date2 LIKE sy-datum .

    FIELD-SYMBOLS <wa> TYPE subty .

    CONSTANTS gv_max_capacity TYPE i VALUE '5' .

    For more information you can apply SAPHelp by pressing F1 while on the keyword. And you can have alook to BC400 class.

    *--Serdar

    Add comment
    10|10000 characters needed characters exceeded