Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting to memory

Former Member
0 Kudos

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.

3 REPLIES 3

Former Member
0 Kudos

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'

Former Member
0 Kudos

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

Former Member
0 Kudos

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'