10-10-2008 11:59 AM
hi all,
i have an internal table which contains some GL Acc nos. & one more table with some related data of that GL accs. now i m getting those in 2 diff internal table but i want to display like,
1 GL acc related records
related records
related records
2GL acc related records
related records
related records
like this.
when i use loop for this it is showing one extra record of 'related records'.
can u plz tel me how to disply them like above & how to avoid that extra record..
thanx..
10-10-2008 12:01 PM
Hi...
Use DELETE ADJESCENT DUPLICATES FROM ITAB BY COMPARING ALL FIELDS once in your program
Thanks,
Naveen.I
10-10-2008 12:05 PM
no sorry not at all i had already tried this but its not working...
10-10-2008 12:08 PM
10-10-2008 12:10 PM
loop at itab.
at new konts.
write:/ itab-konts.
endat.
loop at itab3 .
at new werks.
write:/ itab3-werks.
endat.
at new mtart.
write: itab3-mtart.
endat.
at new lfgja.
write: itab3-lfgja.
endat.
clear itab3.
endloop.
endloop.
10-10-2008 12:24 PM
Hi...
Cahnge it as..,
loop at itab.
at new konts.
write:/ itab-konts.
loop at itab3 .
at new werks.
write:/ itab3-werks.
endat.
at new mtart.
write: itab3-mtart.
endat.
at new lfgja.
write: itab3-lfgja.
endat.
clear itab3.
endloop.
endat.
endloop.
Also try to avoid Loop in side Loop.... You can go for read statement for second table or move all contents into one final internal table.
Thanks,
Naveen.I
10-10-2008 12:30 PM
i have changed it as said its working partially its giving 2 werks 2 mtart 2 lfgja and if i use on change of with mtart and lfgja it gives me 2 werks and others r single value whe...
also tell me in details how shld i use 'read'.
thanx a lot....
Edited by: NILESH S. on Oct 10, 2008 1:32 PM
10-10-2008 12:03 PM
sort itabl1 by gl Accnos.
Loop at itab1 .
write .....
Loop at itab2 where glaccno = itab1-accno.
write...
endloop.
endloop.
10-10-2008 12:25 PM
hi,
merge both the internal tables ..now it will contain duplicate entries corresponding to a G/L no....now use:
SORT ITAB ASCENDING BY G/L no.
DELETE ADJACENT DUPLICATES FROM ITAB COMAPARING G/L no.
Edited by: siddharth kumar on Oct 10, 2008 1:26 PM
05-22-2009 1:51 PM