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: 

Displays an extra record

Former Member
0 Kudos

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..

9 REPLIES 9

naveen_inuganti2
Active Contributor
0 Kudos

Hi...

Use DELETE ADJESCENT DUPLICATES FROM ITAB BY COMPARING ALL FIELDS once in your program

Thanks,

Naveen.I

0 Kudos

no sorry not at all i had already tried this but its not working...

0 Kudos

Why dont you paste your code ?

0 Kudos

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.

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

sort itabl1 by gl Accnos.

Loop at itab1 .

write .....

Loop at itab2 where glaccno = itab1-accno.

write...

endloop.

endloop.

Former Member
0 Kudos

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

Former Member
0 Kudos

ok