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

problem in internaltable

Former Member
0 Likes
979

hi folks,

i have 2 internal tables like itab1 and itab2.

itab1 say zkna1 with 5 fields one field say kunnar

itab2 say zkna2 with one field say zkna2-kunnner.

i would like to get the all data for kunnr data from zkna1

put into zkna2.

here both are internal tables.

how can we solve this problem.

thank u

advance

8 REPLIES 8
Read only

Former Member
0 Likes
961

Hi Sailaja,

do the following:

1) select data from the kna1 into it_kna1

2) loop it_kna1 into wa_kna1.

wa_kna2-kunnr2 = wa_kna1-kunnr1.

append wa_kna2 to it_kna2.

clear wa_kna1.

endloop.

Solves your problem.

Thanks!!

Read only

0 Likes
961

thanks aparna

my problem is solved.

thanks a lot.

Read only

former_member191735
Active Contributor
0 Likes
961

Loop at internal table ZKNA1 and move them to ZKNA2.

Read only

tarangini_katta
Active Contributor
0 Likes
961

HI sailiaja,

Aparna solution will solve u r problem.

I am agrre with aparna.

Thanks,

Read only

Former Member
0 Likes
961

Hi,

You can try this statement..

insert lines of itab1 <condition> into itab2 <condition>.

Regards

Vasavi Kotha

Read only

Former Member
0 Likes
961

Hi

No need to fetch data into another internal table

Straight away loop at zkna1 into wa_kna1.

wa_kna2=wa_kna1.

append wa_kna2 to zkna2.

clear wa_kna2.

endloop.

this will help and will improve performance.

regards

prashant.

Read only

Former Member
0 Likes
961

Loop on the 1st internal table and move the kunnr filed values from 1st internal table to second internal table, you will get the entire data of kunnr from 1st internal table to 2nd internal table.

Read only

Former Member
0 Likes
961

Hi,

Try this,

Loop i_kna1 into wa_kna1.

wa_kna2-kunnr = wa_kna1-kunnr.

append wa_kna2 to i_kna2.

clear: wa_kna1, wa_kna2.

endloop.

Regards,

Joan