04-17-2006 9:31 AM
Hi Expects,
I want to print in the output how much time taken to execute my report. Please help on this.
regards,
vijay
04-17-2006 11:02 AM
Hi
You can use the statement
GET RUN TIME field t1.
gives the runtime till that particular statement.
If you give the statement in the end of the report it will give you the run time taken to execute the entire report.
Regards.
Lavanya.
04-17-2006 9:39 AM
Vijay,
At the starting of the report
GET TIME field1
At the ending.
GET TIME field2.
Field2 - Field1 will the time taken for execution.
REgards,
Ravi
04-17-2006 9:40 AM
Hi vijay,
1. simple
2. we have to use two things to get Current time.
GET TIME
SY-UZEIT.
3.
report abc.
*----
data : t1 type sy-uzeit.
data : t2 type sy-uzeit.
data : diff type i.
data : ekko like table of ekko with header line.
*----
get time.
t1 = sy-uzeit.
select * from ekko into table ekko.
select * from ekko into table ekko.
*----
get time.
t2 = sy-uzeit.
*----
write 😕 t1.
write 😕 t2.
diff = t2 - t1.
write 😕 'Time Taken : ' , diff.
regards,
amit m.
04-17-2006 10:13 AM
Hi Vijay,
You can check this code.
Code:
Data:v_time like sy-uzeit,
v_start like sy-uzeit,
v_diff like sy-uzeit,
v_message type string,
v_mes type string.
Initialization.
v_start = sy-uzeit.
start-of-selection.
get time.
v_time = sy-uzeit.
v_diff = v_time - v_start.
concatenate v_diff v_message into v_mes.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
text = v_mes
This will print time along with message in status bar.
I hope this code reach your functionality.
Regards,
Murali
04-17-2006 10:37 AM
Hi,
You can get the total duration from BACKGROUND job also.
enter all the inputs in selection screen.
set the Background job from Menu EXCUTE Background job or F9. fill print parameters, and then set the job.
once job finishes you can find the total execution time.
Regards
vijay
04-17-2006 11:02 AM
Hi
You can use the statement
GET RUN TIME field t1.
gives the runtime till that particular statement.
If you give the statement in the end of the report it will give you the run time taken to execute the entire report.
Regards.
Lavanya.
04-17-2006 7:28 PM
Finding the time difference is a bit tricky in the case where the program finishes on a different date than it starts. You have to take the difference in dates into account as well as the time. Fortunately, there is at least one FM that will do this: L_TO_TIME_DIFF.
Rob
04-18-2006 2:38 PM
This worked quite well:
REPORT ztest MESSAGE-ID zc.
DATA: start_dt LIKE sy-datum,
start_tm LIKE sy-uzeit,
end_dt LIKE sy-datum,
end_tm LIKE sy-uzeit,
dif LIKE ltak-istwm.
START-OF-SELECTION.
GET TIME.
start_dt = sy-datum.
start_tm = sy-uzeit.
* Program logic
END-OF-SELECTION.
GET TIME.
end_dt = sy-datum.
end_tm = sy-uzeit.
CALL FUNCTION 'L_TO_TIME_DIFF'
EXPORTING
i_start_date = start_dt
i_start_time = start_tm
i_end_date = end_dt
i_end_time = end_tm
i_time_uom = 'S'
IMPORTING
e_time_diff = dif
EXCEPTIONS
input_data_empty = 1
OTHERS = 2.
WRITE: /001 'Start date :', start_dt,
/001 'Start time :', start_tm,
/001 'End date :', end_dt,
/001 'End time :', end_tm,
/001 'Execution time:', dif, 'seconds'.
Rob
04-17-2006 8:04 PM
Try FM
SWO_GET_RUNTIME_INFO
Tip: Go to se37-> search string runtime or TIM . Youll get lots of Functions modules.
Thanks
Saquib