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 get execution time of a script?

Former Member
0 Kudos
134

I have a program to report the result of MRP. It need to process 8000 materials. I used loop to process them one by one. Now, I want to know the processing leadtime for each material. I placed following code

loop at out_put.

write: <b>sy-timlo</b>, out_put-matnr, /.

endloop.

But, unfortunately the timestamp in output is all same though the program ran for 10 minuties.

So, anyone can told me how can I get the actual execution time for each material. Thanks.

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos
84

You need to use the GET TIME syntax.

Like:

DATA: L_ST_TIME TYPE T,
      L_ED_TIME TYPE T.


DO 10 TIMES.
  GET TIME FIELD L_ST_TIME       .  " << start time
  WRITE: / L_ST_TIME.
  WAIT UP TO 1 SECONDS.
  GET TIME FIELD L_ED_TIME       .  " << end time
  WRITE: L_ED_TIME.
ENDDO.

Regards,

Naimesh Patel

2 REPLIES 2

naimesh_patel
Active Contributor
0 Kudos
85

You need to use the GET TIME syntax.

Like:

DATA: L_ST_TIME TYPE T,
      L_ED_TIME TYPE T.


DO 10 TIMES.
  GET TIME FIELD L_ST_TIME       .  " << start time
  WRITE: / L_ST_TIME.
  WAIT UP TO 1 SECONDS.
  GET TIME FIELD L_ED_TIME       .  " << end time
  WRITE: L_ED_TIME.
ENDDO.

Regards,

Naimesh Patel

Former Member
0 Kudos
84

Thanks a lot!