Application Development 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: 

How to create timed out error

Former Member
0 Kudos

Hi All,

I want to create a timed out error as I need it for testing some code.

I am using "Wait" statement to make it wait more than the set run time, but its not working.

Can some one give me a code snippet to create timed out error.

Thanks and Regards

Ankit.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

take a two variables of type sy-uzeit.

at the beginning of the program..

v_starttime = sy-uzeit.

loop at itab.

v_difference = sy-uzieit - v_starttime.

if v_difference > 100.

raise execption TIMED_OUT.

endif.

endloop..

THANKS

Mahesh

4 REPLIES 4

Former Member
0 Kudos

hi,

take a two variables of type sy-uzeit.

at the beginning of the program..

v_starttime = sy-uzeit.

loop at itab.

v_difference = sy-uzieit - v_starttime.

if v_difference > 100.

raise execption TIMED_OUT.

endif.

endloop..

THANKS

Mahesh

Former Member
0 Kudos

If you want a program to keep running until the max runtime parameter is reached you could try;

WHILE 1 = 1.

ENDWHILE.

Former Member
0 Kudos

check below..


DATA:  sec TYPE i,
       temp TYPE t.
sec = 0.

start-of-selection.

temp = sy-uzeit.

WAIT UP TO 10 SECONDS.

WHILE sec LT 11.

  sec = sy-uzeit - temp.

  IF sec GE 10.

    MESSAGE 'Time out' TYPE 'E'.
  ENDIF.

ENDWHILE.

It gives time out for 11 secs..

If useful .. reward points...

Regards

Prax

0 Kudos

Thanks