Tuesday, August 18, 2020
Run R12 FAST formula from backend (TOAD) to debug
declare
l_formula_id ff_formulas_f.formula_id%TYPE;
l_effective_start_date ff_formulas_f.effective_start_date%TYPE;
l_formula_name ff_formulas_f.formula_name %TYPE;
l_inputs ff_exec.inputs_t;
l_outputs ff_exec.outputs_t;
begin
insert into fnd_sessions
values(userenv('SESSIONID'),sysdate);
select ffm.formula_id,ffm.effective_start_date ,ffm.FORMULA_NAME
into l_formula_id,l_effective_start_date ,l_formula_name
from ff_formulas_f ffm
where ffm.FORMULA_NAME='NP_HOUSING_ALLOWANCE_FF';
-- select * from ff_formulas_f where FORMULA_NAME='NP_HOUSING_ALLOWANCE_FF'
dbms_output.put_line(' l_formula_name - l_formula_id - l_effective_start_date :=> '||l_formula_name||' - '||l_formula_id||' - '
||to_char(l_effective_start_date,'DD-MON-YYYY'));
ff_exec.init_formula (l_formula_id,
l_effective_start_date,
l_inputs,
l_outputs
);
--
-- Loop through the Input Values
--
FOR i IN l_inputs.FIRST .. l_inputs.LAST
LOOP
if l_inputs(i).name='BUSINESS_GROUP_ID' then
l_inputs(i).value := 81;
end if;
if l_inputs(i).name='ASSIGNMENT_ID' then
l_inputs(i).value := 64;
end if;
if l_inputs(i).name='DATE_EARNED' then
l_inputs(i).value :=fnd_date.date_to_canonical(trunc(to_date('31-DEC-2020')));
end if;
if l_inputs(i).name='PAYROLL_ACTION_ID' then
l_inputs(i).value := 166992;
end if;
/* if l_inputs(l_in_cnt).name='BUSINESS_GROUP_ID' then
l_inputs(l_in_cnt).value := P_BUSINESS_GROUP_ID;
end if;
if l_inputs(l_in_cnt).name='BUSINESS_GROUP_ID' then
l_inputs(l_in_cnt).value := P_BUSINESS_GROUP_ID;
end if; */
--
-- Pass The each Input value name and its Value : Eg: START_DATE and p_start_date
--
dbms_output.put_line('l_inputs-Name : ' ||l_inputs (i).NAME );
END LOOP;
--
-- Run the formula
--
ff_exec.run_formula (l_inputs ,
l_outputs
);
FOR j IN l_outputs.FIRST .. l_outputs.LAST
LOOP
dbms_output.put_line('j-Name : ' ||l_outputs(j).NAME );
dbms_output.put_line('j-Value : ' ||l_outputs(j).VALUE );
END LOOP;
exception when others then
dbms_output.put_line('MainException : ' ||SQLERRM);
end;
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment