
Creation of dynamic filters in SAP HANA Schema With SAP HANA 1.0 SPS6(Rev 60), we can now leverage the concept of dynamic filters. There have been several requests for this type of functionality, since SAP does not recommend the use of dynamic SQL(EXEC statement) when developing SQLScript procedures. We now have a new statement in SQLScript called APPLY_FILTER. This statement accepts two parameters. The first parameter is the dataset in which you want to apply the filter. This dataset can be a database table, database view, HANA attribute or calculation view, or even an intermediate table variable. The second parameter is of course the filter condition itself. This would be very similar syntax that you would use in the WHERE clause of a SELECT statement. In the following example, I have a SQLScript procedure which simply reads data from the “Products” table and applies a filter which is passed as an input parameter to the proce...