Skip to Content
author's profile photo Former Member
Former Member

For all entries

Hi Experts,

I am getting an error in a select statement using '<b>for all entries'</b>.

The code is as following:

select * from vbkd

into table i_temp

where vbeln IN s_vbeln

and posnr = p_posnr.

sort i_temp by vbeln posnr.

if not i_temp[] is initial.

select * from vbak

into table i_vbak

for all entries in i_temp

where vbtyp = 'K'.

I am getting an error: <i><b>The WHERE condition does not refer to the FOR ALL ENTRIES table.-</b></i>

Can anybody please let me know what's wrong with the select statement?

Thanks a lot.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 10:09 PM

    The error message tells you exactly what the problem is. Try:

    SELECT * FROM vbkd
    INTO TABLE i_temp
    WHERE vbeln IN s_vbeln
    AND posnr = p_posnr.
    
    SORT i_temp BY vbeln posnr.
    
    IF NOT i_temp[] IS INITIAL.
    
      SELECT * FROM vbak
      INTO TABLE i_vbak
      FOR ALL ENTRIES IN i_temp
      WHERE vbeln = i_temp-vbeln       "<====
        AND vbtyp = 'K'.
    ENDIF.
    

    Rob

    Message was edited by:

    Rob Burbank

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.