Skip to Content
Former Member
Mar 01, 2007 at 08:58 AM

SELECT statement in FROM clause - syntax help



I want to have a SELECT statement in the FROM clause. I get syntax error when doing this and since I am new to ABAP I need som help.

I want to do the following, (and if anyone has any SELECT statement from their own system which you know there is no syntax error in please post it here so I can analyze the syntax):

*I leave the INTO itab clause out, since I only want to demonstrate the functionality

  • I am trying to get.

<b>SELECT</b> tableOne~someField

<b>FROM</b> tab <b>AS</b> tableOne (<b>SELECT</b> someField

<b>FROM</b> tab

<b>WHERE</b> someFiled > 1) <b>AS</b> tableTwo

<b>WHERE</b> tableOnesomeField > tableTwosomeField

like I said, the problem is that the select statement in the parenthesis in the from clause seems to be incorrect because I get "wrong expression" when trying to compile. Is this because I cannot have a select statement in the from clause or is it because of a minor syntax error, such as I forgot a dot, or some other sign?

thanks and regards