Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

problem in read statement


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.


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..



Former Member

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.


RIch Heilman

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question