Skip to Content
0

AMDP and HANA analytical privileges

Jun 13, 2017 at 11:02 PM

199

avatar image

Hi, we have implemented an AMDP class with method to execute HANA views.

In the HANA DB, we have developed Role and Analytical Privileges.

How we can leverage the HANA security : Role and Analytical Pri. during the execution of the AMDP method ?

Reading the discussion:

https://archive.sap.com/discussions/thread/3672630

seems that the connection to the HANA DB is always done with the user SAP<SID>.

Thanks.

Andrea

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Horst Keller
Jun 14, 2017 at 06:18 AM
2

When using a database over the database connections of an AS ABAP, the database user is a work process of the AS ABAP, that implicitly accesses the database schema which is connected to the database connection. The database user name of a workprocess can be determined using the function module DB_DBUSER. The database user name is mostly, but not necessarily SAP<SID>. The ABAP database schema is assigned to this user. The name of the ABAP database schema can be determined using the function module DB_DBSCHEMA_CURRENT. It is also mostly, but not necessarily SAP<SID>. (There is also a function module DB_DBSCHEMA that determines the name of the owner of the ABAP database schema, again mostly, but not necessarily SAP<SID>).

AMDP is a framework for creating and calling database procedures and functions from the AS ABAP. Creating is always done by the AS ABAP with a work process as a DB user and in the ABAP database schema. Calling an AMDP procedure or function from ABAP (either using an ABAP method call or by accesing a CDS table function in Open SQL) is also carried out by a work process as a DB user. The privileges of the workprocess as the database user are taken into account. In order to call an AMDP procedure or function with another database user and her priviliges, you have to do it natively from inside HANA (not recommended by SAP). Then, you must take care that the AMDP procedures or functions are available. For that you can use the methods of CL_AMDP_RUNTIME_SERVICES.

Show 8 Share
10 |10000 characters needed characters left characters exceeded

Hi Horst,

when you say "In order to call an AMDP procedure or function with another database user and her priviliges, you have to do it natively from inside HANA." do you have any documentation in the SAP help or useful link in orfder to clarify?

Thank you

Ivan

0

How to call procedures in HANA is part of the HANA documentation.

https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.01/en-US

0

Hi Horst,

How I can call the AMDP method with a specific user?

Thanks.

Andrea

0

We recommend to call AMDP procedures and functions from AS ABAP only.

0

Can I call the AMDP procedures from ABAP specifing an DB user ?

0

You can do so by creating an according database connection in the ABAP DB cockpit and use that in Native SQL (ADBC, EXEC SQL).

0

Thanks Horst.

Can you show me any examples how to use db connection in native SQL?

How I can implement the scenario where the DB user is equal to the ABAP user that call the procedure from ABAP?

Thanks.

Andrea

0
0