Condition Variables within Sub-Query in SAP


One line answer - Sub-Queries are not allowed.

But if you need to handle your scenario, then you can do the following:

  • Encapsulate your entire query into a stored procedure and then use the stored procedure.

  • Create a view. The view is created to handle either your main query or sub-query.

  • Create a table level variable and store the end results of view in it and then go ahead and fetch the value of table variable in the main query.

Sai Subramanyam
Sai Subramanyam

Passionate, Curious and Enthusiastic.

Updated on: 30-Jul-2019

78 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements