Oracle HRMS Fast Formula Overview

By | November 22, 2014

In this article of oracle hrms overview, We have provided the concepts of oracle hrms fast formula and its syntax. Working example and code is also given for your ready reference.

Summary of Contents

Oracle Fast Formula Overview
Uses of Oracle Fast Formula

Oracle Fast Formula Functions
Supplied Formulas
Fast Formula Structure w.r.t Statements
Order of Statements

Working Example of a Fast Formula

Oracle Fast Formula Overview

Formulas are generic expressions of calculations or comparisons you want to repeat with different input values. Formulas take input from a window, a database, or a process, such as a payroll run and they return values or messages.

Oracle FastFormula is a simple way to write formulas using English words and basic
mathematical functions. You can use information from your database in formulas without learning the database structure or a programming language.

Back to top

Uses of Oracle Fast Formula

In HRMS, Oracle Fast Formula is used for

  • applying validations
  • to perform calculations
  • to specify rules.

Here are some examples of its usages.

Back to top

In Payroll, you use formulas to:

• Validate element inputs
• Calculate element pay values and run results during payroll processing
• Specify the rules for skipping an element during payroll processing
• Perform legislative checks during a payroll run

Back to top

In Compensation and Benefits Management, you use formulas to:

• Specify the rules for Paid Time Off accrual plans, such as how much time is accrued and over what period, when new starters are eligible to begin accruing time, and
how much time can be carried over to the next accrual term
• Define custom calculations for benefits administration
• Calculate the duration of an absence given the start and end dates and times
• Create rules for benefits administration such as eligibility determination

Back to top

In People Management, you use formulas to:

• Check that element entry values are valid for an assignment
• Specify the criteria for including an assignment in an assignment set and to edit assignment sets
• Configure the people management templates in a number of ways such as supplying additional information to be available from fields on the template and
validating field entries
• Define collective agreements
• Generate custom global person number sequences for employees, applicants, and contingent workers

You also use formulas to define Oracle Business Intelligence Systems reports, to select the database information you want to display in a QuickPaint report, and to perform calculations for the report.

You can easily create and maintain business rules by calling formulas from the Custom Library. For example, you can use formulas to validate data entry in forms by calling formulas from the Custom Library, and to check that entries made to a user table are valid. You can then call these business rules from other PL/SQL applications. When you write a formula, you specify for which of these purposes you will use it.

Back to top

Components of Formulas

Formulas are made up of a number of different components. These can include  assignment statements, different types of input including database items, functions,
nested expressions, and conditions.

When writing formulas, there are a number of techniques you should use to ensure your formulas are easy to use and understand. There are also rules for using each type of component that you need to follow.

Back to top

Oracle Fast Formula Functions

Oracle FastFormula provides functions that manipulate data in various ways. These include:
Text functions such as the GREATEST function that compares the values of all the text string operands and returns the value of the operand that is alphabetically last
Numeric functions such as the ROUND function that rounds off a numeric value to the specified number of decimal places
Date functions such as the ADD_DAYS function that adds a number of days to a
date
Data conversion functions such as the CONVERT function that converts a character  string from one character set to another

For exclusive detail of Fast Formula Function, Click here

Other types of functions provided by Oracle FastFormula include functions:

• To get values from tables such as the GET_LOOKUP_MEANING function that enables Oracle FastFormula to translate a lookup code into a meaning
• For accrual type formulas such as the GET_START_DATE function that returns the date at which the accrual formula should start calculating accruals
• That allow you to call another formula, either once or in a loop such as the CALL_FORMULA function that runs a named formula with no inputs and no
outputs
• To set and use globals in SQL*Plus from within your formulas such as the ISNULL set of three functions that test whether a text, numeric, or date value is NULL

Back to top

Supplied Formulas

Formulas are predefined for all the tax calculations required for Oracle Payroll. You should not edit these formulas. When tax rules change, you will automatically receive updates.

There are also a number of formulas predefined for accrual plans. You can use these formulas as supplied, or customize them to match the rules of your own plans.
Depending on the legislation, the system may automatically generate some payroll formulas to define earnings and deductions elements, and you can create as many other formulas as you require to process the elements you define.

Formulas for QuickPaint reports and assignment sets can be generated from criteria you enter in windows. You can edit these generated formulas to add more functionality.

Back to top

Fast Formula Structure w.r.t Statements

There are 6 types of statements that we can use in oracle fast formula. Which are shown below

  • Alias statement
  • Default statement
  • Inputs statement
  • Assignment statement
  • If statement
  • Return statement

Fast Formula Structure

Back to top

Order of Statements in Fast Formula

Order of statement should be in following
1. Alias statements (if any)
2. Default statements (if any)
3. Input statement (if any)
4. Other statements
5. Return Statement

Note: An If statement can have Assignment, Return, and other If statements nested within it, enabling you to build up powerful formulas.

Syntax For Statements

Back to top

Alias Statement:

These are the first type of statement in the fast formula structure, Their purpose is to give short names for existing variables in the system. You can declare aliases for database items and global values.

Syntax

ALIAS Database_Item_Or_Global_Value_Name AS Alias_Name

Example

ALIAS Database_Item_Or_Global_Value_Name AS Alias_Name

Back to top

Default Statement

Default statement is used to set the default value for an input value or database item. Fast formula uses the default value if the database item is empty or the input value is not provided when you run the formula.’WAS DEFAULTED’ is used to identify if default value has been used. For example:

Syntax

DEFAULT FOR <varname> IS
where varname is an input value or database item, and constant is a constant value
matching the data type of varname.

Example

DEFAULT FOR Bonus_Amount IS 500.00
IF Bonus_Amount WAS DEFAULTED THEN
MESG = ‘Warning: hourly rate defaulted’

This example sets a default of 500.00 for the database item Bonus_Amount. If Bonus_Amount is empty (NULL) in the database, the formula uses the default value of 500.00 and issues a warning message.

Important: You must use the Default statement for database items that can be empty. The Database Items window includes a check box labeled Default Required. This check box is checked for database items that can be empty. The Database Items window appears when you click the Show Items button on the Formulas window.

Back to top


Inputs Statement

The purpose of Inputs statement is to pass input values from an element into a formula. You do not need to declare the type of number variables because this is the default data type. You can define up to 15 input values for an element.
TheInputs statement must appear before the other formula statements except:
• any Alias statements, which must always be at the top of the formula
• any Default statements that provide default values for input values

Syntax

INPUTS ARE varname1(data type)[, varname2 (data type)] …

Example

INPUTS ARE bonus (number),start_date (date)

Due to performance reasons, It is always recommended to use Inputs statement to retrieve the input values of the element associated with the formula.

Back to top

Assignment Statement

Purpose of Assignment statement is to assign a value into a variable.

Syntax

varname = expression

Example

BonusAmount = 500

Back to top

Return Statement

Purpose of return statement is to return values in local variables to the application. Oracle Fast Formula can pass back any number of variables. The variable does not need to contain a value.

Syntax

Return Variable1,Variable2,Variable3

Example

RETURN Variable1,Variable2,Variable3

Note: Oracle Fast Formula stops executing the formula when it reaches the Return statement. Any statements after the Return statement are ignored.

Back to top

Working Example of a Fast Formula

Following is working example of Oracle Payroll Type written for Element Named Air Ticket Claim. This element has one input value named ‘Amount’. Just to keep this Fast formula simple, I have returned the input value as the fast formula result.

/*
*
* Formula Name: LSG_AIRTICKET_CLAIM
* Formula Type: Oracle Payroll
* Created: 01-Dec-2009
* Author: HRMS
*
* Description: Airticket Claim
*
*/
/*================= ALIAS Begins ================*/
ALIAS PAY_PROC_PERIOD_END_DATE AS PERIOD_END_DATE
ALIAS PAY_PROC_PERIOD_START_DATE AS PERIOD_START_DATE

/*================= ALIAS Ends ================*/

/*================= Database Items Defaults Begins ================*/
DEFAULT FOR ENTRY_END_DATE IS ‘4712/01/01 00:00:00′(Date)
DEFAULT FOR ENTRY_START_DATE IS ‘4712/01/01 00:00:00′(Date)
DEFAULT FOR EMP_HIRE_DATE IS ‘1951/01/01 00:00:00′(Date)
DEFAULT FOR EMP_TERM_DATE IS ‘4712/01/01 00:00:00′(Date)
DEFAULT FOR PERIOD_END_DATE IS ‘4712/12/01 00:00:00′(Date)
DEFAULT FOR PERIOD_START_DATE IS ‘1951/01/01 00:00:00′(Date)
DEFAULT FOR PAY_PROC_PERIOD_DATE_PAID IS ‘4712/12/31 00:00:00′(Date)

DEFAULT FOR ELEMENT_NAME IS ‘XXXX’
DEFAULT FOR Amount IS 0
DEFAULT FOR L_Msg IS ‘ ‘
/*================= Database Items Defaults Ends =================*/

/*======Inputs Starts=======================*/

INPUTS ARE Amount

/*======Inputs Ends========================*/

/*======Local Variables Begins=======*/

L_Msg = ‘Airticket Claim: ‘

L_Msg=L_msg||’Amount ‘+TO_CHAR(Amount)
Amount=LSG_ROUND_VALUE(Amount)

/*======Return Statement=======*/

RETURN L_Msg,Amount

Back to top

In next article, we shall cover the topic of Fast Formula Functions. That will be really helpful while working with Fast Formulas for Oracle HRMS and Payroll business requirements.

Reference: Oracle® Human Resources Management Systems FastFormula User Guide

If have like contents in this post and you think it can be helpful to others, please share it at least once in your circle, in this way, you will join me in my cause to Learn Share and Grow. Come on, Lets Grow Together.

Related Topics:
Online free Tests
Data Types Used in Fast Formulas
Overview of Oracle HCM/ HRMS
Element Termination Rules in Oracle HRMS
Enable Diagnostic Examine in Oracle Apps
Interview Questions