Susmitha,
This will behave unexpectedly since the AT event on a field is triggered whenever the field or any field to the left of that field changes. A more reliable way to loop through the internal table would be to use the COLLECT statement as Neil suggested.