Search This Blog

Wednesday, June 19, 2019

Session Variables in Fusion HCM for BI

Session Variables in BI Publisher to get logged in user info

Session variables are used frequently in BI Publisher when the reports are being exposed to employees.

We need to write query to pull only the logged in user information and for this we will use the session variable.
Apart from this user, there are many other session variables and we are going to look at them now.

Logged in User Person ID - HRC_SESSION_UTIL.get_user_personid​
Logged in User Username - :xdo_user_name
Logged in User Username - FND_GLOBAL.USER_NAME
Logged in User GUID - fnd_global.user_guid
Logged in User SessionID - userenv('sessionid')
Logged in User Language - USERENV ('LANG')
Logged in User Business Group - fnd_profile.value('PER_BUSINESS_GROUP_ID')

Sample SQLs:
select * from per_persons​​ ​where person_id = HRC_SESSION_UTIL.get_user_personid​
select * from per_organization_units WHERE business_group_id = fnd_profile.value('PER_BUSINESS_GROUP_ID')


You can add these to the SQL query as per your requirement and get appropriate results.

Hope this is useful.. stay tuned for more updates.