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 a field from one internal table to other

Former Member
0 Kudos
1,125

hi all,

i have a problem in moving a field from one internal table to other internal table , both are declared as with out header line. i have declared workareas for both internal tables , when iam trying to move name field from second internal table which have two fields,, to first internaltable having values in itand empty name field, the first internal table is overwritten and only name field is populated

please could any one help me in this issue. i have tried using modify append and other keyword. thanks in advance.

sre

1 ACCEPTED SOLUTION

Former Member
0 Kudos
600

loop at itab1 into wa1.

move wa1-fld1 to wa2-fld1.

<i>" corresponding fields... MOVE-CORRESPONDING should be avoided</i>

append wa2 to itab2.

endloop.

Reward if helpful

Regards

Prax

8 REPLIES 8

Former Member
0 Kudos
600

move-corresponding wa_itab1 to wa_itab2.

append it_iotab2 from wa_itab2.

clear wa_itab2.

Former Member
0 Kudos
600

hi

try

append wa2 to corresponding fields of itab1.

regards

ravish

reward if useful

0 Kudos
600

thanks for the reply but when i used move-corresponding , its giving error like these are not internal tables with header line, i want to move structure valuse to internal

sharadendu_agrawal
Active Participant
0 Kudos
600

Hi,

Use the below logic. Hope it wil help.

Loop at itab1 into wa1.

read table itab2 into wa2 with key primary = wa1-primary.

if sy-subrc = 0 .

wa1-name1 = wa2-name1.

wa1-name2 = wa2-name2.

endif.

modify itab1 from wa1.

endloop.

the above logic will definitely wrk in ure case.

Reward if helpful,

Cheers,

Sharadendu

Former Member
0 Kudos
601

loop at itab1 into wa1.

move wa1-fld1 to wa2-fld1.

<i>" corresponding fields... MOVE-CORRESPONDING should be avoided</i>

append wa2 to itab2.

endloop.

Reward if helpful

Regards

Prax

Former Member
0 Kudos
600

Hi,

Please try this.

loop at itab1 into wa1.

wa2-f1 = wa1-f1

wa2-f2 = wa2-f2.

append wa2 to itab2.

clear wa2,wa1.

endloop.

Thanks,

Sandeep.

Former Member
0 Kudos
600

Thnaks

Former Member
0 Kudos
600

Thanks for your suggestions