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

difference between Select * and Select single ?

Former Member
0 Likes
3,576

difference between Select * and Select single ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,802

select * will get all the columns of the table. The number of records will be dependent upon the where clause.

select single * will get a single record with all the columns of a table.

select single field1 field2..will get one record with the fields field1 field2 ..

9 REPLIES 9
Read only

Former Member
0 Likes
2,802

Hi ,

Select * ....: It selects all the fields from the table and this statement requires an endselect.

Select single : It selects only one records and it does not required end seelct.

Regards

ARUN

Read only

Former Member
0 Likes
2,802

Hi

Select single will only pick up one record for the conditions specified

select * wll pick up all the records for that condition

Also check these links

https://forums.sdn.sap.com/click.jspa?searchID=342118&messageID=1710019

https://forums.sdn.sap.com/click.jspa?searchID=342118&messageID=647631

Read only

Former Member
0 Likes
2,802

Select single return one record corresponding to the key field you fill.( all the table key must be fill )

Select * return a range of record corresponding to the parameter you fill in the statement.

Hope this helps,

Erwan

Read only

Former Member
0 Likes
2,803

select * will get all the columns of the table. The number of records will be dependent upon the where clause.

select single * will get a single record with all the columns of a table.

select single field1 field2..will get one record with the fields field1 field2 ..

Read only

Former Member
0 Likes
2,802

Hi,

Select * means Selecting all the fields in the table.

Select single means Selecting single record from the table that matches the Where clause condition. In Select Single statement, Where clause must contain all the key fields of the table.

thanks,

sksingh

Read only

Former Member
0 Likes
2,802

HI,

DATA : IT TYPE TABLE OF MARA,

WA TYPE MARA.

Here it selects all the record and keeps in internal table it.

Select * from mara into corresponding fields of table <b> it</b>.

Here it slects only one record that to first record.

If you wnat any specific record then use where condition.

Select single * from mara into corresponding fields of <b>wa</b>.

Message was edited by:

Purshothaman P

Read only

Former Member
0 Likes
2,802

SELECT * READS ALL THE FIELDS OF A RECORD FROM THE DATABASE.

SELECT * FROM MARA INTO TABLE ITAB.

THE ABOVE STATEMENT SELECTS ALL THE FIELDS OF ALL THE RECORDS IN THE DATABASE AND GET INTO THE ITAB.

IT IS SAME AS:

SELECT * FROM MARA INTO ITAB.

APPEND ITAB.

ENDSELECT.

WHERE AS:

AELECT SINGLE * FROM MARA INTO TABLE ITAB WHERE <COND>----- READS ONLY ONE RECORD BASED ON THE CONDITION.

WE DONT NEED TO WRITE THE ENDSELECT ALSO.

CHEERS.

Read only

Former Member
0 Likes
2,802

hi...

SELECT * means u selecting all the fields from the table and putting it into the internal table of type <tablename>

eg: select * from mara into corresponding fields of it_mara.

the above statement means u selectings all the fields of the it_mara.

where as,

SELECT SINGLE implies that u r selecting just only one record or entry from that table and putting it into the work area.

ie,

select single * from mara into wa_mara.

hope now u got the difference..

all the best!!

Read only

Former Member
0 Likes
2,802

Hi,

<b>Select *</b> starts a loop so as to find the entries specified by where condition or else the complete list of records.It is concluded by endselect.

<b>Select Single</b> selects the first(single) occurrence of the record that satisfies the condition & does not move in a loop.Hence endselect not required in this case.

Also Select Single is more efiicient performance wise as compared to select * if required records has less ocuurence in the internal table.

Hope it helps.

Reward if helpful.

Regards,

Sipra