2007 Mar 15 8:04 AM
Hi
i have a variable that contains a value ,
i want to export this variable value and i want to import this variable value with in the same transaction in another include
can any one give me syntax
2007 Mar 15 8:07 AM
2007 Mar 15 8:08 AM
2007 Mar 15 8:08 AM
use
in your main prog
export var to memory id 'PID'.
in your 2nd prog
import var from memory id 'PID'.
regards
shiba dutta
2007 Mar 15 8:18 AM
right now i dont have exact code.
suppose zreport1.
data : var type i value 5.
var = var * 5.
export var to memory id 'PID'.
now in zreport2
data : var type i.
import var from memory id 'PID'.
write : / var.
it will print 25. but first you have to run zreport1 .
then if you run zreport2 you will get the latest value from the memory id PID.
regards
shiba dutta
2007 Mar 15 8:35 AM
You can use export and import statements but if it is in the same transaction then you can also declare the variable in global declarations if you are not clearing the value in between.
2007 Mar 15 8:43 AM
as u r using that variable in same transaction,its better to declare that variable in topinclude, then that varibale can be accessed globally, no need to go for import/export.
Regards,
Sujatha.
2007 Mar 15 9:15 AM
suppose the field you want to export is 'field1'.
To export : Export field1 to memory ID 'MID'.
So this value is stored in the abap memory and can be retrieved using the ID 'MID'.
TO import : import field1 to field2 FROM MEMORY ID 'MID'.