What is the difference between Select Single and Select up to 1 rows in SAP ABAP ?
These statements are the part of reading data from database table.
By using SELECT SINGLE and SELECT UPTO 1 ROWS we can able to read single record from a database table .
Look at a glance below table:
SELECT SINGLE
|
SELECT UP TO 1 ROWS
|
Used to read exact record from database table.
|
|
Used to read appropriate record
from database table.
|
|
To read exact record from database table we need to provide all key
fields.
|
We can read appropriate record from database table, we may not need
to provide all key fields.
|
This statement should be used only if all the key fields are
available.
|
|
This statement should be used
only if we have some key fields or no key fields.
|
|
How to Write:
SELECT SINGLE * FROM Table_Name INTO WA WHERE ALL KEY
FIELDS
For performance this is better than select upto statement.
|
How to Write:
SELECT * FROM Table_name INTO WA UP TO 1 ROWS WHERE ALL KEY
FIELDS/SOME FIELDS.
ENDSELECT.
From effective performance this is slow.
|
Comments
Post a Comment