Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Endless loop with WHILE ?

Hi Fox,

The bellow coding should terminate the function after a certain time in seconds (as input parameter) and displays the variable count. But it terminates at the end with the short dump since the count becomes an overflow. Thanks for you help.

Function xxxx

import: time_out type i.

DATA: c_syuzeit TYPE sy-uzeit,

count TYPE i.

c_syuzeit = sy-uzeit.

c_syuzeit = c_syuzeit + time_out.

WHILE c_syuzeit > sy-uzeit.

ADD 1 TO count.

ENDWHILE.

ENDFUNCTION xxx.

Tags:
replied

Hi,

Sy-uzeit will always contain the time the report has been launched (it will not change during runtime). To update this variable you can use the ABAP command "GET TIME".

Kind regards,

John.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question