Application Development and Automation 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: 
Read only

Export and Import

Former Member
0 Likes
548

hi Gurus,

Could you please explain what is the exact syntax to use export to memory id and import from memory id. Could you give me an example code explaining what the argument are.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
505
Simple form:
EXPORT <variables>/<internal tables> MEMORY ID 'MID'.

IMPORT <variables>/<internal tables> FROM MEMORY 
ID 'MID'.


Note that the datatype and names of the variables and 
internal tables need to be same in both programs.


Kind Regards
Eswar
4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
505

Sure, there are a couple ways to use this statement. The following is how I usually use it and it seems to work well in all cases.

Data:  it001 type table of t001.
data: xt001 type t001.

select * into table it001 from t001.

export it001 = it001 to memory id 'ZRICHTEST'.

clear it001. refresh it001.

import it001 = it001 from memory id 'ZRICHTEST'.

loop at it001 into xt001.
write:/ xt001-bukrs, xt001-butxt.
endloop.

Regards,

Rich Heilman

Read only

0 Likes
505

Check the following demo programs..

DEMO_DATA_EXT_CLUSTER_EXPORT   Saving Data Objects in Memory            
DEMO_DATA_EXT_CLUSTER_EXPORT_D Saving Data Objects in Cluster Databases 
DEMO_DATA_EXT_CLUSTER_IMPORT   Reading Data Objects from Memory            
DEMO_DATA_EXT_CLUSTER_IMPORT2  Program DEMO_DATA_EXT_CLUSTER_IMPORT2       
DEMO_DATA_EXT_CLUSTER_IMPORT3  Program DEMO_DATA_EXT_CLUSTER_IMPORT3       
DEMO_DATA_EXT_CLUSTER_IMPORT_2 Creating a Directory of a Data Cluster      
DEMO_DATA_EXT_CLUSTER_IMPORT_D Reading Data Objects from Cluster Databases 

~Suresh

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
505

You can also use it like so.



data:  it001 type table of t001.
data: xt001 type t001.

select * into table it001 from t001.

<b>export  it001 to memory id 'ZRICHTEST'.</b>

clear it001. refresh it001.
<b>
import  it001 from memory id 'ZRICHTEST'.</b>

loop at it001 into xt001.
  write:/ xt001-bukrs, xt001-butxt.
endloop.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
506
Simple form:
EXPORT <variables>/<internal tables> MEMORY ID 'MID'.

IMPORT <variables>/<internal tables> FROM MEMORY 
ID 'MID'.


Note that the datatype and names of the variables and 
internal tables need to be same in both programs.


Kind Regards
Eswar