Analytic Privileges restrict the user to view data for which they authorize. SAP HANA Analytic Privileges is used for Security purpose.

SQL Privileges provide authorization on object level not at a record level, so provide a record or row-level authorization “Analytic Privileges” will be used.

SAP HANA Analytic Privileges are used to provide authorization on below information view –

  • Attribute View
  • Analytic View
  • Calculation View

Now we are going to create an Analytic Privileges and will assign to user “ABHI_TEST”, by this Analytic we restrict the user to view data only for a company with value 1000.

Step 1) Go To option as below-

Modelling package (Right Click) –> New -> Analytic Privileges.

SAP HANA Analytic Privileges Tutorial

Step 2) New Analytic Privilege popup appear

  1. Enter Analytic Privileges Name / Label.
  2. Package name is automatically selected.
  3. Selection option creates new.

SAP HANA Analytic Privileges Tutorial

Click on ‘OK’ button, in next step Analytic Privileges editor will be displayed for add and edit privileges.

Step 3) Analytic Privileges editor will open as below-

  1. In General Section name and Label is displayed.
  2. Click on “Add Button” in Reference Models Section.
  3. Select Calculation View (CA_FI_LEDGER) which we created earlier.SAP HANA Analytic Privileges Tutorial
  4. Click on Add Button for create validity of privileges.
  5. Assign Privileges validity.
  6. Click on Add button for selecting attribute for assign restriction.
  7. Select Attribute Company.
  8. Click on the add button to assign a value to attribute for restriction.
  9. Assign Value by selecting Type / operator and value. Here we want to restrict to user see data of calculation view for the only company (1000).

SAP HANA Analytic Privileges Tutorial

Validate and Activate Analytic Privileges, an analytic privilege is created in Analytic Privileges folder under Modelling package as below –

SAP HANA Analytic Privileges Tutorial

Step 4) Now we are going to assign Analytic Privileges to User “ABHI_TEST”. “ABHI_TEST” user have privileges to access modelling package.

Double click on User “ABHI_TEST” from Security -> Users.

  1. Select Analytic Privileges tab.
  2. Click on “+” Button.
  3. A pop-up for Select Analytic Privileges will be displayed. Enter Name of Analytic Privileges which we have created earlier.
  4. Select Analytic Privileges.
  5. Click on Ok Button.

SAP HANA Analytic Privileges Tutorial

Analytic Privileges is added as below –

SAP HANA Analytic Privileges Tutorial

Step 5) Now, we deploy this changes in user by clicking deploy button.

SAP HANA Analytic Privileges Tutorial

A message is displayed as below –

User ‘ABHI_TEST’ changed.

Step-6) Check Analytic Privileges Assign to user “ABHI_TEST” is working or not.

Login to “ABHI_TEST” user by select HANAUSER system as below –

  1. Select HDB (HANAUSER) Current System and right click.
  2. Select “Add System with Different User”, and enter User Name/ password for user “ABHI_TEST”.
  3. A System HDB (ABHI_TEST”) will be added to system list.

SAP HANA Analytic Privileges Tutorial

ABHI_TEST user has no full access of data of Calculation view created by HANAUSER, as HANAUSER has created analytic privileges for restriction on this calculation view for the company -1000 and assign to ABHI_TEST user.

So, Go to Content Folder -> Select Package -> Calculation View (CA_FI_LEDGER) ->Right Click -> Data Preview.

Data Preview screen will be displayed as below-

Data in calculation view will be restricted for company code– 1000.

SAP HANA Analytic Privileges Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *