Application Development and Automation 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: 
Read only

SY-DATUM inside Parallel Processing

Former Member
0 Likes
589

Hi guys,

I'm working with parallel processing of multiple function modules using STARTING NEW TASK. I want to know how long is taking some subroutines inside these FM's. I'm passing SY-DATUM to an internal table at the beginning and at the end of some subroutines. When I check the internal tables returned by the FM's, the times are the same.

Does SY-DATUM work in Parallel Processing? Does it store the time when the task begins?

Thanks,

Raú

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
543

sy-uzeit wont work..

just a simple test...

data: t1 type i, t2 TYPE sy-uzeit, t3 type tzonref-tstamps.
DO 5  TIMES.
  wait UP TO 1 SECONDS.
  GET RUN TIME FIELD t1.
  GET TIME FIELD t2.
  get time STAMP FIELD t3.
  WRITE:/ sy-uzeit, ':', t1, ':', t2, ':', t3.
ENDDO.

so better you need to use GET TIME STAMP.

5 REPLIES 5
Read only

Former Member
0 Likes
543

Sy-datum contains a date...you're expecting the jobs to run more than one day? probably not, so look at this:

data: lv_start type i,
                   lv_end type i,
                   lv_time type i,
                  lv_seconds type i.
get run time field lv_start.      "stores system clock in microseconds
   
* execute your step(s)...

get run time field lv_end.   "stores system clock in microseconds.

 lv_time = lv_end - lv_start.  "in microseconds (1/1000000 of a second). 
 lv_seconds =  lv_time / 1000000.  "wall clock seconds

...etc.

Read only

Former Member
0 Likes
543

Sorry, I mean SY-UZEIT. I'm using both.

Read only

0 Likes
543

Hi

The system data SY-UZEIT (but I suppose SY-DATUM too) is always the time when the process starts

If you want to know the real data for a certain moment, you need to refresh them by statament GET TIME

See the help for details

Max

Read only

0 Likes
543

In Performance Tuning presentations, SAP shows GET RUN TIME command....

Read only

Former Member
0 Likes
544

sy-uzeit wont work..

just a simple test...

data: t1 type i, t2 TYPE sy-uzeit, t3 type tzonref-tstamps.
DO 5  TIMES.
  wait UP TO 1 SECONDS.
  GET RUN TIME FIELD t1.
  GET TIME FIELD t2.
  get time STAMP FIELD t3.
  WRITE:/ sy-uzeit, ':', t1, ':', t2, ':', t3.
ENDDO.

so better you need to use GET TIME STAMP.