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.

Updated on: 2019-07-30T22:30:20+05:30

124 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements