‎2007 Nov 17 10:51 AM
Hi all ,
I have two internal tables like IT1 and IT2. Fields of this tables r,
IT1 : matnr posnr maktx ....... ( upto 10fields )
IT2 : matnr posnr (2 fieds).
Issue is IT1 have set of values and it2 have some values. I want to add corresponding IT2 values in IT1 at linewise .Since no relationship between this two internal tables.
I used move-corresponding and read table concepts, but item wise it's not working .Kindly suggest any ideas.
Thankx advance
‎2007 Nov 17 11:15 AM
Hi,
Do like this
Types: Begin of ty_it3,
matnr type matnr.
posnr type posnr.
maktx type maktx.
End of ty_it3.
Data: it3 type table of ty_it3,
wa3 type ty_it3.
Loop at IT1 into wa1.
Move: wa1-matnr to wa3-matnr,
wa1-posnr to wa3-posnr.
Read table it2 into wa2 with key matnr = wa1-matnr posnr = wa1-posnr.
if sy-subrc = 0.
move wa2-maktx to wa3-maktx.
append wa3 to it3.
clear wa3.
endif.
Endloop.
are you expecting this....????
Reward if this helps,
Satish
‎2007 Nov 17 10:53 AM
not clear with ur post. can u be more clear on ur requirement?
‎2007 Nov 17 11:15 AM
Hi,
Do like this
Types: Begin of ty_it3,
matnr type matnr.
posnr type posnr.
maktx type maktx.
End of ty_it3.
Data: it3 type table of ty_it3,
wa3 type ty_it3.
Loop at IT1 into wa1.
Move: wa1-matnr to wa3-matnr,
wa1-posnr to wa3-posnr.
Read table it2 into wa2 with key matnr = wa1-matnr posnr = wa1-posnr.
if sy-subrc = 0.
move wa2-maktx to wa3-maktx.
append wa3 to it3.
clear wa3.
endif.
Endloop.
are you expecting this....????
Reward if this helps,
Satish
‎2007 Nov 17 12:39 PM
hi prabhu,
thankx for ur reply ,
Issue is Internal table-1 consist of
S.No maktx matnr posnr netwr
-
1 . xxx novalue novalue xxxx
2. xxx novalue novalue xxxx
3. xxx novalue novalue xxxx
-
Internal table - 2 consist of ,
S.no matnr posnr
-
1. xxxx xxxxx
2. xxxx xxxxx
3. xxxxx xxxxx
-
I want add this two fields values (like matnr and posnr) in first internaltable as S.No wise. since maktx is not same for this two tables ,
Also no other relationship between this two tables.plz tell me right solutiion for this issue.
Thankx advance.
‎2007 Nov 17 12:51 PM
if u just need to append the internal table2 to internal table1 then follow this code...
DESCRIBE TABLE itab1 LINES lin.
read table itab into witab index lin.
SINDEX = WITAB-SNO.
loop at itab2 into witab2.
SINDEX = SINDEX + 1.
WITAB1-SNO = SINDEX.
witab1-matnr = witab2-matnr.
witab1-posnr = witab2-posnr.
append witab1 to itab1.
endloop.is this u r lookin for?
‎2007 Nov 19 6:45 AM
hie...
do u require that the First record of IT2 should be the Matnr & Posnr of the First record in IT1 ??
similarly the 2nd record of IT2 should be the Matnr & Posnr of the 2nd record in IT1 ??
is this what is expected ??
‎2007 Nov 19 1:17 PM
‎2007 Nov 20 1:02 PM
if any solution for solveing this probelm,,,, kindly help me,,,