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

Exporting to memory

Hi abapers ,

I got to know the export and import (to and from memory).

why we export generally the internal tables to the memory .

I have gone thru the couple of examples .

Please let me know in detail .

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 08, 2008 at 04:36 PM

    we export generally the internal tables to the memory so that we can import the internal table data from another program

    Example of a program exporting an internal table to ABAP memory.

    Prog 1

    
    
    
    parameters: pa_vbeln like vbak-vbeln.
    data: itab type standard table of vbak.
    * get data to fill the table
    select * from vbak into table itab
                where vbeln = pa_vbeln.
    * now store the internal table to ABAP memory
    export itab to Memory ID 'table''.
     
    * here we call another program, prog 2
    submit prog2 and return.
    

    Prog 2 -> This imports the internal table exported by prog 1 and writes the content of the internal table to a list

    data: jtab type standard table of vbak,
           wa_vbak type vbak.
     
    * importing the itab that was exported by prog1
    import itab to jtab from memory id 'table'.
     
    loop at jtab into wa_vbak.
     write:/ wa_vbak-vbeln,
            wa_vbak-erdat.
    endloop.
     
    * clear the specific memory id after required processing is complete
    free memory id 'table'
    
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 08, 2008 at 04:38 PM

    Hi,

    Internal tables are specfic to the program , so if at all we want to use the data from internal table of one program to internal table of another program , we can use EXPORT and IMPORT

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 08, 2008 at 04:44 PM

    We can pass data from one program to another..

    1. You have to define an internal table ITAB in program XXXX

    2. In the program XXXX you export your ITAB to the memory.

    EXPORT ITAB TO MEMORY ID 'TD' (ID is the name of memory, you don't need to create it ).

    3. In program YYYY you have to declare The same table (same table's name and same fields).

    4. In YYYY you can import ITAB :

    IMPORT ITAB FROM MEMORY ID 'TD'

    5. Now you can export it to XXXX after modifications.

    EXPORT ITAB TO MEMORY ID 'TD'

    6. In XXXX :

    IMPORT ITAB FROM MEMORY ID 'TD'

    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.