Tiven Wang
chevron_rightHANA

HANA Default Client

Wang Tiven November 30, 2016
425 favorite favorites
bookmark bookmark
share share

When accessing the HANA views directly (or via analytical tools like Lumira or BOC), a proper client needs to be maintained at the HANA database user.

It can be maintained in the HANA studio (Navigator -> Systems -> -> Security -> Users -> )

HANA Session Client

Assign a default client to an calculation view and filter data at runtime based on the default client value. The table below lists the default client value types you can assign and their description.

Default Client Value Description
Session Client If you use session client as the default client value, then at run time, modeler filters the table data according to the value you specify as the session client in the user profile.
Cross Client If you use cross client as the default client value, then modeler does not filter the table data against any client and you see values relevant to all clients. But the explicit filter with input parameter MANDT=$$client$$ can filter the table data in sql from ABAP.
Fixed Client If you want to use a fixed client value, for example, 001, then modeler the table data for this client value.

ABAP-Specific Session Variables in SAP HANA

Session variables are global variables in the SAP HANA database that can be accessed there using the predefined function SESSION_CONTEXT. Session variables contain global information about the current context and are hence similar to ABAP system fields.

When a SAP HANA database is used as the central AS ABAP database, the following session variables are filled with ABAP-specific values in ABAP reads:

  • CLIENT contains the current client in accordance with the nominal value of the ABAP system field sy-mandt.
  • APPLICATIONUSER contains the current client in accordance with the nominal value of the ABAP system field sy-uname.
  • LOCALE_SAP contains the language of the current text environment in accordance with the nominal value of the ABAP system field sy-langu.
  • The ABAP-specific session variables can be used, for example, in AMDP methods and make the associated input parameters superfluous. A method of this type should only be called from ABAP programs in this cases, since it cannot otherwise be guaranteed that the variables are given the correct values.
  • In the ABAP CDS DDL, the syntax $session.vname can be used in the definition of a CDS view to access the ABAP-specific session variables. The name vname is then different from the name shown here. When a CDS view is accessed using Open SQL, the session variables are available on all supported database platforms and not just on the SAP HANA database.

Get the details of your session context

SELECT
	 *
FROM M_SESSION_CONTEXT
WHERE connection_id = ( SELECT
	 connection_id
	FROM M_CONNECTIONS
	WHERE own = 'TRUE' )
;

Example

The example SAP HANA, ABAP-Specific Session Variables shows various ways of accessing the session variables specified here.

Similar Posts

Comments

Back to Top