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: 

Import/Export Statement

Former Member
0 Kudos

Hi,

I want to import 2 internal tables (Declared with Header Line) and 1 variable from the memory. These 2 internal tables are exported separately at different points using separate Export Statements. I am not sure, why my Import statement is not working correct. Can you please give me the correct syntax?

Thanks in advance

Kannan.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Kannan,

Export itab1 itab2 var1 to memory id 'ABC'.

import itab1 itab2 var1 from memory id 'ABC'.

You mentioned that the exporting is done two times...

Check if the memory id you are using is the same... if same then the latest values will be set in the memory id....It simply over writes the data.

If you want to export it in two different places... then make sure it is different memory id.

regards

padma

5 REPLIES 5

former_member190578
Participant
0 Kudos

The correct syntax for the "import/export"-command will you find with <F1> on one of this command.

Former Member
0 Kudos

Hi,

This code is from which program you want to export to the ABAP memory:

export ist_resb to memory id 'ZPPC0122_FD'.

where ist_resb is the internal table name &

ZPPC0122_FD is the include name of my program ZPPC0122.

This code is from which program you want to import from the ABAP memory

import *ist_resb *= ist_resb from memory id 'ZPPC0122_FD'.

where ist_resb This internal table is the importing program internal table.

ist_resb This internal table is the exporting program internal table.

But remember in both the program you have defined the same internal table with same structure

Refer this link-

IMPORT:

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3bde358411d1829f0000e829fbfe/content.htm

http://abaplovers.blogspot.com/2008/04/passing-data-from-one-abap-program-to.html

http://help.sap.com/saphelp_45b/helpdata/en/34/8e73a36df74873e10000009b38f9b8/content.htm

Check this

Hope it will help you.

Regards,

Sujit

Former Member
0 Kudos

hi,

Plz refer to the link.

This may help you.

Regards

Sumit AGarwal

Former Member
0 Kudos

Hi Kannan,

Export itab1 itab2 var1 to memory id 'ABC'.

import itab1 itab2 var1 from memory id 'ABC'.

You mentioned that the exporting is done two times...

Check if the memory id you are using is the same... if same then the latest values will be set in the memory id....It simply over writes the data.

If you want to export it in two different places... then make sure it is different memory id.

regards

padma

Former Member
0 Kudos

Hello Kannan,

When you export the second itab to the same memory id, you are actually overwriting it.

Eg,

EXPORT <itab1> TO MEMORY ID 'ASD'.

EXPORT <itab2> TO MEMORY ID 'ASD'.

Now only itab2 is present in the memory id ASD.

Instead you can use,

EXPORT <itab1> <itab2> TO MEMORY ID 'ASD'.

IMPORT <itab1> FROM MEMORY ID 'ASD'.

will give you the itab1 and

IMPORT <itab2> FROM MEMORY ID 'ASD'.

will give you the itab2.

You can use different memory id's if you are exporting them at different points.

Hope you find it useful

Regards

Indu.