on ‎2006 Apr 18 12:15 AM
Hi Gurus,
I am unclear about the meaning or usage of the syntax 'select single ... into...'
Could you please help to clarify?
Thanks,
Alfonso
Request clarification before answering.
hi Alfonso,
to add info given by Praveen...
select single will retrieve only one record eventhough there is more record meet the select statement.
e.g we have data in database
customer customer_group
a x
b x
c x
d y
using select single customer into lv_customer
where customer_group = 'x'.
we will get a only customer = a, though b and c also
meet the condition.
in data loading, it's suggested to avoid select single since it may be #1 performance killer, retrieve some records from database and move first to internal table and later fetch from internal table would normally better than select single record from database each time.
take a look some sample code on this
you can use transaction ABAPHELP to see more detail about select single. and ABAPDOCU may also useful.
hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also..u can read all required data into an internal table and then use 'READ TABLE <int table> WITH KEY <key field names> BINARY SEARCH'.
This can be used when-
all key fields are present in internal table and available from communication structure.
sort internal table by the key fields.
Else it will push first available record from int table into the work area.
regards,
Vishvesh
| User | Count |
|---|---|
| 7 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.