SAP Knowledge Base Article - Public

3478100 - How to get the current user ID in Calculated Columns of a Graphical View in SAP Datasphere

Symptom

This KBA explains how to get the current user ID in Calculated Columns of a Graphical View in SAP Datasphere. For example, if the end user logs into SAP Datasphere with the "TEST@SAP.COM", then the "Creator" column in the Analytic View will always show "TEST@SAP.COM".

"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental."

Environment

SAP Datasphere

Reproducing the Issue

  1. Add a Calculated Columns in the Graphical View.
  2. Click + icon and select Calculated Column.
  3. A value needs to be input in Expression section.

Resolution

Use the one of the expressions below to get the current logon user ID:

  • SESSION_CONTEXT('XS_APPLICATIONUSER')
  • SESSION_CONTEXT('APPLICATIONUSER')

Note: The expression SESSION_USER will return the Space ID, not the current logon user ID.

Keywords

user name, userid, function, logon user , KBA , DS-MD-VIW , Views , How To

Product

SAP Datasphere all versions

Attachments

Pasted image.png