Tag Archive Business Unit

ByMandeep Gupta

BIP – List of departments associated with a specific business unit

In Oracle Fusion HCM, a business unit can be linked to either a common reference data set or a specific one. When associated with a specific reference data set, the business unit gains access to departments defined within that set, as well as those available in the common reference data set. The SQL query provided in this article retrieves all departments accessible to the selected business unit, based on its reference data set associations.

WITH set_details
AS
(
  SELECT fabuv.bu_name 				business_unit_name
        ,fabuv.bu_id				business_unit_id
        ,fss.set_id
        ,fss.set_code
        ,fss.set_name
    FROM FND_SETID_SETS 		fss
        ,FND_SETID_ASSIGNMENTS 	        fsa
  	,FUN_ALL_BUSINESS_UNITS_V       fabuv
   WHERE fabuv.bu_name = 'Enterprise'
     AND fsa.determinant_type = 'BU'
     AND fsa.determinant_value = fabuv.bu_id
     AND fsa.reference_group_name = 'PER_DEPARTMENTS'
     AND fsa.set_id = fss.set_id
     AND fss.set_id <> 0
     AND fss.language = 'US'
     AND TRUNC(SYSDATE) BETWEEN fabuv.date_from AND fabuv.date_to
  UNION
  SELECT fabuv.bu_name 				                business_unit_name
        ,fabuv.bu_id					        business_unit_id
        ,0							set_id
        ,'COMMON'						set_code
        ,'Common'						set_name
    FROM FUN_ALL_BUSINESS_UNITS_V fabuv
   WHERE fabuv.bu_name = 'Discrete Automation'
     AND TRUNC(SYSDATE) BETWEEN fabuv.date_from AND fabuv.date_to   
)
SELECT pd.name					        department
      ,pd.organization_id 				department_id
      ,DECODE(pd.status,'A','Active','Inactive') 	department_status 
      ,set_details.business_unit_name
      ,set_details.set_name
  FROM per_departments 	pd
      ,set_details	set_details
 WHERE pd.set_id = set_details.set_id 	 
   AND TRUNC(SYSDATE) BETWEEN pd.effective_start_date AND pd.effective_end_date
ORDER BY 1 
ByMandeep Gupta

BIP – Query to extract business unit attached to a Job

In multi country HCM Implementations, work structures data can be stored in a COMMON set or a country specific set. In such cases, it becomes important to show the correct business unit name against the jobs in reports.

Use the below report to extract the Job and the business unit:

SELECT BU_ID
      ,BU_NAME
	  ,DEFAULT_SET_ID
	  ,SHORT_CODE
	  ,pjft.name
FROM  PER_JOBS_F pjf
     ,PER_JOBS_F_TL pjft
     ,FUN_ALL_BUSINESS_UNITS_V fabuv
WHERE pjf.SET_ID = fabuv.DEFAULT_SET_ID
and pjf.job_id = pjft.job_id
and trunc(sysdate) between pjf.effective_start_date and pjf.effective_end_date
and trunc(sysdate) between pjft.effective_start_date and pjft.effective_end_date
and pjft.language = 'US'
order by pjft.name

To get more details on SET Name, Set assignments, you can make use of following tables:

FND_SETID_ASSIGNMENTS

FND_SETID_SETS_VL

ByMandeep Gupta

Reports – Query to get business Unit details

Use below query to get business unit details:

SELECT fabuv.bu_name,
fabuv.short_code,
to_char(fabuv.date_from, 'yyyy/mm/dd') start_date,
to_char(fabuv.date_to, 'yyyy/mm/dd') end_date,
fabuv.enabled_for_hr_flag
FROM fun_all_business_units_v fabuv
WHERE TRUNC(SYSDATE) BETWEEN fabuv.date_from AND NVL(fabuv.date_to,TRUNC(SYSDATE))