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&select single*

Former Member
0 Likes
514

hai,

i want to know differance b/w select single&select single* please explain me with an example.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
464

Hi vikram,

SELECT SINGLE*:

The result of the selection should be a single entry. If it is not possible to identify a unique entry, the system uses the first line of the selection.

DATA wa TYPE spfli.

SELECT SINGLE * FROM sflight INTO wa

WHERE

carrid = 'LH ' AND

connid = '0400' AND

fldate = '20010228'.

FLDATE = '19950228'.

WRITE: / wa-carrid, wa-connid, wa-fldate, seatsfree.

SELECT SINGLE:

Selecting the required fields,instead of selcting all the fields

TYPES:begin of itab,

carrid type sflight-carrid,

connid type sflight-connid,

fldate type sflight-fldate,

seatsfree type sflight-seatsfree,

end of itab.

data:wa type itab.

SELECT SINGLE carrid connid fldate seatsfree FROM sflight INTO wa

WHERE

carrid = 'LH ' AND

connid = '0400' AND

fldate = '20010228'.

FLDATE = '19950228'.

WRITE: / wa-carrid, wa-connid, wa-fldate, seatsfree.

reward points if useful

regards

rami

3 REPLIES 3
Read only

suresh_datti
Active Contributor
0 Likes
464

<a href="https://forums.sdn.sap.com/search!default.jspa?objID=f50">Answer</a>

~Suresh

Read only

Former Member
0 Likes
465

Hi vikram,

SELECT SINGLE*:

The result of the selection should be a single entry. If it is not possible to identify a unique entry, the system uses the first line of the selection.

DATA wa TYPE spfli.

SELECT SINGLE * FROM sflight INTO wa

WHERE

carrid = 'LH ' AND

connid = '0400' AND

fldate = '20010228'.

FLDATE = '19950228'.

WRITE: / wa-carrid, wa-connid, wa-fldate, seatsfree.

SELECT SINGLE:

Selecting the required fields,instead of selcting all the fields

TYPES:begin of itab,

carrid type sflight-carrid,

connid type sflight-connid,

fldate type sflight-fldate,

seatsfree type sflight-seatsfree,

end of itab.

data:wa type itab.

SELECT SINGLE carrid connid fldate seatsfree FROM sflight INTO wa

WHERE

carrid = 'LH ' AND

connid = '0400' AND

fldate = '20010228'.

FLDATE = '19950228'.

WRITE: / wa-carrid, wa-connid, wa-fldate, seatsfree.

reward points if useful

regards

rami

Read only

Former Member
0 Likes
464

SELECT *

Gathers all fields from the table....


SELECT FIELD1 FIELD2 FIELD3

You specify which fields you want to gather -;)

Greetings,

Blag.