Is Add_Months allowed in a Fast Formula?

Hi
Im trying to add the following to the carry over fast formula.
: Mid_Month_DDMM = to_char(to_date(to_char(ADD_MONTHS(Continuous_Service_Date, +1),'YYYYMM'),'YYYYMM')-1,'DDMM')
But it seems the formula does not like the "Add_months". Im trying to get the formula to work that when an employees continuous_service_date is not the 1st of the Month the carry over will happen at the end of the month.
Thanks
Andrew

The logic is as follows
Every 12 months employees forfiet their leave and carry over any balance.
From the PTO_CARRY_OVER with abit of customisation
IF ISNULL(OverrideHireDate) = 'Y'
THEN
Continuous_Service_Date = Continuous_Service_Date
ELSE
Continuous_Service_Date = OverrideHireDate
Ann_Date_DDMM = to_char(Continuous_Service_Date,'DDMM') /* ----Put this check to make sure 2902 is not concatenated to a non-leap YYYY ------ */
IF Ann_Date_DDMM = '2902' THEN
Anniversary_Date = to_date('0103' || to_char(Calculation_Date,'YYYY'),'DDMMYYYY')
ELSE
Anniversary_Date = to_date(Ann_Date_DDMM || to_char(Calculation_Date,'YYYY'),'DDMMYYYY')
**Anniversary_Date = to_date('01' || to_char(Anniversary_Date, 'MMYYYY'), 'DDMMYYYY')**
The last line makes sure that everyone no matter when you started has their forfieture date on the 1st of their anniversary month.
I want to us the logic that if your Ann_Date_DDMM does not equal 0101,0102,0103,0104,0105,0106,0107,0108,0109,0110,0111,0112
then your Anniversary date is the end of the anniversay month.
So hence my code of : to_char(to_date(to_char(ADD_MONTHS(Continuous_Service_Date, +1),'YYYYMM'),'YYYYMM')-1,'DDMM') that if working will concatinate with to_char(Calculation_Date,'YYYY'),
So for exampble. My anniversay date is the 13-May-2002.
On the 13-May-2013 the process is run to work out my forfieture-carryover for the 14th. But now the company wants me to only forfeit on the 31-May-2013
Calculation_Date = 13-May-2013 but with to_char(Calculation_Date,'YYYY') I get just the 2013 out.
the code to_char(to_date(to_char(ADD_MONTHS(Continuous_Service_Date, +1),'YYYYMM'),'YYYYMM')-1,'DDMM') should return (and it does in SQL developer) 3105. Concatinated its 31052013 , that would be my new forfeiture - carry over date.
So would be great to get the add_months working in the formula itself. Else if you can tell me where I can find the code for the seeded Continuous_Service_date then I can do the add_months in the package for the function.
Below is the full Formula:
/* Default Statements */
DEFAULT FOR ACP_CONTINUOUS_SERVICE_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR ACP_SERVICE_START_DATE IS '4712/12/31 00:00:00' (date)
/* Inputs Are Statements */
INPUTS ARE
Calculation_Date (date)
,Accrual_Term (text)
/* trace=za_set_trace_on('CARRYOVER')*/
/*--------------------------------- Formula Body -------------------------------------*/
/* ------- Check whether the Continuous Service Date was Set or the Hire Date. ------ */
/* ------- Accordingly set the Continuous Service Date. ------ */
IF ACP_CONTINUOUS_SERVICE_DATE WAS DEFAULTED THEN
Continuous_Service_Date = ACP_SERVICE_START_DATE
ELSE
Continuous_Service_Date = ACP_CONTINUOUS_SERVICE_DATE
OverrideHireDate = KPMG_GET_OVERRIDE_HIRE_DATE(Calculation_Date)
IF ISNULL(OverrideHireDate) = 'Y'
THEN
Continuous_Service_Date = Continuous_Service_Date
ELSE
Continuous_Service_Date = OverrideHireDate
Ann_Date_DDMM = to_char(Continuous_Service_Date,'DDMM') /*Andrew Campbell 30-November-2012*/
/*Mid_Month_DDMM = to_char(to_date(to_char(ADD_MONTHS(Continuous_Service_Date, +1),'YYYYMM'),'YYYYMM')-1,'DDMM')*/
/* ----Put this check to make sure 2902 is not concatenated to a non-leap YYYY ------ */
IF Ann_Date_DDMM = '2902' THEN
Anniversary_Date = to_date('0103' || to_char(Calculation_Date,'YYYY'),'DDMMYYYY')
ELSE
Anniversary_Date = to_date(Ann_Date_DDMM || to_char(Calculation_Date,'YYYY'),'DDMMYYYY')
Anniversary_Date = to_date('01' || to_char(Anniversary_Date, 'MMYYYY'), 'DDMMYYYY')
/* Set Accrual Term to Previous, the requirement is to run CO once per month at the end of the */
/* month for all assgs with Anniversary Dates during that month */
IF Accrual_Term = 'PREVIOUS' THEN
Effective_Date = add_years(add_days(Anniversary_Date, -1), -1)
ELSE
Effective_Date = add_days(Anniversary_Date,-1)
/* For months in later half of the Year and process running for Six Monthly run then reduce */
/* the Effective Date by one year. */
Anniversary_Month = to_char(Anniversary_Date,'MM')
IF (Calculation_Date < Anniversary_Date)
AND ((Anniversary_Month = '07')
OR (Anniversary_Month = '08')
OR (Anniversary_Month = '09')
OR (Anniversary_Month = '10')
OR (Anniversary_Month = '11')
OR (Anniversary_Month = '12')) THEN
Effective_Date = add_years(Effective_Date, -1)
/* Effective_Date = Effective_Date */ /* koos */
/* Calculate Previous Cycle's Start Date,End Date and Six Monthly Anniversary Date in Current Cycle */
Effective_End_Date = Effective_Date
Effective_Start_Date = add_months(Effective_End_Date, -12)
/* Semi_Anniversary_Date = add_months(Effective_End_Date,6) */
Semi_Anniversary_Date = add_months(Effective_End_Date,12) /* Change forfeiture to 12 months after carry over */
/* ------- Calculate the Number of Years completed -------*/
Years_service = floor(months_between(add_days(Effective_date,1), Continuous_Service_Date) / 12)
/* This PROCESS flag is set up so that CO will not run for those employees with eff dates -*/
/* ----------------------------- before calculation_date --------------------------------------*/
IF /* (Calculation_Date >= Effective_Date) */ /* Koos */
(((to_char(Effective_Date,'MMYYYY') = to_char(Calculation_Date,'MMYYYY'))
AND (last_day(Effective_Date) <> Effective_Date ))
OR ((to_char(Anniversary_Date,'MM') = to_char(Calculation_Date,'MM'))
AND (last_day(Effective_Date) = Effective_Date ))) THEN
/* Calculating for Yearly Run */
Process = 'YES'
/* Expiry_Date = add_months(Effective_Date, 6) */
Expiry_Date = add_months(Effective_Date, 12) /* Change forfeiture to 12 months after carry over */
/* After 1 year set the date for calculating for Six Months period */
IF Years_service > 1 THEN
/* Effective_start_Date = add_months(Effective_start_Date,6) */
Effective_start_Date = add_months(Effective_start_Date,12) /* Change forfeiture to 12 months after carry over */
Annual_Cal = 1
ELSE IF /* (Calculation_Date < add_years(Effective_Date,1)) */ /* Koos */
(((to_char(Semi_Anniversary_Date,'MMYYYY') = to_char(Calculation_Date,'MMYYYY'))
AND (last_day(Semi_Anniversary_Date) <> Semi_Anniversary_Date ))
/* OR ((to_char(add_months(Anniversary_Date,6),'MM') = to_char(Calculation_Date,'MM')) */
OR ((to_char(add_months(Anniversary_Date,12),'MM') = to_char(Calculation_Date,'MM')) /* Change forfeiture to 12 months after carry over */
AND (last_day(Semi_Anniversary_Date) = Semi_Anniversary_Date ))) THEN
/* Calculating for Six Monthly Run */
Process = 'YES'
/* Expiry_Date = add_months(Semi_Anniversary_Date,6) */
Expiry_Date = Semi_Anniversary_Date /* Koos */
/* For Semi Annual run set the date for calculation for Six Months */
IF Years_service > 0 THEN
Effective_start_Date = Effective_end_Date
Effective_end_Date = Semi_Anniversary_Date
Annual_Cal = 0
ELSE
/* If neither Annual or Semi Annual Run then Donot process */
Process = 'NO'
Expiry_Date = add_years(Effective_Date, 1)
Annual_Cal = 1
/* --------- Set the Public Variables eg. Maximum Carry Over from the accrual bands ------- */
IF (GET_ACCRUAL_BAND(years_service) = 0) THEN
IF Years_service > 1 then
Max_Carryover = KPMG_GET_ANNUAL_ACCRUAL(Effective_End_Date)
else
Max_Carryover = KPMG_GET_ANNUAL_ACCRUAL(Effective_End_Date)
ELSE
Max_Carryover = KPMG_GET_ANNUAL_ACCRUAL(Effective_End_Date)
/*---------------------- Return Statements --------------------------------------
Effective_date is the last date of an accrual term
Expiry_date is the date by which employees must use carried over PTO or lose it.
/*trace_off = za_set_trace_off*/
RETURN Max_Carryover, Effective_date, Expiry_Date, Process
Thanks

Similar Messages

  • How to use dynamic database item in Fast formula

    Dear All
    How to use Element Pay value in Fast Formula
    Element Name: Transport_Allowance
    Input Values : Name Units User Enterable Database Item
    Pay Value Money No Yes
    Amount Money Yes Yes
    Balance Feeds : Value Name Balance Name Units
    Pay Value Transportation Amount Money
    Formula
    DEFAULT FOR ASG_SALARY IS 0
    DEFAULT FOR TRANSPORTATION_AMOUNT_ASG_RUN IS 0
    ALIAS ASG_SALARY AS Emp_Salary
    ALIAS TRANSPORTATION_AMOUNT_ASG_RUN AS Emp_Trans_Amt
    V_CALCULATED_SALARY = Emp_Salary + Emp_Trans_Amt
    RETURN V_CALCULATED_SALARY
    Using the above formula, I got only Basic Salary only
    How to get the Basic Salary + Transportation allowance in the return value
    Please help me..
    Thanks in advance

    Please check whether the priority of the element with which the fast formula is attached has a priority higher than the Transport_Allowance. If not then cahange the priority of the element to a prriority higher than Transport_Allowance.
    HTH

  • To_Number conversion in Fast Formula

    Hi All
    I am doing a simple Fast Formula calculation where I'm trying to convert the return date into number.
    It is throwing error. But What am i doing wrong. I'm trying to convert the date returned value to number.
    APP-FF-33983: Parameter type mismatch for function 'TO_NUMBER' at line 15
    Cause: The user has specified a function whose name has been recognised but whose parameter types do not match any known version of the function.
    Action: Please check that any variables or literals passed to the function are of the appropriate types for the function definition. ***
    This is my code
    DEFAULT FOR EMP_TERM_DATE IS '1-JAN-4712'(date)
    DEFAULT FOR PAY_PROC_PERIOD_START_DATE IS '01-JAN-1951' (date)
    DEFAULT FOR PAY_PROC_PERIOD_END_DATE IS '31-DEC-4712' (date)
    DEFAULT FOR C_Allowance_Balance_ASG_YTD is 0
    DEFAULT FOR L_paid_amount IS 0
    DEFAULT FOR Day_amount IS 0
    DEFAULT FOR days_deduction IS 0
    DEFAULT FOR deducted_amount IS 0
    DEFAULT FOR L_last_day is '31-JAN-4712'(date)
    L_last_day = TO_DATE( '31-DEC-'+TO_CHAR(PAY_PROC_PERIOD_END_DATE,'YYYY'),'DD-MON-YYYY')
    Day_amount = (C_Allowance_Balance_ASG_YTD)/ 365
    /**15* */ days_deduction =to_number(l_last_day- EMP_TERM_DATE)
    deducted_amount = days_deduction*days_amount
    return deducted_amount

    Thanks Avinash,for the reply!
    Tried that also...
    this is the error i get.
    APP-FF-33003: Line 18: 'DAYS_DEDUCTION' is of type NUMBER but has DATE type assigned into it.
    Cause: The data type of the expression on the right hand side of the assignment statement does not match the data type of the variable on the left hand side of the assignment, probably because of an earlier assignment to the variable of a different data type.
    Action: Ensure data types of assignments match, or that variable being set has not been set before to another data type.
    This is my complete formula
    DEFAULT FOR EMP_TERM_DATE IS '1-JAN-4712'(date)
    DEFAULT FOR PAY_PROC_PERIOD_START_DATE IS '01-JAN-1951' (date)
    DEFAULT FOR PAY_PROC_PERIOD_END_DATE IS '31-DEC-4712' (date)
    DEFAULT FOR C_Allowance_Balance_ASG_YTD is 0
    DEFAULT FOR L_paid_amount IS 0
    DEFAULT FOR Day_amount IS 0
    DEFAULT FOR days_deduction IS 0
    DEFAULT FOR deducted_amount IS 0
    DEFAULT FOR L_last_day is '31-JAN-4712'(date)
    L_msg = 'Club Allowance: '
    L_last_day = TO_DATE( '31-DEC-'+TO_CHAR(PAY_PROC_PERIOD_END_DATE,'YYYY'),'DD-MON-YYYY')
    Day_amount = (C_Allowance_Balance_ASG_YTD)/ 365
    days_deduction = L_last_day-EMP_TERM_DATE
    deducted_amount = (days_deduction*day_amount)
    L_msg = L_msg||' Term Date :'||to_char(EMP_TERM_DATE)||'Days_ded: '||to_char(days_deduction)
    return deducted_amount,L_msg

  • How to use Oracle OAB Fast Formulas in Discoverer-desktop [ for reporting]

    Hi,
    Can anyone tell me how to use a fast formula in discoverer-desktop [for reporting]. Currently, we have a disco-report that calcuates the 'monthly salary', but we don't want to use that. Instead, we have a custom fast-formula [xx_oab_monthly_salary] which has the conditions and calculations that we need.
    I want to use that formula in discoverer-desktop directly and get the monthly-salary.. i.e., someone needs to create a folder under the business area and add it i believe.. the formula internally calls a function.
    when i checked about this with my dba - he said, he can add the 'function', but not the formula. and i need to write the calculation part...
    does anyone know how to add it...there shud a way right...
    i do not have access to the technical-stuff here..
    someone said ["you can wrap the FF_EXEC.run_formula call into your own pl/sql function and map this function into the EUL so that the formula can be called from a workbook.", but this talks about pl/sql-do we need pl/sql
    for this].
    also, someone else said [ some fast formulas need specific contexts to be set. Depending on whether the fast formula below the only fast formula that you want to recreate in Discoverer.
    For a single formula, in general my recommendation is to recreate the fast formula instead of using the ff_exec call].
    any quick answers greatly appreciate..
    thx,

    Hi,
    That's right you need to develop the pl/sql function outside of Discoverer using a pl/sql tool or just SQL*plus. I haven't an example to hand, but can dig one up if you need it. Once you have the function developed you can map it into the EUL using Discoverer Administrator. It will then be available to Discoverer Desktop/Plus as a database function when creating calculations. So you can then just add the calculation to an existing or new report.
    Alternatively, you can build the pl/sql function into a view and load the view into a new folder using Discoverer Admin.
    Rod West

  • Error in Fast Formula for Supplemental Earnings Elements

    Hi,
    I have an requirement in Supplement Earning Elements for US Localization. I need to define some Supplement Earning Elements that should comes in Payroll with the extension of existing Elements.
    Here are the Steps for setups which i have done so far-
    Step 1:Created new Elements with their values with effective dates for existing user Table name
    Step 2:Done the setup for New Elements with classification as Supplemental and Category also attached the formula like "FLAT AMOUNT" formula for Calculation rule in Element Earning screen.
    Step 3: when i tried to query for the element i have created, the value in Calculation Field is "Elementname_FLAT_AMOUNT_RWSI" which is not same for the existing elements.Existing Element which is of same classification and same category the Calculation rule field is "ElementName_FLAT_AMOUNT".
    Step 4: After that i did setup for Element Description and Element Link.
    Step 5: Then i have copied the Formula from Existing element(which is previously configured and working fine for the existing elements ), made the modifications for the newly created element. When Compiling the formula ,i am getting an Error "Incorrect Data type"
    I have two queries -
    1- The setup in Earnings Screen with Calculation Rule is correct or not. As the Calculation Field for newly elements and the existing elements are different (as mentioned in Step 3).
    2- Compilation Error "Incorrect Data Types" in Fast Formula.(as mentioned in Step 5).
    I m pasting the Fast Formula code here for ready reference
    Default for TERMINATED_EMPLOYEE      is 'N'
    Default for RUN_TYPE               is 'R'
    Default for FINAL_PAY_PROCESSED      is 'N'
    default for PAYROLL_TERMINATION_TYPE is 'L'
    default for BG_TERMINATION_TYPE is 'L'
    default FOR LAST_STANDARD_PROCESS_DATE_PROCESSED IS 'N'
    DEFAULT FOR ELEMENT_NAME_NEG_EARNINGS_ASG_GRE_ITD     IS 0
    DEFAULT FOR ELEMENT_NAME_ADDITIONAL_ASG_GRE_ITD     IS 0
    DEFAULT FOR ELEMENT_NAME_REPLACEMENT_ASG_GRE_ITD     IS 0
    DEFAULT FOR ELEMENT_NAME_ASG_GRE_YTD IS 0
    DEFAULT FOR ELEMENT_NAME_ASG_GRE_RUN IS 0
    Default for PAY_EARNED_START_DATE is '02-JAN-0001' (DATE)
    Default for PAY_EARNED_END_DATE is '02-JAN-0001' (DATE)
    Default for ASG_NUMBER is ' '
    Default for ELEMENT_NAME_ASG_GRE_FYTD IS '0'
    Default for CURRENT_ELEMENT_TYPE_ID is 0
    Default for GROUP_KF_PAY_FREQUENCY is '0'
    DEFAULT FOR Amount IS 0
    INPUTS ARE Amount
    IF ELEMENT_NAME_REPLACEMENT_ASG_GRE_ITD WAS DEFAULTED OR ELEMENT_NAME_REPLACEMENT_ASG_GRE_ITD = 0 THEN
    pay_frequency = GROUP_KF_PAY_FREQUENCY
    ELEMENT_TYPE_ID_PASSED = CURRENT_ELEMENT_TYPE_ID
    annual_rate = HCS_GET_SUPPLEMENT_RATE(ELEMENT_TYPE_ID_PASSED, PAY_EARNED_END_DATE, 'General Rate')
    annual_bal = ELEMENT_NAME_ASG_GRE_FYTD
    IF annual_bal = annual_rate THEN
    Amount = 0.00
    mesg = 'Contract amount '||TO_CHAR(annual_rate)||' fully paid for '||ASG_NUMBER
    ELSE
    Amount = annual_rate / TO_NUMBER(pay_frequency)
    If abs(annual_bal+amount-annual_rate) < 1 then
    Amount = annual_rate-annual_bal
    IF ELEMENT_NAME_ASG_GRE_RUN=0 THEN
    flat_amount = Amount
    + ELEMENT_NAME_ADDITIONAL_ASG_GRE_ITD
    + ELEMENT_NAME_NEG_EARNINGS_ASG_GRE_ITD
    ELSE
    ( flat_amount = Amount )
    ELSE
    (flat_amount = ELEMENT_NAME_REPLACEMENT_ASG_GRE_ITD + ELEMENT_NAME_ADDITIONAL_ASG_GRE_ITD
    + ELEMENT_NAME_NEG_EARNINGS_ASG_GRE_ITD
    clear_repl_amt = -1 * ELEMENT_NAME_REPLACEMENT_ASG_GRE_ITD
    IF ELEMENT_NAME_ASG_GRE_RUN = 0 THEN
    IF ELEMENT_NAME_ADDITIONAL_ASG_GRE_ITD <> 0 THEN
    clear_addl_amt = -1 * ELEMENT_NAME_ADDITIONAL_ASG_GRE_ITD
    IF flat_amount < 0 THEN
    (IF (PAYROLL_TERMINATION_TYPE WAS DEFAULTED AND
    BG_TERMINATION_TYPE = 'A' AND
    TERMINATED_EMPLOYEE = 'Y' AND
    FINAL_PAY_PROCESSED = 'N') OR
    (PAYROLL_TERMINATION_TYPE = 'A' AND
    TERMINATED_EMPLOYEE = 'Y' AND
    FINAL_PAY_PROCESSED = 'N') OR
    (PAYROLL_TERMINATION_TYPE WAS DEFAULTED AND
    BG_TERMINATION_TYPE = 'L' AND
    TERMINATED_EMPLOYEE = 'Y' AND
    LAST_STANDARD_PROCESS_DATE_PROCESSED = 'N') OR
    (PAYROLL_TERMINATION_TYPE = 'L' And
    TERMINATED_EMPLOYEE = 'Y' AND
    LAST_STANDARD_PROCESS_DATE_PROCESSED = 'N') THEN
    neg_earn = -1 * ELEMENT_NAME_NEG_EARNINGS_ASG_GRE_ITD
    ELSEHuman Resource Management (HRMS)
    (neg_earn = flat_amount - ELEMENT_NAME_NEG_EARNINGS_ASG_GRE_ITD
    flat_amount = 0
    ELSE
    (IF ELEMENT_NAME_NEG_EARNINGS_ASG_GRE_ITD <> 0 THEN
    neg_earn = -1 * ELEMENT_NAME_NEG_EARNINGS_ASG_GRE_ITD
    IF (PAYROLL_TERMINATION_TYPE WAS DEFAULTED AND
    BG_TERMINATION_TYPE = 'A' AND
    TERMINATED_EMPLOYEE = 'Y' AND FINAL_PAY_PROCESSED = 'N') OR
    ( PAYROLL_TERMINATION_TYPE = 'A' AND
    TERMINATED_EMPLOYEE = 'Y' AND FINAL_PAY_PROCESSED = 'N') OR
    (PAYROLL_TERMINATION_TYPE WAS DEFAULTED AND
    BG_TERMINATION_TYPE = 'A' AND
    TERMINATED_EMPLOYEE = 'Y' AND FINAL_PAY_PROCESSED = 'Y'
    AND RUN_TYPE != 'R') OR
    ( PAYROLL_TERMINATION_TYPE = 'A' AND
    TERMINATED_EMPLOYEE = 'Y' AND FINAL_PAY_PROCESSED = 'Y' AND
    RUN_TYPE != 'R') THEN
    (STOP_ENTRY = 'Y'
    mesg = ' ELEMENT_NAME earning has been stopped for this assignment.'
    ln_calc_meth = SET_ALTRNT_FLAT_RATE_CALC_METH('NOT_APPLICABLE','NOT_APPLICABLE')
    if (1 = 1) then (
         soe_run = ELEMENT_NAME_ASG_GRE_RUN
         soe_ytd = ELEMENT_NAME_ASG_GRE_YTD
    RETURN flat_amount, clear_addl_amt, clear_repl_amt, neg_earn, STOP_ENTRY, mesg
    Can anyone help me in solving this problem. Any kind of pointers would be helpful.
    Thanks
    Pradeep.

    Hi Pradeep,
    Hope you created the new element using the 'Earnings Template' form. If it is created using the 'Earnings Template' form then the calculation rule
    should be correct. You said you are modifying the new element formula by using the existing element formula code, have you checked if the
    formula code to the old and new once have changed anything other than the element name and standard input elements reference. Try to use
    the debug messages in formula and see if that give you any clue. You should find the document in metalink how to debug a formula.
    Thanks,
    Satin

  • Error while uploading Fast Formula using ldt Files.

    Dear All,
    We need to migrate Fast Formula to different instances.
    Also we need to have version control also.
    For that we created custom lct file.
    We were able to download the ldt files correctly but found that while uplaoding fast formula context were getting truncated at the end.
    Any inputs to resolve the above issue will he very helpful.
    Also we need to migrate Payroll Configuration
    1.Element Description
    2.Fast Formula
    3.Formula Function
    4.Formula Results
    5.Element links
    Any input will be very helpful

    user5733015 wrote:
    Do we need any license for I-set up?No -- https://forums.oracle.com/forums/search.jspa?threadID=&q=iSetup+AND+License&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • India localization oracle fast formulas help

    hi ..
    anybody help on oracle india localization fast formulas, absence mgmt setup, online payslip setup and tax declaration set up in payroll and sshr basic setups for absence mangt and transfer setup. plz send me on [email protected]

    send me a contract, buy me a ticket, and i fly over.

  • How to extract the Fast Formula Body through database?

    Hi All
    The Oracle fast formulas are stored in the ff_formulas_f table under the column formula_text having the datatype long. I want to extract the formula text through back end. When I use the statement, Select formula_text from ff_formulas_f, I am getting only the first line.
    How to extract the full formula text?
    Regards
    Rahman

    Here's a unix shell script to do it for you based on the info given by the other posters.
    #!/bin/sh
    if \[ "$1" == "" \]; then
    echo Syntax: $0 FAST_FORMULA_NAME
    exit 1
    fi
    ffname=`echo $1|tr \[:lower:\] \[:upper:\]`; export ffname
    sqlplus -silent $ORAUSER/$ORAPASSWD <<END
    set define off serveroutput on format wrapped linesize 512 pagesize 0 feedback off verify off heading off echo off pause off long 100000
    column formula_text format a512;
    select formula_text from ff_formulas_f where formula_name = '$ffname';
    exit;
    END
    Also this will list the formula names given a substring:
    #!/bin/sh
    if \[ "$1" == "" \]; then
    echo Syntax: $0 FAST_FORMULA_NAME
    exit 1
    fi
    ffname=`echo $1|tr \[:lower:\] \[:upper:\]`; export ffname
    sqlplus -silent $ORAUSER/$ORAPASSWD <<END
    set define off serveroutput on format wrapped linesize 512 pagesize 0 feedback off verify off heading off echo off pause off long 5000
    select formula_name from ff_formulas_f where formula_name like '%$ffname%';
    exit;
    END

  • Custom Fast formula for Time Entry Rule in OTL

    Hi,
    i have created custom validation for time entry rules. I need to validate where Project and task fields are null or not? If Yes, it has to fire the custom message that i have mentioned in function. Please check the below code and help me whether i am on right path:
    CREATE OR REPLACE FUNCTION NON_pto_against_projects (
    p_time_category_id NUMBER,
    p_person_id NUMBER
    RETURN VARCHAR2
    IS
    --Variables used for retrieving timecard id and ovn
    l_db_pre_period_start DATE;
    l_db_pre_period_stop DATE;
    l_time_building_block_id hxc_time_building_blocks.time_building_block_id%TYPE;
    l_object_version_number hxc_time_building_blocks.object_version_number%TYPE;
    --Variables used for loading timecard tables
    l_time_building_blocks hxc_self_service_time_deposit.timecard_info;
    l_time_app_attributes hxc_self_service_time_deposit.app_attributes_info;
    l_attributes hxc_self_service_time_deposit.building_block_attribute_info;
    --Variables used for getting exploded time details
    v_blocks_tab hxc_block_table_type;
    v_attr_tab hxc_attribute_table_type;
    l_messages_tab hxc_message_table_type;
    l_detail_blocks hxc_self_service_time_deposit.timecard_info;
    l_detail_messages hxc_self_service_time_deposit.message_table;
    CURSOR csr_category_elements (p_category_id NUMBER)
    IS
    SELECT 'ELEMENT - ' || TO_CHAR (value_id) element_type_string
    FROM hxc_time_category_comps_v
    WHERE time_category_id = p_category_id;
    l_cat_elements_string VARCHAR2 (2000);
    l_temp VARCHAR2 (1000); --Trace message
    l_success_flag CHAR (1); --Return values
    BEGIN
    --Initialize variables
    l_success_flag := 'S';
    l_time_building_blocks := hxc_self_service_time_deposit.get_building_blocks;
    l_attributes := hxc_self_service_time_deposit.get_block_attributes;
    v_blocks_tab :=
    hxc_deposit_wrapper_utilities.blocks_to_array (l_time_building_blocks);
    v_attr_tab :=
    hxc_deposit_wrapper_utilities.attributes_to_array (l_attributes);
    IF v_blocks_tab.FIRST IS NOT NULL
    THEN
    Take each ELEMENT type attribute, and search whether PROJECTS type attribute exists for the SAME BLOCK-START
    FOR index1 IN v_attr_tab.FIRST .. v_attr_tab.LAST
    LOOP
    IF v_attr_tab (index1).attribute_category = 'ELEMENT - %'
    THEN --Element attr
    FOR element_rec IN csr_category_elements (p_time_category_id)
    LOOP
    If Element Attribute matches any of the NON-TOP elements in the Time Category-START
    IF v_attr_tab (index1).attribute_category =
    element_rec.element_type_string
    THEN
    Check PROJECTS Attributes project and task belonging to ELEMENT attribute's owner block-START
    l_success_flag := 'E';
    FOR index2 IN v_attr_tab.FIRST .. v_attr_tab.LAST
    LOOP
    IF v_attr_tab (index2).attribute_category LIKE
    'PROJECT - %'
    AND v_attr_tab (index2).building_block_id =
    v_attr_tab (index1).building_block_id
    AND v_attr_tab (index2).attribute1 IS NOT NULL
    AND v_attr_tab (index2).attribute2 IS NOT NULL
    THEN
    l_success_flag := 'S';
    EXIT;
    END IF;
    END LOOP;
    IF l_success_flag = 'E'
    THEN
    RETURN 'E';
    END IF;
    Check PROJECTS Attributes project and task belonging to ELEMENT attribute's owner block-END
    END IF;
    If Element Attribute matches any of the NON-TOP elements in the Time Category-END
    END LOOP;
    END IF; --Element attr
    END LOOP;
    Take each ELEMENT type attribute, and search whether PROJECTS type attribute exists for the SAME BLOCK-END
    END IF;
    RETURN l_success_flag;
    EXCEPTION
    WHEN OTHERS
    THEN
    RAISE;
    END NON_pto_against_projects;

    INPUTS ARE resource_id (number)
    , submission_date (text)these inputs are passed in PLSQL Code and some of them in formula context
    2. While we define a new context for a time entry rule. How is the data that we enter in the time entry rule passed to the fast formula?See the time Rule entry screen and you will find the parameters window there.

  • How to use DFF value in BG_ABSENCE_DURATION Fast formula

    Hi All,
    I would like to know how can we use DFF values in BG_ABSENCE_DURATION fast formula.
    Can we pass them as input values?
    Also, when we use them as DATABASE ITEMS how does Fast Formula identifies them.
    For example I have created a DFF value HALF_DAY that can take either "YES" nor "NO".
    I tried to use that as input value but that didnt work, not sure if it is possible at all or not.
    I also tried to use that as Data Base ITEM, as follows:-
    IF (ABSENCES_HALF_DAY WAS DEFAULTED ) then
    duration = 'FAILED'
    invalid_msg = 'DFF not working'
    Any help will be much appreciated.
    Thanks,
    Avinash
    but i am getting following error when i access SSHR
    Formula BG_ABSENCE_DURATION: ORA-01403: no data found ORA-01403: no data found Cause: During the PL/SQL execution part, an Oracle error was detected. Action: Please refer to your system administrator.

    Thanks Vigneswar  and Avaneesh for your helpful comments,
    Actually I want to retrive the DFF value that I pass while applying the Leave Request and not that already stored in the data base. I checked and found that the query you have mentioned is retriving the data from base tables.
    select target.ATTRIBUTE6 -- Attrinute6 is database item ABSENCES_HALF_DAY+
    from    per_absence_attendances                target,+
    per_all_assignments_f                  ASSIGN+
    WHERE   sysdate BETWEEN ASSIGN.effective_start_date+
    AND ASSIGN.effective_end_date+
    AND    ASSIGN.assignment_id                  = 647--&B2+
    AND    ASSIGN.assignment_type                = 'E'+
    AND    target.person_id                      = ASSIGN.person_id+
    AND    target.absence_attendance_id  =+
    *(select max (absence_attendance_id)*
    from   per_absence_attendances+
    where  person_id   =  ASSIGN.person_id+
    and    date_start <=  sysdate+
    I have only added folloing lines In my BG_ABSENCE_DURATION FF
    DEFAULT FOR ABSENCES_HALF_DAY is 'XX'+
    if (1 = 1) then+
    duration = 'FAILED'+
    invalid_msg = 'DFF not working: '+ABSENCES_HALF_DAY+
    But evry time output is *"DFF not working : Yes"* no matter what the value I am passing while applying leave. This value "Yes" is stored in DFF attribute 6 for the test employee and I guess FF is retriving this value from DATABSE not from current transaction.
    Could you please help how to retrive run time data.
    Thanks,
    Avinash

  • Using Oracle Fast Formula in Discoverer

    Hello,
    Does anyone have any experience of using Fast Formula in Discoverer - can it be called from a PL/SQL function that would then be registered in the usual way in Discoverer?
    Thanks
    Rachael

    Hi,
    Yes, you can wrap the FF_EXEC.run_formula call into your own pl/sql function and map this function into the EUL so that the formula can be called from a workbook.
    Rod West

  • R12 - Compile Invalid objects (Fast Formula, Package Body and View) Urgent

    Invalid objects about 43, in this Fast Formula 2 AP Package object, and 1 view
    OWNER     OBJECT_TYPE     COUNT(*)
    APPS     PACKAGE BODY     37.00
    APPS     PROCEDURE     1.00
    SCOTT     PACKAGE BODY     1.00
    APPS     VIEW     1.00
    APPS     FUNCTION     3.00
    any one can give idea to make it valid.
    Awaiting for your reply.
    FYI
    the object list is below.
    OWNER     OBJECT_NAME
    APPS     FFP52474_01010001
    APPS     FFP61059_01010001
    APPS     FFP56168_01010001
    APPS     FFP56167_01010001
    APPS     FFP58579_01052004
    APPS     FFP56169_01010001
    APPS     FFP56170_01010001
    APPS     FFP56171_01010001
    APPS     FFP56172_01010001
    APPS     FFP56173_01010001
    APPS     FFP60309_01010001
    APPS     FFP60306_01010001
    APPS     FFP60308_01010001
    APPS     FFP60310_01010001
    APPS     FFP60307_01010001
    APPS     AP_IMPORT_VALIDATION_PKG
    APPS     FFP58576_01011951
    APPS     FFP60357_01011951
    APPS     FFP57511_01010001
    APPS     FFP57510_01010001
    APPS     FFP52473_01010001
    APPS     FFP60305_01010001
    APPS     FFP60545_01042004
    APPS     FFP60342_01010001
    APPS     FFP58887_01042004
    APPS     FFP58888_01042004
    APPS     FFP58870_01042004
    APPS     FFP58885_01042004
    APPS     FFP58907_01010001
    APPS     FFP58906_01010001
    APPS     FFP58861_01042004
    APPS     FFP61122_01010001
    APPS     FFP58871_01042004
    APPS     FFP58857_01042005
    APPS     FFP60917_01032006
    SCOTT     MK_PLS_XML_REP_TEST
    APPS     MK_PLS_XML_REP_TEST
    APPS     AP_FSX_PAYMENT_ADVICE
    APPS     RA_SITE_USES
    APPS     ZDBAR_CONTACT
    APPS     ZDBAR_FAX
    APPS     ZDBCLOAD
    APPS     ZDBAP_DV_PAYMENT_TYPE
    Advanced thanks for reading and giving solution for this.
    Thamaraiselvan

    any one can give idea to make it valid.Run "Compile APPS Schema" from adadmin.
    For Fast Formulas, refer to:
    Note: 155737.1 - How To Compile Oracle Fast Formulas
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=155737.1

  • Custom Employee Number Generation Using Fast Formulas

    Hi,
    I have a requirement to generate custom employee numbers like "EMP100001". we have already created a business group with the setting of Employee number generation as Automatic. but we need to generate custom employee number as Format given above instead of automatic number generation.
    I have created my own PL/SQL Package to generate custom employee number as per Person Type. Also created a Fast Formula Function with the following parameters -
    Name = Get_Custom_Number
    Data Type = Text
    Class = External Funtion
    Alias Name = NULL or what you want the alias to be
    Description = Returns the next custom number value
    Definition = CUSTOM_EMP_NUMBER_GENERATION.Get_Custom_Number (PL/SQL Function)
    Proving the following Context usages and Parameters details to the Fast Formula Function -
    Context usages:-
    Number = 1
    Context Name = BUSINESS_GROUP_ID
    Data Type = Number
    Parameters as defined in PL/SQL function
    1 p_legislation_code Text Input Only
    2 p_person_type Text Input Only
    3 p_person_number Text Input Only
    4 p_party_id Number Input Only
    5 p_person_id Number Input Only
    6 p_national_id Text Input Only
    7 p_date_of_birth Date Input Only
    Than i created a Fast Formula using the following navigation
    Total Compensation > Basic > Write Formula
    with following details -
    Name = EMP_NUMBER_GENERATION
    Type = Person Number Generation
    Description = Returns next Employee number
    and wrote my formula code.
    When i created a Employee from Enter and Maintain People screen it is showing automatic number instead of my custom employee number.
    I m not able to find where i m missing the logic or some parameters?
    If anyone has come across such situation, please provide some pointers here.
    Thanks
    Renu

    What is the application release?
    Please review these docs and see if it helps.
    Is it Possible to Update Generate Employee Number Method From Automatic to Manual? [ID 393827.1]
    Need To Change The Employee Numbering From Automatic To Manual [ID 291634.1]
    Unable to Switch From Auto to Manual for Employee Number Generation in Shared Hr [ID 452044.1]
    How to Prefix a Zero on Custom Employee Numbers [ID 822425.1]
    How To Implement Custom Person Numbering Using FastFormula Based on User Person Type Instead of System Person Type [ID 372696.1]
    Thanks,
    Hussein

  • How to create database item for fast formula?

    Hi,
    Is there any document for how to create database item for fast formula? I could not find in Metalink or this forum. Thanks.
    Andy

    Oracle ship many pre-delivered Database Items plus they're created automatically when you create Input Values (etc).
    There's often something already there for you. If there's not, you usually create Fast Formula functions to retrieve other data. You don't create your own custom DBIs; Oracle don't deliver APIs for that.

  • How to disable or delete fast formulas?

    Hi,
    We have a list of fast formulas to retire, and I need to know if there's an API that I can use to automate this (either to disable or delete the fast formulas)?
    Thanks,
    Lorena

    Welcome to the Apple community.
    All you need to do is logout at system preferences > iCloud.

Maybe you are looking for

  • Moving SAP ERP Servers to a different domain.

    Hello Experts I currently have 3 SAP ERP 6.0 servers (central installs) a solution manager 7.0 EHP1 and netweaver CE machine all located in one windows domain (currenlty windows 2003 domain controllers) all running Oracle databases.  I have been aske

  • How to exclude top-level keywords from export?

    Hi, I have keywords organised into a hierarchical structure; I never want the top-level keywords to appear in the exported image but can't find a quick way to do it. I can make it work by going to one of it's children and editing that keyword tag, un

  • Aperture Question: No Masters

    Hi, I'm hoping someone here can assist. It seems I don't have the masters of a lot of my photos that I am able to see when I launch Aperture.  I'm hoping I can still use the photos, since I can visually see them on the screen, just not the masters. 

  • Missing Files (images)??!

    I have created a website using iWeb 3.0.4. I have added text & images. Every time I go to publish what I've already saved again, my images are missing & I get the "missing files error message". Help! Do I have to continue to re-add forever? What's up

  • I want to add smooth transitions without freeze frames?

    I usually edit wedding videos with various short clips.  I want to be able to add default transitions to all of the clips at once.  When I do add transitions to all most clips have freeze frames. I've heard about handles, and having enough frames for