‎2006 Nov 15 3:50 PM
‎2006 Nov 15 3:57 PM
Hi,
I think generally if you don't have the full primary value to use SELECT SINGLE..You will be SELECT UP TO 1 ROWS with an ENDSELECT..Can be used for existence check..
Example..
-
SELECT MATNR UP TO 1 ROWS
INTO V_MATNR
FROM VBAP
WHERE VBELN = '1234567'.
ENDSELECT.
Thanks,
Naren
‎2006 Nov 15 3:57 PM
Hi,
I think generally if you don't have the full primary value to use SELECT SINGLE..You will be SELECT UP TO 1 ROWS with an ENDSELECT..Can be used for existence check..
Example..
-
SELECT MATNR UP TO 1 ROWS
INTO V_MATNR
FROM VBAP
WHERE VBELN = '1234567'.
ENDSELECT.
Thanks,
Naren
‎2006 Nov 15 7:39 PM
when you want process some thing( calculating or writing to list ) while fetching the date ,
Regards
Siva
‎2006 Nov 15 7:43 PM
You should use:
SELECT... INTO TABLE it_table
LOOP at it_table
ENDLOOP.
instead !!!
Select...Endselect creates a loop within the select statement BUT... it performs multiple DB reads to achieve it.
The INTO TABLE above performs one and only one DB read... which is much faster and efficient for the App server and DB server.
‎2006 Nov 16 4:02 AM
SELECT * from <Table>
All Processing Logic
END SELECT
SELECT - END SELECT works like a loop. A single record is read and the processing is done.
This causes multiple hits on Data base server... which increases your execution time.
Instead.. it is good programming practice to select all the required data into an internal table and then loop on the internal table. this reduces the run time to a great extent.
the conclusion is that in general you must avaoid using SELECT ENDSELECT.
‎2006 Nov 16 1:31 PM
‎2006 Nov 22 6:06 AM
i would suggest never to use select-end select .
u shopuld always prefer
select (field-list) into table (conditions) .
u can always avoid using select-end select .
also i would tell not to use nested select statements .
a better idea would be to use 'for all entries ' option of select statement .
if helpful plz reward points
‎2006 Dec 01 7:21 AM
Hi,
SELECT ENDSELECT is usually used when we need to select a range of values. Values which are just needed from the IT are selected using this.
SELECT is not concluded by ENDSELECT :
if it is a SELECT SINGLE command,
if only aggregate functions appear in the SELECT clause and there is no GROUP BY clause, or
if the INTO clause INTO TABLE itab or APPENDING TABLE itab does not include the addition PACKAGE SIZE.
Thanks and regards,
Priyanka.