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: 

Appending to 2nd itab.

madan_ullasa
Contributor
0 Kudos

dear frnds,

I have an itab1 with records in it. i want to transfer all the records of itab1 to itab2. then the itab1 is refreshed and it gets second set of records. i want to append this to itab2 again.

any neat and optimal soln. for this ?

regrds madan.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Madan

append lines of ITAB1 TO ITAB2.

REFRESH ITAB1.

--->FILL ITAB1

append lines of ITAB1 TO ITAB2.

REFRESH ITAB1.

Max

5 REPLIES 5

Former Member
0 Kudos

Hi Madan

append lines of ITAB1 TO ITAB2.

REFRESH ITAB1.

--->FILL ITAB1

append lines of ITAB1 TO ITAB2.

REFRESH ITAB1.

Max

0 Kudos

dear max..

itz working fine.

but one draw back. i want atleast one blank line to be inserted if there is no records in the itab1 and still im appending it.

is it possible????

i gave u 6 pts for ur 1st reply :)- .

madan

0 Kudos

Hi

If ITAB1[] IS INITIAL.

APPEND INITIAL LINE TO ITAB2.

ELSE.

APPEND LINES OF ITAB1 TO ITAB2.

ENDIF.

Max

0 Kudos

Thanks dude :)-

regards,

Madan-Bangalore- india...

Former Member
0 Kudos

Hi,

I believe itab1 and itab2 have the same structure in

your case.

First time just write

<b>itab2[] = itab1[].</b>

This will copy the entire contents from itab2 to itab1.

Then in the second time write

<b> Append lines of itab1 to itab2</b>

<b>OR</b> <b>

DATA : wa_itab1 like line of itab1.

LOOP AT itab1 into wa_itab1

append wa_itab1 to itab2.

clear wa_itab1.

ENDLOOP.</b>

Note : Place the above code whereever you want to append from itab1 to itab2.

This will solve your problem.

Please reward points if this explanation is useful.

Regards,

Siva

Message was edited by: Sivakumar Muthusamy