2008 Oct 01 9:47 AM
Hi,
I'm fetching orders from AUFK table based on the order type & plant as provided in the selection screen which is affecting the performance of the program.
Please suggest.
Regards,
Sipra
2008 Oct 01 9:49 AM
You can create a secondary index for that table with AUART and WERKS.
2008 Oct 01 9:53 AM
hi..
As swastik said, u can create a secondary index.
Or try to include AUTYP - Order Category in selection, which is already in indexing along with WERKS.
regards,
Padma
2008 Oct 01 9:57 AM
Hi,
Thanks for your response.We are not authorized to create sec. index & I'm already using the index that u've mentioned. Still some issue in performance.Can you guide me any further?
Regards,
Sipra
2008 Oct 01 10:25 AM
2008 Oct 01 11:05 AM
In our system, we have 160,000+ entries in the AUFK table. We have 5 possible WERKS value,13 possible AUTYP values, 11 possible AUART values. When I select using AUART = 'SIO2' and WERKS = SPACE I get 72,000 records returned! So you can see that, at least in our system, this combination of selection criteria is not restrictive enough to make any query very efficient, whether an index is used or not.
This may, of course, not be the case in your system but it is one possible reason why a query can be slow.
2008 Oct 01 11:41 AM
Hi,
My query is as follows:
SELECT aufnr auart autyp werks kokrs idat2 loekz objnr
FROM aufk
INTO TABLE t_aufk
WHERE autyp = '30'
AND werks IN s_werks.
s_werks contains 3 plants.
Regards,
Sipra
2008 Oct 01 11:50 AM
hi,
The main reason for low performance is you are not using primary key in your where condition.
if possible select data from aufk using aufnr or select data from some other table which is having primary key condition and select data from aufk based on that condition.
2008 Oct 01 11:54 AM
Hi,
the only way to increase performance is to add the secondary index on AUART and WERKS.
So if you have not the authorization, ask for the authorization or ask someone else with the right authorization to do it.
regards,
Hans
2008 Oct 01 11:54 AM
hi..sipra..
If we are selecting data based on non-primary key field it will surely lead to performance issue. Try to include any primary key for selection. Or try to pick AUFNR from any other table based on ur program and then pass that AUFNR to AUFK.
Keenly check your preceeding/suceeding tables, it will have aufnr, pick that, and then pass them to this table.
regards,
padma
2008 Oct 01 12:20 PM
Please run ST05 and SE30 to check what is the real problem of your program!
I'm saying this because since you are using the secondary index AUTYP-WERKS, that select shouldn't create an issue. Even if it takes 100.000 records, it shouldn't take more than some seconds!. The problem can be in what you are doing afterwards.
Also, should use auart in selection:
SELECT aufnr auart autyp werks kokrs idat2 loekz objnr
FROM aufk
INTO TABLE t_aufk
WHERE autyp = '30'
AND werks IN s_werks
AND auart IN s_auart.
Hope this helps.
Regards,
Valter Oliveira.
2008 Oct 01 2:20 PM
>
> Hi,
> My query is as follows:
> SELECT aufnr auart autyp werks kokrs idat2 loekz objnr
> FROM aufk
> INTO TABLE t_aufk
> WHERE autyp = '30'
> AND werks IN s_werks.
> s_werks contains 3 plants.
>
> Regards,
> Sipra
How many records does this bring back? As already mentioned, it should be using one of the secondary indexes already, so data quantities is the only reason I can think of why it should be slow.