Until runtime I don't know the table name and column-name on which I have to do a select.
Here is my SQL:
SELECT single <b>w_sum_col_name </b> FROM (w_tbl_name)
WHERE REQUID = ZOH_AUDIT-REQUID.
My SQL fails when I have SUM(any_column) in the string w_sum_col_name. However it works if its a just a column name of the table. Failure is when the w_sum_col_name string has an aggregate function.
Error is ..SAPSQL_ILLEGAL_AGGREGATE" CX_SY_DYNAMIC_OSQL_SYNTAX
Any alternatives for my requirement is appreciated.