Search for:
BIP – Check bypass Approval Rules status

While performing SIT/UAT, sometimes it becomes mandatory to disable (bypass) all configured approval rules except for a few. One has to go in manually in Transaction console and check the status for each task.

An easy way to run the following SQL query and check the tasks for which approvals are yet not Bypassed:

SELECT HRPB.TASK_FILE_NAME TaskName
      ,DECODE(HAAO.APPROVAL_DISABLED,'true','Bypassed','false','Enabled') "Enabled Status"
      ,haao.last_update_date
      ,haao.last_updated_by
  FROM FUSION.HRC_ARM_PROCESS_B HRPB
      ,FUSION.HRC_ARM_APPROVAL_OPTIONS HAAO
 WHERE HRPB.PROCESS_ID=HAAO.PROCESS_ID
BIP – List of workers without payment method
SELECT papf.person_number

  FROM PER_ALL_PEOPLE_F papf
      ,PER_PERIODS_OF_SERVICE ppos
 WHERE 1=1
  AND papf.person_id = ppos.person_id
  AND (ppos.actual_termination_date IS NULL OR ppos.actual_termination_date >= TRUNC(SYSDATE))
  AND NOT EXISTS (SELECT 'Found' FROM PAY_PAY_RELATIONSHIPS_DN pprd
                                     ,PAY_PERSON_PAY_METHODS_F pppmf
                                WHERE pprd.payroll_relationship_id = pppmf.payroll_relationship_id

                                  AND pprd.person_id = papf.person_id)
HDL – Loading Local Person Names

By default, PersonName child object of Worker.dat loads GLOBAL name type. PersonName object can be used to load local name as well.

Two most important attributes of PersonName object for local name upload are:

Name Type – Legislation Code

CharSetContext – Short code for language.

Below is a sample HDL file to upload local names in Thai language:

METADATA|PersonName|EffectiveEndDate|EffectiveStartDate|LegislationCode|PersonId|NameType|FirstName|MiddleNames|LastName|Honors|KnownAs|PreNameAdjunct|PreviousLastName|Suffix|Title|MilitaryRank|CharSetContext

MERGE|PersonName|4712/12/31|2019/09/20|MY|300000189140970|MY|||XYZ||Test122First||||||TH

Language code can be found in Task – Manage Languages.

HDL – Script to DELETE positions data

In your test environments, you may encounter issues where you want to DELETE positions data. You can use below script for that:

SELECT DATA_ROW
FROM (
SELECT 'METADATA|Position|PositionId|EffectiveStartDate|EffectiveEndDate|SourceSystemId|SourceSystemOwner'  AS DATA_ROW
FROM DUAL
UNION all
select 'DELETE'||'|'||
       'Position' ||'|'||
       hapf.Position_Id||'|'||
       to_char(hapf.Effective_Start_Date,'RRRR/MM/DD')||'|'||
       to_char(hapf.Effective_End_Date,'RRRR/MM/DD') ||'|'||
      (select email_hrc.source_system_id
         from hrc_integration_key_map email_hrc
        WHERE hapf.Position_Id = email_hrc.surrogate_id) ||'|'||
      (select email_hrc.source_system_owner
         from hrc_integration_key_map email_hrc
        WHERE hapf.Position_Id = email_hrc.surrogate_id) AS DATA_ROW
  from hr_all_positions_f hapf
)
BIP – Query to extract DOR attachment name
select papf.person_number 
      ,hdor.document_code
      ,hdor.document_name
      ,hdor.document_number
      ,fdt.file_name
      ,fdt.dm_version_number document_id
      ,fdt.dm_document_id UCM_file
 from fnd_attached_documents fad, hr_documents_of_record hdor, fnd_documents_tl fdt
   ,per_all_people_f papf
   ,hr_document_types_tl hdtt
 where ENTITY_NAME = 'HR_DOCUMENTS_OF_RECORD'
  and hdor.documents_of_record_id = fad.PK1_VALUE
  and fad.document_id = fdt.document_id
  and fdt.language = 'US'
  and hdor.person_id = papf.person_id
  and TRUNC(SYSDATE) BETWEEN papf.effective_start_date AND papf.effective_end_date
  and hdor.document_type_id = hdtt.document_type_id
  and hdtt.language = 'US'
  and hdtt.DOCUMENT_TYPE = 'Test Doc'
HDL – Mask Candidate email addresses

Post P2T, there is always a requirement to mask the candidate email addresses in lower environments. Below SQL can be used to generate data masked email data in HDL format:

SELECT 'METADATA|CandidateEmail|EmailAddressId|PersonId|CandidateNumber|EmailAddress|DateFrom|DateTo|SourceSystemOwner|SourceSystemId' "Record"

 FROM DUAL

UNION

SELECT DISTINCT 'MERGE'    || '|'||

'CandidateEmail'        || '|'||

ICEA.EMAIL_ADDRESS_ID          || '|'||

ICEA.PERSON_ID             || '|'||

ICEA.CANDIDATE_NUMBER          || '|'||

replace(PEAD.EMAIL_ADDRESS,'.com','.invalidcomx')           || '|'||

TO_CHAR(PEAD.DATE_FROM,'YYYY/MM/DD')  || '|'||

TO_CHAR(PEAD.DATE_TO,'YYYY/MM/DD')   || '|'||

HIKM.SOURCE_SYSTEM_OWNER      || '|'||

    HIKM.SOURCE_SYSTEM_ID      "Record"

FROM IRC_CAND_EMAIL_ADDRESS_V ICEA,

PER_EMAIL_ADDRESSES PEAD,

HRC_INTEGRATION_KEY_MAP HIKM

WHERE ICEA.EMAIL_ADDRESS_ID = PEAD.EMAIL_ADDRESS_ID

  AND HIKM.SURROGATE_ID = PEAD.EMAIL_ADDRESS_ID

You can update the email address as per your requirement.

HDL – Sample HDL to delete schedule assignment data

Below HDL file can be used to DELETE the schedule assignment data in a Fusion environment:

METADATA|ScheduleAssignment|ResourceType|ScheduleAssignmentId|SourceSystemId|SourceSystemOwner
DELETE|ScheduleAssignment|ASSIGN|300000117113937|SCHEDULE_E1000001_30-MAY-2017-31-DEC-2017_0-8-8-8-8-0-0|EBS
DELETE|ScheduleAssignment|ASSIGN|300000117309993|SCHEDULE_E1000002_04-JUN-2018-31-DEC-4712_0-8-8-8-8-0-0|EBS

This data can be extracted from Fusion HCM using a simple BIP query:

SELECT DATA_ROW
FROM (
SELECT 'METADATA|ScheduleAssignment|ResourceType|ScheduleAssignmentId|SourceSystemId|SourceSystemOwner'  AS DATA_ROW
FROM DUAL
UNION all
select 'DELETE|ScheduleAssignment|',
	   RESOURCE_TYPE,
       SCHEDULE_ASSIGNMENT_ID,
       source_system_id,
       source_system_owner   AS DATA_ROW
  from fusion.per_schedule_assignments psa
      ,hrc_integration_key_map hikm
 where psa.SCHEDULE_ASSIGNMENT_ID = hikm.surrogate_id
)
OTBI – Areas of Responsibility Subject area

Oracle has released a new subject area for Areas of Responsibility.

Subject Area Name – Workforce Management – Areas of Responsibility

This has simplified the process of extracting AoR data using OTBI.

To get any data in this subject area, you should run “Refresh Representative Data” ESS process. The process should be run post any changes done to AoR’s.

To get data in this SA below duties should be assigned:

FBI_AREAS_OF_RESPONSIBILITY_TRANSACTION_ANALYSIS_DUTY 
ORA_FBI_AREAS_OF_RESPONSIBILITY_TRANSACTION_ANALYSIS_DUTY_HCM

Please note that these duties should be added to Job Role not the Data Role.

BIP – How to check Termination version on your environment?

You can use per_empl_configurations table to verify the versions of Seniority dates/ Termination dates.

Below is an example to check the version for Termination dates:

select version_code 
  from fusion.per_empl_configurations 
 where configuration_type = 'ORA_TERMINATION'

If the version code value is NULL that means you are still on version V2.

Same table can be used to query Seniority Dates version.

HDL – Assignment Working Hour Pattern

Oracle has provided a new feature where working hours for each day can be stored against assignment working hours.

The data is stored in PER_WORKING_HOUR_PATTERNS_F table.

Use below query to extract the data:

SELECT papf.person_number, pwhpf.* 
  FROM PER_WORKING_HOUR_PATTERNS_F pwhpf
      ,PER_ALL_ASSIGNMENTS_M paam
	  ,PER_ALL_PEOPLE_F papf
 WHERE pwhpf.OBJECT_ID = paam.ASSIGNMENT_ID
   AND paam.PERSON_ID = papf.PERSON_ID
   AND papf.person_number = '10011'
   AND paam.assignment_type = 'E'
   AND TRUNC(SYSDATE) BETWEEN papf.effective_start_date AND papf.effective_end_date
   AND TRUNC(SYSDATE) BETWEEN paam.effective_start_date AND paam.effective_end_date
   AND paam.effective_start_date BETWEEN pwhpf.effective_start_date AND pwhpf.effective_end_date

Query to extract data in HDL format:

SELECT
'METADATA|WorkingHourPattern|WorkingHourPatternId|EffectiveStartDate|EffectiveEndDate|Object|ObjectId|AssignmentNumber|PersonId|ReplaceFirstEffectiveStartDate' as DATA_ROW, 1 ORDERBY From dual
UNION
SELECT 'MERGE|WorkingHourPattern|'
|| pwhpf.WORKING_HOUR_PATTERN_ID
|| '|'
|| TO_CHAR(pwhpf.EFFECTIVE_START_DATE,'YYYY/MM/DD')
|| '|'
|| TO_CHAR(pwhpf.EFFECTIVE_END_DATE,'YYYY/MM/DD')
|| '|ASSIGNMENT|'
|| pwhpf.object_id
|| '|'
|| paam.assignment_number
|| '|'
|| paam.person_id
|| '|'
|| 'Y'
 as DATA_ROW, 2 ORDERBY
FROM PER_WORKING_HOUR_PATTERNS_F pwhpf
    ,PER_ALL_ASSIGNMENTS_M paam
WHERE paam.assignment_id = pwhpf.object_id
  AND paam.assignment_type = 'E'
  AND TRUNC(SYSDATE) BETWEEN paam.effective_start_date AND paam.effective_end_date
  AND paam.effective_start_date BETWEEN pwhpf.effective_start_date AND pwhpf.effective_end_date;
BIP – Queries related to Bank, Bank Branches and External Bank accounts

Query for bank details:

select * from ce_banks_v

Query for bank branch details:

select * from ce_bank_branches_v
select cbbv.bank_name
      ,cbbv.bank_branch_name
      ,cbbv.bank_home_country
      ,cbbv.branch_number 
      ,TO_CHAR(cbbv.start_date,'YYYY/MM/DD') branch_start_date
      ,TO_CHAR(cbbv.end_date,'YYYY/MM/DD') branch_end_date
  from ce_bank_branches_v cbbv

Query to extract Internal bank accounts:

select * from ce_bank_accounts

Query to extract External bank accounts:

select * from iby_ext_bank_accounts
BIP – Query to extract Disability Org Details

Use below query to extract disability org details from Fusion HCM:

SELECT houft.name disability_org_name
      ,TO_CHAR(haouf.effective_start_date,'RRRR/MM/DD') disability_org_start_date
      ,TO_CHAR(haouf.effective_end_date,'RRRR/MM/DD') disability_org_end_date
      ,houcf.classification_code
      ,haouf.internal_address_line
      ,houcf.status
  FROM hr_org_unit_classifications_f houcf
     , hr_all_organization_units_f haouf
     , hr_organization_units_f_tl houft
 WHERE houcf.organization_id = haouf.organization_id
   AND houft.organization_id = haouf.organization_id
   AND TRUNC(SYSDATE) BETWEEN houcf.effective_start_date AND houcf.effective_end_date
   AND TRUNC(SYSDATE) BETWEEN haouf.effective_start_date AND haouf.effective_end_date
   AND haouf.effective_start_date BETWEEN houft.effective_start_date AND houft.effective_end_date
   AND houft.language = USERENV('LANG')
   AND houcf.category_code = 'HCM_DISABILITY_ORGANIZATION'
BIP – Query to extract absence reasons from Oracle HCM

Sometime for data migration, it is required to get a dump of all the absence reasons configured in Fusion HCM in order to validate the data being loaded.

Below query can be used to extract the setup data for absence reasons:

SELECT aarft.name absence_reason_name
      ,to_char(aarf.effective_start_date,'YYYY/MM/DD') reason_start_date
      ,to_char(aarf.effective_end_date,'YYYY/MM/DD') reason_end_date
      ,aarf.legislation_code legislation_code
      ,aarf.status reason_status
      ,aarft.description reason_description
      ,aarf.base_name reason_base_name
  FROM ANC_ABSENCE_REASONS_F aarf
      ,ANC_ABSENCE_REASONS_F_TL aarft
 WHERE aarf.absence_reason_id=aarft.absence_reason_id
   AND aarf.effective_start_date BETWEEN aarft.effective_start_date AND aarft.effective_end_date
   AND aarft.language=userenv('LANG')
HDL – Source values for Candidate HDL

When loading Candidate data using HDL, the values of Source attributes (Source and Source Medium) are required. These values are configured in UI using task ‘Manage Candidate Dimension Source Names’.

Use below SQL to get the values:

SELECT DISTINCT
 source_medium_url_value,
source_url_value
  FROM
 fusion.IRC_DIMENSION_DEF_VL
BIP – Query to extract Worker Grade, Grade Step and Rate value
select * from (
SELECT DISTINCT
papf.person_number,
paam.assignment_number,
pgf.name grade_name,
pgsf.name grade_step_name,
prv.value rate_value
FROM
PER_GRADES_F_tl PGF,
PER_GRADES_F PG,
PER_ALL_ASSIGNMENTS_M PAAM,
PER_ALL_PEOPLE_F PAPF,
PER_ASSIGN_GRADE_STEPS_F pagsf,
PER_GRADE_STEPS_F_TL PGSF ,
PER_RATE_VALUES_F prv
WHERE 
1=1
AND PG.grade_id = PGF.grade_id
AND PAAM.grade_id = PGF.grade_id
AND paam.person_id = papf.person_id
and paam.assignment_type = 'E'
and PGF.language = 'US'
AND TRUNC(SYSDATE) BETWEEN PAPF.effective_start_date AND PAPF.effective_end_date
AND TRUNC(SYSDATE) BETWEEN PAAM.effective_start_date AND PAAM.effective_end_date
AND TRUNC(SYSDATE) BETWEEN PGF.effective_start_date AND PGF.effective_end_date
AND TRUNC(SYSDATE) BETWEEN PG.effective_start_date AND PG.effective_end_date
AND pagsf.assignment_id (+) = paam.assignment_id
    and pagsf.grade_step_id = PGSF.grade_step_id (+)
	and paam.effective_start_date between pagsf.effective_start_date (+) and pagsf.effective_end_date (+)
	and paam.effective_start_date between PGSF.effective_start_date (+) and PGSF.effective_end_date (+)
	and PGSF.language (+) = 'US'
	and PGSF.grade_step_id = PRV.rate_object_id (+)
) a 
where grade_step_name is not null
BIP – Restricting succession plans access to logged in person in BIP reports

Succession Plans data is stored in HRM_PLANS table. A succession plan can a PUBLIC or PRIVATE plan. By default if any user accesses HRM_PLANS table, user will be able to see all plans data irrespective of plan type (public or private). The requirement here is that a person who is querying data should be able to see all PUBLIC succession plans and only those PRIVATE plans which are defined by the user.

This can be achieved using below SQL:

select * from HRM_PLANS hp
 where hp.ACCESS_TYPE_CODE = 'PUBLIC'
UNION
select * from HRM_PLANS hp
 where hp.ACCESS_TYPE_CODE = 'PRIVATE'
   and exists (select 1 from HRM_PLAN_OWNERS hpo
                where person_id = hrc_session_util.get_user_personid
				  and hpo.plan_id = hp.plan_id)
BIP – Query to extract Collective Agreement Detials
SELECT pcafv.collective_agreement_name
      ,TO_CHAR(pcafv.effective_start_date,'YYYY/MM/DD') Start_Date
      ,pcafv.legislation_code
      ,pcafv.status
      ,pcafv.identification_code
      ,pcafv.description
      ,pcafv.comments
      ,houf_union.name Union_Name
      ,pcafv.bargaining_unit_code
      ,ple.name Legal_Employer
      ,pcafv.employee_org_name
      ,pcafv.employee_org_contact
      ,pcafv.employer_org_name
      ,pcafv.employer_org_contact
  FROM per_col_agreements_f_vl pcafv
      ,hr_all_organization_units_f_vl houf_union
      ,per_legal_employers ple
 WHERE pcafv.legal_entity_id = ple.organization_id(+)
   AND pcafv.union_id = houf_union.organization_id(+)
   AND trunc(SYSDATE) BETWEEN pcafv.effective_start_date AND pcafv.effective_end_date
   AND trunc(SYSDATE) BETWEEN houf_union.effective_start_date(+) AND houf_union.effective_end_date(+)
   AND trunc(SYSDATE) BETWEEN ple.effective_start_date(+) AND ple.effective_end_date(+)

BIP – Query to extract Calendar Event details

Calendar events are used in HCM to capture public holidays available to employees based on their location or department.

Below SQL queries can be used to extract the list of configured calendar events from backend table:

List of all calendar events configured:

SELECT pcetl.name
      ,pce.short_code
      ,pcetl.description
      ,pce.category
      ,pce.coverage_type 
      ,pce.start_date_time
      ,pce.end_date_time 
      ,pce.tree_code
      ,pce.tree_structure_code 
 FROM per_calendar_events pce,
      per_calendar_events_tl pcetl
WHERE pce.calendar_event_id=pcetl.calendar_event_id
  AND pcetl.LANGUAGE=userenv('LANG')

List of calendar events by location:

SELECT hla.location_id
      ,hla.location_name             
      ,hla.internal_location_code 
      ,pcet.name
	  ,pce.short_code
      ,pcet.description
      ,pce.category
      ,pce.coverage_type	  
	  ,pce.start_date_time
	  ,pce.end_date_time
      ,pce.tree_code
      ,pce.tree_structure_code 	  
 FROM hr_locations_all hla
     ,per_calendar_events pce
	 ,per_calendar_events_tl pcet
	 ,per_cal_event_coverage pcec
	 ,per_geo_tree_node_rf pgtnr
WHERE hla.geo_hierarchy_node_value = pgtnr.ancestor_pk1_value
  AND pgtnr.tree_structure_code = 'PER_GEO_TREE_STRUCTURE'
  AND pgtnr.distance in (0)
  AND pgtnr.ancestor_tree_node_id = pcec.tree_node_id
  AND pcec.calendar_event_id = pcet.calendar_event_id
  AND pcet.calendar_event_id = pce.calendar_event_id
  AND pcet.language = userenv('lang')
  AND pcec.coverage_flag in ('I')
  AND trunc(sysdate) between hla.effective_start_date and hla.effective_end_date