01-31-2010 7:05 PM
Hi Friends,
I want to Transfer ITAB from ZREP1 to ZREP2.
Please let me know, how to do this ?
Thanks,
Sonar
01-31-2010 7:30 PM
Hi,
You want to copy content of an internal table ZREP1 to internal table ZREP2?
If they have same structure and are tables without header lines:
zrep2 = zrep1.
If they have same structure and are tables with header lines:
zrep2[] = zrep1[].
If they have different structure and are tables without header lines:
DATA: ls_zrep1 LIKE LINE OF zrep1.
ls_zrep2 LIKE LINE OF zrep2.
CLEAR zrep2.
LOOP AT zrep1 INTO ls_zrep1.
MOVE-CORRESPONDING ls_zrep1 TO ls_zrep2.
APPEND ls_zrep2 TO zrep2.
ENDLOOP.
If they have different structure and are tables with header lines:
CLEAR: zrep2[], zrep2.
LOOP AT zrep1.
MOVE-CORRESPONDING zrep1 TO zrep2.
APPEND zrep2.
ENDLOOP.
Regards,
Adrian
01-31-2010 9:12 PM
My req is itab is in Report ZREP1 and I want to move itab to ZREP2.
Shoild i use this syntax.?
ZRep1.
submit zrep2.
01-31-2010 9:18 PM
In such case forget about what I wrote, You need to do something completely different:-) Use [EXPORT TO MEMORY|http://help.sap.com/abapdocu_70/en/ABAPEXPORT_DATA_CLUSTER.htm] statement in ZREP1 and [IMPORT FROM MEMORY|http://help.sap.com/abapdocu_70/en/ABAPIMPORT_DATA_CLUSTER.htm] in ZREP2.
Adrian
02-01-2010 1:17 AM
Should I write like this
I am in ZREp1.
Program ZREP1.
Export to itab to memory id 'ABC'.
submit ZREP2 and retur.
free memeory id 'ABC'.
Program ZREP2.
import Itab to memory id 'ABC'.
02-01-2010 4:41 AM
hi,
yes you can.........
In program ZREP1.
Export to itab to memory id 'ABC'.
submit ZREP2 and return.
free memeory id 'ABC'.
Program ZREP2.
create same internal table itab in ZREP2.
import Itab to memory id 'ABC'.
regards
Gaurav