10-18-2007 7:03 PM
hi,
my code is ;
select vbeln audat kunnr auart
from vbak
into table t_vbak2
for all entries in t_vbfa2
where vbeln = t_vbfa2-vbelv
and audat in r_daterange
and kunnr = partner_number.
if not t_vbak2[] is initial.
sort t_vbak2 by vbeln audat auart.
endif.
now if i use read statement :
read table t_vbak2 into wa_vbak2
with key vbeln = wa_vbfa1-vbelv
audat in r_daterange
kunnr = partner_number binary search.
i get a syntax error.
can any one help me with this..
Thanks,
Challa.
10-18-2007 7:06 PM
You can't use the IN operator in your READ statement, only = as you are trying to read with key. In your case, you must use the LOOP statement.
Loop at t_vbak2 into wa_vbak2
where vbeln = wa_vbfa1-vbelv
and audat in R_daterange
and kunnr = Partner_Number.
* Do whatever you need to do
Exit. " This is so you only read one record.
Endloop.
Regards,
RIch Heilman
10-18-2007 7:06 PM
Hi
check what type of error you are getting
May be you can't use the IN parameter with ranges like where condition of select in READ
so have to use only EQUAL symbol
Regards
Anji
10-18-2007 7:06 PM
You can't use the IN operator in your READ statement, only = as you are trying to read with key. In your case, you must use the LOOP statement.
Loop at t_vbak2 into wa_vbak2
where vbeln = wa_vbfa1-vbelv
and audat in R_daterange
and kunnr = Partner_Number.
* Do whatever you need to do
Exit. " This is so you only read one record.
Endloop.
Regards,
RIch Heilman