Hi Mikael,
It would help if you share the contents of your internal tables, especially lt_a.
AT END OF is triggered at the end of a group of records having the same value for a given field. Probably, in your case, the first record in lt_a has a unique value for field time.