‎2007 Aug 14 5:30 PM
Dear SAP,
One simple question !!
What happens, If I dont pass all the key values in select single statement.
which data would it bring, the first occurence in DB table ?????
Cont..
And what happens if, I use select single without passing all keys (missing POSNR) but using it in a loop and giving condition as posnr > 900000. does this always bring same values.
Please let me know. Thank you.
Regards
venkat
‎2007 Aug 14 5:34 PM
Hi
If you don't pass all key fields in SELECT SINGLE there will be multiple records for those condition and it fetches the first record
If you won't pass POSNR in a loop, then for a single doc there will be multiple items and always the first item only selected
if a value exists greater than 900000, then it may consider that value
<b>Reward points for useful Answers</b>
Regards
Anji
‎2007 Aug 14 5:33 PM
SELECT SINGLE only gather one value, so it's the first value it gets from the DB...If you don't specify any key, your going to get the first record of the DB...
In a LOOP is you don't specify the POSNR, your always going to get the same value....
Greetings,
Blag.
‎2007 Aug 14 5:34 PM
Hi
If you don't pass all key fields in SELECT SINGLE there will be multiple records for those condition and it fetches the first record
If you won't pass POSNR in a loop, then for a single doc there will be multiple items and always the first item only selected
if a value exists greater than 900000, then it may consider that value
<b>Reward points for useful Answers</b>
Regards
Anji
‎2007 Aug 14 5:35 PM
That is not recommened if do not have primary key field then do not use select single.
try to use select up to 1 row instead of select single
Thanks
Seshu
‎2007 Aug 14 6:26 PM
Hi Venkat,
It wil behave in the similar way as you thought of.
When you don't have the full key then you should use SELECT...UPTO 1 ROWS ..ENDSELECT as this is much faster in such scenario.
Regards,
Atish
‎2007 Aug 14 7:15 PM
Hi All,
Thanks for your replies !! I am alloting points to all of you.
closing thread !!
Regards
venkat