Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

select single

Former Member
0 Likes
578

hi all,

may i know why cannot do a select single to internal table but only can select single to working area or variable. any reason? besides select single, what others also cannot put into internal table?

thanks

4 REPLIES 4
Read only

Former Member
0 Likes
546

Select single returns only one row. An internal table is not necessary for that. A work area/structure can very well hold one record.

Apart from select single, select .. upto 1 rows does not require an internal table.

Hope this helps.

Manoj

Read only

Former Member
0 Likes
546

Hi,

We use this Select single only if we need a single line from the Database, so there is no point to store this line in to a internal table, so coming to performence wise also we do not use the Internal table to store a single record.

Regards

Sudheer

Read only

Former Member
0 Likes
546

well í always thought it is self-explaining :P.

Anyway: a Select single get´s you expliciteley just ONE record.

So why would you put this record in a whole internal table if a working area is way enough?

if you want to have it in an internal table, declare one, and then do following after your select single statement:

append wa to itab.

Read only

Former Member
0 Likes
546

Select single fetches alwats only one row(that to fist record of the available combination which u mentioned). so internal table is not required to capture one recored (unnessacery declaring internal table read index 1 and also table occupies extra memeryin program) so work area can very well hold one record.

and select upto 1 rows require an internal table.

Ramesh.