09-14-2007 7:21 AM
Hi,
Please solve the following query?
line 10: DATA: t1 TYPE f, t2 TYPE f.
line 20: GET RUN TIME FIELD t1.
line 30: GET RUN TIME FIELD t2.
line 31: t2 = t2 - t1.
I have put the breakpoints on the above mentioned lines and monitoring thje values of t1 and t2.
At line 10: t1 = 0, t2 = 0,
At line 20: t1 = 0.
At line 30: t1 = 0, t2 = 0.
At line 31: t1 = 0, t2 = some value(ex 1.890000...) and accordingly t2 - t1 also.
Problem i am facing is that according to the definition of GET RUN TIME FIELD t2 in the first run the value of t2 shld be zero, but when we excute line 30 for the first time the value of t2 is changing. can any one help plz.
Regards,
Dhiraj
09-14-2007 12:44 PM
t2 will not be zero.. only the first call of GET RUN TIME sets the field value to zero.. so only t1 will be zero.. For each subsequent call, the field ( t1 or t2 or whatever) contains the runtime in microseconds since the first call.
Arya.
09-14-2007 12:44 PM
t2 will not be zero.. only the first call of GET RUN TIME sets the field value to zero.. so only t1 will be zero.. For each subsequent call, the field ( t1 or t2 or whatever) contains the runtime in microseconds since the first call.
Arya.
09-27-2007 7:32 AM
Hi Dhiraj,
Check the following example, where T1 ia 0 but t2 is getting value. Always press F1 on your statement to check the help which has few helpfull example by SAP
DATA: T1 TYPE I,
T2 TYPE I,
TMIN TYPE I.
DATA: F1(4000), F2 LIKE F1.
TMIN = 1000000.
DO 10 TIMES.
GET RUN TIME FIELD T1.
MOVE F1 TO F2.
GET RUN TIME FIELD T2.
T2 = T2 - T1.
IF T2 < TMIN.
TMIN = T2.
ENDIF.
ENDDO.
WRITE: 'MOVE of 4000 byte:', TMIN, 'microseconds'.