Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

I have a join that is getting this error when I do a syntax check. I have a very similar join on more tables that works fine. Can anyone tell what is causing the issue?

TYPES: BEGIN OF ty_main,

          kunnr TYPE kna1-kunnr,

          name1 TYPE kna1-name1,

          name2 TYPE kna1-name2,

          stras TYPE kna1-stras,

          ort01 TYPE kna1-ort01,

          regio TYPE kna1-regio,

          pstlz TYPE kna1-pstlz,

          land1 TYPE kna1-land1,

          telf1 TYPE kna1-telf1,

          telfx TYPE kna1-telfx,

     str_suppl1 TYPE adrc-str_suppl1,

     str_suppl2 TYPE adrc-str_suppl2,

     str_suppl3 TYPE adrc-str_suppl3,

          kdkg1 TYPE kna1-kdkg1,

          sort1 TYPE adrc-sort1,

          sort2 TYPE adrc-sort2,

          erdat TYPE kna1-erdat,

          ernam TYPE kna1-ernam,

          ktokd TYPE kna1-ktokd,

          vkorg type knvv-vkorg,

          vtweg type knvv-vtweg,

          spart type knvv-spart,

          aufsd type kna1-aufsd,

          aufs2 type knvv-aufsd,

          lifsd type kna1-lifsd,

          lifs2 type knvv-lifsd,

          faksd type kna1-faksd,

          faks2 type knvv-faksd,

          loevm type kna1-loevm,

          loev2 type knvv-loevm,

        END OF ty_main.

Data:  it_main     TYPE TABLE OF ty_main.

SELECT kna1~kunnr kna1~name1 kna1~name2 kna1~stras kna1~ort01

          kna1~regio kna1~pstlz kna1~land1 kna1~telf1 kna1~telfx

          adrc~str_suppl1 adrc~str_suppl2 adrc~str_suppl3

          kna1~kdkg1 adrc~sort1 adrc~sort2 kna1~erdat kna1~ernam

          kna1~ktokd knvv~vkorg knvv~vtweg knvv~spart kna1~aufsd

          knvv~aufsd kna1~lifsd knvv~lifsd kna1~faksd knvv~faksd

          kna1~loevm knvv~loevm

     INTO TABLE it_main

     FROM kna1

     LEFT OUTER JOIN knvv ON kna1~kunnr = knvv~kunnr

     LEFT OUTER JOIN adrc ON kna1~adrnr = adrc~addrnumber

    WHERE kna1~kunnr IN s_kunnr

      AND kna1~name1 IN s_name1

      AND kna1~name2 IN s_name2

      AND kna1~stras IN s_stras

      AND kna1~ort01 IN s_ort01

      AND kna1~regio IN s_regio

      AND kna1~pstlz IN s_pstlz

      AND kna1~land1 IN s_land1

      AND kna1~telf1 IN s_telf1

      AND kna1~telfx IN s_telfx

      AND adrc~str_suppl1 IN s_strt2

      AND adrc~str_suppl2 IN s_strt3

      AND adrc~str_suppl3 IN s_strt4

      AND kna1~kdkg1 IN s_kdkg1

      AND adrc~sort1 IN s_sort1

      AND adrc~sort2 IN s_sort2

      AND kna1~erdat IN s_erdat

      AND kna1~ernam IN s_ernam

      AND kna1~ktokd IN s_ktokd

      AND knvv~vkorg IN s_vkorg

      AND knvv~vtweg IN s_vtweg

      AND knvv~spart IN s_spart

      AND kna1~aufsd IN s_aufsd

      AND knvv~aufsd IN s_aufs2

      AND kna1~lifsd IN s_lifsd

      AND knvv~lifsd IN s_lifs2

      AND kna1~faksd IN s_faksd

      AND knvv~faksd IN s_faks2

      AND kna1~loevm IN s_loevm

      AND knvv~loevm IN s_loev2.

Former Member
Former Member replied

... and here what the doc says:

In outer joins, all comparisons that contain columns from the database table or view dbtab_right on the right side (as an operand) must be specified in the associated join condition. These columns are not allowed as operands in the WHERE condition of the same SELECT statement.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question