1
votes

What's wrong with this statement?

SELECT aufk~aufnr
         zmm_limit_co~vd zmm_limit_co~matkl_code
         zmm_limit_matkl~sign
   FROM aufk
   JOIN zmm_limit_co ON zmm_limit_co~auart = aufk~auart
   left JOIN zmm_limit_matkl
        on zmm_limit_matkl~matkl = zmm_limit_matkl~matkl_code    
   INTO CORRESPONDING FIELDS OF table lt_input
   WHERE aufk~aufnr = <lf_new_pos>-aufnr.

When I'm trying to execute program, ABAP gives me an error:

'The elements in the "SELECT LIST" list must be separated using commas.'

I suppose, that the error is somehow connected with JOINs, when I'm removing "left" from it - it's compiling just fine, but with it.

1
Have you tried separating elements in the select list with commas? - Tom H
I would try separating the items in the select with commas, also you can try adding OUTER to the left join. so it reads LEFT OUTER JOIN, I'm not familiar with OPEN-SQL but isn't the INTO statement supposed to be before the from? - WBratz

1 Answers

6
votes

You are (probably inadvertently) mixing the old (now obsolete) and new syntax of the OpenSQL SELECT statement, triggering this rather less-than-helpful error message. Check the release-specific change notes for some details on the changes. However, in the example given, I believe that the second join condition is the problem: You're not joining the contents of zmm_limit_matkl with any of the other two tables, but with itself. That doesn't look right and might confuse the compiler.