cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

select single

Former Member
0 Likes
247

Hi Gurus,

I am unclear about the meaning or usage of the syntax 'select single ... into...'

Could you please help to clarify?

Thanks,

Alfonso

View Entire Topic
edwin_harpino
Active Contributor
0 Likes

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.

Former Member
0 Likes

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