You are on page 1of 243

An Overview of Fusion Applications

By Ashish Harbhajanka (Evangelist, Cloud Consultant, Solution Architect)


Email: ashish1234u@gmail.com

This Book is an Attempt by me to explain some of the very basic concepts about few which are divided into several chapters as below:
Introduction of Why to Adopt Fusion Applications
Chapter 1: HCM Data Loader
Chapter 2: BIP Reports
Chapter 3: OTBI Reports
Chapter 4: Creating Custom ESS Jobs in Fusion Applications
Chapter 5: Fusion Absence Management
Chapter 6: Fusion Fast Formulas
Chapter 7: Fusion HCM Extracts
Chapter 8: Other Topics

Contents
Business Requirement .............................................................................................................................................................................................................................. 81
INTRODUCTION ........................................................................................................................................................................................................................................ 99
INTRODUCTION ....................................................................................................................................................................................................................................... 143
BUSINESS REQUIREMENT ........................................................................................................................................................................................................................ 144
.......................................................................................................................................................................................................................... 156
................................................................................................................................................................................................................................ 159
Formula Code :....................................................................................................................................................................................................................................... 161
Screenshot :............................................................................................................................................................................................................................................ 162
Custom HCM Extract Creation: Available Options ................................................................................................................................................................... 165
ORACLE DELIVERED REPORTS ....................................................................................................................................................................................................... 175
NAVIGATION TO RUN DELIVERED REPORTS ............................................................................................................................................................................... 175

DELIVERED REPORT 1 -> USER ROLES DISPLAY .................................................................................................................................................................................. 176


DELIVERED REPORT 2 -> USER AND ROLE : ROLE DETAILS ................................................................................................................................................................ 177
DELIVERED REPORT 3 -> USER AND ROLE : USER DETAILS ...................................................................................................................................................... 179
NEED FOR A CUSTOM CONSOLIDATED REPORT ......................................................................................................................................................................... 179
SQL USED FOR USER AND ROLE DETAILS REPORT ..................................................................................................................................................................... 179
CONDITIONAL FORMATTING ............................................................................................................................................................................................................... 181
REPORT OUTPUT ................................................................................................................................................................................................................................ 182
ESS JOB CREATION ............................................................................................................................................................................................................................ 183
RUNNING SCHEDULED JOB FOR ONE PERSON ............................................................................................................................................................................. 185

Why to Adopt Fusion Applications


INTRODUCTION
Fusion as the word suggests stand for Culmination / Mix / Combination.
In context of Oracle, Fusion is referred as Fusion Applications.
So Why Fusion Applications ?
Before that lets understand What is Fusion Applications ?
Fusion Application is a new Oracle Product to cater to ERP Needs.
But we already have so many ERP Applications. Some of the most popularly used being EBS (E-Business Suite), PeopleSoft, JDEdwards to name a
few. So why a new ERP application to cater to business needs. The answer is :
Fusion Applications is an attempt ( and for that matter a very popular and widely accepted one) by Oracle . It takes the best features from EBS and
PeopleSoft and does makes life simpler for Business Users and (Both Functional and Technical) Implementation Consultants .Lets try to get into
more details of the same . We would categorize this discussion into two broad categories namely:
a) Business Reasons ( Details about why should Business adopt Fusion)
b) Functional Reasons ( Details about why should Functional Consultant adopt Fusion)
c) Technical Reasons ( Details about why should Technical Consultant adopt Fusion)
BUSINESS REASONS
i)
ii)
iii)
iv)

Easy to use
Better Look and Feel
Better Functionality
Better User Experience

FUNCTIONAL REASONS

i)

Configuration is simpler ( Most configurations from Setup and Maintainenance)

Setup and Maintenance


Most of the setups start with Manage% ( screenshot below)

ii)

Configuration is based on Train Stop Models ( First Step guides you to second step and so on)

Train Stops (First Step Takes you to second step and so on )

iii)

Allows What IF Scenarios (Manage Enterprise Structures, Allows Multiple Combination but Loads just one)

Below Screenshots gives details of creating Enterprise Structures ( and then to view to Technical Summary Report). This would not get loaded but
would be used for comparative analysis. Screenshots displaying what-if scenarios ( ESC Setup Example) .

Example of WHAT IF SCENARIO ( Using Enterprise Structure Configurator)

WHAT IF SCENARIO EXAMPLE-> STEP 1: MANAGE ENTERPRISE

WHAT IF SCENARIO EXAMPLE-> STEP 2 : MANAGE DIVISIONS

WHAT IF SCENARIO EXAMPLE-> STEP 3 : MANAGE LEGAL ENTITIES

WHAT IF SCENARIO EXAMPLE-> STEP 4 : CREATE BUSINESS UNITS

WHAT IF SCENARIO EXAMPLE-> STEP 5 : MANAGE BUSINESS UNITS

WHAT IF SCENARIO EXAMPLE-> STEP 6 : MANAGE REFERENCE DATA SETS

WHAT IF SCENARIO EXAMPLE-> STEP 7 : MANAGE BUSINESS UNIT SET ASSIGNMENT

WHAT IF SCENARIO EXAMPLE-> STEP 8 : MANAGE LOCATION REFERENCE SET

10

WHAT IF SCENARIO EXAMPLE-> INTERVIEW RESULTS

WHAT IF SCENARIO EXAMPLE-> MANAGEMENT REPORTING STRUCTURE

11

WHAT IF SCENARIO EXAMPLE-> TECHNICAL SUMMARY REPORT

12

WHAT IF SCENARIO EXAMPLE-> CLICK ON DOWNLOAD TECHNICAL SUMMARY REPORT TO GET PDF REPORT

13

WHAT IF SCENARIO EXAMPLE-> REPORT SCREENSHOTS

14

15

16

17

18

We can configure multiple such Enterprise Values and compare before loading one. So we can have WHAT IF scenarios. This feature is not supported in older Legacy Systems ( EBS / PPLSOFT).
TECHNICAL REASONS
Broad Responsibilities of any Technical Resource on any ERP Implementations are :
A) INBOUND INTEGRATION ( HDL FROM RELEASE 10 MAKES LIFE SIMPLER, DATA LOAD ON BUTTON CLICK)
B) REPORTING ( BIP / OTBI / OBIA )
C) OUTBOUND INTEGRATION ( HCM EXTRACTS)
All the above three are very easy to implement in Fusion HCM.
So, It is for all the above stated reasons we should have Fusion Applications. Happy Adoption.Cheers

19

20

Chapter 1: HCM Data Loader


Comprises Details About What an HCM Data Loader.
Why to Use HCM Data Loader
How to Configure HCM Data Loader

21

What is HCM Data Loader


INTRODUCTION
HCM Data Loader aka (also known as ) HDL is the next generation Data Loading Tool used in Fusion Applications.
Mostly used in all new implementation starting July 2015 this tool has tremendously advanced features compared to its predecessor FBL (File Based
Loader).
In this article we would try to understand what HDL is and also a brief understanding of key concepts associated with the same.
Role required for using HCM Data Loader is Human Capital Management Integration Specialist
So without much ado lets begin.
MAJOR ENHANCEMENTS OVER FBL
1. Bulk loading of HCM data from any source
2. Data-migration or incremental updates
3. Flexible, pipe-delimited file format
4. Comprehensive bulk loading capabilities
5. Automated and user managed loading
6. Stage Table Maintenance

WHILE THE ABOVE 6 ARE THE ONES MOSTLY STATED AND POPULARLY ADVERTISED FEATURES I HAVE A SLIGHTLY DIFFERENT VIEW AND THEY
ARE :
1. BULK LOADING OF HCM DATA FROM ANY SOURCE
THIS POINT TO ME DOESNT SEEMS VALID AS FBL ALSO USED TO DO THE SAME THING AND HENCE I WILL DISCARD THIS

22

2. DATA MIGRATION OR INCREMENTAL UPDATES


FBL DOES THE SAME BUT IF YOU HAVE SAY N RECORDS FOR AN EMPLOYEE AND YOU WANT TO ADD ONE MORE RECORDS YOU NEED TO
PASS ALL N+1 RECORDS
USING HDL YOU WOULD BE REQUIRED TO JUST PASS THE (N+1) TH RECORD SO A MAJOR ENHANCEMENT

3. FLEXIBLE, PIPE-DELIMITED FILE FORMAT


AVAILABLE IN FBL TOO HENCE DISCARDED AGAIN.
4. COMPREHENSIVE BULK LOADING CAPABILITIES
A VERY NEW ADVANCED AND ENHANCED FEATURE.
5. AUTOMATED AND USER MANAGED LOADING
FBL CAN ALSO BE AUTOMATED USING WEB SERVICE CALL HENCE AGAIN DISCARDED.
6. STAGE TABLE MAINTAINENACE
THIS AGAIN WAS IN FBL TOO HENCE DISCARDED AGAIN.
SO NOW WE WILL PRIMARILY DISCUSS ABOUT 2 POINTS NAMELY :
a) DATA MIGRATION OR INCREMENTAL UPDATES
b) COMPREHENSIVE BULK LOADING CAPABILITIES.
DATA MIGRATION OR INCREMENTAL UPDATES
WE WILL TAKE AN EXAMPLE OF VARIOUS EVENTS IN AN INDIVIDUALS LIFE AND CO-RELATE THE SAME AS DATA TRANSACTIONS.DETAILS OF SAME
EXPLAINED BELOW :
HIRE AN EMPLOYEE
MS. SANDRA MORA IS A LADY WHO JOINS A COMPANY AND BECOMES EMPLOYEE ON 15 JUN 2003. SHE GETS A UNIQUE IDENTIFIER (LIKE SSN FOR
US , PAN CARD FOR INDIA TO UNIQUELY IDENTIFY A INDIVIDUAL, SIMILARLY EACH COMPANY HAS A UNIQUE IDENTIFIER TO IDENTIFY AN EMPLOYEE THIS UNIQUE IDENTIFIER IS REFERRED TO AS EMPLOYEE NUMBER ) NO 12345.

23

MARITAL STATUS CHANGE


SHE GETS MARRIED ON 21ST AUG 2006 AND UNDERGOES FOLLOWING CHANGES IN HER EMPLOYEE RECORD:
1) TITLE: GETS CHANGED FROM MS TO MRS.
2) LAST NAME : HER LAST NAME GETS CHANGED FROM MORA TO BJORK
3) EMAIL ADDRESS : HER EMAIL ADDRESS GETS CHANGED FROM Sandra.mora@abc.net TO Sandra.bjork@abc.net
SHE AS A RESULT OF THIS CHANGE THE PREVIOUS RECORD (HIRE AN EMPLOYEE) GETS END-DATED ON 20TH AUG 2003 AND A NEW RECORD GETS
CREATED ON 21ST AUG 2006
MIDDLE NAME CHANGE
SHE GETS A MIDDLE NAME ADDED (SHE DECIDED TO HAVE HER HUSBANDS FIRST NAME ADDED IN HER NAME ON 16TH JULY 2008) AND A NEW RECORD GETS CREATED.
1) MIDDLE NAME: GETS CHANGED FROM

TO ALBERT.

FTE CAPACITY CHANGE


STARTING 25TH SEP 2009 SHE STARTS WORKING ONLY ON 4 DAYS A WEEK INSTEAD OF INITIAL 5 DAYS A WEEK SO HER FULL TIME EQUIVALENT
(FTE) GETS CHANGED FROM 1 ( ACTUAL DAYS WORKED IN A WEEK (5) / TOTAL WORKING DAYS IN A WEEK (5) ) TO NEW VALUE 0.8 ( ACTUAL
DAYS WORKED IN A WEEK (4) / TOTAL WORKING DAYS IN A WEEK (5))
1) FTE CAPACITY CHANGE: GETS CHANGED FROM 1 TO 0.8
EMAIL ADDRESS CHANGE
SHE UNDERGOES A EMAIL ADDRESS CHANGE AS ON 17TH MARCH 2012
1) EMAIL ADDRESS: GETS CHANGED FROM SANDRA.BJORK@ABC.NET TO SANDRA.BARON@ABC.NET
MIDDLE NAME CHANGE
SHE GETS A MIDDLE NAME ADDED (SHE DECIDED TO HAVE HER FATHERS FIRST NAME ADDED IN HER NAME ON 12TH DEC 2003) AND A NEW RECORD
GETS CREATED.
MIDDLE NAME: GETS CHANGED FROM ALBERT TO FRANK.

THE SAME DETAILS REPRESENTED IN A TABULAR FORMAT FOR EASIER UNDERSTANDING.

24

COMPREHENSIVE BULK LOADING CAPABILITIES

25

26

DATA LOADER PROCESS FLOW DIAGRAM

HCM DATA LOADER SUPPORTED BUSINESS OBJECTS

27

FLEXIBLE PIPE-DELIMITED FILE FORMAT

28

AUTOMATED OR USER MANAGED PROCESSING

IMPORT AND LOAD DATA

29

PROGRESS ICONS

FILE LINE COUNTS

30

OBJECT COUNTS

OBJECT ERRORS

31

STAGE TABLE MAINTAINENANCE

32

HDL FEATURE GUIDELINES

33

WHILE PERFORMING CONVERSION : STEP 1 -> CONFIGURE SOURCE SYSTEM OWNER


THERE COULD BE MULTIPLE SOURCES FROM WHICH DATA CAN BE MIGRATED TO FUSION , HENCE A SOURCE SYSTEM OWNER NEEDS TO BE CONFIGURED FOR UNIQUE IDENTIFICATION OF LEGACY DATA SOURCE. BELOW SCREENSHOT SHOWS HOW TO CONFIGURE THE SAME.

34

WHILE PERFORMING CONVERSION: STEP 2 -> CONFIGURE HCM DATA LOADER

35

HCM DATA LOADER : ERROR REPORTS GENERATION USING DELIVERED HCM EXTRACTS
As with all delivered HCM Extracts, it is recommended that you make a copy of the HCM Data Loader Data Set Summary extract and alter the output to your requirements.
Navigate to the Manage Extract Definitions task available from the Data Exchange work area.
Query the HCM Data Loader Data Set Summary extract.
You click the copy icon to copy the seeded extract, supply your name for the copied extract.
Once your copy is successfully created you can retrieve it by searching for it by name. Click on the name in the Search Results to make your required changes

36

IMPLEMENTATION DECISION POINTS

Last but not the least Human Capital Management Integration Specialist is the Role Required to Perform Conversion. . That brings me to end
of the topic.
Thanks a lot for all your time .. Have a Nice Day!!!!!!!!!!!!!

Why To Use HCM Data Loader


Customers currently provisioned on Release 9 will require a configuration change.
All environments provisioned in Release 10 will be defaulted to HDL.

37

Existing Customers may continue using File Based Loader (FBL) but should begin evaluating HDL to plan a migration in the future, where applicable.
There are a few scenarios where HDL may not be recommended, and an exception may be considered, for both, existing and new Customers.
SITUATIONS WHERE HCM DATA LOADER MAY NOT BE RECOMMENDED
a) An existing customer using File-Based Loader who purchases additional test environment that is created on R10.
b) The customer must log an SR to change the default setting of Full to Limited to match other environments.
c) Customers with PeopleSoft Integration.
d) Customers with Taleo Integration via Taleo Connect Client (TCC) and File-Based Loader.

MIGRATING FROM FILE-BASED LOADER TO HCM DATA LOADER


1. Is File-Based Loader used for migration only? If so, once migration is complete, then HCM Data Loader could be considered.
2. Is File-Based Loader used for ongoing integration? If so, then there will need to be rework of processes and a cutover decision.
3. How are File-Based Loader data files generated? Whatever method is used for generating the File-Based Loader data files will need to be
reworked to generate the correct HCM Data Loader format.
4. The complexity of the integration will need to be taken into account to determine who does the rework of the extract mechanism.
5. Are you loading objects outside of File-Based Loader and HCM Spreadsheet Data Loader (via SR requested scripts)? If this is causing delays
and issues related to lack of automation, then HCM Data Loader should be considered.
6. Are there users who load data using HCM Spreadsheet Data Loader? A move to HCM Data Loader in R10 would disable this
7. Functionality, so it would probably be worth waiting for spreadsheet support. HCM Data Loader migration should be treated as an implementation with a proper project plan. File-Based Loader GUID values can continue to be used with HCM Data Loader. A process can be run to
convert the File-Based Loader GUID into a source key that HCM Data Loader can recognize.
8. HR spreadsheet loaders in the Data Exchange work area will not be available to use in conjunction with HCM Data Loader
9. HCM Data Loader and File-Based Loader cannot be used at the same time for objects supported by both.
10. Payroll batch loader is still required for some payroll object loads.
11. Environment refresh will overwrite HCM Data Loader settings if the source environment uses File-Based Loader. You will
have to follow the process again to enable HCM Data Loader and convert File-Based Loader GUIDs and source keys.
12. Once HCM Data Loader is enabled in a test environment, no additional File-Based Loader load testing will be possible
NEW IMPLEMENTATION CONSIDERATIONS
1) Customers who have recently started implementing and have not yet gone live should consider switching to HCM Data Loader if their timelines can accommodate it.

38

2) This will mitigate the need for conversion to HCM Data Loader later in the project lifecycle. Project plans should be reviewed to incorporate
the migration to HCM Data Loader, taking into account:
3) Training on the new tool
4) Rework of the extract mechanism to get data in the HCM Data Loader format
5) The need to test the migration and integration processes using HCM Data Loader instead of File Based Loader
6) The need to fit in with major implementation milestones
CONSIDERATIONS FOR EXISTING CUSTOMERS
1. Existing live customers already using File-Based Loader and HCM Spreadsheet Data Loader should defer the switch to HCM Data Loader.
2. Customers who are not yet live should evaluate whether to rework their implementation to use HCM Data Loader or continue using FileBased Loader and HCM Spreadsheet Data Loader.
3. The main work involved in using File-Based Loader and HCM Data Loader is the extract of the data from a source system to the correct format ready for loading. Since this is not part of Oracle Fusion, Oracle does not provide a conversion process from File-Based Loader to HCM
Data Loader.
4. Oracle does provide the migration of File-Based Loader GUID values to the HCM Data Loader equivalent, which are referred to as source
keys.
5. Customers using Oracle Fusion Taleo Recruitment Out of the Box (OOTB) V1 Integration are not impacted.
6. If you are using Taleo Connect Client and File-Based Loader or a hybrid with OOTB to integrate with Fusion, you will need to perform an
evaluation and follow the steps to migrate to HCM Data Loader
HCM DATA LOADER COMPATIBILITY WITH FILE BASED LOADER
HCM Data Loader and File-Based Loader cannot be used at the same time for objects supported by both. Either of them should be picked for conversion.
The setting of the HCM Data Loader Scope parameter on the Configure HCM Data Loader page determines whether HCM Data Loader or FileBased Loader is used and controls the behavior of the loading tools. The default value of this parameter is Limited for existing customers. If you
attempt to load data for a business object not supported in the Limited mode, your whole data set will fail.
Limited mode Only business objects not supported by HCM File-Based Loader can be loaded using HCM Data Loader. All objects that can
use File-Based Loader must use File-Based Loader. Any objects that are not available via File-Based Loader should use HCM Data Loader.
Full mode HCM Data Loader is used for bulk-loading data into all supported business objects. HCM File Based Loader and HCM Spreadsheet Data Loader are disabled.
Important Note: You can switch from Limited mode to Full mode, but you cannot switch from Full mode to Limited mode. This is a one-time
switch from File-Based Loader to HCM Data Loader.
Once you migrate to HCM Data Loader, HCM Spreadsheet Data Loader is also disabled because it relies on the File-Based Loader engine to load
data to Oracle HCM Cloud. This restriction applies only to the spreadsheet loading that is launched from the Data Exchange work area. Other spreadsheet data loaders are not impacted by the uptake of HCM Data Loader.

39

IMPACT OF UPGRADE TO RELEASE 10


HCM Data Loader will be Generally Available in R10 (also in Release 9 Patch Bundle 7 and above ) but there is no immediate requirement to
migrate to HCM Data Loader.
HCM Data Loader and File-Based Loader cannot be used at the same time for objects supported by both.
On upgrade to Release 10 you will see the HCM Data Loader options available in the application but you should not use HCM Data Loader if you
are an existing File-Based Loader customer until you have completed an evaluation of HCM Data Loader.
Important Note:
There are differences in file format and key structures.
Once the switch to HCM Data Loader has occurred, you will no longer have access to File-Based Loader or HCM Spreadsheet Data Loader.
If you have a requirement to load documents of record or areas of responsibility, then you can use HCM Data Loader in Limited mode with no impact on File-Based Loader or HCM Spreadsheet Data Loader, since these objects are not currently supported by File-Based Loader
ENVIRONMENT MANAGEMENT CONSIDERATIONS
If you are live with File-Based Loader and testing HCM Data Loader in a nonproduction environment, then you should plan your environment refresh (P2T) requests carefully.
When you request an environment refresh, the HCM Data Loader settings will be overwritten, and the environment will revert to the default Limited
mode.
You will need to go through the same steps as before to switch back to HCM Data Loader. That is, you must convert File-Based Loader GUIDs to
HCM Data Loader source keys and switch HCM Data Loader Scope to Full.
During the HCM Data Loader migration validation and testing, important testing considerations must be included in your planning.
HCM Data Loader in Full mode is not compatible with File-Based Loader; therefore, it is not possible to have an environment with both HCM Data
Loader and File-Based Loader at the same time.

40

This will impact your ability to test File-Based Loader transactions in your nonproduction environment while you are in the process of validating
HCM Data Loader.
Important Note: You will need to ensure that the HCM Data Loader enabled environment is not required for any File-Based Loader testing prior to
setting the HCM Data Loader Scope to Full.
MIGRATION STEPS FOR MOVING FROM FILE BASED LOADER TO HCM DATA LOADER
It is not possible to move to HCM Data Loader for individual core objects on an incremental basis. It is a one-time migration and requires careful
planning and preparation to ensure a smooth transition.
CHOICE OF KEYS

One of the most important decisions when considering the upgrade from File-Based Loader to HCM Data Loader is whether to continue to use the
same key mechanism as is used in File-Based Loader (GUIDs) or whether to take advantage of the user key support that is available in HCM Data
Loader.
User keys allow objects to be identified in HCM Data Loader using their natural key; for example, Job Code, Person Number, and so on.
File-Based Loader GUIDs have an equivalent in HCM Data Loader known as source keys. These are values that are defined in the source system and
stored alongside the Oracle Fusion surrogate keys when objects are created in Oracle HCM Cloud. Source keys can be used to reference objects when
loading related data or to identify specific objects when performing updates or deletes.
Within HCM Data Loader, each object can use different types of keys, so a decision needs to be made on an object-by-object basis to determine
whether a user key or a source key will be used.
CONVERSION OF GUIDS
In order to facilitate the upgrade from File-Based Loader to HCM Data Loader, a process is provided to migrate the File-Based Loader GUIDs to
HCM Data Loader source system IDs. Regardless of whether user keys or source keys will be used, it is recommended that this process be run as the
first step
TEMPLATE GENERATION
Before reworking the export processes, you can download a template for each business object supported by HCM Data Loader. These templates take
into account any flex-field structures that are already in place. By using the templates, you can accurately outline the shape of the data that needs to
be generated by the reworked export processes.
REWORK OF EXPORT PROCESSES

41

The main task required for migration to HCM Data Loader is the rework of the export process that generates the data for loading to Oracle HCM
Cloud. This process needs to take into account the correct attributes for the HCM Data Loader objects as well as preparing the files in the format
expected by HCM Data Loader.
The attached spreadsheet provides a mapping between the HCM Data Loader data file name, file discriminator, and attribute name to the HCM FileBased Loader data file and attribute name.
HCM Data Loader only supports files loaded via Oracle Web-Center Content. If customers are currently using SFTP, then the processes will need to
be changed.
Similar to File-Based Loader, HCM Data Loader has a web service that can be used to invoke the HCM Data Loader processing.

HCM_Data_Loader_
to_File-Based_Loader_Field_Mapping.xlsx

Sample Screenshot (Mapping Sheet)

42

OFFLINE VERIFICATION USING HDLDI


The offline Data File Validator Tool (HDLdi) and used in the extract process to ensure that the data files being prepared are valid in terms of the data
format. It also checks any business rules that apply to the data contained in the data file where other Oracle HCM Cloud data is not required as part of
the validation.
HCM DATA LOADER PROCESS FLOW DIAGRAM

HDL (HCM DATA LOADER) VS FBL (FILE BASED LOADER) COMPARATIVE ANALYSIS (TOP 10 POINTS)
HCM DATA L OADER ( HDL )

FILE BASED LOADER ( FBL )

HAS NEW FEATURES

CUSTOMERS ALREADY ACCUSTOMED TO USING FBL

SINGLE WORKER FILE

MULTIPLE FILES TO LOAD WORKER DETAILS

ALLOWS BULK AND DELTA LOAD

SPECIAL CONSIDERATIONS REQUIRED FOR DELTA LOAD

ERROR HANDLING MECHANISM IS EASY

ERROR HANDLING TAKES LOT OF TIME AND EFFORT

43

ALLOWS DATE EFFECTIVE HISTORICAL DATA LOAD. NEED TO PASS ONLY


THE (N + 1 )TH RECORD

ALLOWS DATE EFFECTIVE HISTORY LOAD. IN CASE YOU NEED TO LOAD (N + 1)TH RECORD
ALL RECORDS STARTING FROM 1 TO N ALSO NEEDS TO BE PASSED

ORACLE RECOMMENDS FOR ALL NEW IMPLEMENTATIONS

ONLY RECOMMENDED FOR EXISTING CUSTOMERS

ENSURES EITHER COMPLETE DETAILS GET LOADED OR NONE. NO P ARTIAL


CONVERSION A LLOWED. ALL OR NONE APPROACH

CUSTOMERS ALREADY ACCUSTOMED TO USING FBL. P ARTIAL LOAD HAPPENS CAUSING


SYNC ISSUES . M AJOR SETBACK FOR ALL IMPLEMENTATIONS

USES SOURCE SYSTEM KEYS APPROACH. USER FRIENDLY PRIMARY KEYS

FOLLOWS GUID APPROACH. P RIMARY KEYS ARE NOT USER FRIENDLY

HDL T EMPLATES ( D ATA F ILE FORMAT) REQUIRED FOR C ONVERSION CAN


BE DOWNLOADED FROM THE APPLICATION I NSTANCE ( COMMONLY REFERRED TO AS POD) ITSELF. N O ADDITIONAL SR (SERVICE REQUESTS )

FBL T EMPLATES ARE MADE AVAILABLE ON REQUEST ( VIA SR)

NEEDS TO BE RAISED

T ODAY OR T OMORROW YOU HAVE TO ACCEPT USING HDL. YOU MAY DELAY USING IT BUT CANNOT AVOID IT.

SAMPLE HDL FILES


Worker.dat

Worker.dat

44

FBL IS AGE OLD TECHNOLOGY NOW. Y OU CAN USE IT FOR NOW BUT IT IS ON THE VERGE OF
EXTINCTION .

How To Configure HCM Data Loader


This article explains in detail about the steps required to enable your system to use HCM Data Loader tool ( for HCM data Migration ) from Legacy
Applications to Fusion Applications.
It has been divided into various sections and the same are detailed below :
FUSION APPLICATION LOGIN PAGE:

The below screenshot shows a Fusion Application Home page. Click on the Fusion Applications Link ( you will receive the same from your Project
Team Colleagues / IT Admin )

45

APPLICATION VERSION DETAILS

Verify the application version


Navigation-: Click on any link from the navigator (E.g.: Setup and Maintenance) -> A new page opens up. On the top right hand side of the page you
will find an arrow next to your login user name which populates below Settings and Actions list screenshots below :

46

Select About This Page. This will provide details of the Fusion application version (highlighted below)

47

USER ROLES:

Role required for using HCM Data Loader is Human Capital Management Integration Specialist
Navigation to check the User roles: Navigator-> My Account ->Current Roles

48

NAVIGATION: CONFIGURE HCM DATA LOADER

Login into Fusion applications-> Click on Navigator-> Setup and Maintenance -> All Tasks
In the search window, give name as Configure HCM Data Loader

49

50

Click on Go to Task i.e.


Icon
NOTE: Permitted field should be green checked. If it is red checked then you do not have required permission to view the settings.
Now you should be able to see all the PARAMETERS set for HCM Data Loader.

CONFIGURATION PARAMETER HCM DATA LOADER SCOPE:

1. Full Enables the use of HCM Data Loader as the primary bulk inbound integration tool. File-based Loader usage is disabled.

51

2. Limited Enables the use of FBL as the primary bulk inbound integration tool and HDL only for objects not supported by FBL Not recommended to
switch the tools for the same business objects intermittently
New release 10 customers will have a default scope of FULL.
CHANGING THE PARAMETER VALUE:

Customers can choose to move from LIMITED to FULL at ANYTIME (available via UI)
Move from FULL to LIMITED requires Development Intervention (can cause issues)

Chapter 2 : BIP Reports


Describes How to Create a Custom BIP Report in Fusion Applications
Also Explains about creating BIP Report from Static Data

52

How to Create a Custom BIP Report in Fusion Applications


BUSINESS REQUIREMENT
Oracle has already delivered a lot of BIP Reports in the Fusion Instance, however during a course of implementation it is a common requirement to
develop new ones.
CONTENT
There are few common steps involved they are :

a) Create a SQL Query which comprises of DB Tables ( that exist in Fusion Schema).
We have a SQL Query which is as below :

select A.person_number,
A.full_name,
A.legal_employer,
A.business_unit,
A.department,
A.absence_plan_name,
A.adjustment_type,
A.adjustment_reason,
A.value,
A.procd_date accrual_entry_date
from
(
select apaed.per_accrual_entry_dtl_id,
apaed.per_accrual_entry_id,

53

apaed.enterprise_id,
apaed.value,
apaed.type,
apaed.created_by,
apaed.creation_date,
apaed.last_updated_by,
apaed.last_update_date,
apaed.last_update_login,
apaed.person_id,
apaed.pl_id,
apaed.procd_date,
apaed.per_event_id,
apaed.legal_employer_id,
apaed.assignment_id,
apaed.per_absence_entry_id,
apaed.per_plan_enrt_id,
apaed.work_term_asg_id,
DECODE(apaed.type,'ADJOTH',ADD_MONTHS(procd_date,6),NULL) proposed_expiration_date,
papf.person_number,
ppnf.full_name,
paam.organization_id,
dept.name department,
paam.legal_entity_id,
legal_employer.classification_code
legal_emp_classification_code,
legal_employer.name
legal_employer,
paam.business_unit_id,
business_unit.classification_code
bu_classification_code,
business_unit.name
business_unit,
absence_plan.name
absence_plan_name,
flvt.meaning
adjustment_type,
adj_reason.meaning
adjustment_reason
FROM anc_per_acrl_entry_dtls apaed
JOIN fnd_lookup_values_tl flvt
ON (flvt.lookup_type = 'ANC_ACCRUAL_ENTRY_TYPE'
AND flvt.lookup_code = apaed.type
AND flvt.language = 'US')
JOIN per_all_people_f papf
ON (apaed.person_id = papf.person_id
AND TRUNC(sysdate) BETWEEN papf.effective_start_date and papf.effective_end_date)
JOIN per_person_names_f ppnf
ON (ppnf.name_type = 'GLOBAL'
AND ppnf.person_id = apaed.person_id
AND TRUNC(SYSDATE) BETWEEN ppnf.effective_start_date and ppnf.effective_end_date)
JOIN per_all_assignments_m paam
ON (paam.assignment_id = apaed.assignment_id
AND paam.person_id = apaed.person_id
AND paam.primary_assignment_flag = 'Y'
AND paam.assignment_type = 'E'
AND TRUNC(SYSDATE) between paam.effective_start_date and paam.effective_end_date)
LEFT OUTER JOIN
( SELECT
flvt1.lookup_code,
flvt1.meaning
FROM fnd_lookup_values_tl flvt1

54

'ANC_ABS_PLAN_OTHER_REASONS'

WHERE

flvt1.lookup_type =

AND flvt1.language = 'US'


) adj_reason
ON (apaed.adjustment_reason = adj_reason.lookup_code)

LEFT OUTER JOIN


( SELECT hauft.organization_id,
hauft.NAME
FROM HR_ORG_UNIT_CLASSIFICATIONS_F houcf,
HR_ALL_ORGANIZATION_UNITS_F haouf,
HR_ORGANIZATION_UNITS_F_TL hauft
WHERE haouf.ORGANIZATION_ID = houcf.ORGANIZATION_ID
AND haouf.ORGANIZATION_ID = hauft.ORGANIZATION_ID
AND haouf.EFFECTIVE_START_DATE BETWEEN houcf.EFFECTIVE_START_DATE AND houcf.EFFECTIVE_END_DATE
AND hauft.LANGUAGE = 'US'
AND hauft.EFFECTIVE_START_DATE = haouf.EFFECTIVE_START_DATE
AND hauft.EFFECTIVE_END_DATE = haouf.EFFECTIVE_END_DATE
AND houcf.CLASSIFICATION_CODE = 'DEPARTMENT'
AND TRUNC(SYSDATE) BETWEEN hauft.effective_start_date AND hauft.effective_end_date
) dept
ON (paam.organization_id = dept.organization_id)
LEFT OUTER JOIN
(SELECT hauft.organization_id,
hauft.NAME,
houcf.classification_code
FROM HR_ORG_UNIT_CLASSIFICATIONS_F houcf,
HR_ALL_ORGANIZATION_UNITS_F haouf,
HR_ORGANIZATION_UNITS_F_TL hauft
WHERE haouf.ORGANIZATION_ID = houcf.ORGANIZATION_ID
AND haouf.ORGANIZATION_ID = hauft.ORGANIZATION_ID
AND haouf.EFFECTIVE_START_DATE BETWEEN houcf.EFFECTIVE_START_DATE AND houcf.EFFECTIVE_END_DATE
AND hauft.LANGUAGE = 'US'
AND hauft.EFFECTIVE_START_DATE = haouf.EFFECTIVE_START_DATE
AND hauft.EFFECTIVE_END_DATE = haouf.EFFECTIVE_END_DATE
AND houcf.CLASSIFICATION_CODE = 'HCM_LEMP'
AND TRUNC(SYSDATE) BETWEEN hauft.effective_start_date AND hauft.effective_end_date
) legal_employer
ON (paam.legal_entity_id = legal_employer.organization_id)
LEFT OUTER JOIN
(SELECT hauft.organization_id business_unit_id,
hauft.NAME,
houcf.classification_code
FROM HR_ORG_UNIT_CLASSIFICATIONS_F houcf,
HR_ALL_ORGANIZATION_UNITS_F haouf,
HR_ORGANIZATION_UNITS_F_TL hauft
WHERE haouf.ORGANIZATION_ID = houcf.ORGANIZATION_ID
AND haouf.ORGANIZATION_ID = hauft.ORGANIZATION_ID
AND haouf.EFFECTIVE_START_DATE BETWEEN houcf.EFFECTIVE_START_DATE AND houcf.EFFECTIVE_END_DATE
AND hauft.LANGUAGE = 'US'
AND hauft.EFFECTIVE_START_DATE = haouf.EFFECTIVE_START_DATE
AND hauft.EFFECTIVE_END_DATE = haouf.EFFECTIVE_END_DATE
AND houcf.CLASSIFICATION_CODE = 'FUN_BUSINESS_UNIT'
AND TRUNC(SYSDATE) BETWEEN hauft.effective_start_date AND hauft.effective_end_date
) business_unit

55

ON (paam.business_unit_id = business_unit.business_unit_id)
LEFT OUTER JOIN
(SELECT aapf.absence_plan_id,
aapft.NAME
FROM anc_absence_plans_f_tl aapft,
anc_absence_plans_f aapf
WHERE aapft.absence_plan_id = aapf.absence_plan_id
AND aapf.plan_status = 'A' -- added to pick only Active Absence Plans
AND trunc(SYSDATE) BETWEEN aapf.effective_start_date AND aapf.effective_end_date
AND trunc(SYSDATE) BETWEEN aapft.effective_start_date AND aapft.effective_end_date
AND aapft.language = 'US'
) absence_plan
ON apaed.pl_id = absence_plan.absence_plan_id
where pl_id = absence_plan.absence_plan_id
and apaed.value <> 0
order by apaed.person_id,apaed.procd_date asc
)A
where person_number = nvl(:pPersonNumber,person_number)
and legal_employer = nvl(:pLegalEmployer,legal_employer)
and business_unit = nvl(:pBusinessUnit,business_unit)
and procd_date >= nvl(:pCalculationDate,procd_date)
and department = nvl(:pDepartment,department)
and full_name = nvl(:pPersonName,full_name)
and absence_plan_name = nvl(:pAbsencePlanName,absence_plan_name)

Navigate to the screen as shown:

56

Under Published Reporting -> Data Model

Create a New Data Set (of SQL Query type) as shown in Screenshot below:

Give a Name to Data Set (for this example say PersonAbsenceAccrualEntryDetails_ds):

57

You would need to take special care while selecting Data Source (Logic Below):
a) If you are Building Finance reports use : ApplicationDB_FSCM
b) If you are Building HCM reports use : ApplicationDB_HCM
c) If you are Building CRM Reports use : ApplicationDB_CRM
For this example we use ApplicationDB_HCM
Depending on the number of Parameters( Bind Variables) used a Popup window will appear as :

58

Click OK. Give a Name to the Parameters as shown below

59

PARAMETER DETAILS :
PARAMETER NAME

DATA TYPE

pLegalEmployer

String

pBusinessUnit

String

pDepartment

String

pAbsencePlanName

String

pCalculationDate
pPersonName

Date
String

60

DEFAULT VALUE

PARAMETER TYPE

Menu ( List of Values Legal Employer)


Menu ( List of Values Business Unit)
Menu ( List of Values Department)
Menu ( List of Values Absence Plan
Name)
Text
Menu ( List of Values Person Name)

ROW PLACEMENT

DISPLAY LABEL

LegalEmployer**
BusinessUnit**
Department**
AbsencePlanName**

CalculationDate**
PersonName**

pPersonNumber

String

Text

PersonNumber**

Create List of Values for Parameters.

LIST OF VALUES
LOV NAME

TYPE

DATA SOURCE

SQL QUERY

Legal Employer

SQL Query

ApplicationDB_HCM

Business Unit

SQL Query

ApplicationDB_HCM

Refer Legal Employer


LOV SQL in LOV SQL
Section
Refer Business Unit
LOV SQL in LOV SQL
Section

ASSOCIATED WITH PARAMETER

61

pLegalEmployer

pBusinessUnit

Department

SQL Query

ApplicationDB_HCM

Absence Plan Name

SQL Query

pLegalEmployer

Person Name

SQL Query

pLegalEmployer

LOV SQL SECTION


This Section shows all the SQL which are used for LOV Creation.

LEGAL EMPLOYER LOV SQL

BUSINESS UNIT LOV SQL

DEPARTMENT LOV SQL

ABSENCE PLAN LOV SQL

62

Refer Department LOV


SQL in LOV SQL Section
Refer Absence Plan
Name LOV SQL in
LOV SQL Section
Refer Person Name LOV
SQL in LOV SQL Section

pDepartment

pAbsencePlanName

pPersonName

PERSON NAME LOV SQL

VIEW DATA :

CLICK ON SAVE AS SAMPLE DATA:

63

CREATE REPORT

Click on Create Report

64

Click Next and Follow Train Stops :

65

Create Table

66

Drag and Drop fields and the Final Report output will look like :

Creating Custom BIP Reports from Static Data


BUSINESS REQUIREMENT
While we all have been accustomed and bored with always creating Data Model using SQL Query we might have missed other options as in this
screen-shot:

67

STEPS
Sample Data is Saved in Local Desktop and uploaded. Once the same is done the screen will appear as

68

FINAL OUTPUT

69

MIGRATION
This Report may be migrated into your specific environment. You would need the below three things :

a) SampleCSVData

SampleCSVData.csv

b) StaticDataBIP ( Data Model)

c) StaticDataBIPReport

70

Chapter 3: OTBI Reports


Gives Brief Description of OTBI Reports
Describes how to create a OTBI Report from Static Data
Also explains creating OTBI Reports from SQL

71

Creating OTBI Reports from Direct Database Query


BUSINESS REQUIREMENT
While we must have been used to creating DRAG and DROP reports using OTBI we might have missed the option of
Create Direct Database Query . In this article lets try to explore the same.
CONTENT
Navigation:
Login to Fusion Applications -> Click on Reports and Analytics -> Click on BI Catalog ( Book Icon) and you reach on this page
Click on Create Direct Database Query

Step 2 :
Provide following details :
CONNECTION POOL : HCM_OLTP.Connection Pool
SQL :

72

select papf.person_number as PersonNumber


from per_all_people_f papf
where rownum < 10
order by papf.person_number desc
EXPECTED SCREEN-PRINT

RESULTS
Click on Results Tab as shown
Results

73

Save Analysis

74

MIGRATING THIS ANALYSIS


Click on Archive option as shown.

75

Archive

Once you click on the Archive Option as shown above a popup window will
appear as shown. Select both the checkbox (this ensures that the same permission and timestamp attached to this analysis is carried forward to the Target instance)

Click Ok and a file gets downloaded to your local desktop. Save it .

76

Click Save. And save the file in a specific location. ( Desktop in this example).
After you save the file in local desktop upload the same to Target Enviornment.
MOVEMENT TO TARGET INSTANCE
Login to Target Instance and Navigate to
Navigator->Reports and Analytics -> BI Catalog -> Shared Folders-> Custom -> <Your Specific Folder where you want to keep this analysis, for this
example Practice Samples>
Screenshot Before Unarchiving the CATALOG File

77

Then Click on Unarchive Option as shown.

78

Unarchive

A Popup window appears as shown below

79

Locate your file and Click Ok

80

CONTD..
HowTo Create Calendar Data Type for a Presentation Variable in OTBI Analysis
Business Requirement
It is a very Common Requirement where-in we need to have a Date Parameter in Reports. Things becomes difficult if the Report is an OTBI one and
the expected Date Parameter is a Date Picker one. By default, what we get is a text field and then we need to ensure that user input should be exactly
as expected by program (generally we guide user via a tooltip). But now we have a workaround explained below:
By default whenever you create a presentation variable it gives the following options for user input

But the requirement is to have a Calendar as a value in drop down list.


Steps:
1) Select the Choice List Option

2) In choice List Values select All Column Values

81

3) Now select any attributes from the Subject Area of Date Type for this example lets choose Start Date from Person Folder (Workforce Management Person Real
Time). Choose Variable Data Type as Date

4) Click Ok.
5) Edit the Prompt Again and now Calendar appears as a User Input in Drop down list

6) Save the changes.


7) The Date Picker appears as desired.

82

Chapter 4: Creating Custom ESS Job in Fusion Applications

83

Creating Custom ESS Job in Fusion Applications

BUSINESS REQUIREMENT
Oracle has already delivered a lot of BIP Reports in the Fusion Instance, however during a course of implementation it is a common requirement to
develop new ones.
CONTENT
There are few common steps involved they are :

b) Create a SQL Query which comprises of DB Tables ( that exist in Fusion Schema).
We have a SQL Query which is as below :
SELECT hdbo.bus_obj_file_discriminator EntityName,fr.key_source_owner SourceSystemOwner, fr.key_source_id SourceSystemId, l.msg_text ErrorMessage,bo.data_file_name,bo.imported_status,bo.validated_status,bo.skipped_status,bo.loaded_status,'Error' DataLoadStatus,'N' DataLoadFlag FROM fusion.hrc_dl_message_lines l , fusion.hrc_dl_data_set_bus_objs bo , fusion.hrc_dl_data_sets ds , fusion.hrc_dl_physical_lines pl , fusion.hrc_dl_file_rows fr , fusion.hrc_dl_file_lines fl , fusion.hrc_dl_business_objects hdbo WHERE l.message_source_table_name = 'HRC_DL_PHYSICAL_LINES' AND bo.data_set_bus_obj_id =
l.data_set_bus_obj_id AND ds.data_set_id = bo.data_set_id AND pl.physical_line_id = l.message_source_line_id AND fr.row_id = pl.row_id AND fl.line_id = fr.line_id
AND hdbo.business_object_id = bo.business_object_id And ds.ucm_content_id = :p_ucm_content_id union SELECT hdbo.bus_obj_file_discriminator EntityName,fr.key_source_owner SourceSystemOwner, fr.key_source_id SourceSystemId, l.msg_text ErrorMessage,bo.data_file_name,bo.imported_status,bo.validated_status,bo.skipped_status,bo.loaded_status,'Error' dataloadstatus,'N' dataloadflag FROM fusion.hrc_dl_message_lines l , fusion.hrc_dl_data_set_bus_objs bo , fusion.hrc_dl_data_sets ds , fusion.hrc_dl_logical_lines ll , fusion.hrc_dl_file_rows fr , fusion.hrc_dl_file_lines fl , fusion.hrc_dl_business_objects hdbo WHERE l.message_source_table_name = 'HRC_DL_LOGICAL_LINES' AND bo.data_set_bus_obj_id = l.data_set_bus_obj_id AND ds.data_set_id = bo.data_set_id AND ll.logical_line_id = l.message_source_line_id AND fr.logical_line_id = ll.logical_line_id AND fl.line_id = fr.line_id AND hdbo.business_object_id = bo.business_object_id
And ds.ucm_content_id = :p_ucm_content_id

SCREEN-SHOT :

84

CREATE A REPORT:

85

86

Give a Name to Data Set (for this example say PersonAbsenceAccrualEntryDetails_ds):

87

You would need to take special care while selecting Data Source (Logic Below):
d) If you are Building Finance reports use : ApplicationDB_FSCM
e) If you are Building HCM reports use : ApplicationDB_HCM
f) If you are Building CRM Reports use : ApplicationDB_CRM
For this example we use ApplicationDB_HCM

Depending on the number of Parameters( Bind Variables) used a Popup window will appear as :

88

Click OK. Give a Name to the Parameters as shown below

89

PARAMETER DETAILS :

PARAMETER NAME

DATA TYPE

pLegalEmployer

String

pBusinessUnit

String

pDepartment

String

pAbsencePlanName

String

pCalculationDate
pPersonName

Date
String

pPersonNumber

String

90

DEFAULT VALUE

PARAMETER TYPE

Menu ( List of Values Legal Employer)


Menu ( List of Values Business Unit)
Menu ( List of Values Department)
Menu ( List of Values Absence Plan
Name)
Text
Menu ( List of Values Person Name)
Text

ROW PLACEMENT

DISPLAY LABEL

LegalEmployer**
BusinessUnit**
Department**
AbsencePlanName**
CalculationDate**
PersonName**
PersonNumber**

Data Model is created. Now we need to check the data retrieved.

. Create List of Values for Parameters.

LIST OF VALUES
LOV NAME

TYPE

DATA SOURCE

SQL QUERY

Legal Employer

SQL Query

ApplicationDB_HCM

Refer Legal Employer


LOV SQL in LOV SQL
Section

ASSOCIATED WITH PARAMETER

91

pLegalEmployer

Business Unit

SQL Query

ApplicationDB_HCM

Department

SQL Query

ApplicationDB_HCM

Absence Plan Name

SQL Query

pLegalEmployer

Person Name

SQL Query

pLegalEmployer

LOV SQL SECTION


This Section shows all the SQL which are used for LOV Creation.

LEGAL EMPLOYER LOV SQL

BUSINESS UNIT LOV SQL

DEPARTMENT LOV SQL

ABSENCE PLAN LOV SQL

92

Refer Business Unit


LOV SQL in LOV SQL
Section
Refer Department LOV
SQL in LOV SQL Section
Refer Absence Plan
Name LOV SQL in
LOV SQL Section
Refer Person Name LOV
SQL in LOV SQL Section

pBusinessUnit

pDepartment

pAbsencePlanName

pPersonName

PERSON NAME LOV SQL

VIEW DATA :

CLICK ON SAVE AS SAMPLE DATA:

93

CREATE REPORT

Click on Create Report

94

Click Next and Follow Train Stops :

95

Create Table

96

Drag and Drop fields and the Final Report output will look like :

97

Chapter 5: Fusion Absence Management


Defines What is Meant by Absence Plan
Explains the same with a Worked Out Example

An Overview of Fusion Absence Management Absence Plan Definition and Use

98

INTRODUCTION

Before we start to understand How to create an Absence Plan first try to understand what an Absence Plan is and why is it required.
In real life Absence Plan holds a different meaning than that of the one meant in Fusion Applications.
In real life Absence Plan for an individual (or for that matter for a Working individual) relates more to a question which is generally asked by his Manager
What are your Absence Plans?
and he would generally respond stating I will be on leave on so and so dates.
But in context with Fusion Applications an Absence Plan (I feel the naming convention isnt correct it should have been called Accrual Plan but that again is incorrect as
Absence Plans are even those which are of qualification and No-Entitlement Type, details about the same in Absence Plan Types Section) could be imagined as a Bucket.
Yes, I mean a Bucket as we know.
Lets for time being say an Absence Plan is an Absence Bucket and I call it as a Bucket as it is supposed to hold:
a) Leave / Absence Balance
Anything and everything around the Entire Absence Plan surrounds around this single piece of information usually called Absence Balance
Different Items related with an Absence Plan and their association with Absence Balance follows:
Absence Plan
A name given to a set of rules / guidelines which define how the absence balance will be assigned and maintained
Legislation
Geography / Country where this Absence Balance is Maintained. For Example, if we are doing Absence Plan setup for India Legislation would be India, if we are doing
for USA it would be United States and so on....
Plan Type
An attribute which defines how the Absence Balance would be calculated / paid.
For example:
If Absence / Leave Balance is paid to employees as a result of an event such as childbirth, illness or injury it is called Qualification Plan Type Absence Plan
Typical Example Being Hospitalization Leave.
If Absence / Leave Balance is paid to employees as a result of accumulation / accrual it is called Accrual Plan Type Absence Plan
Leaves like Annual Leave, Vacation Leave fall into this category

99

If Absence / Leave Balance is paid without having any track, then we referred to them as No-Entitlement Plan Type Absence Plan
Marriage Leave, Compassionate Leave. fall into this category
Plan Term
This is basically the entire time period for which the absence balance has the validity.
For Example
Plan Term: Calendar Year
Start Day: 01
Start Month: 1
Means the Absence Plan will start on 1st day of 1st month (i.e. 1st January) and run till the end of calendar year i.e. 31-Dec
Plan Term: Calendar Year
Start Day: 01
Start Month: 2
Means the Absence Plan will start on 1st day of 2nd month (i.e. 1st February) and run till the end of calendar year i.e. 31-Dec
Plan Term: Calendar Year
Start Day: 05
Start Month: 10

Means the absence Plan will start on 5th day of 10th month (i.e. 5th October) and run till the end of calendar year i.e. 31-Dec
Absence Plan UOM
Unit of Measure which states in which unit (either of Days / Calendar Days / Hours) will this Absence Balance will get measured
Accrual Method
Method of accruing Absence / Leave Balance.
It is of two types:
a) Frontloaded
The Entire Absence Balance is allocated at the beginning of the plan term

100

b) Incremental
The Absence Balance are accrued at regular intervals
Accrual Frequency
Frequency at which accrual happens. It is of two types Person Primary Frequency and Repeating Period.
If person gets his absence / leave balance at the start of payroll period, then the Accrual Frequency is of Person Primary Frequency Type
For Example:
Person Primary Frequency: Weekly
Means he gets paid every week (Employee has a Weekly Payroll Assigned / Attached to him) and same is true for his absence balance too i.e. absence balance is
received every week (in synchronization with his person primary payroll payment frequency).
Person Primary Frequency: Bi-Weekly
Means he gets paid once in row weeks (Employee has a Bi-Weekly Payroll Assigned / Attached to him) and same is true for his absence balance too i.e. absence
balance is received once in two weeks (in synchronization with his person primary payroll payment frequency).
Person Primary Frequency: Monthly
Means he gets paid once a month (Employee has monthly payroll assigned / attached to him) and same is true for his absence balance too i.e. absence balance is
received once a month (in synchronization with his person primary payroll payment frequency).
Person Primary Frequency: Quarterly
Means he gets paid once in quarter (Employee has a Quarterly Payroll Assigned / Attached to him) and same is true for his absence balance too i.e. absence balance
is received once each quarter (in synchronization with his person primary payroll payment frequency).
If person gets his absence / leave balance at the start of each instance of a Specific Repeating Time Period, then Accrual Frequency is of Repeating Time Period
For Example:
Repeating Time Period: Every Quarter of a Calendar year
Means he will accrue this leave once every 3 months in the Calendar Year.
Repeating Time Period: Bi Monthly
Means he will accrue this leave 2 times in a month.
Repeating Time Period: Every Quarter of a Calendar year
Means he will accrue this leave once every 3 months in the Calendar Year.
Repeating Time Period: Monthly

101

Means he will accrue this leave once a month.


Ceiling
This means the maximum Accrual / Leave Balance an employee can accrue / store within a particular accrual term
For Example:
If for a particular Absence Plan the ceiling value is 10
It means that the employee can accrue at max 10 leaves per year. If his balance becomes more than 10 then the same will be forfeited.
If for a particular Absence Plan the ceiling value is 20
It means that the employee can accrue at max 20 leaves per year. If his balance becomes more than 10 then the same will be forfeited.
Carryover
This means the Absence / Leave Balance an employee can carry forward (take along with him) to next accrual term
For Example:
If for a particular Absence Plan has carryover as 50
It means that the employee can carry forward 50 leaves per year. This carry forward value would keep accumulating until ceiling value is reached
So if ceiling is 100 and employee has already carried forward 50 leaves from first year and again 50 from next year then he cannot carry forward leaves for 3rd year.
If for a particular Absence Plan the carryover as 60
It means that the employee can carry forward 60 leaves per year. This carry forward value would keep accumulating until ceiling value is reached
So if ceiling is 100 and employee has already carried forward 50 leaves from first year and again 50 from next year then he cannot carry forward leaves for 3rd year
Vesting Period
This is the Time Period during which Employees can accrue leave but cannot apply leave
For example, if a Plan starts on 1st January and has a vesting period of 1 month then the first leave which an employee can take would be a date after 1st February (1st
January + 1 month). He would anyways be allowed to accrue during the entire January Month
Absence Payment Rate Rule
Method to calculate payment during an Absence Period. (a period when employee is absent from work, but still needs to be paid)
For Example, if a Female Employee is on Maternity Leave for 6 months then at what rate should she be paid.
Final Disbursement Rate Rule
Method to calculate payment of accruals when plan participation ends (An Employee became a Contractor from Regular Employee so his eligibility for Annual Leave
comes to an end, but he has already had a positive balance of say 10. Now if the payroll is integrated with absence then employee needs to be paid for this accrued balance.
This rate talks about the same Disbursement Rate Rule).

102

Discretionary Disbursement Rate Rule


Method to calculate payment when paying out part of accrual balance (An Employee resigns a company and he has a notice period of 30 days, he has served 25 days of
notice period and he has an accrual balance of 10 days. Due to some emergency he has to go to his hometown and he seeks immediate relieving. In this case the company
may decide to deduct his 5 days from Accrual balance and pay for the rest 5 at a discretionary rate).
Liability Rate Rule
Method to calculate cost of accrual balance to determine employer liability (An Employee resigns a company and he has a notice period of 30 days, he has served 25 days
of notice period and he has an accrual balance of 10 days. Due to some emergency he has to go to his hometown and he seeks immediate relieving. In this case the company may decide to deduct his 5 days from Accrual balance and pay for the rest 5 at a discretionary rate and the rest 5 days will be paid at the Liability Rate).

Business Requirement
Now since we are aware of some of the most commonly used terms for an absence plans we should try to create one absence plan. Requirement is to create an Absence
Plan with Absence Plan type as Accrual and Accrual Method as Incremental
We have the following requirement:
Absence Plan Type: Accrual
Accrual Method: Incremental
Accrual UOM: Days
Accrual Values: If Length of Service is < 3 years then Accrue 10 days, have a ceiling of 100 days and carryover of 50 days.
If Length of Service is < 3 years and Length of Service >= 5 years then Accrue 12 days, ceiling of 120 days and carryover of 60
days
If Length of Service is > 5 then Accrue 15 days, have a ceiling of 150 days and carryover of 75 days
Vesting Period: If Legal Employer is Vision Corporation Then Vesting Period is 90 Calendar Days Else Vesting Period is 30 Calendar Days
Absence Payment Rate Rule: Provide a Sickness Rate If the Employee is taking a Leave of Type Sick and Flu else use Hourly Rate
Final Disbursement Rate Rule: If Employee is of Hourly Salaried type use Hourly rate, if he is Regular Employee provide Annual Salary Rate
Discretionary Disbursement Rate Rule: If Employee is of Hourly Salaried type use Hourly rate, if he is Regular Employee provide Annual Salary Rate
Liability Rate Rule: If Employee is of Hourly Salaried type use Hourly rate, if he is Regular Employee provide Annual Salary Rate
We would be using Fast Formula (reasons supporting the same provided alongside) for the following attributes:
**Accrual Values: This can be achieved using an Accrual Matrix but we would like provide maximum flexibility and hence Fast Formula
Vesting Period: This requirement can only be achieved using Fast Formula
**Absence Payment Rate Rule: This requirement could have been met using the Rate Definition option but for flexibility we have used Fast Formula

103

**Final Disbursement Rate Rule: This requirement could have been met using the Rate Definition option but for flexibility we have used Fast Formula
**Discretionary Disbursement Rate Rule: This requirement could have been met using the Rate Definition option but for flexibility we have used Fast Formula
**Liability Rate Rule: This requirement could have been met using the Rate Definition option but for flexibility we have used Fast Formula
**Note: By Allowing Flexibility we mean in case there are additional complex logic in future then we can add the Fast Formula Code in the existing FF defined.

JUSTIFICATIONS FOR USING FAST FORMULAS:


While some might debate that the entire absence plan could well have been setup using standard setups / configurations (and I do agree to that) but the below are specific
reasons for using Fast Formula here:
A) Allows Flexibility of Adding Custom Logic (If required by customer at a Future Date)
Fast Formulas (Details in a separate article) generally allows us to add conditional logics (IF-ELSE constructs) and provide a way to customize the seeded solution.
For Example
Say currently we want to have a condition that if
Employee Category is Hourly then use RateCode as Hourly Rate
Employee Category is Salaried then use RateCode as Salaried
But after few days customer has changed the requirement and now they even want to ensure that any Salaried Employee who has been on leave for most of time
during the year would rather be paid in terms of hours worked (typical example being someone on Leave Without Pay)
IF
Else if
Else

Employee Category is Hourly then use RateCode as Hourly Rate


Employee Category is Salaried and Employee Payroll Status is Currently on Leave without Pay then Hourly Rate ------ new requirement
Employee Category is Salaried and Employee Payroll Status is Active Payroll Eligible then Salaried

end if

Now in order to accommodate the new requirement you would need to create a completely new Absence Plan with new setups and that would have many implications but
if we use Fast Formula this can be achieved by just adding a piece of if-else construct.
B) Absence Plan Migration becomes a little easier
In all implementation projects setups needs to be once done in a Development POD (in EBS we referred them as INSTANCE) , and then the same is migrate to
SIT, UAT , PRE-PROD and then PROD.
IF we use Fast Formula approach migration becomes simpler.

PERQUISITES FOR SETTING UP ABSENCE PLAN ( USING FAST FORMULA APPROACH):

104

You need to create multiple custom fast formula in the system (your POD) in the legislation where you want to create the absence plan.

FAST FORMULA TYPES USED IN THIS EXAMPLE:


There are 4 types of Fast Formula used in this example namely
A)
B)
C)
D)

Global Absence Plan Duration


Global Absence Accrual
Global Absence Vesting Period
Global Absence Plan Use Rate

FAST FORMULA USED IN THIS EXAMPLE:

105

There are 5 Fast Formula used in this example which are:


AH Global Absence Plan Duration Formula
AH Global Absence Accrual Formula
AH Global Absence Vesting Period Formula
AH Global Absence Plan Use Rate Selection Formula 1

AH Global Absence Plan Use Rate Formula2

FORMULA DETAILS

# Formula
Name

Formula
Type

Formula Use

1 AH Global
Absence
Plan Duration Formula

Global Absence Plan


Duration

For Custom Logic to calculate Absence Plan Duration

2 AH Global
Absence Accrual Formula

Global Absence Accrual

Sample Example Below.

Sunday

Any Other Day

Absence Duration (In Hours) = 0

Absence Duration (In Hours) = 8.5 hours

For Custom Logic to calculate Accrual, Ceiling, Carryover.


Sample Example Below.

Length of Service (LOS)


Less than 3 Years

Between 3 to 5 years

More than 5 Years

Accrual Ceiling Carryover Accrual Ceiling Carryover Accrual Ceiling Carryover


10
3 AH Global
Absence
Vesting Period Formula

4 AH Global
Absence
Plan Use
Rate Selection Formula
1

106

Global Absence Vesting Period

Global Absence Plan


Use Rate

100

50

12

120

60

15

150

75

For Custom Logic to calculate Vesting Period


Sample Example Below.

Legal Employer = Vision Corporation

Any Other Legal Employer

Vesting Period = 90 Calendar Days

Vesting Period = 30 Calendar Days

For Custom Logic to fetch the rate code required to pay employee in case of leave disbursement / encashment
Sample Example Below.

Absence Type = Sick / Flu

Any Other Absence Type

Rate Code = Sickness Rate

Rate Code = Hourly Rate

5 AH Global
Absence
Plan Use
Rate Formula2

107

Global Absence Plan


Use Rate

For Custom Logic to fetch the rate code required to pay employee in case of leave disbursement / encashment
Sample Example Below.

Employee Type = Hourly

Employee Type = Salaried

Rate Code = Hourly Rate

Rate Code = Annual Salary Rate

AH GLOBAL ABSENCE PLAN DURATION FORMULA

AH Global Absence Plan Duration Formula


Formula Name

AH Global Absence Plan Duration Formula

Formula Type

Global Absence Plan Duration

Description

If leave falls on a Sunday then the leave hours deducted from leave balance should be
0 for all other cases it should be 8.5 hours

FORMULA TEXT

/************************************************************************************
FORMULA NAME: AH Global Absence Plan Duration Formula
FORMULA TYPE: Global Absence Plan Duration
DESCRIPTION: This sample formula returns the duration based on effective date falls on Sunday.
Change History:

108

Name

Date

Comments

-------------------------------------------------------------------------------------------XXXXXXX

DD-MM-YYYY XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

--------------------------------------------------------------------------------------------

************************************************************************************/
/*================ FORMULA SECTION BEGIN =======================*/

l_date=GET_CONTEXT (EFFECTIVE_DATE,'4712/12/31 00:00:00' (date))


l_weekday=to_char(l_date,'DAY')
If (l_weekday= '7')
then (
duration=0
)
else (
duration=8.5
)
/*================ FORMULA SECTION END =======================*/
return duration

SCREENSHOT

109

110

AH GLOBAL ABSENCE ACCRUAL FORMULA

AH Global Absence Accrual Formula


Formula Name

AH Global Absence Accrual Formula

Formula Type

Global Absence Accrual

Description

This sample formula applies the Accrual, Ceiling, Carryover, Proration Factor, Vesting Units, Vesting UOM, Carryover Proration and Ceiling Proration based on Length
of Service and Accrual Plan the person enrolled into

FORMULA TEXT

/*****************************************************************
FORMULA NAME: AH Global Absence Accrual Formula
FORMULA TYPE: Global Absence Accrual
DESCRIPTION: This sample formula applies the Accrual, Ceiling, CarryOver, Proration Factor, Vesting Units, Vesting UOM, CarryOver Proration and Ceiling Proration
based on Length of Service and Accrual Plan the person enrolled into.
Change History:
Name

Date

Comments

-----------------------------------------------------------------------------------------------------------XXXXXXX

DD-MM-YYYY XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

-----------------------------------------------------------------------------------------------------------*****************************************************************/
/*=========== DATABASE ITEM DEFAULTS BEGIN =====================*/
DEFAULT for PER_ASG_REL_ORIGINAL_DATE_OF_HIRE is '4712/12/31 00:00:00' (date)
DEFAULT for ANC_ABS_PLN_NAME is 'A'

111

DEFAULT for ANC_ABS_PLN_PLAN_UOM is 'H'


/*=========== DATABASE ITEM DEFAULTS ENDS======================*/
/*================ FORMULA SECTION BEGIN =======================*/
l_no_of_days=DAYS_BETWEEN(GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00' (date)),PER_ASG_REL_ORIGINAL_DATE_OF_HIRE)
l_length_of_service=(l_no_of_days/365)

/* check if employee enrolled into this plan or not */


if (ANC_ABS_PLN_NAME='BM_US_ABSENCE_ACCRUAL_PLAN')
then(
if(ANC_ABS_PLN_PLAN_UOM ='H')
then(
if(l_length_of_service <3)
then(
accrual =10
ceiling = 100
carryover=50
prorationFactor=0.25
vestingUnits=40
vestingUOM='C'
carryOverProration=0.25
ceilingProration=0.25
)
else if ((l_length_of_service =>3) and (l_length_of_service<5))
then (
accrual =12
ceiling = 120
carryover=60

112

prorationFactor=0.25
vestingUnits=30
vestingUOM='C'
carryOverProration=0.25
ceilingProration=0.25
)
else if (l_length_of_service =>5)
then (
accrual =15
ceiling = 150
carryover=75
prorationFactor=0.25
vestingUnits=30
vestingUOM='C'
carryOverProration=0.25
ceilingProration=0.25
))
else if (ANC_ABS_PLN_PLAN_UOM ='D')
then(
if (l_length_of_service <3)
then(
accrual =round(10/24,3)
ceiling = round(100/24,3)
carryover=round(50/24,3)
prorationFactor=0.25
vestingUnits=40
vestingUOM='C'

113

carryOverProration=0.25
ceilingProration=0.25
)
else if ((l_length_of_service =>3) and (l_length_of_service<5))
then (
accrual =round(12/24,3)
ceiling = round(120/24,3)
carryover=round(60/24,3)
prorationFactor=0.25
vestingUnits=30
vestingUOM='C'
carryOverProration=0.25
ceilingProration=0.25
)
else if (l_length_of_service =>5)
then (
accrual =round(15/24,3)
ceiling =round(150/24,3)
carryover=round(75/24,3)
prorationFactor=0.25
vestingUnits=30
vestingUOM='C'
carryOverProration=0.25
ceilingProration=0.25
)
)
else if (ANC_ABS_PLN_PLAN_UOM ='W')

114

then(
if (l_length_of_service <3)
then(
accrual =round(10/120,3)
ceiling = round(100/120,3)
carryover=round(50/120,3)
prorationFactor=0.25
vestingUnits=40
vestingUOM='C'
carryOverProration=0.25
ceilingProration=0.25
)
else if ((l_length_of_service =>3) and (l_length_of_service<5))
then (
accrual =round(12/120,3)
ceiling = round(120/120,3)
carryover=round(60/120,3)
prorationFactor=0.25
vestingUnits=30
vestingUOM='C'
carryOverProration=0.25
ceilingProration=0.25
)
else if (l_length_of_service =>5)
then (
accrual =round(15/120,3)
ceiling =round(150/120,3)

115

carryover=round(75/120,3)
prorationFactor=0.25
vestingUnits=30
vestingUOM='C'
carryOverProration=0.25
ceilingProration=0.25
)))
if (ANC_ABS_PLN_NAME='Sickness')
then(
if(ANC_ABS_PLN_PLAN_UOM ='H')
then(
if(l_length_of_service<3)
then(
accrual =12
ceiling = 120
carryover=60
prorationFactor=0.25
vestingUnits=40
vestingUOM='C'
carryOverProration=0.25
ceilingProration=0.25
)
else if ((l_length_of_service =>3) and (l_length_of_service<5))
then (
accrual =13
ceiling = 130
carryover=70

116

prorationFactor=0.25
vestingUnits=30
vestingUOM='C'
carryOverProration=0.25
ceilingProration=0.25
)

else if (l_length_of_service =>5)


then (
accrual =14
ceiling = 160
carryover=80
prorationFactor=0.25
vestingUnits=30
vestingUOM='C'
carryOverProration=0.25
ceilingProration=0.25 ))
else if (ANC_ABS_PLN_PLAN_UOM ='D')
then(
if (l_length_of_service <3)
then(
accrual =round(12/24,3)
ceiling = round(120/24,3)
carryover=round(60/24,3)
prorationFactor=0.25
vestingUnits=40
vestingUOM='C'

117

carryOverProration=0.25
ceilingProration=0.25
)
else if ((l_length_of_service =>3) and (l_length_of_service<5))
then (
accrual =round(13/24,3)
ceiling = round(130/24,3)
carryover=round(70/24,3)
prorationFactor=0.25
vestingUnits=30
vestingUOM='C'
carryOverProration=0.25
ceilingProration=0.25
)
else if (l_length_of_service =>5)
then (
accrual =round(14/24,3)
ceiling =round(160/24,3)
carryover=round(80/24,3)
prorationFactor=0.25
vestingUnits=30
vestingUOM='C'
carryOverProration=0.25
ceilingProration=0.25
))
else if (ANC_ABS_PLN_PLAN_UOM ='W')
then(

118

if (l_length_of_service <3)
then(
accrual =round(12/120,3)
ceiling = round(120/120,3)
carryover=round(60/120,3)
prorationFactor=0.25
vestingUnits=40
vestingUOM='C'
carryOverProration=0.25
ceilingProration=0.25
)
else if ((l_length_of_service =>3) and (l_length_of_service<5))
then (
accrual =round(13/120,3)
ceiling = round(130/120,3)
carryover=round(70/120,3)
prorationFactor=0.25
vestingUnits=30
vestingUOM='C'
carryOverProration=0.25
ceilingProration=0.25
)
else if (l_length_of_service =>5)
then (
accrual =round(14/120,3)
ceiling =round(160/120,3)
carryover=round(80/120,3)

119

prorationFactor=0.25
vestingUnits=30
vestingUOM='C'
carryOverProration=0.25
ceilingProration=0.25
)))
Return accrual, ceiling, carryover, prorationFactor, vestingUnits, vestingUOM, carryOverProration,ceilingProration

SCREENSHOT

120

AH GLOBAL ABSENCE VESTING PERIOD FORMULA

AH Global Absence Vesting Formula


Formula Name

AH Global Absence Vesting Period Formula

Formula Type

Global Absence Vesting Period

Description

This sample formula applies the Ceiling based on employment category. If the Employee belongs to a specific Legal Employer (Vision Corporation for this example)
then his Vesting Period ( Number of Days after which he is allowed to use his accrued leaves) is 90 Calendar Days for any other Legal Employer it is 30

FORMULA TEXT
/********************************************************************

121

FORMULA NAME: AH Global Absence Vesting Period Formula


FORMULA TYPE: Global Absence Vesting Period
DESCRIPTION: This sample formula applies the vesting period based on employment category.
If the Employee belongs to a specific Legal Employer (Vision Corporation for this example)
then his Vesting Period (Number of Days after which he is allowed to use his accrued leaves) is 90 Calendar Days for any other Legal Employer it is 30 Days
Change History:
Name

Date

Comments

----------------------------------------------------------------------------------------------------------------XXXXXXX

DD-MM-YYYY XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

---------------------------------------------------------------------------------------------------------------********************************************************************/
/*==============DATABASE ITEM DEFAULTS BEGIN =====================*/
DEFAULT for PER_ASG_ORG_LEGAL_EMPLOYER_NAME is 'Vision'
/*==============DATABASE ITEM DEFAULTS ENDS======================*/
/*================== FORMULA SECTION BEGIN =======================*/
If (PER_ASG_ORG_LEGAL_EMPLOYER_NAME='Vision Corporation')
then (
vestingUOM = 'C'
vestingUnits=90
)
else(
vestingUOM = 'C'
vestingUnits=30)
/*=================== FORMULA SECTION END =======================*/
return vestingUOM,vestingUnits

SCREENSHOT

122

AH GLOBAL ABSENCE PLAN USE RATE SELECTION FORMULA 1

123

AH Global Absence Plan Use Rate Selection Formula 1


Formula Name

AH Global Absence Plan Use Rate Selection Formula 1

Formula Type

Global Absence Plan Use Rate

Description

This sample formula returns the rate code. We have defined two different rate codes
namely Sickness Rate and Hourly Rate. If an individual chooses either an Absence
Type of Sick or Flu the RateCode is Sickness Rate else its Hourly Rate

FORMULA TEXT

/***********************************************************************
FORMULA NAME: AH Global Absence Plan Use Rate Selection Formula 1
FORMULA TYPE: Global Absence Plan Use Rate
DESCRIPTION: This sample formula returns the rate code.
We have defined two different rate codes namely Sickness Rate and Hourly Rate.
If an individual chooses either an Absence Type of Sick or Flu the RateCode is Sickness Rate else its Hourly Rate.
Change History:
Name

Date

Comments

--------------------------------------------------------------------------------------------------------------------XXXXXXX

DD-MM-YYYY XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

-------------------------------------------------------------------------------------------------------------------***********************************************************************/
/*=========== DATABASE ITEM DEFAULTS BEGINS======================*/
DEFAULT for ANC_ABS_TYP_NAME is 'Sick'
DEFAULT for ANC_ABS_RSN_NAME is 'Cough'
/*=========== DATABASE ITEM DEFAULTS ENDS======================*/
/*================ FORMULA SECTION BEGIN =======================*/

124

if ((ANC_ABS_TYP_NAME='Sick) AND (ANC_ABS_RSN_NAME='Flu'))


then (
rateCode='Sickness Rate'
)
else (
rateCode='Hourly Rate')
/*================ FORMULA SECTION END =======================*/
return rateCode

SCREENSHOT

125

AH GLOBAL ABSENCE PLAN USE RATE FORMULA 2

AH Global Absence Plan Use Rate Formula2


Formula Name

AH Global Absence Plan Use Rate Formula2

Formula Type

Global Absence Plan Use Rate

Decription

This sample formula returns the Plan Use Rate. If an Individual is Paid on Hourly Basis his RateCode will be Hourly else it would be Annual Salary

FORMULA TEXT

/***********************************************************************
FORMULA NAME: AH Global Absence Plan Use Rate Formula2
FORMULA TYPE: Global Absence Plan Use Rate
DESCRIPTION: This sample formula returns the Plan Use Rate. If an Individual is Paid on Hourly Basis his RateCode will be Hourly else, it would be Annual Salary
Change History:
Name

Date

Comments

-------------------------------------------------------------------------------------------XXXXXXX

126

DD-MM-YYYY XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

-------------------------------------------------------------------------------------------***********************************************************************/
/*=========== DATABASE ITEM DEFAULTS BEGIN =====================*/
DEFAULT for PER_ASG_HOURLY_SALARIED_CODE is 'H'
/*=========== DATABASE ITEM DEFAULTS ENDS======================*/
/*=========== FORMULA SECTION BEGIN======================*/
if (PER_ASG_HOURLY_SALARIED_CODE='H')
then (
rateCode='Hourly Rate'
)
else (
rateCode='Annual Salary Rate'
)
/*=========== FORMULA SECTION END======================*/
RETURN rateCode

SCREENSHOTS

127

SETUP STEPS

128

Each absence plan setup requires four Tabs to be filled namely:

a) PLAN ATTRIBUTES
Contains Details about Plan Name, Description, Legislative Data Group, Processing Level, Conversion Formula Attached (used for Absence Duration calculation)

b) PARTICIPATION
Contains Details about Basic Plan Details, Enrollment and Termination Rules

c) ACCRUALS
Contains Details about Accrual Attributes like Accrual Formulas, Payment Percentage, Accrual Method, Accrual Frequency.

d) ENTRIES AND BALANCES


Contains Details about Balance Updates, Rates and Payroll Integrations

129

Navigation is as shown below:

Login to Fusion Applications -> Click on Navigator -> Click on Setup and Maintainenance-> In All Tasks Search for Manage%Absence%Plan

130

Click on Create Button and populate the following details:

LABEL

VALUE

Effective As of Date

09/18/14

Legislation

India

Plan Type

Accrual

You may populate the following screen with above details

131

Populate Plan Attributes Tab:


This Tab Consists of 4 parts which are:

a) General Attributes
b) Plan Term
c) Legislative Information (Optional Used for Populating Legislative Specific Absence Information. Not Applicable in this example)
d) Descriptive Information (Optional Used for Populating DFF Fields If Created for Absence Plan. Not Applicable in this example)

Populate the following details in General Attributes Section as shown below:

General Attributes
LABEL

VALUE

Plan

XX AH Annual Absence Plan IN

Description

Annual Absence Plan Created for India

Plan UOM

Days

Legislative Data Group

IN Legislative Data Group

Status

Active

Enable Concurrent Entitlement

Unchecked

Processing Level

Assignment

Conversion Formula

AH Global Absence Plan Duration Formula

132

Populate the following details in Plan Term Section as shown below:

Plan Term
LABEL

VALUE

Type

Calendar Year

Calendar
Start Month

01

Start Day

Use the above details and populate the Plan Attributes Tab and the screenshot would look like:

133

134

Populate Participation Tab:

This Tab Consists of 2 parts which are:

a) Enrollment Rules
b) Termination Rules
Populate the following details in Enrollment Rules Section as shown below:

Enrollment Rules
LABEL

VALUE

Enrollment Start Rule

As of Event

Waiting Period UOM

Calendar Days

Duration

30

Populate the following details in Termination Rules Section as shown below:

Termination Rules
LABEL

VALUE

Enrollment End Rule

As of Event
On Employment Termination

LABEL

VALUE

Positive Accrual Balances

Checked

Negative Accrual Balance

Checked

135

On Loss of Plan Eligibility


LABEL

VALUE

Disburse Positive Balance

Checked

Recover Negative Balance

Checked

Use the above details and populate the Participation Tab and the screenshot would look like:

136

137

Populate Accruals Tab which consists of Accrual Attributes Section only.


Populate the following details in Accrual Attributes Section as shown below:

Accrual Attributes
LABEL

VALUE

Accrual Definition

Formula

Accrual Formula

AH Global Absence Accrual Formula

Payment Percentage

100%

Accrual Method

Incremental

Partial Accrual Period Formula


Accrual Vesting Rule

Formula

Vesting Period Formula

AH Global Absence Vesting Period Formula

Accrual Frequency Source

Person Primary Frequency

138

Use the above details and populate the Accruals Tab and the screenshot would look like:

139

Populate Entries and Balances Tab.This Tab Consists of 3 Sections which are:

a) Balance Updates
b) Rates
c) Payroll Integration

Populate the following details in Balance Updates Section as shown below:

Balance Updates
LABEL

VALUE

Discretionary Disbursements of Accrual Balance

Checked

Accrual Balance Transfers Across Plans

Checked

Other Adjustments

Checked

Other Adjustment Reasons

Clerical Error , Compensatory

Populate the following details in Rates Section as shown below:

Rates
LABEL

VALUE

Absence Payment Rate Rule

Formula

140

Formula

AH Global Absence Plan Use Rate Selection Formula 1

Final Disbursement Rate Rule

Formula

Formula

AH Global Absence Use Rate Formula2

Discretionary Disbursement Rate Rule

Formula

Formula

AH Global Absence Plan Use Rate Selection Formula 1

Liability Rate Rule

Formula

Formula

AH Global Absence Use Rate Formula2

Populate the following details in Payroll Integration Section as shown below:

Payroll Integration
LABEL

VALUE

Transfer absence payment information


for payroll processing

Checked

Element

Annual Leave

Use the above details and populate the Entries and Balances Tab and the screenshot would look like:

141

If this check

box is not selected (Element field will not show a field value of Annual Leave rather it will be empty)

Once all the above setup is done Absence Plan Creation is complete.

142

An Overview of Fusion Absence Management Part 2 Absence Type Definition and Use

INTRODUCTION
This article is the second part of the series An Overview of Fusion Absence Management.
The first part titled: An overview of Fusion Absence Management Part 1 Absence Plan Definition and Use can be found at Accenture KX Site too.
Before we start to understand How to create an Absence Type first try to understand what a Absence Type is and why is it required.
An absence type as the name suggests refers to different types of absences like Sick Leave, Annual Leave, Vacation Leave, Marriage Leave, Compassionate Leave, Maternity leave, Paternity Leave and you can keep on expanding so on and so forth.
Basically in a nutshell, all the various reasons / events / activities for which a Leave Application may be raised can be treated as Absence Type (context being Fusion
Absence Management).
So before we jump into a typical business requirement and dig deep into how to fulfill the same let-us try to familiarize ourselves with some of the most commonly used
terms which would be referred in the ongoing article:
Absence Pattern
This could be defined as the broad level categorization of different leave types like General Leave, Illness, Injury special leave types.
In context of Fusion Absence Management there are 3 different types of Patterns (available as of today) namely :
a) Childbirth or Placement: Refers to specific leave type Childbirth (Maternity) and Placement ( Specific Assignment)
b) Generic Absence
: Covers the largest scope in terms of leave types. Includes Annual Leave, Vacation Leave, Compensatory Off, Marriage Leave, Optional
Leave, Compassionate Leave etc.
c) Illness or Injury
: As the name suggests leave patterns which depends on an individuals physical condition. This patterns includes Sick Leave,
Hospitalization leave to name a few.

143

Legislation
Geography / Country where this Absence Type is Maintained. For Example if we are doing Absence Type setup for India Legislation would be India , if we are doing for
USA it would be United States and so on....
Absence Type UOM
Unit of Measure which states in which unit (either of Days / Calendar Days / Hours) will this Absence Type will get measured

BUSINESS REQUIREMENT
Now since we are aware of some of the most commonly used terms for an absence types we should try to create one absence type .Requirement is to create an Absence
Type of Pattern Generic Absence.

PERQUISITES:
You need to have an already created Absence Plan available to attach to the absence Type (we did same in Absence Article 1 so we are good) . Also we would assume
that we have an absence reason already created in the application to use.

SETUP STEPS
In this example to keep things simpler we would only discuss about the Mandatory Details required to create an Absence type (fields which are mandatory are generally
highlighted with an asterisk mark beside them), A complete detail of all fields could be covered in next article.

Navigation is as shown below:


Login to Fusion Applications -> Click on Navigator -> Click on Setup and Maintenance-> In All Tasks Search for Manage%Absence%Types

144

Click on Go to Task Button


Click on Create Button and populate the following details:
LABEL
Effective as of Date
Legislation
Pattern

VALUE
9/18/14
India
Generic Absence

You may populate the following screen with above details

145

Each absence plan setup requires four Tabs to be filled namely (screen-shot reference).

a) TYPE ATTRIBUTES
Contains Details about Type Name, Description, UOM, Legislative Data Group, Status, Duration Rules , Absence Record Maintenance, fast formulas Conversion
Formula , Validation Formula along with Eligibility Profile associated with a particular absence type

146

Populate the following values (displayed in tabular format below)

LABEL
Name
Description
UOM
Legislative Data Group
Status

LABEL
Minimum Duration Rule
Maximum Duration Rule
Partial Day Rule

147

General Attributes
VALUE
XX AH Annual Absence Type IN
XX AH Annual Absence Type IN
Calendar Days
India
Active

Duration Rules
VALUE
None
None
Unlimited

b) PLANS AND REASONS


Plans and Reasons ( Absence Plans)

148

LABEL
Plan
Status
Priority

VALUE
XX AH Annual Absence Plan IN
Active
10

Contains Details about Effective Start Date, Plan, Status Priority as shown in below screenshot :

Also select an Absence Reason as shown:

149

Plans and Reasons (Absence Reasons)


LABEL
VALUE
Reason
Annual Leave
Linkage Reason
No
Default
No

150

The page after filling details should look like:

151

c) DISPLAY FEATURES
This page comes with default values populated and for the sake of simplicity let-us keep them as is the page appears as shown below

d) ACTION ITEMS

152

Used to configure any specific actions to be triggered / executed / performed whenever this leave type is applied. Not applicable for current example hence ignored for now. We keep this page as blank as shown below;

Click on Save and Close Button

153

Once all the above setup is done Absence Type Creation is complete.

Chapter 6 - Fusion Fast Formulas

154

155

How-To Create a Global Absence Entry Validation Fast Formula in Fusion Applications

Customer has a requirement where-in they allow only individuals


a) Leave Duration should be wither Half / Full day.
b) This leave is only allowed up-to 3 childrens
c) You can only avail this leave if you have dependent/ adopted children
d) Leave needs to be applied within 1 year of childbirth
Details of the Custom **Error Message and their description below ( In tabular Format)

**All the above Error Messages are defined in 'Manage Messages' under Setup and Maintaineance

/******************************************************************************
FORMULA NAME: A2F_ANC_VALID_Paternity
FORMULA TYPE: Global Absence Entry Validation
DESCRIPTION: This formula returns the Paternity Leave Criteria. Only workers who have less than 3 dependent children are eligible
Change History:
Name Date Comments
----------------------------------------------Ashley Hardy 07-Apr-2015 Initial Version
*******************************************************************************/
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_PERSON_ID IS 0
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_CONTACT_TYPE IS ' '
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_DATE_OF_BIRTH IS '4712/12/31 00:00:00' (date)
DEFAULT_DATA_VALUE for ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR is 0

156

DEFAULT FOR ANC_ABS_ENTRS_ABSENCE_TYPE_ID is 0


/*=========== DATABASE ITEM DEFAULTS END =====================*/
/*================ FORMULA SECTION BEGIN =======================*/
/*==============INPUTS SECTION BEGIN================*/
INPUTS ARE iv_start_date (date),
iv_end_date (date),
IV_TOTALDURATION
/*==============INPUTS SECTION BEGIN================*/
ln_pl_type_id = GET_CONTEXT(ABSENCE_TYPE_ID,0) /* pl stands for Paternity Leave */
ld_child_birth_date = TO_DATE('1951-01-01','yyyy-MM-dd')
ld_start_date = TO_DATE('1951-01-01','yyyy-MM-dd')
j=1
l_new_duration = IV_TOTALDURATION
ln_child_count = 0
ln_rem = MOD(IV_TOTALDURATION,0.5)
IF (ln_rem <> 0)
THEN
(
VALID = 'N'
ERROR_MESSAGE = 'A2F_ANC_SG_ERR_DURCAL' /* 'Leave Duration should either be Half/Full Day.Please change absence start and end dates accordingly' */
RETURN VALID,ERROR_MESSAGE
)
CHANGE_CONTEXTS(START_DATE=iv_start_date, END_DATE=iv_end_date)
(
i=PER_PER_CONTACT_PERSON_ID.FIRST(-1)
WHILE PER_PER_CONTACT_PERSON_ID.exists(i)
LOOP
(
if(PER_PER_CONTACT_CONTACT_TYPE[i] = 'C' or PER_PER_CONTACT_CONTACT_TYPE[i] = 'A')
then
(
ln_child_count = ln_child_count + 1
ld_child_birth_date = PER_PER_CONTACT_DATE_OF_BIRTH[i]
IF ( ld_child_birth_date < PER_PER_CONTACT_DATE_OF_BIRTH[i])
THEN
ld_child_birth_date = PER_PER_CONTACT_DATE_OF_BIRTH[i]
)
i= i+1
)
if(ln_child_count => 3 ) /*ln_child_count > 3*/
THEN
(valid = 'N'
ERROR_MESSAGE = 'A2F_ANC_A2F_ERR_PATERNITY' /*'This leave is only allowed upto 3 childrens'*/
RETURN valid,ERROR_MESSAGE
)

157

if (ln_child_count = 0)
THEN
(VALID = 'N'
ERROR_MESSAGE = 'A2F_ANC_A2F_ERR_PAT_0KIDS' /* 'You can only avail this leave if you have dependent/adopted children' */
RETURN VALID,ERROR_MESSAGE
)
else(
valid='Y'
)
)
CHANGE_CONTEXTS(START_DATE=ld_start_date, END_DATE=IV_START_DATE)
(
WHILE ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR.exists(j)
LOOP
(
CHANGE_CONTEXTS (ABSENCE_ENTRY_ID = ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR[j])
(
IF (ln_pl_type_id = ANC_ABS_ENTRS_ABSENCE_TYPE_ID)
THEN
(
IF (DAYS_BETWEEN(IV_START_DATE,ld_child_birth_date) > 365 OR DAYS_BETWEEN(IV_START_DATE,ld_child_birth_date) < 0)
THEN
(VALID = 'N'
ERROR_MESSAGE = 'A2F_ANC_A2F_FLEX_FROM_CHILDBIRTH' /* This leave needs to be applied within 1 year of chilbirth */
RETURN VALID,ERROR_MESSAGE
)
)
)
j=j+1
)
)
/*================ FORMULA SECTION END =======================*/
return VALID,ERROR_MESSAGE

158

Click on Edit Button and then select Correct as shown :

159

How-To Create a Global Absence Vesting Period Fast Formula in Fusion Applications

BUSINESS REQUIREMENT
Global Absence Vesting Period Formula is used when want to ensure what type of vesting (how long will an employee accrue leave balance) but will
not be allowed to apply for a leave.
For this specific example requirement is:
We have a DFF (Descriptive Flex Field) defined at the assignment screen which holds employee assignment type namely 'Assignee', 'OTP' , 'Resident', 'Resident -Home'.....
The Requirement is:
A) There will be no Vesting Period if
1) the current assignment is First assignment and DFF value is either 'Assignee' , 'OTP' or 'Resident'
OR
2) the current assignment is Global Temporary Assignment and DFF value is either 'Assignee' , 'OTP' or 'Resident'
B) There will be Vesting Period if
1) the current assignment is NOT First assignment and DFF value is neither of 'Assignee' , 'OTP' or 'Resident'
OR
2) the current assignment is NOT Global Temporary Assignment and DFF value is neither of 'Assignee' , 'OTP' or 'Resident'

160

Formula Code :
/********************************************************************
FORMULA NAME: A2F_ANC_AssigneeOTPResident_VESTING_1MONTH
FORMULA TYPE: Global Absence Vesting Period
DESCRIPTION: This sample formula removes the vesting period for Assignee/OTP/Resident
Name Date Comments
----------------------------------------------------------------------------------------------------------------Ashley Hardy 15-Jun-2015 Initial Version
Ashley Hardy 06-Jul-2015 Incorporate Changes Required for 'Global Temporary Assignment'
---------------------------------------------------------------------------------------------------------------********************************************************************/
/*==============DATABASE ITEM DEFAULTS BEGIN =====================*/
DEFAULT for PER_ASG_REL_DATE_START is '1951/01/01 00:00:00' (date)
DEFAULT for PER_ASG_REL_ORIGINAL_DATE_OF_HIRE is '1951/01/01 00:00:00' (date)
DEFAULT for PER_PERSON_ENTERPRISE_HIRE_DATE is '1951/01/01 00:00:00' (date)
DEFAULT FOR PER_ASG_ATTRIBUTE5 IS ' '
DEFAULT FOR PER_ASG_ACTION_CODE is ' '
/*==============DATABASE ITEM DEFAULTS ENDS======================*/

161

/*================== FORMULA SECTION BEGIN =======================*/


IF ((PER_ASG_REL_DATE_START = PER_ASG_REL_ORIGINAL_DATE_OF_HIRE) OR (PER_ASG_ACTION_CODE = 'GLB_TEMP_ASG'))
THEN (
If (PER_ASG_ATTRIBUTE5 = 'Assignee')
OR (PER_ASG_ATTRIBUTE5 = 'OTP')
OR (PER_ASG_ATTRIBUTE5 = 'Resident')
then(
vestingUOM = 'M'
vestingUnits= 0
)
else(
vestingUOM = 'M'
vestingUnits=1
)
) else
(vestingUOM = 'M'
vestingUnits=1 )
/*=================== FORMULA SECTION END =======================*/
return vestingUOM,vestingUnits

Screenshot :

162

Click on Edit Button and then select Correct as shown :

163

Chapter 7 - Fusion HCM Extracts

164

Creating Custom HCM Extracts in Fusion Applications

HCM Extracts and BI / OTBI / OBIA (currently enabled in on premise) are the most commonly used modes via which data can be transferred from
Fusion Applications to 3rd Party System.
While BI Publisher even OTBI and OBIA in same cases allows you to get the specific data set which is being desired by the third party system, we
still need a robust outbound tool / mechanism to cater to all business needs. Some important features being:
a) Dynamic File Name
b) Dynamic File Location
c) Capability to capture Changed Data only feature
d) Capability to provide data into different formats like E-Text, XML, PDF, RTF
While it is agreed all this can be done using BI Publisher ( Using advanced Features like Bursting which allows dynamic file name generation and
also allows encryption too) still for large Data Set and for more coherent integration the preferred and most commonly used mechanism( as of today)
is HCM Extract.
The literal meaning of HCM Extract as the name suggests is HR Output. HR for HCM and Output for Extract so HCM Extract means HR Output
in simple terms i.e. when you get HR Data as Output from Fusion Applications it is called HCM Extract.
Custom HCM Extract Creation: Available Options
There are three available options while creating Custom HCM Extract in a Fusion POD (Application Environment):
A) Import Custom HCM Extract from another Fusion Instance
B) Make a copy of existing delivered extracts. Add/Edit/Delete/Modify/Extend the same and make a Custom HCM Extract
C) Create a Custom HCM Extract from scratch

165

To make things simpler we would try to publish all three categories in three different articles which would be posted soon. The article names (proposed) are:
A) How-to Migrate Custom HCM Extract
B) How-to Make a Copy of Existing Delivered HCM Extracts
C) How-to Create a Custom HCM Extract from scratch.

How-To Migrate Custom HCM Extract in Fusion Applications

Business Requirement
At times we have multiple instances and we intend to move one HCM Extract (created in Development) environment to another instance ( UAT ) or even in Production.
We can use the Export Import feature then.

Export
Login to Fusion Applications, Navigate to Data Exchange and then search for the custom worker extract you wish to export.

166

Click on the Export symbol and xml file gets downloaded as displayed:

IMPORT
Navigate to Data Exchange as displayed:

167

Under Tasks -> HCM Extracts -> Manage Extract Definitions

Click on Import Extract Option

168

A new popup window opens which asks for the File Path as displayed:

169

Give a new name if you wish to

Once the import Process is complete you would be able to search for the Extract:

170

Data Extraction - HCM Extracts or Reporting Tools - Which one to use when and why

In Fusion Applications we have various methods of extracting data. The most popularly used ones being:
a) HCM Extracts
b) Fusion Reporting Tools (BIP, OTBI , OBIA also referred to as OTBI-E)
A very common question for any Technical Consultant is which one of the above mentioned mechanisms (be it either HCM Extracts / BIP / OTBI / OBIA) are used for
extraction.

But before going into the details let us try to understand what the above terms mean :

171

a) BIP
BIP stands for Business Intelligence Publisher
BIP Reports stands for Business Intelligence Publisher Reports
For technical consultant with Reports 6i or more advanced versions it is just a new name given in Fusion Applications.
These kind of reports comprises of :
i)

ii)

Data Model
This is typically a name given to a Data Set which comprises of Data Set (which in turn is a name given to a Data Source which could be with of SQL
Query, LDAP Query, XML Query, Static Data. )
Also has provision of adding separate placeholder columns, formula columns and other features
Layout
This is a page/graphical area which shows how the report would look like.
This can comprise of Table, Letters, Logos, Icons, Images and what not.
Can have repeating and Non-Repeating Segments, XML Tags, Dynamic Values, Summary Columns..
The layout can be any of the output formats like PDF, RTF, Excel, E-text, CSV..

b) OTBI
OTBI Stands for Oracle Transactional Business Intelligence
Typically referred to as Drag and Drop Reporting (similar to Discoverer Reports)
This kind of Reports are created from specific subject areas (basically specific folder structure made up of logical data attributes clubbed together and are associated with some specific areas of application like for Payroll we have Payroll Real Time, Workforce Management Real Time and so on
OTBI Agents are new features which works similar to like ( Oracle Alerts we had in EBS)
Also there are ways to combine 2 different subject areas using a common attribute (named as facts)

c) OBIA
OBIA stands for Oracle Business Intelligence Applications
Pre-seeded Analytics Reports
Details about Trends, Historical Analysis, Predictions
On-Premise Applications has these features enabled
Off late Oracle has planned to release it to Cloud Customers too renaming them as OTBI-E

172

d) HCM Extracts
This is the Oracle recommended way of data transfer from Fusion Applications to other 3rd party systems.
While this tool comprises of:
i)
Define
Comprises of Define Tab (here we name the Extract Names and the parameters)
ii)
Design
This is the section where we define the Extract Definition (HCM Data Objects as well as the Extract Attributes)
iii)
Delivery Options
Different ways of delivery ( File Naming, Output Type, Delivery Frequency , Output Format, Layout ..)

In essence while its not impossible to create data extract for integration from either of the above mentioned options but HCM Extracts is preferred because of
following reasons :

a) It is a mix and match of all above options


Design is OTBI + OBIA (you drag and drop extract attributes and they could be both real time attributes(OTBI) or historical extract attributes(OBIA))
Deliver is BIP ( you create layout, report, template )
Define is again BIP (allows you to have custom parameters)

b) This has DELTA extract features


So each new run can compare itself with previous run (depending on parameter value passed during define extract phase) and provides only the changed data

173

Chapter 8: Other Miscellaneous Topics

174

Fusion Applications User Role Detail Report

FUSION APPLICATIONS USER ROLE DETAIL REPORT


BUSINESS REQUIREMENT:

It is a very common requirement in almost all implementation where in the Stakeholders are interested to know how many user accounts are there is
the system along with the corresponding roles attached to them. While oracle has delivered some seeded Reports which could be run from
Application Diagnostic Framework, screenshot below (Troubleshooting -> Run Diagnostic Tests)

RACLE DELIVERED REPORTS

1) User Roles Display


2) User and Role: Role Details 3) User and Role: User Details

AVIGATION TO RUN DELIVERED REPORTS

Login to Application -> Run Diagnostic Tests

175

After Running Reports :

ELIVERED REPORT 1 -> USER ROLES DISPLAY

User Roles Display: (Displays the Roles attached to procurement user)

Input Value : Sachin.Satpute

176

Output Screenshot :

ELIVERED REPORT 2 -> USER AND ROLE : ROLE DETAILS

User and Role : Role Details


Takes Role Name as input and displays all users who have the role attached to their user account. ( Secured i.e if the individual who is running the
Report has access to a specific Data Set individuals belonging to that Data Set would only be displayed).

Input Value : Employee

177

Output Screenshot :

178

ELIVERED REPORT 3 -> USER AND ROLE : USER DETAILS

User and Role: User Details


Takes User Name as input and displays all roles attached to the user. (Secured i.e. if the individual who is running the Report has access to a
User Account being passed as input data would be displayed else no.)

Input value : Sachin.Satpute

Output Screenshot :

EED FOR A CUSTOM CONSOLIDATED REPORT

But if we need a consolidated report which will list all the users along with all the roles they have neither of the delivered ones help.
So we need a Custom Report (Preferred O/P Format could be RTF, Interactive, Excel, PPT. )
Since we are planning to display a colorful report with Different colour Code Combination (using Conditional Formatting feature we choose
PPT Format for this example)

CUSTOM REPORT NAME -> USER AND ROLE DETAILS REPORT

SED FOR USER AND ROLE DETAILS REPORT

SQL U

select papf.person_number "PersonNumber",


ppnf_emp.full_name "PersonName",
pu_emp.user_start_date "UserAccountStartDate",
pu_emp.user_end_date "UserAccountEndDate",
pu_emp.is_user_account_active "UserAccountStatus",
pu_emp.username "UserAccountName",
pu_emp.is_user_account_suspended "IsUserAccountSuspended",
pu_emp.user_distinguished_name "UserAccountInternalName",
pur_emp.method_code "RoleProvisioningMethod",
pur_emp.is_user_role_active "IsUserRoleActive",
pur_emp.is_user_role_terminated "IsUserRoleTerminated",
Case

When (pur_emp.is_user_role_active = 'Yes' AND pur_emp.is_user_role_terminated = 'No' ) Then 'Active'


When (pur_emp.is_user_role_active =
'No' AND pur_emp.is_user_role_terminated = 'No') Then 'NeitherActiveNorTerminated'
When (pur_emp.is_user_role_active = 'Yes' AND pur_emp.is_user_role_terminated = 'Yes') Then 'ActiveAndTerminated'
When (pur_emp.is_user_role_active = 'No' AND pur_emp.is_user_role_terminated = 'Yes' ) Then
'InactiveAndNotTerminated' End as "UserRoleStatus",
pur_emp.role_start_date
"UserRoleStartDate",
pur_emp.role_end_date "UserRoleEndDate",
prd_emp.abstract_role "IsRoleAAbstractRole",
prd_emp.job_role
"IsRoleAJobRole",
prd_emp.data_role
"IsRoleADataRole",
prd_emp.is_role_active "IsRoleActive",
Case
When (prd_emp.abstract_role = 'Y' AND prd_emp.job_role = 'N' AND prd_emp.data_role = 'N' ) Then 'Abstract Role'
When (prd_emp.abstract_role = 'N' AND prd_emp.job_role = 'Y' AND prd_emp.data_role = 'N' ) Then 'Job Role'
When (prd_emp.abstract_role = 'N'
AND prd_emp.job_role = 'N' AND prd_emp.data_role = 'Y' ) Then 'Data Role'
When (prd_emp.abstract_role is NULL AND prd_emp.job_role is NULL AND prd_emp.data_role is NULL ) Then '-NA--'
End as "UserRoleType",
prd_emp.role_common_name "RoleCommonName",
prd_emp.multitenancy_common_name "MultitenancyCommonName",
prd_emp.role_distinguished_name "IsRoleDistinguishedName",
prdt_emp.role_name
"UserRoleName",
prdt_emp.RoleDescription
FROM per_all_people_f papf
JOIN
(
SELECT ppnf.full_name,
ppnf.person_id
FROM per_person_names_f ppnf
WHERE ppnf.name_type = 'GLOBAL'
AND TRUNC(SYSDATE) BETWEEN ppnf.effective_start_date AND ppnf.effective_end_date
) ppnf_emp ON (
ppnf_emp.person_id = papf.person_id
AND TRUNC(SYSDATE) BETWEEN papf.effective_start_date AND papf.effective_end_date
)
LEFT OUTER JOIN
(
SELECT pu.person_id,
pu.user_id,
pu.username,
to_char(pu.start_date,'DD-MM-RRRR') user_start_date,
to_char(pu.end_date,'DD-MM-RRRR') user_end_date,
DECODE(pu.active_flag,'N','Inactive','Y','Active') is_user_account_active,
DECODE(pu.suspended,'N','No','Y','Yes') is_user_account_suspended,
pu.user_distinguished_name
FROM per_users pu
) pu_emp
ON (pu_emp.person_id = papf.person_id AND TRUNC(SYSDATE) BETWEEN papf.effective_start_date AND papf.effective_end_date)
LEFT OUTER JOIN
(
SELECT pur.user_id,
pur.role_id,
pur.role_guid,
DECODE(pur.method_code,'A','Automatic','M','Manually','E','Externally Provisioned') method_code,
DECODE(pur.active_flag,'N','No','Y','Yes') is_user_role_active,
DECODE(pur.terminated_flag,'N','No','Y','Yes')
is_user_role_terminated,
to_char(pur.start_date,'DD-MM-RRRR') role_start_date,
to_char(pur.end_date,'DD-MMRRRR') role_end_date
FROM per_user_roles pur
) pur_emp
ON (pu_emp.user_id = pur_emp.user_id)
JOIN
(
SELECT prd.role_id,
prd.role_guid,
prd.abstract_role,
prd.job_role,
prd.data_role,
DECODE(prd.active_flag,'N','No','Y','Yes') is_role_active,
prd.role_common_name,

180

prd.multitenancy_common_name,
prd.role_distinguished_name
FROM per_roles_dn prd
) prd_emp
ON (pur_emp.role_id = prd_emp.role_id AND pur_emp.role_guid = prd_emp.role_guid)
JOIN
(
SELECT prdt.role_id,
prdt.role_name,
prdt.description RoleDescription,
prdt.source_lang
FROM
per_roles_dn_tl prdt
) prdt_emp
ON (prd_emp.role_id = prdt_emp.role_id AND pur_emp.role_id = prdt_emp.role_id AND prdt_emp.source_lang = 'US' )
WHERE papf.person_number = nvl(:pn_person_number, papf.person_number)
AND TRUNC (SYSDATE) BETWEEN papf.effective_start_date AND papf.effective_end_date

ONDITIONAL FORMATTING

The different colour code feature can be added using the Conditional Formatting fields (Highlight and Manage Formats)

181

EPORT OUTPUT

SCHEDULING THE

182

R EPORT

Scheduling the Report:

ESS J

183

OB CREATION

SCHEDULED OUTPUT ( PPT F ORMAT )

PARAMETER D EFINITION

R UNNING SCHEDULED J OB

184

UNNING SCHEDULED JOB FOR ONE PERSON

Person Number: 10

185

186

FusionAbsenceManagementREL92-SampleFastFormulas
/******************************************************************************

FORMULA NAME: XX_ANC_ACCRUAL_XX_ExtendedChildCare


FORMULA TYPE: Global Absence Accrual
DESCRIPTION: This formula returns the accrual for employees enrolled in Extended Child Care Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 10-Apr-2015 Initial Version


*******************************************************************************/

DEFAULT FOR PER_ASG_FTE IS 1


DEFAULT FOR PER_REL_ORIGINAL_DATE_OF_HIRE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR PER_REL_ACTUAL_TERMINATION_DATE IS '4712/12/31 00:00:00' (date)

ln_accrual = 0
ld_effective_date=PER_REL_ORIGINAL_DATE_OF_HIRE ld_emp_term_date =PER_REL_ACTUAL_TERMINATION_DATE ld_current_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00' (date)) ld_term_start_date = TO_DATE('01-01-'||TO_CHAR(ld_effective_date, 'rrrr'),'dd-mm-rrrr') ld_term_end_date = TO_DATE('31-12'||TO_CHAR(ld_effective_date, 'rrrr'),'dd-mm-rrrr') ld_term_duration = DAYS_BETWEEN (ld_term_end_date, ld_term_start_date) ld_hire_year = TO_NUMBER(TO_CHAR(ld_effective_date,'rrrr')) ld_curr_year = TO_NUMBER(TO_CHAR(ld_current_date,'rrrr'))

accrual = 0
IF (ld_curr_year = ld_hire_year)
THEN
(
IF (TO_NUMBER(TO_CHAR(ld_effective_date,'MM')) < 7)
THEN
(
accrual = 2
)
IF (TO_NUMBER(TO_CHAR(ld_effective_date,'MM')) >= 7 AND TO_NUMBER(TO_CHAR(ld_effective_date,'MM')) <= 12) THEN
(
accrual = 1
)
)

187

IF (ld_curr_year > ld_hire_year)


THEN
(accrual = 2)

ceiling = 2
carryover=0 vestingUnits=3 vestingUOM='M'

RETURN accrual,ceiling,carryover,vestingUnits,vestingUOM

/******************************************************************************
FORMULA NAME: XX_ANC_ACCRUAL_XX_FamilyLeave
FORMULA TYPE: Global Absence Accrual
DESCRIPTION: This formula returns the accrual for employees enrolled Family Leave Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 10-Apr-2015 Initial Version


*******************************************************************************/

DEFAULT FOR PER_ASG_FTE IS 1


DEFAULT FOR PER_REL_ORIGINAL_DATE_OF_HIRE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR PER_REL_ACTUAL_TERMINATION_DATE IS '4712/12/31 00:00:00' (date)

ln_accrual = 0

ld_effective_date=PER_REL_ORIGINAL_DATE_OF_HIRE ld_emp_term_date =PER_REL_ACTUAL_TERMINATION_DATE


ld_current_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00' (date)) ld_term_start_date = TO_DATE('01-01-'||TO_CHAR(ld_effective_date, 'rrrr'),'dd-mmrrrr') ld_term_end_date = TO_DATE('31-12-'||TO_CHAR(ld_effective_date, 'rrrr'),'dd-mm-rrrr') ld_term_duration = DAYS_BETWEEN (ld_term_end_date, ld_term_start_date)
ld_hire_year = TO_NUMBER(TO_CHAR(ld_effective_date,'rrrr')) ld_curr_year = TO_NUMBER(TO_CHAR(ld_current_date,'rrrr'))

accrual = 0
IF (ld_curr_year = ld_hire_year)
THEN
(
IF (TO_NUMBER(TO_CHAR(ld_effective_date,'MM')) < 7)
THEN
(
188

accrual = 2
)
IF (TO_NUMBER(TO_CHAR(ld_effective_date,'MM')) >= 7 AND TO_NUMBER(TO_CHAR(ld_effective_date,'MM')) <= 12) THEN
(
accrual = 1
)
)

IF (ld_curr_year > ld_hire_year)


THEN
(accrual = 2)

ceiling = 2
carryover=0 vestingUnits=3
vestingUOM='M'

RETURN accrual,ceiling,carryover,vestingUnits,vestingUOM

/******************************************************************************
FORMULA NAME: XX_ANC_ACCRUAL_XX_ChildCare
FORMULA TYPE: Global Absence Accrual
DESCRIPTION: This formula returns the accrual for employees enrolled in Child Care Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 10-Apr-2015 Initial Version


*******************************************************************************/

DEFAULT FOR PER_ASG_FTE IS 1


DEFAULT FOR PER_REL_ORIGINAL_DATE_OF_HIRE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR PER_REL_ACTUAL_TERMINATION_DATE IS '4712/12/31 00:00:00' (date)

ln_accrual = 0

189

ld_effective_date=PER_REL_ORIGINAL_DATE_OF_HIRE ld_emp_term_date =PER_REL_ACTUAL_TERMINATION_DATE ld_current_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00' (date)) ld_term_start_date = TO_DATE('01-01-'||TO_CHAR(ld_effective_date, 'rrrr'),'dd-mm-rrrr') ld_term_end_date = TO_DATE('31-12'||TO_CHAR(ld_effective_date, 'rrrr'),'dd-mm-rrrr') ld_term_duration = DAYS_BETWEEN (ld_term_end_date, ld_term_start_date) ld_hire_year = TO_NUMBER(TO_CHAR(ld_effective_date,'rrrr'))
ld_curr_year = TO_NUMBER(TO_CHAR(ld_current_date,'rrrr'))

accrual = 0
IF (ld_curr_year = ld_hire_year)
THEN
(
IF (TO_NUMBER(TO_CHAR(ld_effective_date,'MM')) < 7)
THEN
(
accrual = 6
)
IF (TO_NUMBER(TO_CHAR(ld_effective_date,'MM')) >= 7 AND TO_NUMBER(TO_CHAR(ld_effective_date,'MM')) <= 12) THEN
(
accrual = 3
)
)

IF (ld_curr_year > ld_hire_year)


THEN
(accrual = 6)

ceiling = 6
carryover=0 vestingUnits=3
vestingUOM='M'

RETURN accrual,ceiling,carryover,vestingUnits,vestingUOM

/******************************************************************************
FORMULA NAME: XX_ANC_GET_OFFLIEU_INDIVIDUAL_LEAVE_BALANCE
FORMULA TYPE: Global Absence Accrual
DESCRIPTION: This formula returns the leave balance for Off-in-Lieu (Individually earned) Change History:
190

Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 20-Apr-2015 Initial Version


*******************************************************************************/

INPUTS ARE IV_PERSON_ID,IV_TERM_ID,IV_EFF_DT (DATE)

ld_current_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00' (date))

L_Leave_Balance = 0
ln_off_per_plan_id = 300000001752614

/* Accrual Plan Id for Off-in-Lieu (Individually earned)*/

L_Term_Id = IV_TERM_ID
L_Person_Id = IV_PERSON_ID
L_Eff_Dt = IV_EFF_DT

CHANGE_CONTEXTS(ACCRUAL_PLAN_ID = ln_off_per_plan_id,HR_ASSIGNMENT_ID = L_Term_Id,PERSON_ID = L_Person_Id,EFFECTIVE_DATE =L_Eff_Dt )

(
L_Leave_Balance = GET_ACCRUAL_BALANCE()
)
return L_Leave_Balance

/******************************************************************************
FORMULA NAME: XX_ANC_GET_OFFLIEU_PUBLIC_LEAVE_BALANCE
FORMULA TYPE: Global Absence Accrual
DESCRIPTION: This formula returns the leave balance for Off-in-Lieu (Public Holiday) Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 20-Apr-2015 Initial Version


*******************************************************************************/

INPUTS ARE IV_PERSON_ID,IV_TERM_ID,IV_EFF_DT (DATE)

ld_current_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00' (date))


191

L_Leave_Balance = 0
ln_off_public_plan_id = 300000001752613

/* Accrual Plan Id for Off-in-Lieu (Public Holiday)*/ L_Term_Id = IV_TERM_ID

L_Person_Id = IV_PERSON_ID
L_Eff_Dt = IV_EFF_DT

CHANGE_CONTEXTS(ACCRUAL_PLAN_ID = ln_off_public_plan_id,HR_ASSIGNMENT_ID = L_Term_Id,PERSON_ID = L_Person_Id,EFFECTIVE_DATE =L_Eff_Dt )

(
L_Leave_Balance = GET_ACCRUAL_BALANCE()
)
return L_Leave_Balance

/******************************************************************************
FORMULA NAME: XX_ANC_GET_ANNUAL_LEAVE_BALANCE
FORMULA TYPE: Global Absence Accrual
DESCRIPTION: This formula returns the leave balance for Annual Leave - Non Manager Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 20-Apr-2015 Initial Version


*******************************************************************************/

INPUTS ARE IV_PERSON_ID,IV_TERM_ID,IV_EFF_DT (DATE)

ln_accrual = 0

ld_current_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00' (date))

L_Leave_Balance = 0
ln_annual_accrual_plan_id = 300000001752602 /*Accrual Plan Id for Annual Leave Plan (Non- Manager) */
L_Term_Id = IV_TERM_ID
L_Person_Id = IV_PERSON_ID
L_Eff_Dt = IV_EFF_DT

CHANGE_CONTEXTS(ACCRUAL_PLAN_ID = ln_annual_accrual_plan_id,HR_ASSIGNMENT_ID = L_Term_Id,PERSON_ID = L_Person_Id,EFFECTIVE_DATE =L_Eff_Dt )


192

(
L_Leave_Balance = GET_ACCRUAL_BALANCE()
)
return L_Leave_Balance

/*******************************************************************
FORMULA NAME: XX_ANC_XX_ACCMAT_Annual
FORMULA TYPE: Global Absence Accrual Matrix
DESCRIPTION: This sample formula will find the weighted average of the Accrual value based on the number of the days the employee was eligible in a particular band. For example, I an employee has changed from Band 1 to Band 2 on 03Mar-2014 and accrual value for Band 1 and Band 2 is 100 and 200 respectively. The formula will return: accrual =
(100*(number of days employee in Band1) + 200*(number of days Employee in Band 2))/365 Change History:
Name

Date

Comments

-------------------------------------------------------------------------------------------------------------------Ashish Harbhajanka

12-May-2015

Initial Version

-------------------------------------------------------------------------------------------------------------------***********************************************************************/
/*=========== DATABASE ITEM DEFAULTS BEGIN =====================*/
DEFAULT for PER_ASG_REL_ORIGINAL_DATE_OF_HIRE is '4712/12/31 00:00:00' (date)
Default for IV_BAND_CHG_DT1 is '1951/01/01 00:00' (date)
Default for IV_BAND_CHG_DT2 is '1951/01/01 00:00' (date)
DEFAULT for IV_ACCRUALPERIODSTARTDATE is '4712/12/31 00:00:00' (date)
DEFAULT for IV_ACCRUALPERIODENDDATE is '4712/12/31 00:00:00' (date) Default for IV_BAND_CHG_BEFVAL1 is 15
Default for IV_BAND_CHG_AFTVAL1 is 18
Default for IV_BAND_CHG_AFTVAL2 is 21
DEFAULT FOR PER_ASG_PERSON_NUMBER IS 'X'
Default for IV_CEILING is 0
Default for IV_CARRYOVER is 0
Inputs are
IV_ACCRUAL,IV_BAND_CHG_DT1,IV_BAND_CHG_DT2,IV_BAND_CHG_BEFVAL1,IV_BAND_CHG_AFTVAL1,IV_BAND_CHG_BEFVAL2,IV_BAND_CHG_AFTVAL2,
IV_CARRYOVER,IV_CEILING,IV_ACCRUALPERIODSTARTDATE,IV_ACCRUALPERIODENDDATE
/*=========== DATABASE ITEM DEFAULTS ENDS======================*/
/*================ FORMULA SECTION BEGIN =======================*/

ld_effective_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00' (date)) ld_term_start_date = TO_DATE('01-01-'||TO_CHAR(ld_effective_date, 'rrrr'),'dd-mm-rrrr')


ld_term_end_date = TO_DATE('31-12-'||TO_CHAR(ld_effective_date, 'rrrr'),'dd-mm-rrrr')
193

ld_band1_end_date = ADD_YEARS(PER_ASG_REL_ORIGINAL_DATE_OF_HIRE,3) ld_band2_end_date = ADD_YEARS(PER_ASG_REL_ORIGINAL_DATE_OF_HIRE,6) accrual = IV_ACCRUAL

l_log = ess_log_write('***********************START********************************') l_log = ess_log_write('PERSON_NUMBER : '|| PER_ASG_PERSON_NUMBER)


l_log = ess_log_write('ld_effective_date : '|| TO_CHAR(ld_effective_date,'DD-MM-YYYY')) l_log = ess_log_write('ld_band1_end_date : '|| TO_CHAR(ld_band1_end_date,'DD-MMYYYY')) l_log = ess_log_write('ld_band2_end_date : '|| TO_CHAR(ld_band2_end_date,'DD-MM-YYYY')) l_log = ess_log_write('IV_BAND_CHG_BEFVAL1 : '||
TO_CHAR(IV_BAND_CHG_BEFVAL1)) l_log = ess_log_write('IV_BAND_CHG_AFTVAL1 : '|| TO_CHAR(IV_BAND_CHG_AFTVAL1)) l_log =
ess_log_write('IV_BAND_CHG_AFTVAL2 : '|| TO_CHAR(IV_BAND_CHG_AFTVAL2))
l_log = ess_log_write('Initial Accrual : '|| TO_CHAR(IV_ACCRUAL)) l_log = ess_log_write('Accrual Period Start Date : '|| TO_CHAR(IV_ACCRUALPERIODSTARTDATE,'DD-MON-RRRR'))
l_log = ess_log_write('Accrual Period End Date : '|| TO_CHAR(IV_ACCRUALPERIODENDDATE,'DD-MON-RRRR')) l_log =
ess_log_write('***********************END********************************')

IF (TO_CHAR(ld_effective_date,'YYYY') = TO_CHAR(ld_band1_end_date,'YYYY')) /* (TO_CHAR(ld_effective_date,'YYYY') = TO_CHAR(IV_BAND_CHG_DT1,'YYYY')) */


THEN
(
l_log = ess_log_write('Within Band 1')
l_no_of_ds1 = DAYS_BETWEEN(ld_band1_end_date,ld_term_start_date) + 1
= DAYS_BETWEEN(ld_term_end_date,ld_band1_end_date) + 1
l_log = ess_log_write('l_no_of_ds2 : '|| TO_CHAR(l_no_of_ds2))

l_log = ess_log_write('l_no_of_ds1 : '|| TO_CHAR(l_no_of_ds1))

l_no_of_ds2

l_no_of_ds3 = 0

l_log = ess_log_write('IV_BAND_CHG_BEFVAL1 : '|| TO_CHAR(IV_BAND_CHG_BEFVAL1)) l_log = ess_log_write('IV_BAND_CHG_AFTVAL1 : '||


TO_CHAR(IV_BAND_CHG_AFTVAL1)) l_log = ess_log_write('IV_BAND_CHG_AFTVAL2 : '|| TO_CHAR(IV_BAND_CHG_AFTVAL2))
accrual=(l_no_of_ds1*IV_BAND_CHG_BEFVAL1 + l_no_of_ds2 * IV_BAND_CHG_AFTVAL1 + l_no_of_ds3*IV_BAND_CHG_AFTVAL2)/ 365

l_log = ess_log_write('Accrual : '|| TO_CHAR(accrual))

)
IF (TO_CHAR(ld_effective_date,'YYYY') = TO_CHAR(ld_band2_end_date,'YYYY')) /*(TO_CHAR(ld_effective_date,'YYYY') = TO_CHAR(IV_BAND_CHG_DT2,'YYYY'))*/
THEN
(
l_log = ess_log_write('Within Band 2')

l_no_of_ds1 = 0

l_no_of_ds2 = DAYS_BETWEEN(ld_band2_end_date,ld_term_start_date) + 1
= DAYS_BETWEEN(ld_term_end_date,ld_band2_end_date) + 1

l_log = ess_log_write('l_no_of_ds2 : '|| TO_CHAR(l_no_of_ds2))

l_no_of_ds3

l_log = ess_log_write('l_no_of_ds3 : '|| TO_CHAR(l_no_of_ds3)) l_log = ess_log_write('IV_BAND_CHG_BEFVAL1 : '|| TO_CHAR(IV_BAND_CHG_BEFVAL1))


l_log = ess_log_write('IV_BAND_CHG_AFTVAL1 : '|| TO_CHAR(IV_BAND_CHG_AFTVAL1)) l_log = ess_log_write('IV_BAND_CHG_AFTVAL2 : '||
TO_CHAR(IV_BAND_CHG_AFTVAL2))
accrual=(l_no_of_ds1*IV_BAND_CHG_BEFVAL1 + l_no_of_ds2 * IV_BAND_CHG_AFTVAL1 + l_no_of_ds3*IV_BAND_CHG_AFTVAL2)/ 365
)

l_log = ess_log_write(' Prorated Accrual considered : '|| TO_CHAR(accrual))

194

l_log = ess_log_write('Accrual : '|| TO_CHAR(accrual))

floored_accrual = FLOOR(accrual)
decimal_accrual = accrual - floored_accrual

IF (decimal_accrual < 0.5 )


THEN
accrual = floored_accrual
IF (decimal_accrual >= 0.5)
THEN
accrual = floored_accrual + 1

l_log = ess_log_write(' Final Accrual considered : '|| TO_CHAR(accrual))


carryover = IV_CARRYOVER ceiling = IV_CEILING l_log = ess_log_write(' Carryover : '|| TO_CHAR(IV_CARRYOVER))
Ceiling : '|| TO_CHAR(IV_CEILING)) return accrual,ceiling,carryover

/******************************************************************************
FORMULA NAME: XX_ANC_XXPC_ACCMAT_LongServiceLeave
FORMULA TYPE: Global Absence Accrual Matrix
DESCRIPTION: This formula returns the accrual for employees enrolled into Long Service Leave Change History:
Name

Date

Comments

---------------------------------------------------------------------------Ashish Harbhajanka 21-May-2015 Initial Version


*******************************************************************************/

DEFAULT FOR PER_TERM_REL_LENGTH_OF_SERVICE IS 0


DEFAULT FOR PER_PER_ADD_REGION2 IS ' '
DEFAULT FOR PER_TERM_REL_DATE_START is '4712/12/31 00:00:00' (date)
DEFAULT FOR PER_ASG_REL_DATE_START is '4712/12/31 00:00:00' (date)
DEFAULT FOR PER_ASG_DISPLAY_NAME is ' '
DEFAULT FOR IV_ACCRUAL is 0
DEFAULT FOR IV_CEILING is 0
DEFAULT FOR IV_CARRYOVER is 0

INPUTS are IV_ACCRUAL,IV_CEILING,IV_CARRYOVER

195

l_log = ess_log_write('

ld_effective_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00' (date)) ln_los_years = TRUNC(MONTHS_BETWEEN(ld_effective_date,PER_ASG_REL_DATE_START)/12,2) ln_cons_5years = FLOOR(PER_TERM_REL_LENGTH_OF_SERVICE/5) ln_cons_years =


FLOOR(PER_TERM_REL_LENGTH_OF_SERVICE) - 10 ln_length_of_service = PER_TERM_REL_LENGTH_OF_SERVICE lc_emp_addr_state = PER_PER_ADD_REGION2
ln_assignment_id = GET_CONTEXT(HR_ASSIGNMENT_ID,0) ln_person_id = GET_CONTEXT(PERSON_ID,0)

ln_years_between = TO_NUMBER(TO_CHAR(ld_effective_date,'YYYY')) - TO_NUMBER(TO_CHAR(PER_ASG_REL_DATE_START,'YYYY')) ln_div_floor = FLOOR(ln_years_between/5) ln_div = ln_years_between/5


ln_div_dec = ln_div - ln_div_floor ln_rem = MOD(ln_years_between,5) ln_above10years = ln_years_between - 10
ln_cons_5years_mod = MOD(ln_above10years,5) ln_cons_5years_div = FLOOR(ln_above10years/5) accrual = IV_ACCRUAL
ceiling = IV_CEILING
carryover = IV_CARRYOVER

l_log = ess_log_write('Before IF LOOP ')


l_log = ess_log_write('Start Processing for Person ID : ' || TO_CHAR(ln_person_id)) l_log = ess_log_write('Start Processing for Assignment ID : ' || TO_CHAR(ln_assignment_id))
l_log = ess_log_write('Start Processing for : ' || PER_ASG_DISPLAY_NAME) l_log = ess_log_write('Employee Address State : ' || lc_emp_addr_state) l_log =
ess_log_write('Years of Service : ' || TO_CHAR(ln_years_between)) l_log = ess_log_write('ln_cons_years : ' || TO_CHAR(ln_cons_years)) l_log = ess_log_write('ln_cons_5years : '
|| TO_CHAR(ln_cons_5years)) l_log = ess_log_write('ln_cons_5years_mod : ' || TO_CHAR(ln_cons_5years_mod)) l_log = ess_log_write('ln_cons_5years_div : ' ||
TO_CHAR(ln_cons_5years_div)) l_log = ess_log_write('Accrual : ' || TO_CHAR(accrual))

IF (lc_emp_addr_state = 'New South Wales' or lc_emp_addr_state = 'Queensland' or lc_emp_addr_state = 'Western Australia' or lc_emp_addr_state = 'Victoria')
THEN
(
IF (ln_years_between = 10)
THEN
(
accrual = 325
l_log = ess_log_write('Step 1 : ' || TO_CHAR(accrual))

l_log = ess_log_write('Accrual : ' || TO_CHAR(accrual))

)
IF (ln_years_between > 10 AND ln_cons_5years_mod = 0 AND ln_cons_5years_div > 0)
THEN
(
accrual = 162.5
l_log = ess_log_write('Step 2 : ' || TO_CHAR(accrual))
)
)
ELSE
196

l_log = ess_log_write('Accrual : ' || TO_CHAR(accrual))

(
IF (lc_emp_addr_state = 'South Australia')
THEN
IF (ln_years_between = 10 )
THEN
accrual = 487.5
IF (ln_years_between > 10)
THEN
accrual = 48.75
)

l_log = ess_log_write('After IF LOOP ') l_log = ess_log_write('Employee Address State : ' || lc_emp_addr_state) l_log = ess_log_write('Years of Service : ' ||
TO_CHAR(ln_years_between)) l_log = ess_log_write('ln_cons_years : ' || TO_CHAR(ln_cons_years)) l_log = ess_log_write('ln_cons_5years : ' ||
TO_CHAR(ln_cons_5years)) l_log = ess_log_write('ln_cons_5years_mod : ' || TO_CHAR(ln_cons_5years_mod)) l_log = ess_log_write('ln_cons_5years_div : ' ||
TO_CHAR(ln_cons_5years_div)) l_log = ess_log_write('Accrual : ' || TO_CHAR(accrual))
l_log = ess_log_write('End Processing for Person ID : ' || TO_CHAR(ln_person_id)) l_log = ess_log_write('End Processing for Assignment ID : ' || TO_CHAR(ln_assignment_id))
l_log = ess_log_write('End Processing for : ' || PER_ASG_DISPLAY_NAME)

RETURN accrual,ceiling,carryover
/*'New South Wales', 'Queensland', 'South Australia','Western Australia', 'Victoria'*/

/******************************************************************************
FORMULA NAME: XX_ANC_XX_VALID_Paternity
FORMULA TYPE: Global Absence Entry Validation
DESCRIPTION: This formula returns the Paternity Leave Criteria. Only workers who have less than 3 dependent children are eligible Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 07-Apr-2015 Initial Version


*******************************************************************************/
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_PERSON_ID IS 0
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_CONTACT_TYPE IS ' '
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_DATE_OF_BIRTH IS '4712/12/31 00:00:00' (date)
DEFAULT_DATA_VALUE for ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR is 0
DEFAULT FOR ANC_ABS_ENTRS_ABSENCE_TYPE_ID is 0

197

/*=========== DATABASE ITEM DEFAULTS END =====================*/


/*================ FORMULA SECTION BEGIN =======================*/
/*==============INPUTS SECTION BEGIN================*/
INPUTS ARE iv_start_date (date),
iv_end_date (date),

IV_TOTALDURATION

/*==============INPUTS SECTION BEGIN================*/


ln_pl_type_id = GET_CONTEXT(ABSENCE_TYPE_ID,0) /* pl stands for Paternity Leave */ ld_child_birth_date = TO_DATE('1951-01-01','yyyy-MM-dd') ld_start_date =
TO_DATE('1951-01-01','yyyy-MM-dd')

j=1

l_new_duration = IV_TOTALDURATION
ln_child_count = 0

ln_rem = MOD(IV_TOTALDURATION,0.5)

IF (ln_rem <> 0)
THEN
(
VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_SG_ERR_DURCAL' /* 'Leave Duration should either be Half/Full Day.Please change absence start and end dates accordingly' */
RETURN VALID,ERROR_MESSAGE
)

CHANGE_CONTEXTS(START_DATE=iv_start_date, END_DATE=iv_end_date)
(
i=PER_PER_CONTACT_PERSON_ID.FIRST(-1)

WHILE PER_PER_CONTACT_PERSON_ID.exists(i)

LOOP
(
if(PER_PER_CONTACT_CONTACT_TYPE[i] = 'C' or PER_PER_CONTACT_CONTACT_TYPE[i] = 'A')
(
ln_child_count = ln_child_count + 1

198

then

ld_child_birth_date = PER_PER_CONTACT_DATE_OF_BIRTH[i]

IF ( ld_child_birth_date < PER_PER_CONTACT_DATE_OF_BIRTH[i])


THEN
ld_child_birth_date = PER_PER_CONTACT_DATE_OF_BIRTH[i]
)
i= i+1
)
if(ln_child_count => 3 ) /*ln_child_count > 3*/
THEN
(valid = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_PATERNITY' /*'This leave is only allowed upto 3 childrens'*/

RETURN valid,ERROR_MESSAGE

)
if (ln_child_count = 0)
THEN
(VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_PAT_0KIDS' /* 'You can only avail this leave if you have dependent/adopted children' */

RETURN VALID,ERROR_MESSAGE

)
else(

valid='Y'

CHANGE_CONTEXTS(START_DATE=ld_start_date, END_DATE=IV_START_DATE)
(
WHILE ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR.exists(j)
LOOP
(
CHANGE_CONTEXTS (ABSENCE_ENTRY_ID = ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR[j])
(
IF (ln_pl_type_id = ANC_ABS_ENTRS_ABSENCE_TYPE_ID)
THEN
(
IF (DAYS_BETWEEN(IV_START_DATE,ld_child_birth_date) > 365 OR DAYS_BETWEEN(IV_START_DATE,ld_child_birth_date) < 0) THEN
(VALID = 'N'
199

ERROR_MESSAGE = 'XX_ANC_XX_FLEX_FROM_CHILDBIRTH' /* This leave needs to be applied within 1 year of chilbirth */

RETURN VALID,ERROR_MESSAGE

)
)

)
j=j+1
)
)

/*================ FORMULA SECTION END =======================*/ return VALID,ERROR_MESSAGE


/******************************************************************************
FORMULA NAME: XX_ANC_XX_VALID_Marriage
FORMULA TYPE: Global Absence Entry Validation
DESCRIPTION: This formula returns the Marriage Leave Criteria. Only workers who are single are allowed to use this leave type.This Leave can be availed just once Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 07-Apr-2015 Initial Version


*******************************************************************************/
/*=========== DATABASE ITEM DEFAULTS BEGIN =====================*/

DEFAULT for ANC_ABS_ENTRS_ABSENCE_TYPE_ID is 0


DEFAULT for PER_PER_MARITAL_STATUS is ' '
DEFAULT for ANC_ABS_ENTRS_DURATION is 0
DEFAULT FOR ANC_ABS_ENTRS_ABSENCE_STATUS_CD is ' '
DEFAULT FOR IV_TOTALDURATION is 0

DEFAULT_DATA_VALUE for ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR is 0 DEFAULT for ANC_ABS_ENTRS_ABSENCE_TYPE_ID is 0

/*=========== DATABASE ITEM DEFAULTS END =====================*/


/*================ FORMULA SECTION BEGIN =======================*/
/*==============INPUTS SECTION BEGIN================*/
INPUTS ARE iv_start_date (date),
iv_end_date (date),

200

IV_TOTALDURATION

/*==============INPUTS SECTION BEGIN================*/

l_cuurent_year=to_char(Get_context(EFFECTIVE_DATE, '1999/01/01 12:00:00' (date)),'YYYY')


l_start_date=to_date(l_cuurent_year+'/01/01') l_end_date=to_date(l_cuurent_year+'/12/31') l_absence_type_id=GET_CONTEXT(ABSENCE_TYPE_ID,0) l_current_duration=days_between(iv_end_date,iv_start_date)+1 l_days=0 l_days_duration =0 ln_occurence = 1
l_total_days = 0
l_new_duration = IV_TOTALDURATION
lc_marital_status = PER_PER_MARITAL_STATUS

ln_rem = MOD(IV_TOTALDURATION,0.5)

IF (ln_rem <> 0)
THEN
(
VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_DURCAL' /* 'Leave Duration should either be Half/Full Day.Please change absence start and end dates accordingly' */
RETURN VALID,ERROR_MESSAGE
)

CHANGE_CONTEXTS(START_DATE=l_start_date, END_DATE=l_end_date)
(
i=ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR.FIRST(-1)
LOOP

WHILE ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR.exists(i)

(
CHANGE_CONTEXTS(ABSENCE_ENTRY_ID=ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR[i])
(

if((l_absence_type_id=ANC_ABS_ENTRS_ABSENCE_TYPE_ID) AND (ANC_ABS_ENTRS_ABSENCE_STATUS_CD <> 'ORA_WITHDRAWN'))


(
l_days_duration=ANC_ABS_ENTRS_DURATION
ln_occurence = ln_occurence + 1
)
l_days=l_days_duration+l_days
201

then

i= ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR.NEXT(I,-1)
)
if(ln_occurence > 1)
THEN
(valid = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_FIRST_MARRIAGE' /*'This Leave is allowed only for the First Legal Marriage' */
)
l_total_days = l_days + l_new_duration
if(lc_marital_status <> 'S')

then

(valid='N'

ERROR_MESSAGE = 'XX_ANC_XX_ERR_MARRIAGE_ELIG' /*'Only Single and unmarried workers can avail this leave'*/
)
else(

valid='Y'

/*================ FORMULA SECTION END =======================*/ return VALID,ERROR_MESSAGE


/******************************************************************************
FORMULA NAME: XX_ANC_XX_VALID_FlexMaternity
FORMULA TYPE: Global Absence Entry Validation
DESCRIPTION: This formula returns validates the Flex Maternity Leave entry Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 05-May-2015 Initial Version


*******************************************************************************/
DEFAULT FOR IV_START_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR IV_END_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT_DATA_VALUE for ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR is 0
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_PERSON_ID IS 0
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_CONTACT_TYPE IS ' '
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_DATE_OF_BIRTH IS '4712/12/31 00:00:00' (date)
DEFAULT FOR ANC_ABS_ENTRS_ABSENCE_TYPE_ID is 0

202

RETURN valid,ERROR_MESSAGE

DEFAULT FOR ANC_ABS_MTRNT_ACTUAL_CHILD_BIRTH_DATE IS '4712/12/31 00:00:00' (date)


DEFAULT FOR ANC_ABS_MTRNT_ACTUAL_RETURN_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR ANC_ABS_MTRNT_ACTUAL_DURATION IS 112
DEFAULT FOR ANC_ABS_ENTRS_DURATION IS 0
DEFAULT FOR ANC_ABS_TYP_NAME IS ' '
DEFAULT FOR ANC_ABS_ENTRS_START_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR ANC_ABS_ENTRS_END_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR ANC_ABS_ENTRS_APPROVAL_STATUS_CD is ' '
DEFAULT FOR ANC_ABS_ENTRS_ABSENCE_STATUS_CD is ' '
DEFAULT FOR ANC_ABS_ENTRS_PERSON_ID is 0

INPUTS ARE IV_END_DATE (date), IV_START_DATE (date)

lc_resource_type = 'ASSIGN' ld_period_start_date = IV_START_DATE ld_period_end_date = IV_END_DATE


lc_use_sch_asg = 'Y' lc_use_sch_inh = 'Y' lc_include_noshift = 'N' lc_include_calevents = 'N' lc_calc_units = 'D'
ln_curr_fmla_duration = 0

lc_mat_8weeks = 'Maternity Leave (8 Weeks)' lc_mat_16weeks = 'Maternity Leave (16 weeks)'


ln_fml_type_id = GET_CONTEXT(ABSENCE_TYPE_ID,0) /*fml stands for Flexible Maternity Leave */ l_person_id = GET_CONTEXT(PERSON_ID,0) /* Person ID */
ln_fml_count = 0 ln_counter = 0
ln_child_count = 0

ld_start_date = TO_DATE('1951-01-01','yyyy-MM-dd') ld_end_date = TO_DATE('4712-12-31','yyyy-MM-dd') ld_maternity_end_date = TO_DATE('4712-1231','yyyy-MM-dd') ld_current_date = TO_DATE(GLOBAL_PAY_INTERFACE_EXTRACTION_DATE)


ld_child_birth_date = TO_DATE('1951-01-01','yyyy-MM-dd')

j=1 k=1

CHANGE_CONTEXTS(START_DATE=iv_start_date, END_DATE=iv_end_date)
(
i=PER_PER_CONTACT_PERSON_ID.FIRST(-1)

WHILE PER_PER_CONTACT_PERSON_ID.exists(i)

LOOP
(
IF (PER_PER_CONTACT_CONTACT_TYPE[i] = 'C' )
203

THEN
(
ln_child_count = ln_child_count + 1

/* Logic to fetch Youngest Child Birth Date */


ld_child_birth_date = PER_PER_CONTACT_DATE_OF_BIRTH[i]

IF ( ld_child_birth_date < PER_PER_CONTACT_DATE_OF_BIRTH[i])


THEN
ld_child_birth_date = PER_PER_CONTACT_DATE_OF_BIRTH[i]
)
ELSE
(ln_child_count = ln_child_count)
i= i+1
)
if (ln_child_count = 0)
THEN
(VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_MAT_0KIDS' /* 'You can only avail this leave if you have dependent children' */

RETURN VALID,ERROR_MESSAGE

)
)
CHANGE_CONTEXTS(START_DATE=ld_start_date, END_DATE=ld_end_date)
(
WHILE ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR.exists(j)
LOOP
(
CHANGE_CONTEXTS (ABSENCE_ENTRY_ID = ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR[j])
(
CHANGE_CONTEXTS (ABSENCE_TYPE_ID = ANC_ABS_ENTRS_ABSENCE_TYPE_ID)
(
IF ((ANC_ABS_TYP_NAME = lc_mat_8weeks OR ANC_ABS_TYP_NAME = lc_mat_16weeks) AND (ANC_ABS_ENTRS_ABSENCE_STATUS_CD <> 'ORA_WITHDRAWN'))
THEN (
ln_counter = ln_counter + 1
)

204

)
j=j+1
)
IF (ln_counter = 0)
THEN (VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_FLEX_FROM_MATERNITY' /* You can only avail this leave after availing Maternity Leave (8 weeks / 16 weeks) */
RETURN VALID, ERROR_MESSAGE)

/*
CHANGE_CONTEXTS (ABSENCE_ENTRY_ID = ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR[ln_counter])
(
IF (ANC_ABS_MTRNT_ACTUAL_CHILD_BIRTH_DATE WAS DEFAULTED)
THEN (VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_FLEX_DATEOFBIRTH'
RETURN VALID, ERROR_MESSAGE)

IF (DAYS_BETWEEN(ld_period_start_date, ANC_ABS_MTRNT_ACTUAL_CHILD_BIRTH_DATE) > 365 OR DAYS_BETWEEN(ld_period_start_date, ANC_ABS_MTRNT_ACTUAL_CHILD_BIRTH_DATE) < 0)


THEN (VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_FLEX_FROM_MATERNITY'
RETURN VALID, ERROR_MESSAGE)
ELSE
(ld_maternity_end_date = ANC_ABS_MTRNT_ACTUAL_RETURN_DATE ln_remaining_days = (16 - (ANC_ABS_MTRNT_ACTUAL_DURATION/7)) * 5 ln_fml_available = LEAST(ln_remaining_days, 40))
)
*/
)

CHANGE_CONTEXTS(START_DATE=ld_start_date, END_DATE=IV_START_DATE) /* Removed ld_maternity_end_date to ld_start_date */


(
WHILE ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR.exists(k)
LOOP
(
CHANGE_CONTEXTS (ABSENCE_ENTRY_ID = ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR[k])

205

(
IF (ln_fml_type_id = ANC_ABS_ENTRS_ABSENCE_TYPE_ID) THEN
( ln_fml_count = ln_fml_count + ANC_ABS_ENTRS_DURATION
IF (DAYS_BETWEEN(IV_START_DATE,ld_child_birth_date) > 365 OR DAYS_BETWEEN(IV_START_DATE,ld_child_birth_date) < 0) THEN
(VALID = 'N'
ERROR_MESSAGE = 'FX_ANC_XX_FLEX_FROM_CHILDBIRTH' /* This leave needs to be applied within 1 year of chilbirth */

RETURN VALID,ERROR_MESSAGE

)
)

)
k=k+1
)
)
ln_curr_fmla_duration = GET_PAY_AVAILABILITY (lc_resource_type,
lc_use_sch_inh, lc_include_noshift, lc_include_calevents,

ld_period_start_date,

ld_period_end_date,

lc_use_sch_asg,

lc_calc_units)

ln_fmla_total= ln_curr_fmla_duration + ln_fml_count /* May need to add the current absence duration as required */

IF ln_fmla_total > 56
THEN (VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_FLEX_TOTALDAYS' /* You are only entitled to a maximum of 56 Days of Leaves for this leave type. */
ELSE (VALID = 'Y')

RETURN VALID, ERROR_MESSAGE

/******************************************************************************
FORMULA NAME: XX_ANC_XX_VALID_Unpaid
FORMULA TYPE: Global Absence Entry Validation
DESCRIPTION: This formula validates the Unpaid leave entry for APAC region Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 13-Apr-2015 Initial Version


Ashish Harbhajanka 26-Jun-2015 Added Validation for Annual Leave Plan (Manager) and Annual Leave Plan (DTC Contract)

206

RETURN VALID, ERROR_MESSAGE)

**********************************************************************************************************************/ DEFAULT FOR IV_START_DATE IS '4712/12/31 00:00:00' (date)


DEFAULT FOR IV_END_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT_DATA_VALUE for ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR is 0
DEFAULT for PER_ASG_REL_ORIGINAL_DATE_OF_HIRE is '1951/01/01 00:00:00' (date)
DEFAULT FOR ANC_ABS_ENTRS_ABSENCE_TYPE_ID is 0
DEFAULT FOR ANC_ABS_TYP_NAME IS ' '
DEFAULT FOR ANC_ABS_ENTRS_END_DATE IS '4712/12/31 00:00:00' (date)

INPUTS ARE IV_END_DATE (date), IV_START_DATE (date),IV_TOTALDURATION

lc_annual_name = 'Annual Leave Non Manager'


lc_off_lieu_public_name = 'Off-in-Lieu (Public Holiday)' lc_off_lieu_per_name = 'Off-in-Lieu (Individually earned)' lc_annual_mgr_name = 'Annual Leave Plan
(Manager)'
lc_annual_dtc_contract_name = 'Annual Leave Plan (DTC Contract)'

ld_effective_date = IV_START_DATE ln_person_id =


TEXT(HR_TERM_ID,0)

GET_CONTEXT(PERSON_ID,0) ln_term_id

= GET_CON-

ln_annual_accrual_plan_id = 300000001752602
/*Accrual Plan Id for Annual Leave Plan - Non Manager*/ ln_off_public_plan_id = 300000001752613
/* Accrual Plan Id for Off-in-Lieu (Public
Holiday)*/ ln_off_per_plan_id = 300000001752614
/* Accrual Plan Id for Off-in-Lieu (Individually earned)*/ ln_annual_mgr_accrual_plan_id = 300000001752603 /*Accrual Plan Id for Annual Leave
Plan (Manager) */ ln_annual_dtc_contract_accrual_plan_id = 300000001752605 /*Accrual Plan Id for Annual Leave Plan (DTC Contract) */ ln_annual_leave_balance = 0 ln_off_public_leave_balance = 0
ln_off_per_leave_balance = 0 ln_annual_mgr_leave_balance = 0 ln_annual_dtc_contract_leave_balance = 0 ln_net_balance = 0

ln_rem = MOD(IV_TOTALDURATION,0.5)

IF (ln_rem <> 0)
THEN
(
VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_DURCAL' /* 'Leave Duration should either be Half/Full Day.Please change absence start and end dates accordingly' */
RETURN VALID,ERROR_MESSAGE
)

SET_INPUT('IV_PERSON_ID', ln_person_id)
SET_INPUT('IV_TERM_ID', ln_term_id)
SET_INPUT('IV_EFF_DT', ld_effective_date)

207

EXECUTE('FX_ANC_GET_ANNUAL_LEAVE_BALANCE') ln_annual_leave_balance = GET_OUTPUT('L_Leave_Balance', 0)

SET_INPUT('IV_PERSON_ID', ln_person_id)
SET_INPUT('IV_TERM_ID', ln_term_id)
SET_INPUT('IV_EFF_DT', ld_effective_date)
EXECUTE('FX_ANC_GET_OFFLIEU_PUBLIC_LEAVE_BALANCE') ln_off_public_leave_balance = GET_OUTPUT('L_Leave_Balance', 0)

SET_INPUT('IV_PERSON_ID', ln_person_id)
SET_INPUT('IV_TERM_ID', ln_term_id)
SET_INPUT('IV_EFF_DT', ld_effective_date)
EXECUTE('FX_ANC_GET_OFFLIEU_INDIVIDUAL_LEAVE_BALANCE') ln_off_per_leave_balance = GET_OUTPUT('L_Leave_Balance', 0)

SET_INPUT('IV_PERSON_ID', ln_person_id)
SET_INPUT('IV_TERM_ID', ln_term_id)
SET_INPUT('IV_EFF_DT', ld_effective_date)
EXECUTE('FX_ANC_GET_ANNUAL_MGR_LEAVE_BALANCE') ln_annual_mgr_leave_balance = GET_OUTPUT('L_Leave_Balance', 0)

SET_INPUT('IV_PERSON_ID', ln_person_id)
SET_INPUT('IV_TERM_ID', ln_term_id)
SET_INPUT('IV_EFF_DT', ld_effective_date)
EXECUTE('FX_ANC_GET_ANNUAL_DTC_CONTRACT_LEAVE_BALANCE') ln_annual_dtc_contract_leave_balance = GET_OUTPUT('L_Leave_Balance', 0)

ln_net_balance = ln_annual_leave_balance + ln_off_public_leave_balance + ln_off_per_leave_balance + ln_annual_mgr_leave_balance + ln_annual_dtc_contract_leave_balance

IF (IV_END_DATE <= ADD_MONTHS(PER_ASG_REL_ORIGINAL_DATE_OF_HIRE,1)) THEN


( VALID = 'Y'
ERROR_MESSAGE = ' '
)
else
(
IF (ln_net_balance = 0)
THEN
(VALID = 'Y')
ELSE
208

(VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_MSG_UNPAID' /* 'You can only apply this leave after you have exhausted Annual and Off-in-Lieu Leaves' */
)
)
RETURN VALID, ERROR_MESSAGE

/******************************************************************************
FORMULA NAME: XX_ANC_XX_VALID_SharedParental FORMULA TYPE: Global Absence Entry Validation
DESCRIPTION: This formula returns the Shared Parental Leave Criteria. Only workers who have at least one children are eligible. Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 04-May-2015 Initial Version


*******************************************************************************/
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_PERSON_ID IS 0
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_CONTACT_TYPE IS ' '
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_DATE_OF_BIRTH IS '4712/12/31 00:00:00' (date)
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_DISPLAY_NAME is ' '
DEFAULT FOR GLOBAL_PAY_INTERFACE_EXTRACTION_DATE is '47121231'
DEFAULT_DATA_VALUE for ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR is 0
DEFAULT FOR ANC_ABS_ENTRS_ABSENCE_TYPE_ID is 0

/*=========== DATABASE ITEM DEFAULTS END =====================*/


/*================ FORMULA SECTION BEGIN =======================*/
/*==============INPUTS SECTION BEGIN================*/
INPUTS ARE iv_start_date (date),
iv_end_date (date),

IV_TOTALDURATION

/*==============INPUTS SECTION BEGIN================*/

l_new_duration = IV_TOTALDURATION
ln_child_count = 0

209

ld_effective_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00'(date)) ln_spl_type_id = GET_CONTEXT(ABSENCE_TYPE_ID,0) /*spl stands for Shared Parental
Leave */ ld_child_birth_date = TO_DATE('1951-01-01','yyyy-MM-dd') ld_start_date = TO_DATE('1951-01-01','yyyy-MM-dd')

/*ld_current_date = TO_DATE(DATE_TO_TEXT(GLOBAL_PAY_INTERFACE_EXTRACTION_DATE),'YYYY/MM/DD HH24:MM:SS')*/ ld_current_date = TO_DATE(GLOBAL_PAY_INTERFACE_EXTRACTION_DATE) ln_rem = MOD(l_new_duration,0.5)

j=1

IF (ln_rem <> 0)
THEN
(
VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_DURCAL' /* 'Leave Duration should either be Half/Full Day.Please change absence start and end dates accordingly' */
RETURN VALID,ERROR_MESSAGE
)

VALID = 'Y'

CHANGE_CONTEXTS(START_DATE=iv_start_date, END_DATE=iv_end_date)
(
i=PER_PER_CONTACT_PERSON_ID.FIRST(-1)

WHILE PER_PER_CONTACT_PERSON_ID.exists(i)

LOOP
(
if(PER_PER_CONTACT_CONTACT_TYPE[i] = 'C' or PER_PER_CONTACT_CONTACT_TYPE[i] = 'A')
(
ln_child_count = ln_child_count + 1
ld_child_birth_date = PER_PER_CONTACT_DATE_OF_BIRTH[i]

IF ( ld_child_birth_date < PER_PER_CONTACT_DATE_OF_BIRTH[i])


THEN
ld_child_birth_date = PER_PER_CONTACT_DATE_OF_BIRTH[i]
)

i= i+1

)
if (ln_child_count = 0)
THEN
(VALID = 'N'
210

then

ERROR_MESSAGE = 'XX_ANC_XX_ERR_SHRD_PARENTAL' /* 'Please ensure that you have apply via the Shared Parental Leave Allocation System and upload the letter to HR.' */
RETURN VALID,ERROR_MESSAGE
)
else
VALID = 'Y'
)

CHANGE_CONTEXTS(START_DATE=ld_start_date, END_DATE=IV_START_DATE)
(
WHILE ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR.exists(j) LOOP
(
CHANGE_CONTEXTS (ABSENCE_ENTRY_ID = ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR[j])
(
IF (ln_spl_type_id = ANC_ABS_ENTRS_ABSENCE_TYPE_ID)
THEN
(
IF (DAYS_BETWEEN(IV_START_DATE,ld_child_birth_date) > 365 OR DAYS_BETWEEN(IV_START_DATE,ld_child_birth_date) < 0) THEN
(VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_FLEX_FROM_CHILDBIRTH' /* This leave needs to be applied within 1 year of chilbirth */

RETURN VALID,ERROR_MESSAGE

)
else
VALID = 'Y'
)
)
j=j+1
)
)

return VALID,ERROR_MESSAGE
/*================ FORMULA SECTION END =======================*/

/******************************************************************************
FORMULA NAME: XX_ANC_XX_VALID_ChildCare
FORMULA TYPE: Global Absence Entry Validation
DESCRIPTION: This formula returns the Child Care Leave Criteria. Only workers who have at least one children with age less than 7 years are eligible. Change History:
211

Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 30-Apr-2015 Initial Version


*******************************************************************************/
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_PERSON_ID IS 0
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_CONTACT_TYPE IS ' '
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_DATE_OF_BIRTH IS '4712/12/31 00:00:00' (date)
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_DISPLAY_NAME is ' '
DEFAULT FOR GLOBAL_PAY_INTERFACE_EXTRACTION_DATE is '47121231'

/*=========== DATABASE ITEM DEFAULTS END =====================*/


/*================ FORMULA SECTION BEGIN =======================*/
/*==============INPUTS SECTION BEGIN================*/
INPUTS ARE iv_start_date (date),
iv_end_date (date),

IV_TOTALDURATION

/*==============INPUTS SECTION BEGIN================*/

l_new_duration = IV_TOTALDURATION
ln_child_count = 0
ld_effective_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00'(date)) ld_yngst_child_birth_date = TO_DATE('1951-01-01','yyyy-MM-dd')

/*ld_current_date = TO_DATE(DATE_TO_TEXT(GLOBAL_PAY_INTERFACE_EXTRACTION_DATE),'YYYY/MM/DD HH24:MM:SS')*/ ld_current_date = TO_DATE(GLOBAL_PAY_INTERFACE_EXTRACTION_DATE) ln_rem = MOD(l_new_duration,0.5)

IF (ln_rem <> 0)
THEN
(
VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_DURCAL' /* 'Leave Duration should either be Half/Full Day.Please change absence start and end dates accordingly' */
RETURN VALID,ERROR_MESSAGE
)

212

lc_eligible = 'N'

CHANGE_CONTEXTS(START_DATE=iv_start_date, END_DATE=iv_end_date)
(
i=PER_PER_CONTACT_PERSON_ID.FIRST(-1)

WHILE PER_PER_CONTACT_PERSON_ID.exists(i)

LOOP
(
if(PER_PER_CONTACT_CONTACT_TYPE[i] = 'C' or PER_PER_CONTACT_CONTACT_TYPE[i] = 'A')

then

(
ln_child_count = ln_child_count + 1

/* Adding Condition for Checking Child Age */

ld_child_compare_date = ADD_YEARS(PER_PER_CONTACT_DATE_OF_BIRTH[i],7)

IF (ld_yngst_child_birth_date < ld_child_birth_date)

ld_child_birth_date = PER_PER_CONTACT_DATE_OF_BIRTH[i]

THEN

(
ld_yngst_child_birth_date = ld_child_birth_date
ln_no_of_days = DAYS_BETWEEN(ld_effective_date,ld_child_birth_date)

ln_age = ROUND(ln_no_of_days/365,2)

)
)

i= i+1
)
/*Added by Ashish for Debugging */

/*End of Debugging Section */

if (ln_child_count = 0)

THEN
(VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_PAT_0KIDS' /* 'You can only avail this leave if you have dependent/adopted children' */
)

if (ln_age > 7)
(VALID = 'N'
213

THEN

RETURN VALID,ERROR_MESSAGE

ERROR_MESSAGE = 'XX_ANC_XX_ERR_CHILD_AGE_LESS7' /* You can only avail this leave if your youngest child is less than 7 years of age.'*/
RETURN VALID,ERROR_MESSAGE
)
else(

valid='Y'

/*================ FORMULA SECTION END =======================*/ return VALID,ERROR_MESSAGE

/******************************************************************************
FORMULA NAME: XX_ANC_XX_VALID_ExtendedChildCare FORMULA TYPE: Global Absence Entry Validation
DESCRIPTION: This formula returns the Extended Child Care Leave Criteria.Only workers who have at least one children within age of 7-12 years are eligible. Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 30-Apr-2015 Initial Version


*******************************************************************************/
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_PERSON_ID IS 0
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_CONTACT_TYPE IS ' '
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_DATE_OF_BIRTH IS '4712/12/31 00:00:00' (date)
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_DISPLAY_NAME is ' '
DEFAULT FOR GLOBAL_PAY_INTERFACE_EXTRACTION_DATE is '47121231'

/*=========== DATABASE ITEM DEFAULTS END =====================*/


/*================ FORMULA SECTION BEGIN =======================*/
/*==============INPUTS SECTION BEGIN================*/
INPUTS ARE iv_start_date (date),
iv_end_date (date),

IV_TOTALDURATION

/*==============INPUTS SECTION BEGIN================*/

214

l_new_duration = IV_TOTALDURATION
ln_child_count = 0
ld_effective_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00'(date)) ld_yngst_child_birth_date = TO_DATE('1951-01-01','yyyy-MM-dd')
ln_no_of_days = 0 ln_age = 0 ld_start_date = TO_DATE('1951-01-01','yyyy-MM-dd')
ld_end_date = TO_DATE('4712-12-31','yyyy-MM-dd')

/*ld_current_date = TO_DATE(DATE_TO_TEXT(GLOBAL_PAY_INTERFACE_EXTRACTION_DATE),'YYYY/MM/DD HH24:MM:SS')*/ ld_current_date = TO_DATE(GLOBAL_PAY_INTERFACE_EXTRACTION_DATE)


ln_rem = MOD(l_new_duration,0.5)

IF (ln_rem <> 0)
THEN
(
VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_DURCAL' /* 'Leave Duration should either be Half/Full Day.Please change absence start and end dates accordingly' */
RETURN VALID,ERROR_MESSAGE
)

CHANGE_CONTEXTS(START_DATE=iv_start_date, END_DATE=iv_end_date)
(
i=PER_PER_CONTACT_PERSON_ID.FIRST(-1)

WHILE PER_PER_CONTACT_PERSON_ID.exists(i)

LOOP
(
if(PER_PER_CONTACT_CONTACT_TYPE[i] = 'C' or PER_PER_CONTACT_CONTACT_TYPE[i] = 'A')

then

(
ln_child_count = ln_child_count + 1

/* Adding Condition for Checking Child Age */


ld_child_compare_date = ADD_YEARS(PER_PER_CONTACT_DATE_OF_BIRTH[i],7)

IF (ld_yngst_child_birth_date < ld_child_birth_date)


THEN
(

215

ld_child_birth_date = PER_PER_CONTACT_DATE_OF_BIRTH[i]

ld_yngst_child_birth_date = ld_child_birth_date
ln_no_of_days = DAYS_BETWEEN(ld_current_date,ld_yngst_child_birth_date)

ln_age = ROUND(ln_no_of_days/365,2)

)
)
i= i+1
)
if (ln_child_count = 0)
THEN
(VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_PAT_0KIDS' /* 'You can only avail this leave if you have dependent/adopted children' */

RETURN VALID,ERROR_MESSAGE

)
/*

if (1=1)
THEN
(VALID = 'N'
ERROR_MESSAGE = 'Age of youngest child is : '|| TO_CHAR(ln_age)
RETURN VALID,ERROR_MESSAGE
)

*/
if (ln_age > 7 and ln_age < 12)
THEN
(
VALID = 'Y'
)
else
(
VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_CHILD_AGE_7TO12' /* You can only avail this leave if your youngest child is between 7 to 12 years of age.'*/
RETURN VALID,ERROR_MESSAGE
)
)

/*================ FORMULA SECTION END =======================*/ return VALID,ERROR_MESSAGE

/******************************************************************************
FORMULA NAME: XX_ANC_XX_VALID_Adoption
216

FORMULA TYPE: Global Absence Entry Validation


DESCRIPTION: This formula returns the Adoption Leave Criteria. Only workers who have adopted childrens having age less than a year are eligible. Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 11-May-2015 Initial Version


*******************************************************************************/
/*=========== DATABASE ITEM DEFAULTS BEGIN =====================*/
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_PERSON_ID IS 0
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_CONTACT_TYPE IS ' '
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_DATE_OF_BIRTH IS '4712/12/31 00:00:00' (date)
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_DISPLAY_NAME is ' '
DEFAULT FOR GLOBAL_PAY_INTERFACE_EXTRACTION_DATE is '47121231'
DEFAULT for ANC_ABS_ENTRS_ABSENCE_TYPE_ID is 0
DEFAULT for PER_PER_MARITAL_STATUS is ' '
DEFAULT for ANC_ABS_ENTRS_DURATION is 0
DEFAULT FOR IV_TOTALDURATION is 0

DEFAULT_DATA_VALUE for ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR is 0 DEFAULT for ANC_ABS_ENTRS_ABSENCE_TYPE_ID is 0

/*=========== DATABASE ITEM DEFAULTS END =====================*/


/*================ FORMULA SECTION BEGIN =======================*/
/*==============INPUTS SECTION BEGIN================*/
INPUTS ARE iv_start_date (date),
iv_end_date (date),
IV_TOTALDURATION

/*==============INPUTS SECTION BEGIN================*/

l_cuurent_year=to_char(Get_context(EFFECTIVE_DATE, '1999/01/01 12:00:00' (date)),'YYYY') l_start_date=to_date(l_cuurent_year+'/01/01')


l_end_date=to_date(l_cuurent_year+'/12/31') l_absence_type_id=GET_CONTEXT(ABSENCE_TYPE_ID,0) l_current_duration=days_between(iv_end_date,iv_start_date)+1
l_days=0 l_days_duration =0 ln_occurence = 1
l_total_days = 0
l_new_duration = IV_TOTALDURATION lc_marital_status = PER_PER_MARITAL_STATUS
ln_child_count = 0
217

ld_yngst_child_birth_date = TO_DATE('1951-01-01','yyyy-MM-dd') ln_no_of_days = 0


ld_current_date = TO_DATE(GLOBAL_PAY_INTERFACE_EXTRACTION_DATE)

ln_rem = MOD(IV_TOTALDURATION,0.5)

IF (ln_rem <> 0)
THEN
(
VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_DURCAL' /* 'Leave Duration should either be Half/Full Day.Please change absence start and end dates accordingly' */
RETURN VALID,ERROR_MESSAGE
)

CHANGE_CONTEXTS(START_DATE=iv_start_date, END_DATE=iv_end_date)
(
i=PER_PER_CONTACT_PERSON_ID.FIRST(-1)

WHILE PER_PER_CONTACT_PERSON_ID.exists(i)

LOOP
(
if(PER_PER_CONTACT_CONTACT_TYPE[i] = 'A')

then

(
ln_child_count = ln_child_count + 1

/* Adding Condition for Checking Child Age */

ld_child_birth_date = PER_PER_CONTACT_DATE_OF_BIRTH[i]

IF (ld_yngst_child_birth_date < ld_child_birth_date)


THEN
(
ld_yngst_child_birth_date = ld_child_birth_date
ln_age = ROUND(ln_no_of_days/365,2)
)
)
i= i+1

218

ln_no_of_days = DAYS_BETWEEN(ld_current_date,ld_child_birth_date)

)
if (ln_child_count = 0)
THEN
(VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_ADOPTION_0KIDS' /* 'You can only avail this leave if you have adopted children' */

RETURN VALID,ERROR_MESSAGE

if (ln_age > 1)

THEN

(VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_CHILD_AGE_LESS1' /* You can only avail this leave if your youngest child is less than a year old.'*/
)
else(

valid='Y'

/*================ FORMULA SECTION END =======================*/ return VALID,ERROR_MESSAGE

/******************************************************************************
FORMULA NAME: XX_ANC_VALID_Duration
FORMULA TYPE: Global Absence Entry Validation
DESCRIPTION: This formula checks that the absence duration should either be half/full day.
Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 12-May-2015 Initial Version


*******************************************************************************/

/*=========== DATABASE ITEM DEFAULTS END =====================*/


/*================ FORMULA SECTION BEGIN =======================*/
/*==============INPUTS SECTION BEGIN================*/
INPUTS ARE iv_start_date (date),
219

RETURN VALID,ERROR_MESSAGE

iv_end_date (date),
IV_TOTALDURATION

/*==============INPUTS SECTION BEGIN================*/

l_new_duration = IV_TOTALDURATION
ln_rem = MOD(l_new_duration,0.5)

IF (ln_rem <> 0)
THEN
(
VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_DURCAL' /* 'Leave Duration should either be Half/Full Day.E.g.: Full Day (8.45am 5.45pm / 8am 5pm etc)E.g.: Half Day (8.45am 12.45pm or 1.45pm 5.45pm / 8am 12pm or 1pm
5pm etc)' */ RETURN VALID,ERROR_MESSAGE
)
ELSE
(
VALID = 'Y'
)
RETURN VALID,ERROR_MESSAGE

/******************************************************************************
FORMULA NAME: XX_ANC_XXPC_VALID_Duration
FORMULA TYPE: Global Absence Entry Validation
DESCRIPTION: This formula checks that the absence duration should either be half/full day for FXPC Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 12-May-2015 Initial Version


*******************************************************************************/

/*=========== DATABASE ITEM DEFAULTS END =====================*/


/*================ FORMULA SECTION BEGIN =======================*/

220

/*==============INPUTS SECTION BEGIN================*/


INPUTS ARE iv_start_date (date),
iv_end_date (date),

IV_TOTALDURATION

/*==============INPUTS SECTION BEGIN================*/

l_new_duration = IV_TOTALDURATION
ln_rem = MOD(l_new_duration,0.5)

IF (ln_rem <> 0)
THEN
(
VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_DURCAL_FXPC' /* 'Leave Duration should either be Half/Full Day*/

RETURN VALID,ERROR_MESSAGE

)
ELSE
(
VALID = 'Y'
)
RETURN VALID,ERROR_MESSAGE

/******************************************************************************
FORMULA NAME: XX_ANC_XX_VALID_Maternity
FORMULA TYPE: Global Absence Entry Validation
DESCRIPTION: This formula returns validates the Maternity Leave Criteria. Allowed only if a child is born within 1 year of leave application date Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 14-May-2015 Initial Version


*******************************************************************************/
DEFAULT FOR IV_START_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR IV_END_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT_DATA_VALUE for ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR is 0
DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_PERSON_ID IS 0
221

DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_CONTACT_TYPE IS ' '


DEFAULT_DATA_VALUE FOR PER_PER_CONTACT_DATE_OF_BIRTH IS '4712/12/31 00:00:00' (date)
DEFAULT FOR ANC_ABS_ENTRS_ABSENCE_TYPE_ID is 0
DEFAULT FOR ANC_ABS_MTRNT_ACTUAL_CHILD_BIRTH_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR ANC_ABS_MTRNT_ACTUAL_RETURN_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR ANC_ABS_MTRNT_ACTUAL_DURATION IS 112
DEFAULT FOR ANC_ABS_ENTRS_DURATION IS 0
DEFAULT FOR ANC_ABS_TYP_NAME IS ' '

INPUTS ARE IV_END_DATE (date), IV_START_DATE (date)

ld_period_start_date = IV_START_DATE
ld_period_end_date = IV_END_DATE

ln_ml_type_id = GET_CONTEXT(ABSENCE_TYPE_ID,0) /*ml stands for Maternity Leave */ ln_counter = 0


ln_child_count = 0

ld_start_date = TO_DATE('1951-01-01','yyyy-MM-dd') ld_end_date = TO_DATE('4712-12-31','yyyy-MM-dd') ld_maternity_end_date = TO_DATE('4712-1231','yyyy-MM-dd') ld_current_date = TO_DATE(GLOBAL_PAY_INTERFACE_EXTRACTION_DATE) ld_child_birth_date = TO_DATE('1951-01-01','yyyyMM-dd')

j=1 VALID = 'Y'

CHANGE_CONTEXTS(START_DATE=iv_start_date, END_DATE=iv_end_date)
(
i=PER_PER_CONTACT_PERSON_ID.FIRST(-1)

WHILE PER_PER_CONTACT_PERSON_ID.exists(i)

LOOP
(
IF (PER_PER_CONTACT_CONTACT_TYPE[i] = 'C')
THEN
(
ln_child_count = ln_child_count + 1
222

/* Logic to fetch Youngest Child Birth Date */


ld_child_birth_date = PER_PER_CONTACT_DATE_OF_BIRTH[i]

IF ( ld_child_birth_date < PER_PER_CONTACT_DATE_OF_BIRTH[i])


THEN
ld_child_birth_date = PER_PER_CONTACT_DATE_OF_BIRTH[i]
)
ELSE
(ln_child_count = ln_child_count)
i= i+1
)
if (ln_child_count = 0)
THEN
(VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_ERR_MAT_0KIDS' /* 'You can only avail this leave if you have dependent children' */

RETURN VALID,ERROR_MESSAGE

)
)

CHANGE_CONTEXTS(START_DATE=ld_start_date, END_DATE=IV_START_DATE) /* Removed ld_maternity_end_date to ld_start_date */


(
WHILE ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR.exists(j)
LOOP
(
CHANGE_CONTEXTS (ABSENCE_ENTRY_ID = ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR[j])
(
IF (ln_ml_type_id = ANC_ABS_ENTRS_ABSENCE_TYPE_ID)
THEN
(
IF (DAYS_BETWEEN(IV_START_DATE,ld_child_birth_date) > 365 OR DAYS_BETWEEN(IV_START_DATE,ld_child_birth_date) < 0) THEN
(VALID = 'N'
ERROR_MESSAGE = 'XX_ANC_XX_FLEX_FROM_CHILDBIRTH' /* This leave needs to be applied within 1 year of chilbirth */
)
)

223

RETURN VALID,ERROR_MESSAGE

)
j=j+1
)
)

RETURN VALID, ERROR_MESSAGE

/******************************************************************************
FORMULA NAME: XX_ANC_XX_PARACC_AnnualXXAssignee
FORMULA TYPE: Global Absence Partial Period Accrual Rate
DESCRIPTION: This formula returns the FTE pro-rated partial period accrual for employees enrolled into Annual Leave plan in Singapore Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 20-Apr-2015 Initial Version


Ashish Harbhajanka 16-Jun-2015 Changed Accrual Calculation Basis From Hire Date to Assignment Start Date *******************************************************************************/

DEFAULT FOR PER_REL_ORIGINAL_DATE_OF_HIRE IS '4712/12/31 00:00:00' (date) DEFAULT FOR PER_ASG_REL_DATE_START is '4712/12/31 00:00:00' (date)

ld_term_end_date = TO_DATE('31-12-'||TO_CHAR(PER_REL_ORIGINAL_DATE_OF_HIRE, 'rrrr'),'dd-mm-rrrr')


ld_term_end_date = TO_DATE('31-12-'||TO_CHAR(PER_ASG_REL_DATE_START, 'rrrr'),'dd-mm-rrrr')

/* Added By Ashish on 16-Jun-2015 */ ln_accrual = 0

ln_months = MONTHS_BETWEEN(ld_term_end_date, PER_REL_ORIGINAL_DATE_OF_HIRE)


ln_months = MONTHS_BETWEEN(ld_term_end_date, PER_ASG_REL_DATE_START)
THEN
(ln_accrual = 4)
IF (ln_months >= 3 AND ln_months < 6)
THEN
(ln_accrual = 8)
IF (ln_months >= 6 AND ln_months < 9)
THEN
(ln_accrual = 12)
IF (ln_months >= 9 AND ln_months < 12)
THEN
(ln_accrual = 16)

224

/* Added By Ashish on 16-Jun-2015 */ IF (ln_months < 3)

accrual = ln_accrual vestingUnits=1


vestingUOM='M'

RETURN accrual,vestingUnits,vestingUOM

/***************************************************************************
FORMULA NAME: XX_ANC_PARACC_Annual
FORMULA TYPE: Global Absence Partial Period Accrual Rate Formula
DESCRIPTION: This formula returns the accrual for mid-period enrollments and un-enrollments for Annual Leave plan Change History:
Name

Date

Comments

------------------------------------------------------------------------------Ashish Harbhajanka 25-Feb-2014 Initial Version


Ashish Harbhajanka 16-Jun-2015 Changed Accrual Calculation Basis from Hire Date to Assignment Start Date
*******************************************************************************/

DEFAULT FOR IV_ACCRUAL IS 0


DEFAULT FOR PER_REL_ORIGINAL_DATE_OF_HIRE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR PER_REL_ACTUAL_TERMINATION_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR PER_ASG_REL_DATE_START is '4712/12/31 00:00:00' (date)

INPUTS ARE IV_ACCRUAL,IV_CALEDARSTARTDATE (date),IV_CALEDARENDDATE(date)

ld_emp_hire_date=PER_REL_ORIGINAL_DATE_OF_HIRE ld_emp_hire_date=PER_ASG_REL_DATE_START ld_emp_term_date =PER_REL_ACTUAL_TERMINATION_DATE


ld_effective_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00' (date)) ld_term_start_date = TO_DATE('01-01-'||TO_CHAR(ld_effective_date, 'rrrr'),'dd-mm-rrrr')
ld_term_end_date = TO_DATE('31-12-'||TO_CHAR(ld_effective_date, 'rrrr'),'dd-mm-rrrr') ld_term_duration = DAYS_BETWEEN (ld_term_end_date, ld_term_start_date)

/* If Employee is Active - Termination Date is Defaulted */

IF (TO_CHAR(ld_effective_date,'MM-YYYY') = TO_CHAR(ld_emp_hire_date,'MM-YYYY'))
THEN
(

ld_participation_start_date = ld_emp_hire_date
ld_participation_end_date = TO_DATE('31-12-'||TO_CHAR(ld_emp_hire_date,'rrrr'),'dd-mm-rrrr')

225

ld_participation_duration = DAYS_BETWEEN(ld_participation_end_date,ld_participation_start_date)
ld_term_duration),2)
valid = 'N'
floored_accrual = floor(prorated_accrual)

prorated_accrual = ROUND(IV_ACCRUAL * (ld_participation_duration /

decimal_accrual = prorated_accrual - floored_accrual

IF (decimal_accrual = 0)
THEN
final_accrual = floored_accrual
IF (decimal_accrual > 0 and decimal_accrual <= 0.5)
THEN
final_accrual = floored_accrual + 0.5
IF (decimal_accrual > 0.5)
THEN
final_accrual = floored_accrual + 1

accrual = final_accrual

/* IF Employee has Termination date - Not Defaulted */


IF (TO_CHAR(ld_effective_date,'MM-YYYY') = TO_CHAR(ld_emp_term_date,'MM-YYYY'))
THEN
(

ld_participation_start_date = ld_emp_term_date ld_participation_end_date = TO_DATE('31-12'||TO_CHAR(ld_emp_term_date,'rrrr'),'dd-mm-rrrr') ld_participation_duration =


DAYS_BETWEEN(ld_participation_end_date,ld_participation_start_date) prorated_accrual = ROUND(IV_ACCRUAL * (ld_participation_duration / ld_term_duration),2) floored_accrual
= floor(prorated_accrual) decimal_accrual = prorated_accrual - floored_accrual
IF (decimal_accrual = 0)
THEN
final_accrual = prorated_accrual
IF (decimal_accrual >0 and decimal_accrual <= 0.5)
THEN
decimal_accrual = 0

IF (decimal_accrual > 0.5)

decimal_accrual = 0.5

final_accrual = floored_accrual + decimal_accrual


accrual = (-1) * final_accrual
226

THEN

/*RETURN accrual*/

)
RETURN accrual

/************************************************************************************
FORMULA NAME: XX_ANC_MAT_DURCAL
FORMULA TYPE: Global Absence Type Duration
DESCRIPTION: This sample formula returns the calendar days for Maternity Leave.
Change History:
Name Date Comments
-------------------------------------------------------------------------------------------Ashish Harbhajanka 28-Apr-2015 Initial Version
************************************************************************************/
INPUTS ARE IV_START_DATE (date),
IV_END_DATE (date),
IV_START_TIME,
IV_END_TIME,
IV_TOTALDURATION
/*================ FORMULA SECTION BEGIN =======================*/
DEFAULT for IV_TOTALDURATION is 0

duration = DAYS_BETWEEN(IV_END_DATE,IV_START_DATE) + 1

/*================ FORMULA SECTION END =======================*/ return duration

/********************************************************************
FORMULA NAME: XX_ANC_AssigneeOTPResident_VESTING_1MONTH
FORMULA TYPE: Global Absence Vesting Period
DESCRIPTION: This sample formula removes the vesting period for Assignee/OTP/Resident
Name

Date

Comments

----------------------------------------------------------------------------------------------------------------- Ashish Harbhajanka


Ashish Harbhajanka

06-Jul-2015 Incorporate Changes Required for 'Global Temporary Assignment'

---------------------------------------------------------------------------------------------------------------227

15-Jun-2015 Initial Version

********************************************************************/
/*==============DATABASE ITEM DEFAULTS BEGIN =====================*/
DEFAULT for PER_ASG_REL_DATE_START is '1951/01/01 00:00:00' (date)
DEFAULT for PER_ASG_REL_ORIGINAL_DATE_OF_HIRE is '1951/01/01 00:00:00' (date)
DEFAULT for PER_PERSON_ENTERPRISE_HIRE_DATE is '1951/01/01 00:00:00' (date)
DEFAULT FOR PER_ASG_ATTRIBUTE5 IS ' '
DEFAULT FOR PER_ASG_ACTION_CODE is ' '
/*==============DATABASE ITEM DEFAULTS ENDS======================*/
/*================== FORMULA SECTION BEGIN =======================*/
IF ((PER_ASG_REL_DATE_START = PER_ASG_REL_ORIGINAL_DATE_OF_HIRE) OR (PER_ASG_ACTION_CODE = 'GLB_TEMP_ASG')) THEN
(
If (PER_ASG_ATTRIBUTE5 = 'Assignee')
OR (PER_ASG_ATTRIBUTE5 = 'OTP')
OR (PER_ASG_ATTRIBUTE5 = 'Resident')
then( vestingUOM = 'M'
vestingUnits= 0
)
else(
vestingUOM = 'M'
vestingUnits=1
)
)
else
(vestingUOM = 'M'
vestingUnits=1
)
/*=================== FORMULA SECTION END =======================*/ return vestingUOM,vestingUnits

/********************************************************************
FORMULA NAME: XX_ANC_AssigneeOTPResident_VESTING_3MONTHS
FORMULA TYPE: Global Absence Vesting Period
DESCRIPTION: This sample formula removes the vesting period for Assignee/OTP/Resident. Conditionally applies vesting period of 3 month for first assignment record.
Name

Date

Comments

----------------------------------------------------------------------------------------------------------------- Ashish Harbhajanka


Ashish Harbhajanka
228

06-Jul-2015 Incorporate Changes Required for 'Global Temporary Assignment'

18-Jun-2015 Initial Version

---------------------------------------------------------------------------------------------------------------********************************************************************/
/*==============DATABASE ITEM DEFAULTS BEGIN =====================*/
DEFAULT for PER_ASG_REL_DATE_START is '1951/01/01 00:00:00' (date)
DEFAULT for PER_ASG_REL_ORIGINAL_DATE_OF_HIRE is '1951/01/01 00:00:00' (date)
DEFAULT for PER_PERSON_ENTERPRISE_HIRE_DATE is '1951/01/01 00:00:00' (date)
DEFAULT FOR PER_ASG_ATTRIBUTE5 IS ' '
DEFAULT FOR PER_ASG_ACTION_CODE is ' '
/*==============DATABASE ITEM DEFAULTS ENDS======================*/
/*================== FORMULA SECTION BEGIN =======================*/
IF ((PER_ASG_REL_DATE_START = PER_ASG_REL_ORIGINAL_DATE_OF_HIRE) OR (PER_ASG_ACTION_CODE = 'GLB_TEMP_ASG')) THEN
(
If (PER_ASG_ATTRIBUTE5 = 'Assignee')
OR (PER_ASG_ATTRIBUTE5 = 'OTP') OR (PER_ASG_ATTRIBUTE5 = 'Resident') then( vestingUOM = 'M'
vestingUnits=0
)
else( vestingUOM = 'M'
vestingUnits=3
)
)
else
(vestingUOM = 'M'
vestingUnits=3
)
/*=================== FORMULA SECTION END =======================*/ return vestingUOM,vestingUnits

/***************************************************************************
FORMULA NAME: XX_ANC_ELIG_ASGTYPE_MARSTATUS_Married_NOAssignee_OTP_Resident
FORMULA TYPE: Participation and Rate Eligibility Formula
DESCRIPTION: This formula returns a 'Y' if the employee is married and not a Assignee, OTP, Resident Change History:
Name

Date

Comments

--------------------------------------------------------------------------------- Ashish Harbhajanka

8-May-2015 Initial Version

*******************************************************************************/

DEFAULT FOR PER_PER_MARITAL_STATUS_MEANING IS ' '


229

DEFAULT FOR PER_ASG_ATTRIBUTE5 IS ' '

ELIGIBLE = 'N'

IF ((PER_PER_MARITAL_STATUS_MEANING = 'Married') AND (PER_ASG_ATTRIBUTE5 = 'Assignee')) THEN(ELIGIBLE = 'N')


ELSE IF ((PER_PER_MARITAL_STATUS_MEANING = 'Married') AND (PER_ASG_ATTRIBUTE5 = 'OTP')) THEN(ELIGIBLE = 'N')
ELSE IF ((PER_PER_MARITAL_STATUS_MEANING = 'Married') AND (PER_ASG_ATTRIBUTE5 = 'Resident')) THEN(ELIGIBLE = 'N')
ELSE IF ((PER_PER_MARITAL_STATUS_MEANING = 'Married') AND (PER_ASG_ATTRIBUTE5 = 'XX Assignee')) THEN(ELIGIBLE = 'N')
ELSE IF ((PER_PER_MARITAL_STATUS_MEANING = 'Married') AND (PER_ASG_ATTRIBUTE5 = 'XX OTP')) THEN(ELIGIBLE = 'N')
ELSE IF ((PER_PER_MARITAL_STATUS_MEANING = 'Married') AND (PER_ASG_ATTRIBUTE5 = 'XX Resident')) THEN(ELIGIBLE = 'N')
ELSE IF ((PER_PER_MARITAL_STATUS_MEANING = 'Married') AND (PER_ASG_ATTRIBUTE5 = ' ')) THEN (ELIGIBLE = 'Y')

RETURN ELIGIBLE

/***************************************************************************
FORMULA NAME: XX_ANC_ELIG_ASGType_MARSTATUS_Married_NoXXAssignee_OTP_Resident
FORMULA TYPE: Participation and Rate Eligibility Formula
DESCRIPTION: This formula returns a 'Y' if the employee is single and not a Assignee, OTP, Resident Change History:
Name

Date

Comments

--------------------------------------------------------------------------------- Ashish Harbhajanka

3-June-2015 Initial Version

*******************************************************************************/ DEFAULT FOR PER_PER_MARITAL_STATUS_MEANING IS ' '


DEFAULT FOR PER_ASG_ATTRIBUTE5 IS ' '

ELIGIBLE = 'N'

IF ((PER_PER_MARITAL_STATUS_MEANING = 'Married') AND (PER_ASG_ATTRIBUTE5 = 'Assignee')) THEN(ELIGIBLE = 'N')


IF ((PER_PER_MARITAL_STATUS_MEANING = 'Married') AND (PER_ASG_ATTRIBUTE5 = 'OTP')) THEN(ELIGIBLE = 'N')
IF ((PER_PER_MARITAL_STATUS_MEANING = 'Married') AND (PER_ASG_ATTRIBUTE5 = 'Resident'))
THEN(ELIGIBLE = 'N')
ELSE IF ((PER_PER_MARITAL_STATUS_MEANING = 'Married') AND (PER_ASG_ATTRIBUTE5 = 'XX Assignee')) THEN(ELIGIBLE = 'Y')
ELSE IF ((PER_PER_MARITAL_STATUS_MEANING = 'Married') AND (PER_ASG_ATTRIBUTE5 = 'XX OTP')) THEN(ELIGIBLE = 'Y')
ELSE IF ((PER_PER_MARITAL_STATUS_MEANING = 'Married') AND (PER_ASG_ATTRIBUTE5 = 'XX Resident')) THEN(ELIGIBLE = 'Y')
ELSE IF ((PER_PER_MARITAL_STATUS_MEANING = 'Married') AND (PER_ASG_ATTRIBUTE5 = ' ')) THEN (ELIGIBLE = 'Y')

230

RETURN ELIGIBLE

/***************************************************************************
FORMULA NAME: XX_ANC_ELIG_ASGType_NoAssignee_OTP_Resident
FORMULA TYPE: Participation and Rate Eligibility Formula
DESCRIPTION: Returns a 'Yes' if the employees are not a Assignee, OTP & Resident Change History:
Name

Date

Comments

--------------------------------------------------------------------------------Ashish Harbhajanka

8-May-2015 Initial Version

*******************************************************************************/

DEFAULT FOR PER_ASG_ATTRIBUTE5 IS ' '

ELIGIBLE = 'Y'
IF ((PER_ASG_ATTRIBUTE5 = 'XX Resident')
OR (PER_ASG_ATTRIBUTE5 = 'XX Assignee')
OR (PER_ASG_ATTRIBUTE5 = 'XX OTP')
OR (PER_ASG_ATTRIBUTE5 = 'Assignee')
OR (PER_ASG_ATTRIBUTE5 = 'OTP')
OR (PER_ASG_ATTRIBUTE5 = 'Resident'))
THEN(ELIGIBLE = 'N')

RETURN ELIGIBLE

/***************************************************************************
FORMULA NAME: XX_ANC_ELIG_ASGType_NoFXAssignee_OTP_Resident
FORMULA TYPE: Participation and Rate Eligibility Formula
DESCRIPTION: Returns a Yes for employees who have assignment type as 'XX Assignee' Change History:
Name

Date

Comments

--------------------------------------------------------------------------------- Spencer Lin

8-May-2015 Initial Version

*******************************************************************************/

231

DEFAULT FOR PER_ASG_ATTRIBUTE5 IS ' '

ELIGIBLE = 'Y'
IF ((PER_ASG_ATTRIBUTE5 = 'XX Resident')
OR (PER_ASG_ATTRIBUTE5 = 'XX Assignee')
OR (PER_ASG_ATTRIBUTE5 = 'XX OTP'))
THEN(ELIGIBLE = 'N')

RETURN ELIGIBLE

/***************************************************************************
FORMULA NAME: XX_ANC_ELIG_OTP_ASSIGN_RESIDENT
FORMULA TYPE: Participation and Rate Eligibility Formula
DESCRIPTION: Returns a Yes for employees who have assignment type as 'Assignee', 'OTP', 'Resident' Change History:
Name

Date

Comments

--------------------------------------------------------------------------------- Ashish Harbhajanka

8-May-2015 Initial Version

*******************************************************************************/

DEFAULT FOR PER_ASG_ATTRIBUTE5 IS ' '

ELIGIBLE = 'N'
IF ((PER_ASG_ATTRIBUTE5 = 'Resident')
OR (PER_ASG_ATTRIBUTE5 = 'Assignee')
OR (PER_ASG_ATTRIBUTE5 = 'OTP')
)
THEN(ELIGIBLE = 'Y')
RETURN ELIGIBLE

/***************************************************************************
FORMULA NAME: XX_ANC_ELIG_ASGTYPE_XXAssign_Resident_OTP
FORMULA TYPE: Participation and Rate Eligibility Formula
DESCRIPTION: Returns a Yes for employees who have assignment type as 'XX Assignee' Change History:
Name

Date

Comments

--------------------------------------------------------------------------------- Ashish Harbhajanka

8-May-2015 Initial Version

*******************************************************************************/ DEFAULT FOR PER_ASG_ATTRIBUTE5 IS ' '


232

ELIGIBLE = 'N'
IF ((PER_ASG_ATTRIBUTE5 = 'Resident')
OR (PER_ASG_ATTRIBUTE5 = 'Assignee'))
THEN(ELIGIBLE = 'Y')
RETURN ELIGIBLE

/***************************************************************************
FORMULA NAME: XX_ANC_ELIG_ASGTYPE_XXOTP
FORMULA TYPE: Participation and Rate Eligibility Formula
DESCRIPTION: Returns a Yes for employees who have assignment Type as 'XX OTP' Change History:
Name

Date

Comments

--------------------------------------------------------------------------------- Ashish Harbhajanka 15-April-2015 Initial Version


*******************************************************************************/

DEFAULT FOR PER_ASG_ATTRIBUTE5 IS ' '

ELIGIBLE = 'N'

IF (PER_ASG_ATTRIBUTE5 = 'XX OTP ')


THEN(ELIGIBLE = 'Y')

RETURN ELIGIBLE

/***************************************************************************
FORMULA NAME: XX_ANC_ELIG_ASGTYPE_NOAssignee_OTP_Resident
FORMULA TYPE: Participation and Rate Eligibility Formula
DESCRIPTION: Returns a 'Yes' if the employees are not a Assignee, OTP & Resident Change History:
Name

Date

Comments --------------------------------------------------------------------------------- Ashish Harbhajanka

*******************************************************************************/

DEFAULT FOR PER_ASG_ATTRIBUTE5 IS ' '

ELIGIBLE = 'Y'
IF ((PER_ASG_ATTRIBUTE5 = 'Resident')
233

8-May-2015 Initial Version

OR (PER_ASG_ATTRIBUTE5 = 'Assignee')
OR (PER_ASG_ATTRIBUTE5 = 'OTP')
OR (PER_ASG_ATTRIBUTE5 = 'XX Assignee')
OR (PER_ASG_ATTRIBUTE5 = 'XX OTP')
OR (PER_ASG_ATTRIBUTE5 = 'XX Resident'))
THEN(ELIGIBLE = 'N')

RETURN ELIGIBLE

/***************************************************************************
FORMULA NAME: XX_ANC_ELIG_ASGTYPE_MARSTATUS_Single_NOAssignee_OTP_Resident
FORMULA TYPE: Participation and Rate Eligibility Formula
DESCRIPTION: This formula returns a 'Y' if the employee is single and not a Assignee, OTP, Resident Change History:
Name

Date

Comments

--------------------------------------------------------------------------------- Ashish Harbhajanka

3-June-2015 Initial Version

*******************************************************************************/

DEFAULT FOR PER_PER_MARITAL_STATUS_MEANING IS ' '


DEFAULT FOR PER_ASG_ATTRIBUTE5 IS ' '

ELIGIBLE = 'N'

IF ((PER_PER_MARITAL_STATUS_MEANING = 'Single') AND (PER_ASG_ATTRIBUTE5 = 'XX Assignee')) THEN(ELIGIBLE = 'N')


IF ((PER_PER_MARITAL_STATUS_MEANING = 'Single') AND (PER_ASG_ATTRIBUTE5 = 'XX OTP')) THEN(ELIGIBLE = 'N')
IF ((PER_PER_MARITAL_STATUS_MEANING = 'Single') AND (PER_ASG_ATTRIBUTE5 = 'XX Resident')) THEN(ELIGIBLE = 'N')
ELSE IF ((PER_PER_MARITAL_STATUS_MEANING = 'Single') AND (PER_ASG_ATTRIBUTE5 = 'Assignee')) THEN(ELIGIBLE = 'Y')
ELSE IF ((PER_PER_MARITAL_STATUS_MEANING = 'Single') AND (PER_ASG_ATTRIBUTE5 = 'OTP')) THEN(ELIGIBLE = 'Y')
ELSE IF ((PER_PER_MARITAL_STATUS_MEANING = 'Single') AND (PER_ASG_ATTRIBUTE5 = 'Resident')) THEN(ELIGIBLE = 'Y')
ELSE IF ((PER_PER_MARITAL_STATUS_MEANING = 'Single') AND (PER_ASG_ATTRIBUTE5 = ' ')) THEN (ELIGIBLE = 'Y')

RETURN ELIGIBLE

/***************************************************************************
FORMULA NAME: XX_ANC_ELIG_HomeState_XXPC
234

FORMULA TYPE: Participation and Rate Eligibility Formula


DESCRIPTION: Returns a Yes for employees who have Address Region as either of 'New South Wales','Queensland','Western Australia','Vistoria','South Australia'
Change History:
Name

Date

Comments

--------------------------------------------------------------------------------- Ashish Harbhajanka 20-April-2015 Initial Version


*******************************************************************************/
DEFAULT FOR PER_PER_ADD_REGION2 IS ' '

lc_emp_addr_state = PER_PER_ADD_REGION2

ELIGIBLE = 'N'

IF (lc_emp_addr_state = 'New South Wales' OR lc_emp_addr_state = 'Queensland' OR lc_emp_addr_state = 'Western Australia' OR lc_emp_addr_state =
'Victoria' OR lc_emp_addr_state = 'South Australia')
THEN(ELIGIBLE = 'Y')

RETURN ELIGIBLE

/******************************************************************************
FORMULA NAME: XX_ANC_GET_ANNUAL_MGR_LEAVE_BALANCE
FORMULA TYPE: Global Absence Accrual
DESCRIPTION: This formula returns the leave balance for Annual Leave Plan (Manager) Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 24-Jun-2015 Initial Version


*******************************************************************************/

INPUTS ARE IV_PERSON_ID,IV_TERM_ID,IV_EFF_DT (DATE)

ln_accrual = 0

ld_current_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00' (date))

L_Leave_Balance = 0
ln_annual_mgr_accrual_plan_id = 300000001752603 /*Accrual Plan Id for Annual Leave Plan (Manager) */ L_Term_Id = IV_TERM_ID
235

L_Person_Id = IV_PERSON_ID
L_Eff_Dt = IV_EFF_DT

CHANGE_CONTEXTS(ACCRUAL_PLAN_ID = ln_annual_mgr_accrual_plan_id,HR_ASSIGNMENT_ID = L_Term_Id,PERSON_ID = L_Person_Id,EFFECTIVE_DATE =L_Eff_Dt )

(
L_Leave_Balance = GET_ACCRUAL_BALANCE()
)
return L_Leave_Balance

/******************************************************************************
FORMULA NAME: XX_ANC_GET_ANNUAL_DTC_CONTRACT_LEAVE_BALANCE
FORMULA TYPE: Global Absence Accrual
DESCRIPTION: This formula returns the leave balance for Annual Leave Plan (DTC Contract) Change History:
Name

Date

Comments

----------------------------------------------Ashish Harbhajanka 24-Jun-2015 Initial Version


*******************************************************************************/

INPUTS ARE IV_PERSON_ID,IV_TERM_ID,IV_EFF_DT (DATE)

ln_accrual = 0

ld_current_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00' (date))

L_Leave_Balance = 0
ln_annual_dtc_contract_accrual_plan_id = 300000001752605 /*Accrual Plan Id for Annual Leave Plan (DTC Contract) */ L_Term_Id = IV_TERM_ID
L_Person_Id = IV_PERSON_ID
L_Eff_Dt = IV_EFF_DT

CHANGE_CONTEXTS(ACCRUAL_PLAN_ID = ln_annual_dtc_contract_accrual_plan_id,HR_ASSIGNMENT_ID = L_Term_Id,PERSON_ID = L_Person_Id,EFFECTIVE_DATE =L_Eff_Dt )

(
L_Leave_Balance = GET_ACCRUAL_BALANCE()
)
236

return L_Leave_Balance

/*******************************************************************
FORMULA NAME : XX_COMP_HIERARCHY_XXAP_Compensation_Plan_2015
FORMULA TYPE : Compensation Hierarchy Determination
DESCRIPTION : Hierarchy determination fast formula which is based on assignment_id

Created By Ashish Harbhajanka

/*=========== INPUT VALUES DEFAULTS BEGIN =====================*/


INPUTS ARE CMP_IV_ASSIGNMENT_ID (number), CMP_IV_PLAN_ID (number), CMP_IV_PERIOD_ID (number)

DEFAULT FOR CMP_IV_ASSIGNMENT_ID IS 0


DEFAULT FOR XX_COMPENSATION_PLAN_DETAILS_BONUS_POOL_MGR_EMP_NO_ASG_ENTRY_VALUE IS '0'
DEFAULT FOR XX_COMPENSATION_PLAN_DETAILS_BONUS_POOL_MGR_ASG_ENTRY_VALUE IS 'X'
DEFAULT FOR XX_COMPENSATION_PLAN_DETAILS_PLAN_NAME_ASG_ENTRY_VALUE IS 'PLAN_NAME_DEFAULTED'
DEFAULT FOR PER_PER_FULL_NAME IS ' '
DEFAULT FOR PER_ASG_PERSON_NUMBER IS '0'
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_ASG_EFFECTIVE_END_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_ASG_EFFECTIVE_START_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_ASSIGNMENT_ID IS 0
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_ENTERPRISE_ID IS 0
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_LINE_MANAGER_ASG_ID IS 0
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_LINE_MANAGER_ID IS 0
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_PERSON_ID IS 0
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_ASSIGNMENT_ID IS 0
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_DISPLAY_NAME IS ' '
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_FIRST_NAME IS ' '
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_FULL_NAME IS ' '
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_HONORS IS ' '
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_KNOWN_AS IS ' '
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_LAST_NAME IS ' '
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_LIST_NAME IS ' '
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_MIDDLE_NAME IS ' '
237

DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_MILITARY_RANK IS ' '


DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_NAME_EFFE_END_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_NAME_EFFE_START_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_NAME_SUFFIX IS ' '
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_NAME_TYPE IS ' '
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_ORDER_NAME IS ' '
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_PERSON_ID IS 0
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_PREV_LAST_NAME IS ' '
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_PRE_NAME_ADJUNCT IS ' '
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_TITLE IS ' '
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_TYPE IS ' '
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_TYPE_CODE IS ' '
DEFAULT_DATA_VALUE FOR PER_EXT_ASG_CONT_RESP_TYPE_MEANING IS ' '

ld_effective_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00' (date))


ln_assignment_id = GET_CONTEXT(HR_ASSIGNMENT_ID,0)
ln_person_id = GET_CONTEXT(PERSON_ID,0)
L_PERSON_ID = '0'
L_ASSIGNMENT_ID = '0'

/*
L_PLAN_POOL_MGR = XX_COMPENSATION_PLAN_DETAILS_BONUS_POOL_MGR_EMP_NO_ASG_ENTRY_VALUE
L_PLAN_POOL_MGR_NAME = XX_COMPENSATION_PLAN_DETAILS_BONUS_POOL_MGR_ASG_ENTRY_VALUE
L_PERSON_PLAN = XX_COMPENSATION_PLAN_DETAILS_PLAN_NAME_ASG_ENTRY_VALUE
L_PLAN_NAME = GET_TABLE_VALUE('XX_COMP_PLAN_CONTROL_DATA','PLAN_NAME',TO_CHAR(CMP_IV_PLAN_ID),'NO_PLAN_NAME_FOUND') L_PLAN_CODE = GET_TABLE_VALUE('XX_COMP_PLAN_CONTROL_DATA','PLAN_CODE',TO_CHAR(CMP_IV_PLAN_ID),'NO_PLAN_CODE_FOUND')

l_log = ESS_LOG_WRITE('=== plan name and code from UDT using plan ID -> ' || L_PLAN_NAME || ' (' || L_PLAN_CODE || ')') */

l_log = ess_log_write('Start Processing for Person ID : ' || TO_CHAR(ln_person_id)) l_log = ess_log_write('Start Processing for Assignment ID : ' || TO_CHAR(ln_assignment_id))
l_log = ess_log_write('Start Processing for Person Number : ' || PER_ASG_PERSON_NUMBER) l_log = ess_log_write('Start Processing for Person Name : ' ||
PER_PER_FULL_NAME)

CHANGE_CONTEXTS(HR_ASSIGNMENT_ID = ln_assignment_id ,EFFECTIVE_DATE = ld_effective_date)


(

238

i=PER_EXT_ASG_CONT_RESP_ASSIGNMENT_ID.FIRST(-1) WHILE PER_EXT_ASG_CONT_RESP_ASSIGNMENT_ID.exists(i)


LOOP
(
IF (PER_EXT_ASG_CONT_RESP_TYPE[i] = 'HR_REP')
THEN
(

l_log = ESS_LOG_WRITE('=== start custom logging for employee : ' || PER_PER_FULL_NAME || ' (' || PER_ASG_PERSON_NUMBER|| ')')
l_log = ESS_LOG_WRITE (PER_EXT_ASG_CONT_RESP_DISPLAY_NAME[i] || ' is the HR Representative of Person Number : ' || PER_ASG_PERSON_NUMBER )
l_log = ESS_LOG_WRITE('Person ID of HR Representative is ' || to_char(PER_EXT_ASG_CONT_RESP_PERSON_ID[i]) )
l_log = ESS_LOG_WRITE('Assignment ID of HR Representative is ' || to_char(PER_EXT_ASG_CONT_RESP_ASSIGNMENT_ID[i]) )
L_APPROVER_PERSON_ID = PER_EXT_ASG_CONT_RESP_PERSON_ID[i]
L_APPROVER_ASG_ID = PER_EXT_ASG_CONT_ASSIGNMENT_ID[i]

l_log = ESS_LOG_WRITE('=== L_APPROVER_PERSON_ID ' || TO_CHAR(L_APPROVER_PERSON_ID ))


PROVER_ASG_ID ' || TO_CHAR(L_APPROVER_ASG_ID ))

l_log = ESS_LOG_WRITE('=== L_AP-

IF L_APPROVER_PERSON_ID != 0 THEN
(

l_log = ESS_LOG_WRITE(' ')


L_PERSON_ID = TO_CHAR(L_APPROVER_PERSON_ID)
L_ASSIGNMENT_ID = TO_CHAR(L_APPROVER_ASG_ID)
RETURN L_PERSON_ID,L_ASSIGNMENT_ID
)
ELSE
(

l_log = ESS_LOG_WRITE('=== no approver found, returning ')

l_log = ESS_LOG_WRITE(' ')

RETURN

)
)
l_log = ESS_LOG_WRITE('=== end custom logging for employee : ' || PER_PER_FULL_NAME || ' (' || PER_ASG_PERSON_NUMBER|| ')')
l_log = ess_log_write('Start Processing for Person ID : ' ||
TO_CHAR(ln_person_id))
l_log = ess_log_write('Start Processing for Assignment ID : ' || TO_CHAR(ln_assignment_id))
l_log = ess_log_write('Start Processing for Person Number : ' || PER_ASG_PERSON_NUMBER)
l_log = ess_log_write('Start Processing for Person Name : ' || PER_PER_FULL_NAME)
i=1+1
239

)
) /* end of Formula */

Fusion Applications Data Mapping - From HCM Screens to DB Field


This is a very common question I have encountered in my previous implementations where in a Consultant (Technical / Functional / Techno Functional) or for that matter even Business Users (for UAT Purposes) are interested to understand which
Fusion Applications UI field gets mapped to which corresponding Data Field in Database.
Truly speaking there isnt a formal documentation available, but I came across a MOSC document Fusion Record Names.pdf ( link : https://community.oracle.com/docs/DOC-821238 ) shared by Prasanna and compiled by him for few of the objects
( related with HCM ).
I have tried to again present the same in a more easy and readable format but the entire hard work is of Prasanna.
Before starting lets try to define / explain the terminologies used in this article . They are :
a) Object Name
These are the specific objects or Business Entities which are generally represented as a single or multiple pages on UI .Some examples being ( Person , PersonDocumentation, WorkRelationshipByPerson, Location, Jobs, JobFamily,
Position , Business Units , Department , Grades, Grade Rates , Element Entry to name a few)
c) Search Records
These are the Record Types which are exposed on the UI pages and enables search ( Each Page has a search button and that search is executed on a record type variable which is basically a UI Page ). Few Examples being per_persons,
per_all_people_f , per_person_names_f ,per_email_Addresses . And many more )
c) Base Records
These are actual Base Records (in other words actual DB Tables ). Few examples being
PER_DRIVERS_LICENSE_TYPES , PER_DRIVERS_LICENSES,PER_PERSON_DLVRY_METHODS,PER_IMAGES ,PER_CITIZENSHIPS
GIONS ,PER_PHONES ,PER_NATIONAL_IDENTIFIERS . To
Name a few.

,PER_CONTACT_RELSHIPS_F ,PER_PERSON_TYPE_USAGES_M ,PER_RELI-

In Essence basis the below spreadsheet first you identify the Business Object ( from Fusion UI ) and then you need to check all the corresponding tables mentioned and look for the data field. In most cases the names of the field ( called LABEL /
PROMPT in UI ) corresponds to similar names in Database but in case of any discrepancy you may raise a SR to get the same clarified.
You may even verify the same by entering some data in UI and checking the same using SQL queries on the Database side ( using BI Data Model in SaaS Environment).
This is not the complete list but probably the most commonly used ones. I would try adding more once I get more info around the same.
Object Name

PERSON

240

Search Records

PER_PERSONS
PER_ALL_PEOPLE_F
PER_PERSON_NAMES_F
PER_EMAIL_ADDRESSES

Base Records
PER_DRIVERS_LICENSE_TYPES
PER_DRIVERS_LICENSES
PER_PERSON_DLVRY_METHODS
PER_IMAGES
PER_CTIZENSHIPS
PER_PASSPORTS
PER_VISAS_PERMITS_F
PER_SHARE_INFORMATION
PER_DISABILITIES_F
PER_CONTACT_EXTRA_INFO_F
PER_CONTACT_RELSHIPS_F
PER_PERSON_TYPE_USAGES_M
PER_RELIGIONS
PER_PHONES
PER_NATIONAL_IDENTIFIERS

PER_PERSON_NAMES_F
PER_PERSON_LEGISLATIVE_F
PER_PEOPLE_EXTRA_INFO_F
PER_ETHNICITIES
PER_EMAIL_ADDRESSES
PER_ADDRESSES_F
PER_PERSON_ADDR_USAGES_F
PER_ALL_PEOPLE_F
PER_PERSONS

CONTD
Object Name
PERSON DOCUMENTATION

Search Records
HR_DOCUMENTS_OF_RECORD
PER_ALL_PEOPLE_F
PER_PERSON_NAMES_F
PER_EMAIL_ADDRESSES

Base Records

HR_DOCUMENTS_OF_RECORD
HRC_LOADER_BATCH_KEY_MAP
(FOR PAYROLL REFERENCES )
PAY_REL_GROUPS_F
PAY_REL_GROUPS_DN
PAY_PAY_RELATIONSHIPS_F

WORKRELATIONSHIPBYPERSON

PER_PERIODS_OF_SERVICE
PER_ALL_PEOPLE_F
PER_PERSON_NAMES_F
PER_EMAIL_ADDRESSES_F

PAY_PAY_RELATIONSHIPS_DN
BEN_REL_ASSIGNMENTS_F
BEN_BENEFIT_RELATIONS_F
PER_LDAP_REQUESTS
PER_ACTION_OCCURENCES
PER_CONTRACTS_F
PER_ASSIGN_GRADE_STEPS_F
PER_ASSIGNMENT_SUPERVISORS_
F
PER_ASSIGN_WORK_MEASURES_F
PER_ALL_ASSIGNMENTS_M
PER_PERIODS_OF_SERVICE

CONTD..
Object Name

Search Records

Base Records
PER_ACTION_OCCURRENCES

241

PER_ADDRESSES_F
PER_LOC_ADDRESS_USAGES_F
PER_LOCATION_DETAILS_F_VL
PER_LOCATIONS

LOCATION

PER_LOCATIONS_DETAILS_F_TL
PER_LOCATION_EXTRA_INFO_F
PER_LOCATION_LEG_F
PER_LOCATION_DETAILS_F_TL
PER_LOCATION_DETAILS_F
PER_LOCATIONS
PER_ACTION_OCCURENCES

JOBS

PER_JOBS_F_VL

PER_VALID_GRADES_F
PER_JOBS_F_TL
PER_JOBS_F
PER_ACTION_OCCURENCES

JOB FAMILY

PER_JOB_FAMILY_F_VL

PER_JOB_FAMILY_F
PER_JOB_FAMILY_F_TL
PER_POSITION_LEG_F

POSITION

HR_ALL_POSITIONS_F_VL

PER_POSITION_EXTRA_INFO_F
HR_ALL_POSITIONS_F_TL
HR_ALL_POSITIONS_F
PER_ACTION_OCCURRENCES

GRADES

---------NA------------------------

PER_GRADES_F_TL
PER_GRADES_F

Object Name

Search Records

Base Records
PER_RATES_F_TL

GRADE RATES

PER_GRADES_F_VL

PER_RATES_F
PER_RATE_VALUES_F
PER_ACTION_OCCURRENCES
HR_ORG_UNIT_CLASSIFICATIONS_F

BUSINESS UNIT

FUN_ALL_BUSINESS_UNITS_V

HR_ORGANIZATION_INFORMATION_F
HR_ORGANIZATION_UNITS_F_TL
HR_ALL_ORGANIZATION_UNITS_F
PER_ACTION_OCCURENCES
HR_ORG_UNIT_CLASSIFICATIONS_F

DEPARTMENT

PER_DEPARTMENTS

HR_ORGANIZATION_INFORMATION_F
HR_ORGANIZATION_UNITS_F_TL
HR_ALL_ORGANIZATION_UNITS_F_TL

242

PAY_ELEMENT_ENTRIES_F
PAY_ELEMENT_TYPES_F
ELEMENT ENTRY

PER_PERSONS
PER_ALL_PEOPLE_F
PER_PERSON_NAMES_F
PER_EMAIL_ADDRESSES_F

243

PAY_ENTRY_PCT
PAY_ELEMENT_ENTRY_VALUES_F
PAY_ENTRY_USAGES
PAY_ELEMENT_ENTRIES_F

You might also like