Skip to Content

hana Classical Analytical Privilege


SAP HANA : I want the total number of views, which are listed in a particular Classical Analytical Privilege.
Ex : From the Content. SALES package only 50 views has been assigned to AP_SALES Classical Analytical Privilege - Need that 50 count of views assigned in AP_SALES Privilege.

Is there any SQL Query to get the above results..? Please suggest me how to find.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jun 26, 2017 at 07:10 PM

    To my knowledge there is no system view from which you can extract in the information. For classic analytical privileges (in XS classic) you can determine that from the analytic privilege XML file stored in table _SYS_REPO.ACTIVE_OBJECT.

    The models assigned to the privilege are stored in the XML file like following:

    ...
    <securedModels>
      <modelUri>/test.misc.model/calculationviews/test</modelUri>
    </securedModels>
    ...

    So making a count on the modelUri start tag, should give you the result you require.

    select OCCURRENCES_REGEXPR('<modelUri>' IN "CDATA")
    from _sys_repo.active_object
    where package_id = <your package id>
      and object_name = <your object name> -- name of analytic privilege
      and object_suffix = 'analyticprivilege'
    

    In a system with a HANA version >= 2.0 SPS00 you can also use the XMLEXTRACT function to extract the xml tags using an XPATH query and do a acount on that result.

    Regards,
    Florian

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 23, 2017 at 02:32 PM

    A query on the Object cross reference table might help you with this -

    SELECT "FROM_OBJECT_NAME", "TO_PACKAGE_ID", "TO_OBJECT_NAME" FROM "_SYS_REPO"."ACTIVE_OBJECTCROSSREF" WHERE ("FROM_OBJECT_SUFFIX" = 'analyticprivilege' AND "FROM_OBJECT_NAME" = '<your Analytical Privilege name>') ORDER BY "FROM_OBJECT_NAME" ASC, "TO_PACKAGE_ID" ASC, "TO_OBJECT_NAME" ASC

    Best,
    Sanjiv

    Add comment
    10|10000 characters needed characters exceeded