Skip to Content
author's profile photo Former Member
Former Member

IMPORT and EXPORT 2 internal table to memory?

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 20, 2009 at 03: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 20, 2009 at 03: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'.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 20, 2009 at 03:56 PM

    If you want to export and import 2 itabs... you can do it using two different memory ids... like 'table1' and 'table2'....

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 20, 2009 at 04: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'.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 20, 2009 at 05: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 20, 2009 at 06: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
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 21, 2009 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.