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

Regarding program time out...

0 Likes
1,102

Hi all

I have a requirement where i need to display an error message when my report is taking more than thirty min to generate.

Can anyone please help me in this regard.

I need to capture the execution time and display the message at runtime.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,053

I Know this is the foolish way to fullfill ur requirement for time being

u can test following piece of code in ur program....

data: l_var1 type uzeit,

l_var2 type uzeit,

l_var3 type uzeit.

in intialization or start-of-selection

l_tm1 = sy-uzeit.

after that write following piece of code in 3 or 4 place where u thought that these

are time consuming steps

l_var2 = sy-uzeit.

l_var3 = l_var2 - l_var1.

if l_var3 ge 1800.

message e999(oo) with 'timeout'.

endif.

8 REPLIES 8
Read only

Former Member
0 Likes
1,054

I Know this is the foolish way to fullfill ur requirement for time being

u can test following piece of code in ur program....

data: l_var1 type uzeit,

l_var2 type uzeit,

l_var3 type uzeit.

in intialization or start-of-selection

l_tm1 = sy-uzeit.

after that write following piece of code in 3 or 4 place where u thought that these

are time consuming steps

l_var2 = sy-uzeit.

l_var3 = l_var2 - l_var1.

if l_var3 ge 1800.

message e999(oo) with 'timeout'.

endif.

Read only

andreas_mann3
Active Contributor
0 Likes
1,053

calc time and use fm SAPGUI_PROGRESS_INDICATOR

A.

Read only

0 Likes
1,053

Andreas,

Can u please explain it in detail ? I had a look at the function module but i am unable to understand hoe would it be helpful in my case.?

Read only

Former Member
0 Likes
1,053

Hi Shilpa

U can use SAPGUI_PROGRESS_INDICATOR for displayin clock in as display in standard programs

bu passing ..u can define p_rate at diffrent place of ur program in p_txt Cusomize message will display

call function 'SAPGUI_PROGRESS_INDICATOR'

exporting

percentage = p_rate

text = p_text.

start-of-selection

p_rate = 0 .

perform f_get_clock.

perform f_clock_display.

...............

again some piece of code

p_rate = 10 .

perform f_get_clock.

perform f_clock_display.

.....

............

p_rate = 20 .

perform f_get_clock.

perform f_clock_display.

form f_get_clock .

if p_rate = 0.

p_text = 'Checking for Whether File Exsists or Not'.

elseif p_rate = 10.

p_text = 'Transforming Data From File to internal Table'.

elseif p_rate = 20.

p_text = 'Formatting Data in the Internal Table'.

elseif p_rate = 30.

p_text = 'Removing Inactive,Not in SAP,Discharged Cases'.

elseif p_rate = 40.

p_text = 'Removing Exsisting Records'.

elseif p_rate = 50.

p_text = 'Checking For Public Holiday Condition'.

elseif p_rate = 60.

p_text = 'Adjusting Leave According to Leave Quata Avail'.

elseif p_rate = 70.

p_text = 'Uploading Records'.

elseif p_rate = 80.

p_text = 'Modifying Records created with .88 and .57'.

elseif p_rate = 90.

p_text = 'Writting Log Report'.

endif.

endform.

form f_clock_display .

call function 'SAPGUI_PROGRESS_INDICATOR'

exporting

percentage = p_rate

text = p_text.

endform.

Read only

Former Member
0 Likes
1,053

This function module just brings some beutyfication in ur program and nothing else..

Read only

former_member192467
Active Participant
0 Likes
1,053

Hi,

adding to the information given above: there will be a default timeout set by the BASIS. after this time period the report will automatically give a short dump stating the reasons for the timeout. you can check with your BASIS team to see what is the time sttings defined in your system.

Read only

Former Member
0 Likes
1,053

Its simple use

"GET RUNTIME"

use a variable say t1 befre processing starts

and t2 and processing ends

get runtime = t2 - t1 .

if get runtime is > 30 mins "error message"

hope ths helps

Bhanu

Read only

former_member212005
Active Contributor
0 Likes
1,053

Your program cannot run for 30mins in foreground.....it usually times out after 5 mins...

So I dont think generation will ever take 30 mins. atleast in foreground..

Please contact your BASIS guy for assistance on this! He can increase the time out value for you...but I doubt whether 30 mins is feasible...

Do you want to cancel the job automatically...once the program has reached 30 mins for generation (in background).