‎2007 Mar 21 2:55 PM
I know this is a dumb question but I can't figure out why this select statement gives me a syntax error:
SELECT mblnr budat mjahr from mkpf INTO CORRESPONDING FIELDS OF table it_docnum
WHERE budat IN s_budat.
ENDSELECT. Regards,
Davis
‎2007 Mar 21 2:56 PM
drop the endselect.. you don't need it with inTO table option.
SELECT mblnr budat mjahr from mkpf INTO CORRESPONDING FIELDS OF table it_docnum
WHERE budat IN s_budat.
is enough.
~Suresh
‎2007 Mar 21 2:56 PM
drop the endselect.. you don't need it with inTO table option.
SELECT mblnr budat mjahr from mkpf INTO CORRESPONDING FIELDS OF table it_docnum
WHERE budat IN s_budat.
is enough.
~Suresh
‎2007 Mar 21 2:59 PM
hi,
No need of <b>ENDSELECT</b> as you are passing into internal tbale by saying <b>into table</b>.
Regards,
Sailaja.
‎2007 Mar 21 3:00 PM
‎2007 Mar 21 3:01 PM
Thanks to all for your help. When do you use an endselect?
Regards,
Davis
‎2007 Mar 21 3:03 PM
When you are <u>not</u> selecting the records using the primary key and you are <u>not</u> moving the selected records into an internal table in one single shot by using INTO TABLE option.
‎2007 Mar 21 3:03 PM
‎2007 Mar 21 3:01 PM
Hi
If you want to keep endselet then remove table keywod in select stmnt
Thanks
‎2007 Mar 21 3:03 PM
hi Davis,
When you are passing records into an internal table by using INTO TABLE or
when you are using SELECT SINGLE , then there is no need of ENDSELECT.
Regards,
Sailaja.
‎2007 Mar 21 3:04 PM
one more is,
better avoid <b>into corresponding fields</b>
for that the order of field in internal table and select statement must be same.
data: begin of it_docnum occurs 0,
mblnr like mkpf-mblnr,
budat like mkpf-budat,
mjahr like mkpf-mjahr,
end of it_docnum.
SELECT mblnr
budat
mjahr
from mkpf INTO table it_docnum
WHERE budat IN s_budat.
‎2007 Mar 21 3:07 PM
Thanks a lot Santhosh, that answers the question of why I wasn't getting any records! I would love to reward you points for this but I'm all out for this question.
Thanks again!
Davis
‎2007 Mar 21 3:06 PM
Thanks a lot to everybody for all of your help! I apologize for the dumb, easy question.
Davis