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

data transfer

Former Member
0 Likes
688

How can u transfer the data from one itab to another without using move & write statements?

1 ACCEPTED SOLUTION
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
671

Hi,

You can just use '=' to move the data.


itab2 = tab1. " Table with out header line
itab2[] = tab1[]. " Table with header line

You can also use

INSERT LINES OF itab1 INTO itab2.

Regards,

Sesh

6 REPLIES 6
Read only

Former Member
0 Likes
671

Define another ITAB which has the same structure as that of the first ITAB.

Then use the statement.

ITAB2[] = ITAB1[].

Hope this is your requirement.

Regards,

Pavan

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
672

Hi,

You can just use '=' to move the data.


itab2 = tab1. " Table with out header line
itab2[] = tab1[]. " Table with header line

You can also use

INSERT LINES OF itab1 INTO itab2.

Regards,

Sesh

Read only

Former Member
0 Likes
671

HI,

You can use ITAB1[] = ITAB2[]. but these 2 itabs should be same structure

Regards

Sudheer

Read only

0 Likes
671

LOL = is just a synony for move, but well, why would someone have this requirement? i dont get it. this is very unusual.

Read only

Former Member
0 Likes
671

Hello,

Use Insert lines of

<b>INSERT LINES OF itab1 [FROM idx1] [TO idx2] INTO itab2 [INDEX idx3].</b>

Effect

Inserts the internal table itab1 or an extract of it into the internal table itab2. This operation is the same as using a loop at the source area and inserting the entries into the target table line-by-line.

eg:

INSERT LINES OF NAME_TAB_1 FROM 2 INTO NAME_TAB_2 INDEX 2.

Regards,

Lijo

Read only

Former Member
0 Likes
671

hi,

u can do it many ways as

itab2 [] = itab1[].

loop at itab1.

read table itab1 with index sy-tabix.

itab2 = itab1.

append itab2.

endloop.

loop at itab1.

insert itab2 from itab1.

endloop.

insert lines of ........... itab1 to itab2.

,,,,,,,,,,,

if helpful reward some points.

with regards,

Suresh aluri.