Skip to Content
0
Former Member
Sep 26, 2006 at 03:16 PM

Select-join from (TABNAME) problem

46 Views

I wonder, if anybody can answer, why this code cann't be compiled:

SELECT DISTINCT (ls_dynqr-fields)

INTO TABLE lt_doclist

FROM (ls_dynqr-tablename) AS a

INNER JOIN /abat/mcrm_mycus AS b

ON akunnr = bkunnrx AND

b~bname = sy-uname

UP TO lv_pmax ROWS

WHERE (ls_where-where_tab).

Tablename, list of fields and where-clauses are specified at runtime. Without JOIN it works fine, but with it it can not be compiled because of incorrect FROM condition, I meen unexpected 'JOIN' after 'FROM'.