‎2008 May 13 8:36 AM
Can I use the following select single.
Select single kunnr from kna1 where kunnr = kunrg.
Is this statement okay
‎2008 May 13 8:39 AM
Select single kunnr into lv_kunnr from kna1 where kunnr = kunrg.
BTW: What is kunrg? Is that a range?
Edited by: Micky Oestreich on May 13, 2008 9:39 AM
‎2008 May 13 8:40 AM
hi,
try this.
select single kunnr from kna1 into table it_kna1.
if u want specific kunnr thn select data by giving condition.
this will give u one kunnr record from kna1.
reward if hlpful.
‎2008 May 13 8:42 AM
HI
USE THIS
SELECT SINGLE KUNNR INTO KNA1-KUNNER FROM KNA1
WHERE
KUNNR = KUNRG.
AND SINCE U R USING SELECT SINGLE SO U HAVE TO AL PRIMARY KEY AND IN KNA1 KUNNER IS THE PRIMARY KEY SO U CAN USE IT
CHEERS
Snehi Chouhan
Edited by: snehi chouhan on May 13, 2008 9:43 AM
‎2008 May 13 8:43 AM
Hi MN,
try this code,
DATA wa_kna1 TYPE kna1.
PARAMETERS: p_kunn TYPE kna1-kunnr.
SELECT SINGLE * FROM kna1 INTO wa_kna1 WHERE kunnr = p_kunn.
Regards
Adil
‎2008 May 13 8:43 AM
Your select seems to be ok
But use select single with specfiying full primary keys else it gives a performance
problem
Also u can use
select upto 1 rows
‎2008 May 13 8:52 AM
hi this is not ok..bcoz there is no field kunrg in the table kna1 and the statement is not accessible with out into stetement....
parameters:kunnr like kna1-kunnr.
data:v_kunnr type kunnr.
Select single kunnr from kna1 into v_kunnr where kunnr = kunnr .
regards,
venkat
‎2008 May 13 8:54 AM
kunrg is an input field of an RFC with structure str.
str-kunrg has data element kunrg and domain domain kunnr.
Then is the following statement valid.
Select single kunnr from kna1 where kunnr = kunag
‎2008 May 13 9:02 AM
hi i hope it doesnt work with out the into clause..
regards,
venkat
‎2008 May 14 9:57 AM
Hi MN!!
Select single kunnr from kna1 where kunnr = kunag
if u write above statement it gives syntax error as field list without into clause is nt allowed.
u will have to mention either
Select single * kunnr from kna1 where kunnr = kunag
or
Select single kunnr from kna1 into wa_kna1 where kunnr = kunag.
kindly reward if helpful.
‎2008 May 13 9:23 AM
Hello,
This statement will not work correctly. You have to provide into clause, since you have mentioned the field list (kunnr).
1. Select single * from kna1 where kunnr = kunrg. - True
2. Select single kunnr from kna1 where kunnr = kunrg. - False
3. Data : wa_kunnr type kunnr.
Select single kunnr from kna1 into wa_kunnr
where kunnr = kunrg. - True
Reward if helpful,
Regards,
Lijo
‎2008 May 13 9:56 AM
Hi
data: lv_kunnr like kna1-kunnr.
Pass value to knurg and define the same.
Select single kunnr into lv_kunnr from kna1 where kunnr = kunrg.
Award points if helpful
‎2008 May 13 11:10 AM
Your statement is incorrect as you have not used a work area to fetch kunnr.So, the correct statement would be :
Select single kunnr into w_kunnr from kna1
where kunnr = kunrg.
If you don't specify a particular column in your select statement, then you do not need to give the work area separately.In that case,
you could have used the following select :
Select single * from kna1
where kunnr = kunrg.
Reward if useful.
Regards,
Nidhi Shroff