Hello,
One thing you should do is to avoid the SELECT SINGLE statement. Instead of that, place a SELECT FOR ALL ENTRIES IN out of the LOOP AT (before the loop). This way you will prevent your program from getting into a loop and selecting a line of data in each lap. I assure you that program's performance will improve noticeable.
Hope this help you, regards.