‎2010 Nov 22 3:30 PM
Hi All.
I have a problem with IMPORT/EXPORT TO MEMORY.
This is a simple code :
DATA : id1 TYPE c LENGTH 10 VALUE 'TEXTS'.
task = 1.
EXPORT task TO MEMORY ID id1.
DATA : task1(2) TYPE c.
IMPORT task1 FROM MEMORY ID id1.
WRITE : task1.
I expected that result is 1 but the field task1 is empty. Why?
‎2010 Nov 22 3:42 PM
You are using the obsolete short form of IMPORT/EXPORT, there the two data object names "task" and "task1" must be identical.
You should rather use the slighty longer form with separate parameters and data objects. See F1 help for IMPORT and EXPORT statements, it is all explained.
Thomas
‎2010 Nov 22 3:42 PM
You are using the obsolete short form of IMPORT/EXPORT, there the two data object names "task" and "task1" must be identical.
You should rather use the slighty longer form with separate parameters and data objects. See F1 help for IMPORT and EXPORT statements, it is all explained.
Thomas
‎2010 Nov 22 4:17 PM
The data object are the same.
Now, if I use this sintax
export task to memory id 'task'.
IMPORT task TO task1 FROM MEMORY ID 'task'.
this work well in same program but if I try to insert "IMPORT task TO task1 FROM MEMORY ID 'task'." in other program called by SUBMIT this don't work. ( This program is called in FM JOB_SUBMIT )
Do you have some example?
‎2010 Nov 22 5:23 PM
Hi,
I think in this case you need to use SET/GET,
Import/Export are considered only for 1 session,
in your case you are calling the program from some other,
so session is different.
Thanks,
Anmol Bhat
‎2010 Nov 22 7:14 PM
this work well in same program but if I try to insert "IMPORT task TO task1 FROM MEMORY ID 'task'." in other program called by SUBMIT this don't work. ( This program is called in FM JOB_SUBMIT )The reason may be that SAP uses different memory area for online and background activity.....also the data is not transferred..
When you are using IMPORT / EXPORT both the program needs to be in a single / similar call (session is correct word for online)
‎2011 Dec 08 1:58 PM
Hello all.
Very late...
Solution would be shared memory.
Check EXPORT instruction help.
‎2011 Dec 08 8:18 PM
Hi,
Export LIFNR TO MEMORY ID 'AB'. (ID is the name of memory, you don't need to create it ).
Import LIFNR FROM MEMORY ID 'AB'. (In Importing program create the same field name)
‎2013 Sep 11 1:59 PM
HI All,
I too have the same problem.
Any body, have dealt with this issue ?
Thanking You All.
‎2013 Sep 11 3:18 PM
HI,
I just changed your program the following way it worked within same program.
DATA : id1 TYPE c LENGTH 10 VALUE 'TEXTS'.
DATA : task1(2) TYPE c,
task(2) TYPE c.
task = 1.
EXPORT P1 = task TO MEMORY ID id1.
IMPORT P1 = task1 FROM MEMORY ID id1.
WRITE : task1.
Also The same also worked when I Used SUBMIT and Return.
Regards,
Vasanth
‎2014 Nov 11 9:15 AM
Hi,
Import and Export Parameters are used only for data placed in the same session, other wise it is not useful..
i.e, ABAP memory( Local Memory ).
Better to go for SAP Memory like SET and GET will use for your scenario ...
Thanks ,
Vamsi.
‎2014 Nov 11 9:16 AM
Hi all,
i think using the memory / shared memory is kinda risky, because every application server got its own memory. if you have more than 1 application server you never know on which of them your programm is executed to provide data to the memory and on which you want to recieve the data again. though it can happen that your memory stays empty after importing.
my personal opinion is better to use tables to store data.
regards
Stefan Seeburger