2008 Jun 02 5:37 AM
Hi All
i have the following select statement,
SELECT KBETR FROM KONV
INTO (V_EXDUTY) UP TO 1 ROWS
WHERE KNUMV = VBRK-KNUMV
AND KSCHL = 'JEXP'
AND KPOSN = VBFA-POSNN.
ENDSELECT.
now i want to know the alternative stat for this one by removing the end-select. and also explain me why do we use select ..... end-select. brief explanation is appreciated.
thanks in advance
ABAPER
2008 Jun 02 5:39 AM
hi,
u can use SELECT SINGLE ...since u r using select upto 1 rows. they hv used select upto 1 rows...as they are passing partial primary keys. there is a possibility that u mite have more than one matching records.
u can use "select..into table" and use some condition to retrieve the specific record.
regards,
madhu
2008 Jun 02 5:39 AM
hi,
u can use SELECT SINGLE ...since u r using select upto 1 rows. they hv used select upto 1 rows...as they are passing partial primary keys. there is a possibility that u mite have more than one matching records.
u can use "select..into table" and use some condition to retrieve the specific record.
regards,
madhu
2008 Jun 02 5:45 AM
Hi,
Here you can use select single on behalf of ..Upto 1 row.
But select single gives best performance only if you accessed using full primary key. Otherwise upto 1 row gives its best if you specifying a partial key...
2008 Jun 02 6:03 AM
SELECT SINGLE KBETR
FROM KONV
INTO V_EXDUTY
WHERE KNUMV = VBRK-KNUMV
AND KSCHL = 'JEXP'
AND KPOSN = VBFA-POSNN.