Showing posts with label Short Writeups. Show all posts
Showing posts with label Short Writeups. Show all posts

Friday, April 23, 2010

Short Writeup: Fast Formula - Overview

Oracle Fast Formula can be written using formula form found in

Navigation -> Total Compensation -> Basic -> Fast Formula -> Write Formula

Once written, usually Fast formulas are attached to elements of Payroll for any computation. But FF can be of any type including payroll, accruals etc.

Different Components of Fast Formulas:
  1. Input Statement
  2. Assignment Statements
  3. Return Statements
Data Types:
There are three types of data available in fast formula. They are text, numeric and date types. By default a variable is of numeric type. If the data type is not numeric then it must be specified like

INPUTS are x,y (date),z (text)

Fast Formula Variables:
Fast formula variables are of three types. Local, Global and database variables.

Variables usually get their values when values are input to them during a formula call or through database objects.

Formula Structure:
A simple formula may look like this with input, assignment and return statements.

INPUTS are x,y

x = y + 1

RETURN x

Note:
  • RETURN statement is used to return the specific value to outside usually a payroll run
  • There can be many RETURN statement in a formula but only one INPUTS statement is allowed in a formula
  • Values of input variables can not be changed
  • When the element input value is passed to the formula, the input name must be same as that of the input values of the element and the multiple words must be joined by an underscore.
Contexts:
Contexts are similar to environment variables. Since fast formulas are attached to elements, the contexts change for each assignment. Typical context info include
  • Business group
  • Element and element links
  • Employee and his assignments
Order of processing:
Calculation begins from inner most braces starting left to right.

Conditional Statements:
We can use If-else statement like we use it in any other languages.

IF THEN
(
statements
)
ELSE
(
statements
)

Here we can use the normal conditional operators and logical operators(AND,OR,NOT). There is one more clause called 'WAS DEFAULTED' which when used in if condition, results in true condition if the particular value passed is null.
For eg.

DEFAULT for x is 10

IF x WAS DEFAULTED THEN
(
statements
)
ELSE
(
statements
)

When no value/null value is passed to x then the condition evaluates to TRUE oterwise FALSE.

Comments:
The commenting is similar to that of pl/sql and C++
/* Comments */

Aliases:
The database items are often longer and referencing them in formulas becomes tedious without aliases.
ALIAS database_name AS alias_name

Fast Formula Functions:
FF Functions can be of following types.
  • Text Functions
  • Numeric Functions
  • Date Functions
  • Data conversion Functions
  • NULL Functions
Database items:
Database items are the procedures that exist in database. These items can be referenced in fast formula to arrive at the result values. There are two types of database items.

  1. Static DB Items: are predefined and include standard type of information. For example, date of birth of an employee.
  2. Dynamic DB Items: are generated by the definitions of elements, balances, absence types, flex field segments etc. For example, for each of the input value entry of an element one DB Item is created with preceding element name.


Thursday, April 22, 2010

Short Writeup: Oracle Payroll Balances

Balances in oracle payroll is nothing but addition/subtraction of 'run result values'. Considering a lay man example of showing year to date salary payment made for particular employee, it may be computed through summing up run result values generated after each payroll through specified time period or one could use Balances.

We could define our own balance or use one of the seeded balance to take particular element feeds.

Navigation -> Total Compensation -> Basic -> Banlances

Again, balances can be fed by individual elements or through element classification(at the larger level). We should note that both are mutually exclusive. Basic balance information is stored in PAY_BALANCE_TYPES table in R12 .

Dimension:
Dimensions talk about period context of balance i.e. in our previous example, 'one financial year' forms the dimension. similarly dimension can be quarter to date, month to date types. Dimension details are stored in PAY_BALANCE_DIMENSIONS.

Balance Feeds:
As we saw previously, balance feed is nothing but how element types are used to feed balances. The input values of element type is linked to balance type via PAY_BALANCE_FEEDS_F table.

Defined Balances:
Balances by itself does not hold the accrued balance values. Because the context in which balance is going to be used may change depending on the dimension with which we query it. Hence PAY_DEFINED_BALANCES links the valid combination of balance types and dimension types. This table has defined_balance_id as the primary key which will be extensively referred in latest balances.

Balance Dimension Types:
Usually balances are associated at the assignment level. But there are five different types of dimensions based on which the balances may be used differs.

  1. N type - Not Fed, Not stored
  2. F type - Fed, but not stored
  3. A type - stored at assignment level
  4. P type - stored at person level
  5. R type - Run level balances
The balances for N and F types are not stored in the database tables whereas it is stored for other types.

Latest Balance:
In R12, the latest balances, be it in assignment level or at person level are stored commonly in a table called PAY_LATEST_BALANCES. The latest balances at assignment level are stored in PAY_ASSIGNMENT_LATEST_BALANCES and linked to PAY_LATEST_BALANCES through latest_balance_id. This table also holds assignment_id and assignment_action_id also. Similarly PAY_PERSON_LATEST_BALANCES is also linked to PAY_LATEST_BALANCES.