‎2008 Jan 08 8:40 AM
hi,
I have to code in two methods belonging to the same class. An internal table is to be passed from one method to the other.
I am using EXPORT - IMPORT . But it is not working. Can you tellme, where i am going wrong?
Method 1:
CONCATENATE 'memory1' sy-datum INTO v_memoryloc1.
CONCATENATE 'memory2' sy-datum INTO v_memoryloc2.
delete from MEMORY ID v_memoryloc1.
delete from MEMORY ID v_memoryloc2.
EXPORT v_mem FROM v_exitflag TO MEMORY ID v_memoryloc1.
EXPORT v_memory FROM it_output TO MEMORY ID v_memoryloc2.
Method 2:
CONCATENATE 'memory1' sy-datum INTO v_memoryloc1.
CONCATENATE 'memory2' sy-datum INTO v_memoryloc2.
IMPORT v_mem TO v_exitflag FROM MEMORY ID v_memoryloc1.
IMPORT v_memory TO it_output FROM MEMORY ID
v_memoryloc2.
DELETE FROM MEMORY ID v_memoryloc1.
DELETE FROM MEMORY ID v_memoryloc2.
‎2008 Jan 08 8:48 AM
Hi,
The memory id are valid until it executes the code. if you want to fetch the details from memory even after the program executes, then use export to database memory instead of memory id.
like this,
Data: ls_indx TYPE indx.
ls_indx-aedat = sy-datum.
ls_indx-usera = sy-uname.
ls_indx-pgmid = sy-repid.
EXPORT tab = lt_vbkd
TO DATABASE indx(V1)
FROM ls_indx ID 'ZTEST'.
IMPORT tab = lt_vbkd
FROM DATABASE indx(V1)
TO ls_indx ID 'ZTEST'.
Reward points if useful.
Regards,
Niyaz
‎2008 Jan 08 8:46 AM
Hi Balaji,
Make sure you are using both Methods in same program.. (or it's in called program / FM)..
For transporting internal table try using ITAB[] instead of ITAB...This can lead to exporting only headerline to Memory..
Regards,
Mohaiyuddin
‎2008 Jan 08 8:48 AM
I am also exporting a variable v_exitflag. Even i am not getting that correct.
Actually during debugging, sy-subrc is 4 for these steps.
‎2008 Jan 08 8:48 AM
Hi,
The memory id are valid until it executes the code. if you want to fetch the details from memory even after the program executes, then use export to database memory instead of memory id.
like this,
Data: ls_indx TYPE indx.
ls_indx-aedat = sy-datum.
ls_indx-usera = sy-uname.
ls_indx-pgmid = sy-repid.
EXPORT tab = lt_vbkd
TO DATABASE indx(V1)
FROM ls_indx ID 'ZTEST'.
IMPORT tab = lt_vbkd
FROM DATABASE indx(V1)
TO ls_indx ID 'ZTEST'.
Reward points if useful.
Regards,
Niyaz
‎2008 Jan 08 9:06 AM
‎2008 Jan 08 9:00 AM
If sy-subrc = 4 ==> this means you are executing 2 methods in different programs, hence Import is not able to find Memory ID set by Method1.
Regards,
Mohaiyuddin