cancel
Showing results for 
Search instead for 
Did you mean: 

Analytic privilege error for CV secured by SQL analytic privilege using stored procedure

0 Kudos

Hi,

I have below procedure which i ave designed just for testing views secured with Dynamic AP using stored procedure.

PROCEDURE "SYSTEM"."X_HANA_XYZ_PR::Nikunj234" (OUT test VARCHAR(20) ) LANGUAGE SQLSCRIPT SQL SECURITY INVOKER DEFAULT SCHEMA SYSTEM READS SQL DATA AS v_filter VARCHAR(20); CURSOR v_cusror FOR SELECT distinct "Customer_Name" FROM "SYSTEM"."CUSTOMER_DIM1" where "Customer_ID" = '786'; BEGIN OPEN v_cusror; FETCH v_cusror INTO v_filter; test := v_filter; CLOSE v_cusror; END;

the procedure syntax is correct, but when I try data preview of views secured by AP using this procedure I get error as below. I have checked and all the necessary access is in place. the view i am able to preview data for if i just secured it with simple SQL. Can anyone help what could be the issue. error screenshot attachedhana-error.jpg

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member208449
Active Participant
0 Kudos

Hi Ninkuj

This error is due to the invalid filter clause that comes from the procedure's output. The scalar output from the procedure should be exactly like a filter condition in a WHERE clause i.e

Region='West' (assuming Region is column in your table)

former_member183326
Active Contributor
0 Kudos

1: Firstly make sure the _SYS_REPO has the Select granted to it on the Schema.

2: If the _SYS_REPO has the select already granted, then check this Note I wrote: https://launchpad.support.sap.com/#/notes/2540498

3: If none of the above work then run the trace outlined in this Wiki and attach the trace here so i can look at it to see what you're missing