2009 Mar 20 3:48 PM
Hi all,
Can you please tell me that is it possible to import and export 2 interal table to memroy?
If yes
I tried to export and import for 2nd table same way as i did for first table but its not comming for 2nd table.
Thanks in advance.
Hi all,
Can you please tell me that is it possible to import and export 2 interal table to memroy?
If yes
I tried to export and import for 2nd table same way as i did for first table but its not comming for 2nd table.
Thanks in advance.
2009 Mar 20 3:50 PM
EXPORT ITAB TO MEMORY ID 'table'.
IMPORT ITAB FROM MEMORY ID 'TABLE'.[IMPORT/EXPORT|http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb3bde358411d1829f0000e829fbfe/content.htm]
Both the import and export structure should be same.
Regards,
Gurpreet
2009 Mar 20 3:52 PM
You can IMPORT and EXPORT an internal table by sending it to MEMORY ID as:
In a report, you can export the data of internal table to memory id 'table'.
EXPORT t_table TO MEMORY ID 'table'.
And then you can import the same data again as:
IMPORT t_table FROM MEMORY ID 'table'.
2009 Mar 20 3:54 PM
I want to import and export 2 internal table is it possible?
2009 Mar 20 3:57 PM
Try:
EXPORT t_table TO MEMORY ID 'table'.
EXPORT t_table1 TO MEMORY ID 'table1'.
IMPORT t_table FROM MEMORY ID 'table'.
IMPORT t_table1 FROM MEMORY ID 'table1'.
2009 Mar 20 3:56 PM
If you want to export and import 2 itabs... you can do it using two different memory ids... like 'table1' and 'table2'....
2009 Mar 20 4:17 PM
Hi dude,
we can do that ...
Create 2 reports...
Copy paste the below codes and execute.. Report Teset2.
REPORT TEST2.
DATA: ITAB TYPE I OCCURS 10,
ITAB2 TYPE I OCCURS 10,
NUM TYPE I.
SUBMIT TEST1 AND RETURN.
IMPORT ITAB FROM MEMORY ID 'HK'.
LOOP AT ITAB INTO NUM.
WRITE / NUM.
ENDLOOP.
skip 5.
IMPORT ITAB2 FROM MEMORY ID 'MK'.
LOOP AT ITAB2 INTO NUM.
WRITE / NUM.
ENDLOOP.
-
REPORT TEST1.
DATA: NUMBER TYPE I,
ITAB TYPE I OCCURS 10.
DATA: NUMBER2 TYPE I,
ITAB2 TYPE I OCCURS 10.
DO 5 TIMES.
NUMBER = SY-INDEX.
APPEND NUMBER TO ITAB.
ENDDO.
DO 15 TIMES.
NUMBER2 = SY-INDEX.
APPEND NUMBER2 TO ITAB2.
ENDDO.
EXPORT ITAB TO MEMORY ID 'HK'.
EXPORT ITAB2 TO MEMORY ID 'MK'.
2009 Mar 20 5:52 PM
Do it in one shot:
EXPORT mem_tab1 FROM tab1[]
mem_tab2 FROM tab2[] TO MEMORY ID 'MY_TABS'.
IMPORT mem_tab1 TO tab1[]
mem_tab2 TO tab2[] FROM MEMORY ID 'MY_TABS'.
It saves both your table content under mem_tab1 and mem_tab2 in memory id 'MY_TABS' and then reads back from that place.
Regards
Marcin
Sorry some corrections.
Edited by: Marcin Pciak on Mar 20, 2009 6:55 PM
2009 Mar 20 6:52 PM
use like this
IMPORT l_it_ztable = l_it_ztable FROM MEMORY ID 'ZTABLE'. "memory id can be any string id
EXPORT l_it_ztable = l_it_ztable TO MEMORY ID 'ZTABLE'. "same as above
2009 Mar 21 2:51 AM
HI
you can use
IMPORT T_ITAB FROM MEMORY ID 'ABC'.
EXPORT T_ITAB TO MEMORY ID 'ABC'.But this will give you an EPC error in new versions .
So try this also.
EXPORT T_ITAB FROM T_ITAB TO MEMORY ID 'ABC'.
IMPORT T_ITAB TO T_ITAB FROM MEMORY ID 'ABC.'Regards
Hareesh Menon