11-16-2007 4:04 AM
In the itab for ex.
no code
-
1 ht
1 ht
1 ht1
I want to compare these record.ie 1st rec with all other records and 2nd with all other rec etc. How can I do this. Or else can I find the count.How?Plz help me..
11-16-2007 4:07 AM
data:count type i.
loop at itab into wA.
at new field1.
clear count.
count = count + 1.
endat.
count = count + 1.
endloop.
Message was edited by:
Karthikeyan Pandurangan
11-16-2007 4:07 AM
data : l_lines type sy-tabix.
describe table itab lines l_lines.
loop at itab into watab.
l_tabix = sy-tabix + 1.
loop at itab into wtemp from l_tabix to l_lines where matnr = watab-matnr.
write 😕 'duplicate record exists'.
endloop.
clear : l_tabix,
watab,
wtemp.
endloop.
11-16-2007 4:22 AM
Hello Suganya,
Do you want to compare the records or do u need something else?
If u want to compare the records, then u can do it in nested loops.
Eg : Consider i_tab1 is first internal table with header lines.
i_tab2 is second internal table with header lines.
loop at i_tab1.
loop at i_tab2 where field1 = i_tab1-field1 and
field2 = i_tab1-field2 and
fieldN = i_tab1-fieldN.
if the control enters the second loop, then duplicate records exists.
if u want to count the duplicate records,set a counter & increment the counter
endloop.
endloop.