2010 Dec 10 10:04 AM
Hi All,
I have table from which i have to find out the site and its max number.i fetch all the data in ITAB. now i am not understanding wat to do to find the max number.here is my problem...
Site Number
1001 2
1001 1
1001 5
1001 50
1001 30
1002 1
1002 100
1002 10
now i have all this data in my ITAB and den it is printing in my alv.
now i want data to be like this...
Site Number
1001 50
1002 100
plz tell me wat to do...as i am very new in this area.
Thanx,
Vaneet
Moderator Message: Basic Post. Put some effort of your own first.
Edited by: kishan P on Dec 10, 2010 3:42 PM
Hi All,
I have table from which i have to find out the site and its max number.i fetch all the data in ITAB. now i am not understanding wat to do to find the max number.here is my problem...
Site Number
1001 2
1001 1
1001 5
1001 50
1001 30
1002 1
1002 100
1002 10
now i have all this data in my ITAB and den it is printing in my alv.
now i want data to be like this...
Site Number
1001 50
1002 100
plz tell me wat to do...as i am very new in this area.
Thanx,
Vaneet
Moderator Message: Basic Post. Put some effort of your own first.
Edited by: kishan P on Dec 10, 2010 3:42 PM
2010 Dec 10 10:09 AM
Pretty straigth forward.
Just sort the internal table by site number descending. That way you know you always have the highest number in the first record for the site.
sort itab by site number descending.
loop at itab.
at new site.
itab2-site = itab-site.
itab2-number = itab-number.
append itab.
endat.
continue.
endloop.