problem in read statement
my code is ;
select vbeln audat kunnr auart
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.
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..
Rich Heilman replied
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.