declare
--
l_action varchar2(10) := 'CREATE';--'UPDATE'
--
l_business_group_id number := 101;
l_assignment_id number := 123456;
l_budget_unit per_assignment_budget_values_f.unit%type := 'FTE';
l_budget_value per_assignment_budget_values_f.value%type := 1;
--
l_ovn_abv number;
l_ass_bv_id number;
begin
/* This API creates/updates an assignment budget value.
*
* An assignment budget value gives information on how much that assignment is
* contributing to your enterprise. It has an associated unit; example values
* are 'Full Time Equivalent', 'Headcount', 'Percentage Full Time'. Assignment
* budget values are used primarily in reporting.
@param p_unit The unit of the budget value. Valid values are defined by the
* lookup type 'BUDGET_MEASUREMENT_TYPE'.
*/
if l_action = 'CREATE' then
--
hr_asg_budget_value_api.create_asg_budget_value
( p_validate => false
, p_effective_date => trunc(sysdate)
, p_business_group_id => l_business_group_id
, p_assignment_id => l_assignment_id
, p_unit => l_budget_unit
, p_value => l_budget_value
-- Out
, p_object_version_number => l_ovn_abv
, p_assignment_budget_value_id => l_ass_bv_id
);
if l_ovn_abv is null then
dbms_output.put_line('Budget creation failed '||sqlerrm);
rollback;
else
dbms_output.put_line('Budget created');
commit;
end if;
else
--
l_ass_bv_id := 3;
--
hr_asg_budget_value_api.update_asg_budget_value
( p_validate => false
, p_assignment_budget_value_id => ln_ass_bv_id
, p_effective_date => trunc(sysdate)
, p_datetrack_mode => 'UPDATE'
, p_business_group_id => l_business_group_id
, p_unit => l_budget_unit
, p_value => l_budget_value
-- In / Out
, p_object_version_number => l_ass_bv_id
);
if l_ass_bv_id > 3 then
dbms_output.put_line('Budget updated');
commit;
else
dbms_output.put_line('Budget updatetion failed '||sqlerrm);
rollback;
end if;
end if;
--
exception
when others then
dbms_output.put_line('hr_asg_budget_value_api API failed with error :'||sqlerrm);
rollback;
end;
--
--
l_action varchar2(10) := 'CREATE';--'UPDATE'
--
l_business_group_id number := 101;
l_assignment_id number := 123456;
l_budget_unit per_assignment_budget_values_f.unit%type := 'FTE';
l_budget_value per_assignment_budget_values_f.value%type := 1;
--
l_ovn_abv number;
l_ass_bv_id number;
begin
/* This API creates/updates an assignment budget value.
*
* An assignment budget value gives information on how much that assignment is
* contributing to your enterprise. It has an associated unit; example values
* are 'Full Time Equivalent', 'Headcount', 'Percentage Full Time'. Assignment
* budget values are used primarily in reporting.
@param p_unit The unit of the budget value. Valid values are defined by the
* lookup type 'BUDGET_MEASUREMENT_TYPE'.
*/
if l_action = 'CREATE' then
--
hr_asg_budget_value_api.create_asg_budget_value
( p_validate => false
, p_effective_date => trunc(sysdate)
, p_business_group_id => l_business_group_id
, p_assignment_id => l_assignment_id
, p_unit => l_budget_unit
, p_value => l_budget_value
-- Out
, p_object_version_number => l_ovn_abv
, p_assignment_budget_value_id => l_ass_bv_id
);
if l_ovn_abv is null then
dbms_output.put_line('Budget creation failed '||sqlerrm);
rollback;
else
dbms_output.put_line('Budget created');
commit;
end if;
else
--
l_ass_bv_id := 3;
--
hr_asg_budget_value_api.update_asg_budget_value
( p_validate => false
, p_assignment_budget_value_id => ln_ass_bv_id
, p_effective_date => trunc(sysdate)
, p_datetrack_mode => 'UPDATE'
, p_business_group_id => l_business_group_id
, p_unit => l_budget_unit
, p_value => l_budget_value
-- In / Out
, p_object_version_number => l_ass_bv_id
);
if l_ass_bv_id > 3 then
dbms_output.put_line('Budget updated');
commit;
else
dbms_output.put_line('Budget updatetion failed '||sqlerrm);
rollback;
end if;
end if;
--
exception
when others then
dbms_output.put_line('hr_asg_budget_value_api API failed with error :'||sqlerrm);
rollback;
end;
--
No comments:
Post a Comment