Dear Kodanda Pani,
Please consider the below points which might help for performance improvements!!
- Use if sy-subrc = 0 after select query execution.
- Check the where clause in select statement (i.e DATETO = '99991231') Which is maximum, Could you please check the data whether date selection can be dynamically provided! so that we can restrict the data!
Regards
Kiran N