11-22-2007 11:10 AM
hi i want to do
select xxx from xxx
into variable
for all entries in table
i know i can't do that since puting the data into a variable won't work in for all entries. i tried with up to 1 row or select single but i won't work
plzzz mee urgent help
11-22-2007 11:14 AM
If your requirement is to select any single record, and as you said <b>its not taking SELECT SINGLE</b>, For entries in the table (used for for all entries ) why don't you try this.
A) Get the first record in the table and then Fire your select single query
B) Loop at the table
Fire Select single query, if it is successful
exit the loop.
endloop.
11-22-2007 11:17 AM
Hi,
If u want to put the data into a variable use
Select single FIELDNAME from TABLENAME into variable name
where condition.
Regards,
Vani.
11-22-2007 11:22 AM
Select single FIELDNAME from TABLENAME into variable name
where condition.
that's what i say i can't fo cozzz
Select single FIELDNAME from TABLENAME into variable name
for all entries TABLEx
where tablename = table x.
11-22-2007 11:21 AM
Hi.
Inorder to achieve ur requirement u have to do like this
loop at itab.
select single werks from marc into v_werks
where matnr = itab-matnr.
endloop.
Reward if helpful.
Regards,
Nagaraj
11-22-2007 11:22 AM
hi,
select single is working, may be u gave wrong data type
data : m type string.
select single matnr from mara into m.
write: / m.
regards,
pavan
11-22-2007 11:23 AM
See this example.....
PARAMETERS p_city TYPE spfli-cityfrom.
TYPES: BEGIN OF entry_tab_type,
carrid TYPE spfli-carrid,
connid TYPE spfli-connid,
END OF entry_tab_type.
DATA: entry_tab TYPE TABLE OF entry_tab_type,
sflight_tab TYPE SORTED TABLE OF sflight
WITH UNIQUE KEY carrid connid fldate.
SELECT carrid connid
FROM spfli
INTO CORRESPONDING FIELDS OF TABLE entry_tab
WHERE cityfrom = p_city.
SELECT carrid connid fldate
FROM sflight
INTO CORRESPONDING FIELDS OF TABLE sflight_tab
FOR ALL ENTRIES IN entry_tab
WHERE carrid = entry_tab-carrid AND
connid = entry_tab-connid.
11-22-2007 11:26 AM
Hi newbie82,
have you given the type for the selection-screen field??
just have a look at this code,
tables: vbak.
data: wa_vbak-vkorg(4).
<b>data: wa_vbak-vbeln type vbak-vbeln.</b>
select-options: s_vbeln for wa_vbak-vbeln.
<b>SELECT single vkorg
INTO wa_vbak-vkorg FROM vbak
WHERE
vbeln in s_vbeln.</b>
WRITE: / wa_vbak-vkorg.
hope this works.
11-23-2007 9:32 AM