2006 Jan 13 12:56 PM
Hi Group,
I have an internal table (itab) which I fill in program Z1. Now I want to export this itab to a memory id and then in program Z2 I will import this table in the initialization event. Any idea how can I do this ?
Ankur Bhandari
2006 Jan 13 1:09 PM
HI,
If import export is not working . You can try using
global SAP memory.
DATA: REPID(8) VALUE 'RFSCHU01'.
SET PARAMETER ID 'RID' FIELD REPID.
Get PARAMETER ID 'RID' FIELD REPID.
Double Click on 'RID' it will create global paramter id
Regards
Amole
Hi Group,
I have an internal table (itab) which I fill in program Z1. Now I want to export this itab to a memory id and then in program Z2 I will import this table in the initialization event. Any idea how can I do this ?
Ankur Bhandari
2006 Jan 13 12:59 PM
Hi,
EXPORT obj1 ... objn TO MEMORY.
IMPORT obj1 ... FROM MEMORY.
Hope this may be helpful
Regards
Amole
2006 Jan 13 1:00 PM
In prog Z1:
export itab to memory id 'ZZPROG'.
In prog Z2:
import itab from memory id 'ZZPROG'.
Itab must be declared the same way in both programs!
<b>Thanks for the reward</b>
2006 Jan 13 1:01 PM
This doesnt work. Please confirm.
Ankur Bhandari
p.s This works with normal variables, but I have an internal table with 100 rows and 4 columns
Message was edited by: Ankur Bhandari
2006 Jan 13 1:02 PM
Hi,
U can export using the EXPORT/IMPORT options.
Ex:
TABLES INDX.
DATA : BEGIN OF ITAB OCCURS 0,
f1,f2...
END OF ITAB.
Fill ITAB with values...
For Exporting,
CLEAR INDX.
INDX-AEDAT = SY-DATUM.
INDX-USERA = SY-UNAME.
INDX-PGMID = SY-REPID.
EXPORT ITAB TO DATABASE INDX(HK) ID 'Table'.
For importing,
IMPORT ITAB TO JTAB FROM DATABASE INDX(HK) ID 'Table'.
JTAB should have the same structure as ITAB
Sreedhar
Message was edited by: Sreedhar Kanchanapalli
2006 Jan 13 1:07 PM
What is the importance of 'HK' or it can be anything ? How can I free this id ? I used to use free memory id earlier ?
2006 Jan 13 1:12 PM
Tried this , this doesn't work. Any one can share a working code ?
Ankur Bhandari
2006 Jan 13 1:17 PM
HI Ankur
You can use below code.
Define below variables in both the programs.
<b>DATA: w_indxkey TYPE indx-srtfd VALUE 'TABLE'.
DATA: wa_indx TYPE indx.</b>
Define internal table with reference to DB structure so that in future if you want make some changes in internal table then it will be reflected in both the programs.
<b>data itab type table of ddic_structure.</b>
<b>
EXPORT itab FROM itab
TO DATABASE indx(st)
FROM wa_indx
ID w_indxkey.
IMPORT itab TO itab
FROM DATABASE indx(st)
ID w_indxkey
TO wa_indx.
FREE MEMORY ID w_indxkey.</b>
Regards,
Atish
2006 Jan 13 1:09 PM
HI,
If import export is not working . You can try using
global SAP memory.
DATA: REPID(8) VALUE 'RFSCHU01'.
SET PARAMETER ID 'RID' FIELD REPID.
Get PARAMETER ID 'RID' FIELD REPID.
Double Click on 'RID' it will create global paramter id
Regards
Amole
2006 Jan 13 1:11 PM
Hi Ankur,
INDX is cluster table for index. HK is a area in that table where u r going to store ur Itab entries temporarily. U can use also different area for that...Pls chk the INDX table entries.
To clear Memory...use FREE MEMORY..statement only...
Sreedhar
2006 Jan 13 1:17 PM
Hi,
It is the well executed code in our project...
May i know how u are executing the other program after excporting from one program..
Sreedhar
2006 Jan 13 1:18 PM
Hi,
try create a database table with same structure and
write the data to this table from progran Z1.
Read this table from program Z2.
Regards
Amole
2006 Jan 13 3:37 PM
Hi Ankur,
Have a look at demo programs
DEMO_DATA_EXT_CLUSTER_IMPORT
DEMO_DATA_EXT_CLUSTER_EXPORT
Hope these progrmas gives some inputs.
Thanks
Lakshman