Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Re : Open sql query.

former_member226225
Contributor
0 Kudos

Hi Folks,

I am currently listening the open sap videos for the abap on hana week3 .in that i wrote abap query modified with the enhancement of the sql statement

but my statement is showing syntax errors.

Please find the below query.

SELECT carrid

       connid

       fldate

       price

       currency

   FROM sflight

   INTO TABLE lt_sflight.

IF sy-subrc IS INITIAL.

  DESCRIBE TABLE lt_sflight LINES sy-tfill.

  WRITE : / sy-tfill.

ENDIF.

SELECT carrid,

       connid,

       fldate,

       price,

       currency

   from sflight

   into table @data(lt_sflight).



From the above query i am getting the below error.


"," is not allowed here since it contains an invalid character or it is

a keyword. (It might be possible to escape it using "!"). Or a space is

missing or there is one space too many.

I am using EHP7 with sp04 ides server.

Thanks in advance.

Regards,

Raghunadh Kodali.

3 REPLIES 3

former_member226225
Contributor
0 Kudos

Hi Folks.

I got the solution.

from the help.sap.com

In Open SQL, all operands in lists can now be separated by commas and this is also the recommended way of separating them from Release 7.40, SP05. Until now, comma-separated lists could only be used when single target fields were specified in parentheses after INTO in SELECT and when data objects were specified in parentheses after WHERE. Comma-separated lists are now also possible in Unicode programs where the program attribute fixed point arithmetic is activated:

ABAP Keyword Documentation

Thanks & Regards,

Raghunadh Kodali.

0 Kudos

Hi Raghundadh,
so the solution is, that the statement you wrote is not possible in SP5... but in SP8 it's perfectly fine for the syntax check, right?
Cheers,
  Jasmin

0 Kudos

Hi Jasmin,

I am currently working in a SP08 system and the syntax is working perfectly .



Thanks & Regards,

Raghunadh Kodali.