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

select single

Former Member
0 Likes
252

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
Former Member
0 Likes

Hello Alfanso,

Following is the text from SAP help.

To read a single entry from the database, use the following:

SELECT SINGLE <cols> ... WHERE ...

To ensure that the line can be uniquely identified, you must specify values for all of the fields of the primary key of the table in the WHERE clause. If the WHERE clause does not contain all of the key fields, the syntax check produces a warning, and the SELECT statement reads the first entry that it finds that matches the key fields that you have specified.

The result of the selection is either an elementary field or a flat structure, depending on the number of columns you specified in <cols>. The target area in the INTO clause must be appropriately convertible.

If the system finds a line with the corresponding key, SY-SUBRC is set to 0, otherwise to 4.

Hope it helps.

Regards,

Praveen