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

First time execution problem

Former Member
0 Likes
1,549

Hi All,

I have created a report on Vendors, used the tables LFA1, LFM1, EKKO, EKPO, T024.

When I execute the report for the first time it's taking around 8 Mins., On the other hand, When I execute the same report with the same variant, it's taking around 30 Seconds!

When I check the report in SM50, its showing EKPO sequential read.

Any, Hint to reduce the first time execution time.

Thanks,

Kal Chand

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,430

Hi Kal,

Are you executing the report without variant for the first time..

please check whether you have refreshed all the global internal tables and global structures...

prashant

11 REPLIES 11
Read only

Former Member
0 Likes
1,431

Hi Kal,

Are you executing the report without variant for the first time..

please check whether you have refreshed all the global internal tables and global structures...

prashant

Read only

0 Likes
1,430

Hi Prashant,

I have used the same variant for the first time & second time execution.

I have refreshed all the internal tables & structures...

Thanks,

Kal Chand

Read only

Former Member
0 Likes
1,430

There is probably noothing you can do. The first execution can need about 10 times longer than the later executions, so the 8 = 480 sec and 30 are in that expected range.

But also 30sec is not really fast, check my blog on the SQL trace

/people/siegfried.boes/blog/2007/09/05/the-sql-trace-st05-150-quick-and-easy

View the SQL statement summary, why does your report need 30sec?

+ Is the mintime/record or average time/record much larger than 10.000 then an index might help?

+ Or is the number of records very large? Is this correct or are there many identical executions?

Maybe your second execution can be improved to less then 2sec, then your first execution will also be faster. Usually the first execution is anyway not so important, but second which is like the third, fourth ..... 1000th.

Siegfried

Read only

0 Likes
1,430

Hi Siegfried,

As you mentioned in mail, "The first execution can need about 10 times longer than the later executions".

Does the first execution means first time of the day?

Last time when I execute the report, I have faced this problem for the first time.

Again today when I execute the report for the first time, I got the problem.

Please clarify.

Thanks,

Kal Chand

Read only

Former Member
0 Likes
1,430

You don't say what system you are running in. If you are doing this in a Development or Test System, then there will be very few other users and the database buffers will be left filled with the data from your first run at the time you run the second time, so the access will be faster.

Try running the program for a smaller selection of data and use ST05 / SE30 on it to see where the time is being taken up.

Read only

Former Member
0 Likes
1,430

John explained it already, difference between first and secon time comes from database buffers.

Check the SQL Trace, as I said, I assume that your second execution has still bugs.

Read only

Former Member
0 Likes
1,430

Could you share with us your select statement on table EKPO?

Read only

0 Likes
1,430

Hi All,

Thanks for your interest,

I am working on the Development&QA server.

This report is similar to standard report "MKVZ",

Adding additional fields...

MARK: I am coping the select statements

Regards,

Kal Chand

START-OF-SELECTION.

SELECT PLIFNR PKTOKK PNAME1 PSTRAS PORT01 PPSTLZ PLAND1 PSORTL QEKORG QVERKF QTELF1 FROM LFA1 AS P INNER JOIN LFM1 AS Q ON QLIFNR = PLIFNR INTO TABLE IT_VEND WHERE PLIFNR IN S_LIFNR AND QEKORG IN S_EKORG AND PSORTL IN S_SORTL AND PKTOKK IN S_KTOKK AND QSPERM NE 'X'.

SELECT DISTINCT PLIFNR PEKORG PEKGRP QWERKS FROM EKKO AS P

INNER JOIN EKPO AS Q ON QEBELN = PEBELN INTO CORRESPONDING FIELDS OF TABLE IT_PURC FOR ALL ENTRIES IN IT_VEND WHERE LIFNR = IT_VEND-LIFNR.

SELECT EKGRP EKNAM FROM T024 INTO TABLE IT_T024 FOR ALL ENTRIES IN IT_PURC WHERE EKGRP = IT_PURC-EKGRP AND EKNAM NE ' '.

Read only

0 Likes
1,430

I need to know why you feel the need to read tables EKKO and EKPO when all the information you are looking for are available in tables LFA1, LFM1 and T024.

Read only

0 Likes
1,430

Hi Mark,

I am reading EKKO for EKGRP, EKPO for WERKS.

I found WERKS in LFM2 table but no values.

Thanks,

Kal Chand

Read only

Former Member
0 Likes
1,430

Hi All,

I have followed your suggestions, made changes to the select statements.

Thanks,

kal chand