Application Development and Automation 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: 
Read only

EXPORTING VALUE OF A VARIABLE

Former Member
0 Likes
1,752

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

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

7 REPLIES 7
Read only

andreas_mann3
Active Contributor
0 Likes
1,435

hi,

try: export/import to/from memory id 'test'.

A.

Read only

0 Likes
1,435

CAN U GIVE ME SAMPLE SYNTAX

Read only

Former Member
0 Likes
1,435

use

in your main prog

export var to memory id 'PID'.

in your 2nd prog

import var from memory id 'PID'.

regards

shiba dutta

Read only

Former Member
0 Likes
1,435

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

Read only

Former Member
0 Likes
1,435

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.

Read only

Former Member
0 Likes
1,435

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.

Read only

Former Member
0 Likes
1,435

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'.