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: 

Transfer ITAB from ZREP1 to ZREP2

Former Member
0 Kudos

Hi Friends,

I want to Transfer ITAB from ZREP1 to ZREP2.

Please let me know, how to do this ?

Thanks,

Sonar

5 REPLIES 5

Former Member
0 Kudos

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

0 Kudos

My req is itab is in Report ZREP1 and I want to move itab to ZREP2.

Shoild i use this syntax.?

ZRep1.

submit zrep2.

0 Kudos

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

0 Kudos

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'.

Former Member
0 Kudos

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