2008 Dec 23 11:09 PM
Hello gurus,
I have a code which is exceeding 10000 microsec timelimit. So there is a code dump.
Can u suggst me a way to replace this code.
SELECT imptt~point
APPENDING CORRESPONDING FIELDS OF TABLE tb_data
FROM ( imptt INNER JOIN iflo ON ifloobjnr = impttmpobj )
FOR ALL entries IN ra_tplnr
WHERE iflo~tplnr EQ ra_tplnr-low
AND imptt~indct EQ po_indct
AND iflo~swerk IN so_swerk.
Thanking in advance!!!
2008 Dec 23 11:58 PM
you can create a new index for that table.
the new index must have
Mandt and then all the fields that u are using in the where condition.
before creating the index i recomend that run txn st05, activate the trace, then run your query, stop the trace and try to find out wich join or where is with more rows.
good luck
Javier
2008 Dec 23 11:14 PM
check this document -
http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
also, I hope u are checking for internal table initial before using FOR ALL ENTERIES on it.
Also, it is preferable to SPLIT your select statement into 2 to perform better since you are using JOIN, FORL ALL ENTERIES and APPENDING all together.
Or execute the code in background.
Edited by: Amit Khare on Dec 24, 2008 4:47 AM
2008 Dec 23 11:23 PM
2008 Dec 23 11:24 PM
Thanks for advice But The client said she doesn't want to execute it in background( Tough lady!! )
2008 Dec 23 11:58 PM
you can create a new index for that table.
the new index must have
Mandt and then all the fields that u are using in the where condition.
before creating the index i recomend that run txn st05, activate the trace, then run your query, stop the trace and try to find out wich join or where is with more rows.
good luck
Javier
2008 Dec 24 12:12 AM
Thanks. I have run st05 and found that this is the query( which i posted ) where i have maximum duration spent while running. Thats why i am asking you people to tell me an alternet way of doing the same thing which the uery does.
2008 Dec 24 4:25 PM
Ok,
U have 2 options then.
1) split the query in two or 3, you need to create a WA, and filled with all the data u need, not from a single query.
2) create a new index with the fields of the where condition.
FOR ALL ENTRIES is very very slow try to not to use it.
wheck if the stadistics are up to date (basis) sometimes the indexes may not work because of that.