Hi Lakshmi,
I think you are using the FM 'SAP_GUI_PROGRESS_INDICATOR' , as I remember this will also handles timeouts.
My suggestion is process the logic of progress BAR for selected line of records.
Example: executes process bar logic for every 20000 records once or even less in a loop(Do not execute for each record in a loop).
And also use commit work statement after the FM this will remove your timeout/logoff error.
Note: First try to optimize your code, if nested loop exists try to implement parallel cursor.
Regards,
Shadab.