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

Comma without preceding colon (after SELECT ?)

Hi,

I'm rather new to ABAP and only know some basics, and I ran into an error that I can't solve, must be something stupid:

The error is: Comma without preceding colon (after SELECT ?)

and this is the code that seems to cause this error:

LOOP AT i_itm1_c.

SELECT * FROM /bic/al_itm700 INTO wa_t_data

WHERE

/bic/al_itm700-/bic/l_docnr

LIKE /bic/al_itm1c00-/bic/l_docnr,

/bic/al_itm700-bic/l_posnr

like /bic/al_itm1c00-/bic/l_posnr,

/bic/al_itm700-/bic/yl_kcrdat

like /bic/al_itm1c00-/bic/yl_kcrdat,

/bic/sourcesys like /bic/al_itm1c00-/bic/sourcesys.

wa_t_data-recordmode = ''.

  • MOVE-CORRESPONDING wa_t_data TO e_t_data.

MOVE:

wa_t_data-/bic/l_docnr TO e_t_data-/bic/ydoc_numb,

wa_t_data-/bic/l_posnr TO e_t_data-/bic/yl_count,

wa_t_data-/bic/sourcesys TO e_t_data-/bic/sourcesys.

APPEND e_t_data.

ENDSELECT.

ENDLOOP.

Any ideas on what can be wrong here? points awarded of course!

thanks!

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 09:46 AM

    remove the commas and use AND or OR and also

    remove like and use = operator

    LOOP AT i_itm1_c.
    SELECT * FROM /bic/al_itm700 INTO wa_t_data
    WHERE
    
    /bic/al_itm700-/bic/l_docnr
    = /bic/al_itm1c00-/bic/l_docnr <b>and</b>  
    
    /bic/al_itm700-bic/l_posnr
    = /bic/al_itm1c00-/bic/l_posnr <b>and</b> 
    
    /bic/al_itm700-/bic/yl_kcrdat
    = /bic/al_itm1c00-/bic/yl_kcrdat <b>and</b> 
    
    /bic/sourcesys =/bic/al_itm1c00-/bic/sourcesys.
    wa_t_data-recordmode = ''.
    
    * MOVE-CORRESPONDING wa_t_data TO e_t_data.
    MOVE:
    wa_t_data-/bic/l_docnr TO e_t_data-/bic/ydoc_numb,
    wa_t_data-/bic/l_posnr TO e_t_data-/bic/yl_count,
    wa_t_data-/bic/sourcesys TO e_t_data-/bic/sourcesys.
    
    APPEND e_t_data.
    ENDSELECT.
    ENDLOOP.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 09:48 AM

    Hi,

    Your select statement should not have "<b>,</b>".

    So it creates a syntax error.

    Kindly check the corrected code:

    SELECT * FROM /bic/al_itm700 INTO wa_t_data
    WHERE /bic/al_itm700-/bic/l_docnr LIKE /bic/al_itm1c00-/bic/l_docnr
    AND   /BIC/AL_ITM700-BIC/L_POSNR LIKE /bic/al_itm1c00-/bic/l_posnr
    AND   /bic/al_itm700-/bic/yl_kcrdat LIKE /bic/al_itm1c00-/bic/yl_kcrdat
    AND   /bic/sourcesys LIKE /bic/al_itm1c00-/bic/sourcesys.

    hope this helps!

    best regards,

    Thangesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 09:47 AM

    Dear Joris

    Please change as highlighted below and see:

    LOOP AT i_itm1_c.
      SELECT * FROM /bic/al_itm700 INTO wa_t_data
    <b>  WHERE   /bic/l_docnr = /bic/l_docnr
      AND     /bic/l_posnr  = /bic/l_posnr
      AND     /bic/yl_kcrdat = /bic/yl_kcrdat
      AND     /bic/sourcesys eq /bic/sourcesys.</b> 
       wa_t_data-recordmode = ''.
    
    * MOVE-CORRESPONDING wa_t_data TO e_t_data.
        MOVE:
        wa_t_data-/bic/l_docnr TO e_t_data-/bic/ydoc_numb,
        wa_t_data-/bic/l_posnr TO e_t_data-/bic/yl_count,
        wa_t_data-/bic/sourcesys TO e_t_data-/bic/sourcesys.
    
        APPEND e_t_data.
      ENDSELECT.
    ENDLOOP.

    Kind Regards

    Eswar

    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.