Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Time-out error due to SQL in loop

Former Member
0 Likes
1,617

Hi Folks,

Have an issue with performance. I have a couple of scenarios:

1) A custom report program loops through 9000 odd records (records which are being fetched from BSEG, BSID table). It gives a short dumpafter 10 mins. It is a TIME_OUT error. The maximum runtime profile parameter rdisp/max_wprun_time is set to 600 seconds and thus its apparently obvious that the program will dump as a result. The code has a few few selects inside the LOOP which may be the reason.

2) The same program loops through 22000 odd records for a different set of data in the selection screen and gives the output (ALV Display) after 2 hours!!

I am now not sure why is it behaving differently by not giving a short dump in the second case.

Will be very thankful to however is able to provide me any lead for this issue.

Thanks and Regards,

Shashank.

1 ACCEPTED SOLUTION
Read only

ravi_lanjewar
Contributor
0 Likes
1,550

Hi,

Don't spend your time to imagine what is you exact problem in your program trace your program which database sql take longer time useing the ST05 try to avoid the bulk data read in loop if possible.

You mention in point 1 it is correct.

Why you are reading all data at all ?

Just read some chunk of data and process (ie. read maximum of 50-50 record and process).

Suppose if you are reading 10,000 record at a time it will take approximate 15 minutes to execute the SQL such snario it will give dump due to maximum execution time is 10 minutes. gives timeout runtime error. Read 50 or 100 record at a time then process set of record and read again. you can also used the the pakage.

4 REPLIES 4
Read only

Rui_Dantas
Active Contributor
0 Likes
1,550

Is the program making any commits every now and then? That would avoid the time out.

Read only

0 Likes
1,550

The program does not do any commit. Its a simple report program which dumps with 9000 odd records (TIME_OUT dump) and shows the output after 2 hours with 22000 odd records. One point I would like to highlight is there are numerous SELECTS inside the particular loop (I talked about in my question previously)..

Read only

ravi_lanjewar
Contributor
0 Likes
1,551

Hi,

Don't spend your time to imagine what is you exact problem in your program trace your program which database sql take longer time useing the ST05 try to avoid the bulk data read in loop if possible.

You mention in point 1 it is correct.

Why you are reading all data at all ?

Just read some chunk of data and process (ie. read maximum of 50-50 record and process).

Suppose if you are reading 10,000 record at a time it will take approximate 15 minutes to execute the SQL such snario it will give dump due to maximum execution time is 10 minutes. gives timeout runtime error. Read 50 or 100 record at a time then process set of record and read again. you can also used the the pakage.

Read only

vieet
Explorer
0 Likes
1,409

I could able to execute the report program without any dump. But with the same parameters the other user is getting dump after 10 ,minutes TIME OUT Dump. Any idea why it is behaving differently for different users
rdisp/scheduler/prio_high/max_runtime is the reason for dump.