Step1 : Create the Element and Element links
Step2: write the fast formula
Step3: Attach the fast formula in Formula Results
Package used to call the fast formula from the backed : ff_exec
Simple Code Snippet below:
l_formula_id NUMBER;
l_element_inputs ff_exec.inputs_t;
l_element_outputs ff_exec.outputs_t;
l_in_count NUMBER;
l_out_count NUMBER;
l_pay_value NUMBER;
BEGIN
BEGIN
SELECT formula_id
INTO l_formula_id
FROM ff_formulas_f
WHERE formula_name = ‘XX_PAYROLL_FORMULA’
AND p_effective_date BETWEEN effective_start_date
AND effective_end_date;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (‘NO formula exists’);
END;
IF l_formula_id IS NOT NULL
THEN
— Insert FND_SESSIONS row ( Optional )
INSERT INTO fnd_sessions
( session_id,
effective_date
)
VALUES
( USERENV (‘sessionid’),
p_effective_date
);
—
— Initialize the formula.
—
ff_exec.init_formula (l_formula_id,
p_effective_date,
l_element_inputs,
l_element_outputs
);
—
— Loop through the Input Values
—
FOR l_in_count IN l_element_inputs.FIRST .. l_element_inputs.LAST
LOOP
—
— Pass The each Input value name and its Value : Eg: START_DATE and p_start_date
—
IF (l_element_inputs (l_in_count).NAME = ‘START_DATE’)
THEN
l_element_inputs (l_in_count).VALUE :=
fnd_date.date_to_canonical (p_start_date);
END IF;
END LOOP;
—
–Run The formula
—
ff_exec.run_formula (l_element_inputs, l_element_outputs);
—
— Get the Out Put Values
—
FOR l_out_count IN l_element_outputs.FIRST .. l_element_outputs.LAST
LOOP
—
— Get all the Out Put Values Here L_PAY_VALUE is the out put value
—
IF (l_element_outputs (l_out_count).NAME = ‘L_PAY_VALUE’)
THEN
l_pay_value := l_element_outputs (l_out_count).VALUE;
END IF;
END LOOP;
RETURN (l_pay_value);
END;
Prerequisites:
Latest Posts
- R12 – How to Handle NULL for :$FLEX$.VALUE_SET_NAME In Oracle ERPAugust 25, 2023 - 1:20 pm
- R12 – How to Delete Oracle AR TransactionsMarch 22, 2019 - 8:37 pm
- How to Define Custom Key Flexfield (KFF) in R12January 19, 2018 - 5:43 pm
- AutoLock Box Concepts In R12November 10, 2017 - 8:30 am
- R12 – java.sql.SQLException: Invalid column type in OAFSeptember 15, 2017 - 9:39 am
Recent Comments