unlocking the power of oracle fast formula

Upload: adnan-khan

Post on 03-Apr-2018

237 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    1/21

    OAUG Spring 2002 i

    Unlocking the Power of Oracle Fast Formula

    Prepared by Thomas Russell

    Xcelicor, Inc.

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    2/21

    Document Control Page ii

    Contents

    Introduction.............................................................................................................................1

    Purpose .............................................................................................................................1Summary...........................................................................................................................1

    Advantages of Using Fast Formula / Rules .......................................................................2

    How To Use Fast Formula (Rules) - Naming .....................................................................3

    How To Use Fast Formula (Rules) - Syntax ........................................................................4

    How To Use Fast Formula (Rules) - Conditional Logic ....................................................6

    How To Use Fast Formula (Rules) - Functions...................................................................8

    How To Use Fast Formula (Rules) - DBitems.....................................................................9

    How To Use Fast Formula (Rules) Return Statement...................................................10

    Fast Formula / Rules Where can they be used and how .............................................11

    Payroll Run Time calculations.....................................................................................12Payroll Element input validation edits ....................................................................13Payroll Skip Rules.......................................................................................................14PTO Accruals Calculations for accrual and carryover ..........................................15Benefits Enforce client specific eligibilities, coverage rates, inception of coverage,etc. ....................................................................................................................................16Benefits System Extract data selection.....................................................................17HRMS Quickpaint for displaying employee information ....................................18

    Conclusion.............................................................................................................................19

    Questions ........................................................................................................................19

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    3/21

    OAUG Spring 2002 1

    Introduction

    Purpose

    Oracle Fast Formula are extremely versatile. The purpose of thisdocument is to focus on that versatility. It is notmeant to be an all encompassing how to guide. Instead, standard Oracle fast Formula documentation and

    functionality will be referred to rather than re-defined.

    Summary

    Oracle Fast Formulae are most often thought of as a payroll feature and something too technical for the average userto use. It is generally known by Oracle payroll clients that fast formulae are programs that calculate earnings,deductions and taxes. This is a fairly narrow scope. Oracle has been inserting this technology in other applicationswithin the HRMS umbrella.

    This presentation will dispel the misguided notion that fast formulae are for payroll only and that they are only forthe super technical. It will present fast formulae uses in payroll, benefits and system extract. It will unlock the power

    of these applications; with fast formulae one can truly be free to enforce ones own client rules.

    In payroll, fast formulae are used to determine if and when an element is processed , how it is processed and theresult of that processing. In benefits each comp object is furnished with a rule window that allows one to createcustom fast formulae for all benefit requirements including eligibilities, post processing edits, etc..

    Additionally in the standard benefits product system extract enables one to extract prescribed data from theapplication and fast formulae explodes this realm in such a way that many extract files can be created by this feature

    This presentation is not intended to present payroll, benefits or system extract but rather the underlying oftmisunderstood tool that can make implementing and maintaining client rules a routine task .

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    4/21

    OAUG Spring 2002 2

    Advantages of Using Fast Formula / Rules

    Easy for the non technical to use

    Knowledge of SQL not necessary

    Integrated into Oracle HR, Payroll, Benefits : easy access to data (including balances)

    An easy way to implement client specific rules

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    5/21

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    6/21

    OAUG Spring 2002 4

    How To Use Fast Formula (Rules) - Syntax

    Improper syntax results in fast formula compilation errors. Formula like these will not execute. Syntax and usageguidelines are defined by Oracle in the Fast Formula documentation.

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

    FORMULA NAME: mass transit

    FORMULA TYPE: Payroll

    Change History

    22-FEB-2001 T Russell Created .

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

    /* Alias Section */

    ALIAS SCL_ASG_US_WORK_SCHEDULE AS Work_Schedule

    /* Defaults Section */

    default for tax_free_amount is 0

    default for taxable_amount is 0

    /* Inputs Section */

    Inputs are tax_free_amount,

    taxable_amount

    IF taxable_amount WAS DEFAULTED or

    tax_free_amount WAS DEFAULTED

    THEN

    ( mesg =

    'Mass transit requires both tax free and taxable amounts to be inputted'

    RETURN mesg )

    ELSE

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    7/21

    OAUG Spring 2002 5

    (

    nottaxed = tax_free_amount

    istaxed = taxable_amount

    RETURN nottaxed, istaxed, mesg )

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    8/21

    OAUG Spring 2002 6

    How To Use Fast Formula (Rules) - Conditional Logic

    If-Then-Else , conditional and nested logic allows great versatility in coding.

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

    FORMULA NAME: MILEAGE_FLAT_AMOUNT_NONRECUR

    FORMULA TYPE: Payroll

    DESCRIPTION: calculate $ mileage using global

    **********************************************************************

    Change History

    17-APR-01 T Russell Created.

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

    /* Input Value Defaults */

    Default for MILEAGE_00_ADDITIONAL_ASG_GRE_ITD is 0

    Default for MILEAGE_00_REPLACEMENT_ASG_GRE_ITD is 0

    Default for MILEAGE_00_ASG_GRE_RUN is 0

    Default for MILEAGE_00_ASG_GRE_YTD is 0

    Default for Distance is 0

    /* Inputs */

    INPUTS ARE Distance

    Amount=Distance * cents_per_mile_00 /* global */

    mesg = 'amount='+to_text(amount) +' global='+to_text(cents_per_mile_00)

    IF MILEAGE_00_REPLACEMENT_ASG_GRE_ITD WAS DEFAULTED OR

    MILEAGE_00_REPLACEMENT_ASG_GRE_ITD = 0 THEN

    (flat_amount = Amount + MILEAGE_00_ADDITIONAL_ASG_GRE_ITD

    + MILEAGE_00_ADDITIONAL_ASG_GRE_ITD)

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    9/21

    OAUG Spring 2002 7

    ELSE

    (flat_amount = MILEAGE_00_REPLACEMENT_ASG_GRE_ITD

    + MILEAGE_00_ADDITIONAL_ASG_GRE_ITD

    clear_repl_amt = -1 * MILEAGE_00_REPLACEMENT_ASG_GRE_ITD

    mesg = 'MILEAGE_00 Amount overridden by Replacement Amount.')

    IF MILEAGE_00_ADDITIONAL_ASG_GRE_ITD 0 THEN

    clear_addl_amt = -1 * MILEAGE_00_ADDITIONAL_ASG_GRE_ITD

    if (1 = 1) then (

    )

    RETURN flat_amount, clear_addl_amt, clear_repl_amt, mesg

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    10/21

    OAUG Spring 2002 8

    How To Use Fast Formula (Rules) - Functions

    These are PL/SQL scripts that are catalogued for and made available to fast formula. These perform complex datamanipulations and allow one to be more economical in the coding of a fast formula. Oracle delivers many useful

    functions and clients can define their own. The standard / delivered functions are documented by Oracle in theUsing Fast Formula manual. Some of the delivered functions are:

    To_Char : used to transform character data to numeric

    To_Num : used to transform data from char to numeric

    Trunc: to truncate decimals

    Days_Between : to return the days between two dates

    Months_Between : to return the months between two dates

    Years_Between : to return the years between two dates

    Greatest : returns the greatest in a string

    Least : returns the least in a string

    Calculate_Payroll_periods

    Get_Absence

    Many More.

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    11/21

    OAUG Spring 2002 9

    How To Use Fast Formula (Rules) - DBitems

    The data that is accessed in fast formula are registered as dbitems (data base items). Dbitems have context whichdetermine where they can be accessed. For example a dbitem for payroll may not be accessible to benefits. The client

    can define dbitems automatically when a element, earning,deduction, balance, globals, person, etc. is defined. Onoccasion though a dbitem needs to be defined technically; this entails technical support to update those Oracle tablesdefining the dbitem and its context(s).

    Automatically defined dbitems are called dynamic dbitems. Those dbitems pre-defined within the application arecalled static dbitems.

    Dynamic Dbitems

    Elements (earnings, deductions, information)

    Element input values

    Balances

    Flex Fields

    Global Values

    Static Dbitems

    Accrual Plans

    Applicant

    Employee

    Contact

    Location

    Address

    Date

    Payroll

    etc

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    12/21

    OAUG Spring 2002 10

    How To Use Fast Formula (Rules) Return Statement

    Every fast formula should have a return statement. This fast formula statement when processed ends execution of theformula and passes the result of its execution to the appropriate destination.

    Payroll uses the formula results form to map return variables as direct feeds (the result of thecalculation or indirect feeds (pass data to another element for subsequent processing or balanceprocessing or message processing). The client is free to name their own results, passing them thru thereturn statement and mapping them as desired.

    Benefits There are prescribed returns predefined within the benefits application. So, in addition todetermining the type of fast formula one must also select the corresponding return. Failure to do thiswill result in the benefit rule not performing as desired..it will appear that the formula did notexecute.

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    13/21

    OAUG Spring 2002 11

    Fast Formula / Rules Where can they be used and how

    A Fast Formula or Rule is only valuable when it can be executed. The following lists some of the places in OracleHRMS/Benefits where these rules can be executed

    Payroll Payroll run time calculations

    Payroll Element input validation edits

    Payroll Skip Rule

    PTO Accruals Calculations for accrual and carryover

    Benefits Enforce client specific eligibilities, coverage rates, inception of coverage, etc.

    Benefits System Extract data selection

    HRMS Quickpaint for displaying employee information

    HRMS Assignment Sets

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    14/21

    OAUG Spring 2002 12

    Payroll Run Time calculations

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    15/21

    OAUG Spring 2002 13

    Payroll Element input validation edits

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    16/21

    OAUG Spring 2002 14

    Payroll Skip Rules

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    17/21

    OAUG Spring 2002 15

    PTO Accruals Calculations for accrual and carryover

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    18/21

    OAUG Spring 2002 16

    Benefits Enforce client specific eligibilities, coverage rates, inception of coverage, etc.

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    19/21

    OAUG Spring 2002 17

    Benefits System Extract data selection

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    20/21

  • 7/28/2019 Unlocking the Power of Oracle Fast Formula

    21/21

    Conclusion

    Fast Formula (Rules) empower the non technical super user

    Fast Formula (Rules) are versatile

    Fast Formula (Rules) are integrated in the HRMS suite of applications

    Future enhancements to Oracle HRMS/Benefits will continue to include Fast Formula (Rules)

    Questions

    ?