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

Former Member
0 Likes
982

WHEN TO USE SELECT....ENDSELECT.. / SELECT SINGLE....

9 REPLIES 9
Read only

Former Member
0 Likes
957

Hi,

When you want to select many records from the database table you have to use select..endselect.It works like a loop selecting records one at a time.

It is not advisable to use it due to performance issues.

Select single is sued when you want to fetch just a single records based upon the key fields.It retrieves just a single record.When you want to select only one record please use select single.

Hope it was useful.

Thanks,

Sandeep,.

Read only

Former Member
0 Likes
957

Hi,

select..endselect is used when you are retrieving data directly into work area rather into a table.its like a loop statement.it should be avoided as its not a good programming technique.

select single is used to pull a single record from the table matching on the criteria in the select statement.

Thanks.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
957

Hi,

You can get all this FROM ABAP Keyword Documentation.

You use SELECT ENDSELECT if you want to prcoess the data between these two statements. Its like LOOP over the database table and in each loop pass you want to process something.

SELECT SINGLE is to read one record, make sure you give the full PRIMARY key fields in WHERE clause.

Regards,

Sesh

Read only

Former Member
0 Likes
957

hi dear,

Select ......End Select is use for multiple records fetching

but Select Single is use for single record fetching.

But select ......End select is not use very much but it's break your performance instead of u use select ......into table .......which is fast compare to other select.

Read only

Former Member
0 Likes
957

hi dear,

Select ......End Select is use for multiple records fetching

but Select Single is use for single record fetching.

But select ......End select is not use very much but it's break your performance instead of u use select ......into table .......which is fast compare to other select.

Read only

Former Member
0 Likes
957

HI

SELECT SINGLE IS MAINLY USED FOR VALIDATION PERPOUS

AND SELECT / ENDSELECT IS USED FOR RETRIVING DATA FROM DATA BASE

REWARD IF USEFULL

Read only

Former Member
0 Likes
957

hi,

<b>Select .. end select </b> --> For Fetching Multiple records..

Its Runs in loop

i.eNo. of Database Hits = Length of loop .

so it should avoided for performance issues and use

<b>select ..... into table...</b>

<b>select single </b> --> Used for fetching single record.

Regards,

Praveen

Read only

Former Member
0 Likes
957

Hi ,

Select endselect can be used when u want to make some modifications to the fields during fetch from the database and before storing it in internal table . MOdification can be done between

select

endselect statement .

Select * from databaetable into table itab is used to directrly store the rows fetched from the internal table .

Regards

Read only

0 Likes
957

hi,

if you want to fetch only one record use SELECT SINGLE in the where condition use all primary key fields if you don't know all primary fields use UP TO 1 row.

where as select and endselect is used to fetch more than one record we use but SAP is not recommending usage of SELECT and ENDSELECT for this we have to use INTERNAL TABLE WITH OUT HEADER TABLE and In the SELECT statement use INTO TABLE <ITAB>.

Usage of SELECT - ENDSELECT IS Performance's issue for fetching each record Your program will hit DATABASE.

reward points to all helpful answers.

P.Surendar Reddy