‎2006 Oct 16 8:21 AM
SELECT * FROM CATSPS INTO TABLE TCATSPS
WHERE TRANSFER = 'X' .
SELECT RUECK
CATSBELNR
STOKZ
FROM AFRU
INTO table T_AFRU
for all entries in tcatsps
WHERE CATSBELNR = TCATSPS-BELNR
AND STOKZ = TCATSPS-STOKZ.
In the above statement, Tcatsps internal table is getting around 3 Lakh records. Becos of which when i run the select statement, time is taken for ever.
Can I improve the performance statment of above select statemtn in any other effective way.
Thanks
Regds
Venu
‎2006 Oct 16 8:30 AM
Hi <b>Saamy</b>,
Instead of <b>*</b> specify <b>require fields</b> only...
In where condition specify all <b>Primary keys</b> and <b>Secondary indexes</b>...
If helpful reward..
Regards,
<b>Kishore Reddy Vuppuluri.</b>
‎2006 Oct 16 8:26 AM
hi Venu,
1. Put all the entries order IN T_AFRU i.e, the way they are in the database table ..
2. Try including all the primary keys in the where condition of your select statement ..
3. Avoid using * instead fetch the required fields only ..
this way you can improve the performance of your program
Regards,
Santosh
‎2006 Oct 16 8:30 AM
Hi <b>Saamy</b>,
Instead of <b>*</b> specify <b>require fields</b> only...
In where condition specify all <b>Primary keys</b> and <b>Secondary indexes</b>...
If helpful reward..
Regards,
<b>Kishore Reddy Vuppuluri.</b>
‎2006 Oct 16 8:50 AM
Hi Venu,
From your code i could see that u have totally ignored the Primary keys.
Try to give counter and stokz feilds of CATSPS in ranges and the RUECK and RMZHL feilds of AFRU in ranges.
Dont use select * from catsps.
Reward if it helps.
Thanks,
Anooop
‎2006 Oct 16 10:26 AM
Hi,
the problem is first select statement is wotking fione. the time is taken for second select statement. and i couldnt use primary keys... cos condition i need doesnt depend on promary keys.
regds
Venu
‎2007 Jan 31 11:57 AM
define secondary indexes on the fields using which you are writing the select statement.
‎2007 Mar 06 2:54 PM
Yes, Use Secondary Index as well as Inner Join.
Thx
SAP Developer