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

Error with select statement

Hi All,

I am getting the error 'Comma without preceding colon (after SELECT ?).' with the following select statement. Can someone help me with the error.

select single actdate_from actdate_to

into ( lv_actdate_from, lv_actdate_to )

from zsdcoop

where kunnr = wa-kunnr and pfnum = wa-pfnum.

if ( lv_actdate_from NE wa-actdate_from ) or ( lv_actdate_to NE wa-actdate_to ).

wa-block = 'X'.

Endif.

Thanks,

Veni.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Dec 17, 2008 at 06:19 PM

    Remove the spaces after & before brackets.

    select single actdate_from actdate_to

    into (lv_actdate_from, lv_actdate_to)

    from zsdcoop

    where kunnr = wa-kunnr and pfnum = wa-pfnum

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 17, 2008 at 06:28 PM

    Typically, on statements like this, you want to use AND instead of OR. Google "truth tables" for a detailed explanation of why.

    if ( lv_actdate_from NE wa-actdate_from ) or ( lv_actdate_to NE wa-actdate_to ).
    wa-block = 'X'.

    Should probably be:

    if ( lv_actdate_from NE wa-actdate_from ) AND ( lv_actdate_to NE wa-actdate_to ).
    wa-block = 'X'.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 17, 2008 at 06:18 PM
    if  lv_actdate_from NE wa-actdate_from  or 
     lv_actdate_to NE wa-actdate_to .
    wa-block = 'X'.
    Endif.
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 17, 2008 at 06:21 PM

    >

    > select single actdate_from actdate_to

    > into (lv_actdate_from, lv_actdate_to)

    > from zsdcoop

    > where kunnr = wa-kunnr and pfnum = wa-pfnum.

    > Veni.

    you could have tried it yourself.

    ~Suresh

    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.