08-23-2004 4:36 PM
Hi,
How to create and use global variable?
Advance thanks.
Regards,
V Balaji.
08-23-2004 10: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.
08-23-2004 5: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
08-23-2004 10: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.