2008 Aug 07 1:59 PM
Hi,
is there a way, how to select 2 values from a table row to 2 variables?
like:
select single a b
into ex_a
ex_b
from x
where...
Thank you,
Olian
Edited by: Olian Saludew on Aug 7, 2008 3:00 PM
2008 Aug 07 2:01 PM
Like this example you can select as amny you want.
SELECT SINGLE bukrs werks ename btrtl kostl orgeh stell plans persg INTO
(ls_ee-bukrs, ls_ee-persa, ls_ee-ee_name, ls_ee-btrtl, ls_ee-curr_kostl, ls_ee-orgeh,
ls_ee-job, ls_ee-plans, ls_ee-persg) FROM pa0001 WHERE
pernr EQ ls_ee-ee_no AND
begda LE sy-datum AND
endda GE sy-datum.
2008 Aug 07 2:01 PM
Like this example you can select as amny you want.
SELECT SINGLE bukrs werks ename btrtl kostl orgeh stell plans persg INTO
(ls_ee-bukrs, ls_ee-persa, ls_ee-ee_name, ls_ee-btrtl, ls_ee-curr_kostl, ls_ee-orgeh,
ls_ee-job, ls_ee-plans, ls_ee-persg) FROM pa0001 WHERE
pernr EQ ls_ee-ee_no AND
begda LE sy-datum AND
endda GE sy-datum.
2008 Aug 07 2:02 PM
Hi...
Declare f1, f2.... as two seperate variables..
>select single f1 from <table> into f1 where <condition>
>select single f2 from <table> into f2 where <condition>
Thanks,
Naveen.I
2008 Aug 07 2:02 PM
Hi,
Please try this
select single a b into (ex_a, ex_b) from x .....
Pavan
2008 Aug 07 2:03 PM
i think the syntax is select a b into (d,e ) from dbtab.
~PIyush Patil
2008 Aug 07 2:04 PM
DATA wa TYPE spfli.
SELECT carrid connid cityfrom cityto
FROM spfli
INTO (wa-carrid, wa-connid, wa-cityfrom, wa-cityto).
WRITE: / wa-carrid, wa-connid, wa-cityfrom, wa-cityto.
ENDSELECT.
2008 Aug 07 2:05 PM
Hi,
Check this Example.
PARAMETERS:p_matnr LIKE mara-matnr.
DATA:wa_matnr LIKE mara-matnr.
DATA:wa_ntgew LIKE mara-ntgew.
START-OF-SELECTION.
SELECT SINGLE matnr ntgew FROM mara INTO (wa_matnr,wa_ntgew) WHERE matnr = p_matnr.
WRITE:wa_matnr,wa_ntgew.
2008 Aug 07 2:05 PM