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