Application Development 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: 

Optimisation issue

Former Member
0 Kudos
131

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!!!

1 ACCEPTED SOLUTION

Former Member
0 Kudos
96

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

6 REPLIES 6

amit_khare
Active Contributor
0 Kudos
96

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

0 Kudos
96

Could you simply tell me how should i remove the inner join?

0 Kudos
96

Thanks for advice But The client said she doesn't want to execute it in background( Tough lady!! )

Former Member
0 Kudos
97

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

0 Kudos
96

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.

0 Kudos
96

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.