‎2008 Jan 02 11:52 AM
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
‎2008 Jan 02 11:57 AM
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
‎2008 Jan 02 11:57 AM
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
‎2008 Jan 02 12:20 PM
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
‎2008 Jan 02 12:03 PM
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
‎2008 Jan 02 1:12 PM
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
‎2008 Jan 02 1:42 PM
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.
‎2008 Jan 02 2:23 PM
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.
‎2008 Jan 02 2:39 PM
Could you share with us your select statement on table EKPO?
‎2008 Jan 02 4:27 PM
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 ' '.
‎2008 Jan 02 8:17 PM
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.
‎2008 Jan 03 10:48 AM
Hi Mark,
I am reading EKKO for EKGRP, EKPO for WERKS.
I found WERKS in LFM2 table but no values.
Thanks,
Kal Chand
‎2008 Jan 03 10:52 AM
Hi All,
I have followed your suggestions, made changes to the select statements.
Thanks,
kal chand