Hi Jannus,
In addition to the experts comments above, I will suggest to use the function module SAPGUI_PROGRESS_INDICATOR to avoid time out error.
Also you can dynamically popup the message to the user indicating how much processing still left.
describe table itab.
batch = sy-tfill / 100.
cnt = 0.
loop at itab.
cnt = cnt + 1.
if cnt = batch. "For every 100 records
percent = percent + 1.
cnt = 0.
if percent > 100.
percent = 100.
endif.
txt = percent.
CONDENSE txt.
CONCATENATE txt ' % completed' INTO txt.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = percent
text = txt.
endif.
YOUR BUSINESS LOGIC
endloop.
Regards.