04-23-2009 6:45 PM
I have appended a field (ZREFWBS) to the PRPS table and I am using the below quey to get the single record.
SELECT posid
psphi
FROM prps
INTO (v_pspnr,
v_psphi)
UP TO 1 ROWS
WHERE zzrefwbs = ci_prps-zzrefwbs.
ENDSELECT.
It is taking almost 5 to 10 mins to execute.
Please suggest.
Thanks in Advance.
Moderator message - moved to correct forum
Edited by: Rob Burbank on Apr 23, 2009 2:02 PM
04-23-2009 7:11 PM
First thing rather than using select upto 1 rows use select single
Second dont use select endselect.
Finally if both does not help then
What you can do is add the field zzrefwbs as the secondary field of the table.
Before doing that just check where used list for the table.
Regards,
Lalit Mohan Gupta.
04-23-2009 7:15 PM
>
> First thing rather than using select upto 1 rows use select single
Really - how does that help?
Rob
04-24-2009 4:41 AM
Select Single * will pickup only one matching record from the database into the buffer, and returns the same to the internal table.
Select upto 1 rows will pickup all the records matching the condition into the buffer, but return the top record to the internal table.
Regards,
Lalit Mohan Gupta.
04-24-2009 12:15 PM
Hi guys,
we need to pick only single record and there is would be not any loop between select and endselect.
Please suggest.
04-24-2009 2:21 PM
>
> Hi guys,
>
> we need to pick only single record and there is would be not any loop between select and endselect.
>
> Please suggest.
I think the best solution in this case is to simply run the program in the background. Not all programs can be easily tuned without causing problems elsewhere.
Rob
04-24-2009 2:02 PM
> Select Single * will pickup only one matching record from the database into the buffer, and returns the > same to the internal table.
>
> Select upto 1 rows will pickup all the records matching the condition into the buffer, but return the top > record to the internal table.
nonsense ... SELECT SINGLE and UP TO 1 ROWS are 100% identical
and buffers is something completely different, there is also not internal involved in that statement.
*About the question, you a field to the table ... how should it be in any index ????? *
by automatic index creation or what ???
No index => no performance, very simple.
Siegfried
12-10-2009 1:59 PM