‎2007 Jun 21 3:48 PM
hai,
i want to know differance b/w select single&select single* please explain me with an example.
‎2007 Jun 21 3:57 PM
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
‎2007 Jun 21 3:50 PM
<a href="https://forums.sdn.sap.com/search!default.jspa?objID=f50">Answer</a>
~Suresh
‎2007 Jun 21 3:57 PM
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
‎2007 Jun 21 4:00 PM
SELECT *
Gathers all fields from the table....
SELECT FIELD1 FIELD2 FIELD3
You specify which fields you want to gather -;)
Greetings,
Blag.