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

Run Time Analysis

Former Member
0 Likes
699

Hi All,

I am facing problem in writing the program.

here is the one ..can anyone help me..?

I have an Internal table with a strcuture of a Table.

In my tabel I have a field RECORD NUMBER.

Internal table is having one million records.

I need to know the performacne time of the loop and endloop.

we will have to check the time before teh loop starting executing and after the end of the loop.

KIndly check this and help me.

Thanks,

Varun.

1 ACCEPTED SOLUTION
Read only

pole_li
Active Participant
0 Likes
669

Hi,

Before LOOP,

use "get time" statement , and get the value of sy-uzeit to a

variable T1,

after LOOP, use the same way to get sy-uzeit value to T2,

Then (T2 - T1) to get the rum time.

Also, You can copy your code to SE30,paste in Tips&Tricks window to mesure the runtime.

Regards,

Pole

6 REPLIES 6
Read only

former_member195383
Active Contributor
0 Likes
669

make use of st05..

U can analyse the performance

Read only

pole_li
Active Participant
0 Likes
670

Hi,

Before LOOP,

use "get time" statement , and get the value of sy-uzeit to a

variable T1,

after LOOP, use the same way to get sy-uzeit value to T2,

Then (T2 - T1) to get the rum time.

Also, You can copy your code to SE30,paste in Tips&Tricks window to mesure the runtime.

Regards,

Pole

Read only

ThomasZloch
Active Contributor
0 Likes
669

you can use statement GET RUN TIME FIELD for this purpose.

With so many records, I recommend LOOP AT ... ASSIGNING as opposed to LOOP AT ... INTO, this will save some processing time.

Thomas

P.S. consider closing your previous questions, once you reach 10 open ones, you will not be able to open a new one.

Read only

Former Member
0 Likes
669

Hi,

Put a break point at the start and end of the loop. Now execute the program. When your program reaches at this point go to ST05 and activate the trace. Now press F7 in your program. When control goes to next break point deactivate the trace in ST05 and then you can analyze the same.

Please remember to deactivate the trace once you are done as at one time only one person can activate the trace. So if you leave the same active no one else would be able to use trace .

Hope this will be of some help!!!

Regards,

Lalit

Read only

0 Likes
669

Hi All,

sorry for troubling u..

actually i what i need is ..

the internal tabel shud have teh strcuture of the table.

But internal tabel should be filled by 1 million records with teh same strcuture with a counter.

and then we need the run time for that internal table.

Here is my Test code..can someone..please make the chnages and reply.

REPORT YRUNTIME_YRDOD0050.

DATA :V_START_TIME type SY-UZEIT,

V_END_TIME type SY-UZEIT,

V_RUNTIME type SY-UZEIT.

DATA: I_YRDOD0050 TYPE STANDARD TABLE OF YRDOD0050 with header line.

select * from YRDOD0050 into table I_YRDOD0050 .

SORT I_YRDOD0050 ascending by RECORD.

V_START_TIME = SY-UZEIT.

Loop at I_YRDOD0050.

Endloop.

V_END_TIME = SY-UZEIT.

V_RUNTIME = V_END_TIME - V_START_TIME.

WRITE: / 'RUNTIME is:', V_RUNTIME.

Read only

0 Likes
669

Insert GET TIME before each of the two accesses to SY-UZEIT, otherwise it will show runtime of 0 seconds.

Or use the GET RUN TIME FIELD statement as I suggested above, this will measure in microseconds.

I'm sure you can work this out yourself after these hints.

Thomas