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

Copying the data into internal table without internal table

Former Member
0 Likes
508

Hello experts.

i have two internal tables . itab1 without headerline and itab2 with headerline. itab1 has 10 fields and itab2 has 2 fields.

BEGIN OF itab,

lifnr LIKE lfa1-lifnr,

ktokk LIKE lfa1-ktokk,

name1 LIKE lfa1-name1,

sortl LIKE lfa1-sortl,

pstlz LIKE lfa1-pstlz,

ort01 LIKE lfa1-ort01,

land1 LIKE lfa1-land1,

j_1ipanno LIKE j_1imovend-panno,

end of itab.

DATA: itab1 TYPE STANDARD TABLE OF itab.

data: begin of itab2 occurs 0,

lifnr like j_1imovend-lifnr,

j_1ipanno like j_1imovend-j_1ipanno,

end of itab2.

now i want to move the data from itab2-j_1ipanno into itab1-j_1ipanno.

Both the tables ie itab1 and itab2 has lifnr data in them .

so in itab2 j_1ipanno has pan number for the lifnr( vendors) so i need to populate this pannumbers in itab1 also by comparing

the lifnrs in two tables. where ever the lifnr of itab2 is equal to itab1-lifnr then this pannumber should be placed there.

so pls tell me how to do that. lifnr in both the tables are the same.

thanks for all the replies.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
486

create an work area for itab1. (wa_itab1).

loop at itab2 .

MOVE-CORRESPONDING itab2 TO wa_itab1.

modify itab1 from wa_itab1.

endloop.

Edited by: jean liker on Jan 17, 2008 5:38 AM

Hello experts.

i have two internal tables . itab1 without headerline and itab2 with headerline. itab1 has 10 fields and itab2 has 2 fields.

BEGIN OF itab,

lifnr LIKE lfa1-lifnr,

ktokk LIKE lfa1-ktokk,

name1 LIKE lfa1-name1,

sortl LIKE lfa1-sortl,

pstlz LIKE lfa1-pstlz,

ort01 LIKE lfa1-ort01,

land1 LIKE lfa1-land1,

j_1ipanno LIKE j_1imovend-panno,

end of itab.

DATA: itab1 TYPE STANDARD TABLE OF itab.

data: begin of itab2 occurs 0,

lifnr like j_1imovend-lifnr,

j_1ipanno like j_1imovend-j_1ipanno,

end of itab2.

now i want to move the data from itab2-j_1ipanno into itab1-j_1ipanno.

Both the tables ie itab1 and itab2 has lifnr data in them .

so in itab2 j_1ipanno has pan number for the lifnr( vendors) so i need to populate this pannumbers in itab1 also by comparing

the lifnrs in two tables. where ever the lifnr of itab2 is equal to itab1-lifnr then this pannumber should be placed there.

so pls tell me how to do that. lifnr in both the tables are the same.

thanks for all the replies.

3 REPLIES 3
Read only

Former Member
0 Likes
487

create an work area for itab1. (wa_itab1).

loop at itab2 .

MOVE-CORRESPONDING itab2 TO wa_itab1.

modify itab1 from wa_itab1.

endloop.

Edited by: jean liker on Jan 17, 2008 5:38 AM

Read only

Former Member
0 Likes
486

Hi Shiva,

Try this one..

data: begin of itab.

lifnr LIKE lfa1-lifnr,

ktokk LIKE lfa1-ktokk,

name1 LIKE lfa1-name1,

sortl LIKE lfa1-sortl,

pstlz LIKE lfa1-pstlz,

ort01 LIKE lfa1-ort01,

land1 LIKE lfa1-land1,

j_1ipanno LIKE j_1imovend-panno,

end of itab.

data: wa like line of itab1.

data: begin of itab occurs 0,

lifnr like j_1imovend-lifnr,

j_1ipanno like j_1imovend-j_1ipanno,

end of itab2.

data: wa1 like line of itab2.

loop at itab1 into wa.

itab2-lifnr = wa-lifnr.

itab2-j_1ipanno = wa-j_1ipanno

append itab2.

endloop.

Reward points if helpful.

Kiran Kumar.G.A

Have a Nice Day..

Read only

Former Member
0 Likes
486

Hi shiva...

Try out this.

data : wa_itab1 like line of itab1.

loop at itab2.

loop at itab1 into wa_itab1.

if wa_itab1-lifnr = itab2-lifnr .

wa_itab1-j_1ipanno = itab2-j_1ipanno.

modify itab1 from wa_itab1.

endif.

endloop.

endloop.

Regards

sandeep.