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

export to memory id

Former Member
0 Likes
4,846

Hi Chaps

I have a program as follows

FORM x.

DATA lv_val(3) TYPE c VALUE 'EXP'.

EXPORT lv_val TO MEMORY ID 'table'.

CALL TRANSACTION 'xyz'.

ENDFORM.

My question:

WIll i be able to retrieve the exported value in any function module of transaction xyz?

I am not getting it despite the following statment

IMPORT lv_val FROM MEMORY ID 'table' in a FM in transaction XYZ.

Should i only use the SAP memory in this case?

1 ACCEPTED SOLUTION
Read only

Former Member
2,145

Hi janardhan,

1. When u use memory id, make sure of the

following points.

a) The memory id is SAME as the variable name

b) Memory id should be in CAPITAL

c) When u want to import,

the variable name should be same as original one,

and should be declared in the same fashion only.

regards,

amit m.

Hi Chaps

I have a program as follows

FORM x.

DATA lv_val(3) TYPE c VALUE 'EXP'.

EXPORT lv_val TO MEMORY ID 'table'.

CALL TRANSACTION 'xyz'.

ENDFORM.

My question:

WIll i be able to retrieve the exported value in any function module of transaction xyz?

I am not getting it despite the following statment

IMPORT lv_val FROM MEMORY ID 'table' in a FM in transaction XYZ.

Should i only use the SAP memory in this case?

9 REPLIES 9
Read only

Former Member
0 Likes
2,145

Hi Janardhan,

You can retrieve the exported value.

Regards,

Ram

Read only

Former Member
0 Likes
2,145

check table <b>TPARA</b> , MEMORY ID IS THERE OR NOT IF NOT MAKE IT.

Read only

0 Likes
2,145

Hi Kishan,

I added the memory id in the table TPARA. But still Import doesnot fetch the value within the new transaction.

-

Jana

Read only

Former Member
0 Likes
2,145

YOu have to use SPA?GPA parameters ..i.e sap memory for this requirement i guess.

SET PARAMETER ID pid FIELD f.

GET PARAMETER ID pid FIELD f.

Regards,

ravi

Read only

Former Member
0 Likes
2,145

You can retrive it .but before that u should maintain that parameter if its not there in TPARA.

Read only

Former Member
2,146

Hi janardhan,

1. When u use memory id, make sure of the

following points.

a) The memory id is SAME as the variable name

b) Memory id should be in CAPITAL

c) When u want to import,

the variable name should be same as original one,

and should be declared in the same fashion only.

regards,

amit m.

Read only

0 Likes
2,145

Hi Amith,

Thanks for the answer. I have taken care of the mentioned points. However, "IMPORT" doesnt fetch the value.

In the transaction I am calling after export statement, the variable is a Global Variable. However, in the variable used for the export statement is local to the program. Otherwise, everything else is same. I have also added the id in the table TPARA.

Could you please help further ?

-

Jana

Read only

0 Likes
2,145

Hi again,

1. I just tried now,

and it works perfectly fine.

2. Local and global variables, do not matter.

3. just make sure all the points are satisfied.

4. To get a taste of it, just do this :

(This works absolutely fine)

a) make any z1 program and copy paste the code.

b) make another z2 program with tcode ZTR01.

*----


for Z1

report abc.

DATA : PERNR LIKE P0001-PERNR.

PERNR = '00004556'.

EXPORT PERNR TO MEMORY ID 'PERNR'.

CALL TRANSACTION 'ZTR01'.

*----


For Z2 (having tcode ZTR01)

report abc.

DATA : PERNR LIKE P0001-PERNR.

IMPORT PERNR FROM MEMORY ID 'PERNR'.

BREAK-POINT.

regards,

amit m.

Read only

0 Likes
2,145

Thanks a lot!!!

The problem is now resolved !!!