--
declare
--
l_action varchar2(10) := 'CREATE';--'UPDATE'
--
l_business_group_id number := 101;
l_assignment_id number := 123456;
l_salary_reason varchar2(20) := 'PROM';
l_salary number := 46119;
l_end_date date := hr_general.end_of_time;
l_salary_status varchar2(10) := 'Y';
l_ee_id number;
l_pay_proposal_id per_pay_proposals.pay_proposal_id%type := 678546;
l_ovn_ppp number;
l_inv_next_sal_date_warning boolean;
l_proposed_salary_warning boolean;
l_approved_warning boolean;
l_payroll_warning boolean;
--
begin
/*#
* This API inserts/updates a salary proposal into the per_pay_proposals table.
* If the proposal is an approved one, this procedure will also insert into the
* pay_element_entries table to create a new salary proposal.
* @param p_proposal_reason The proposal reason. Valid values are defined by
* lookup type 'PROPOSAL_REASON'.
*/
if l_action = 'CREATE' then
--
l_pay_proposal_id := null;
--
hr_maintain_proposal_api.insert_salary_proposal
-- Out
( p_pay_proposal_id => l_pay_proposal_id
--
, p_assignment_id => l_assignment_id
, p_business_group_id => l_business_group_id
, p_change_date => trunc(sysdate)
, p_proposal_reason => l_salary_reason
, p_proposed_salary_n => l_salary
, p_date_to => l_end_date
-- Out
, p_object_version_number => l_ovn_ppp
--
, p_multiple_components => 'N'
, p_approved => l_salary_status
, p_validate => false
-- In / Out
, p_element_entry_id => l_ee_id
-- Out
, p_inv_next_sal_date_warning => l_inv_next_sal_date_warning
, p_proposed_salary_warning => l_proposed_salary_warning
, p_approved_warning => l_approved_warning
, p_payroll_warning => l_payroll_warning
);
if l_ovn_ppp is null or (l_inv_next_sal_date_warning = true or l_proposed_salary_warning = true
or l_approved_warning = true or l_payroll_warning = true) then
dbms_output.put_line('Salary creation failed '||sqlerrm);
rollback;
else
dbms_output.put_line('Salary created');
commit;
end if;
else
--
l_ovn_ppp := 3;
--
hr_maintain_proposal_api.update_salary_proposal
( p_pay_proposal_id => l_pay_proposal_id
, p_change_date => trunc(sysdate)
, p_proposal_reason => l_salary_reason
, p_proposed_salary_n => l_salary
, p_date_to => l_end_date
-- In / Out
, p_object_version_number => l_ovn_ppp
--
, p_multiple_components => 'N'
, p_approved => l_salary_status
, p_validate => false
-- Out
, p_inv_next_sal_date_warning => l_inv_next_sal_date_warning
, p_proposed_salary_warning => l_proposed_salary_warning
, p_approved_warning => l_approved_warning
, p_payroll_warning => l_payroll_warning
);
if l_ovn_ppp > 3 then
dbms_output.put_line('Salary updated');
commit;
elsif (l_inv_next_sal_date_warning = true or l_proposed_salary_warning = true
or l_approved_warning = true or l_payroll_warning = true) then
dbms_output.put_line('Salary updatetion failed '||sqlerrm);
rollback;
end if;
end if;
--
exception
when others then
dbms_output.put_line('hr_maintain_proposal_api API failed with error :'||sqlerrm);
rollback;
end;
--
declare
--
l_action varchar2(10) := 'CREATE';--'UPDATE'
--
l_business_group_id number := 101;
l_assignment_id number := 123456;
l_salary_reason varchar2(20) := 'PROM';
l_salary number := 46119;
l_end_date date := hr_general.end_of_time;
l_salary_status varchar2(10) := 'Y';
l_ee_id number;
l_pay_proposal_id per_pay_proposals.pay_proposal_id%type := 678546;
l_ovn_ppp number;
l_inv_next_sal_date_warning boolean;
l_proposed_salary_warning boolean;
l_approved_warning boolean;
l_payroll_warning boolean;
--
begin
/*#
* This API inserts/updates a salary proposal into the per_pay_proposals table.
* If the proposal is an approved one, this procedure will also insert into the
* pay_element_entries table to create a new salary proposal.
* @param p_proposal_reason The proposal reason. Valid values are defined by
* lookup type 'PROPOSAL_REASON'.
*/
if l_action = 'CREATE' then
--
l_pay_proposal_id := null;
--
hr_maintain_proposal_api.insert_salary_proposal
-- Out
( p_pay_proposal_id => l_pay_proposal_id
--
, p_assignment_id => l_assignment_id
, p_business_group_id => l_business_group_id
, p_change_date => trunc(sysdate)
, p_proposal_reason => l_salary_reason
, p_proposed_salary_n => l_salary
, p_date_to => l_end_date
-- Out
, p_object_version_number => l_ovn_ppp
--
, p_multiple_components => 'N'
, p_approved => l_salary_status
, p_validate => false
-- In / Out
, p_element_entry_id => l_ee_id
-- Out
, p_inv_next_sal_date_warning => l_inv_next_sal_date_warning
, p_proposed_salary_warning => l_proposed_salary_warning
, p_approved_warning => l_approved_warning
, p_payroll_warning => l_payroll_warning
);
if l_ovn_ppp is null or (l_inv_next_sal_date_warning = true or l_proposed_salary_warning = true
or l_approved_warning = true or l_payroll_warning = true) then
dbms_output.put_line('Salary creation failed '||sqlerrm);
rollback;
else
dbms_output.put_line('Salary created');
commit;
end if;
else
--
l_ovn_ppp := 3;
--
hr_maintain_proposal_api.update_salary_proposal
( p_pay_proposal_id => l_pay_proposal_id
, p_change_date => trunc(sysdate)
, p_proposal_reason => l_salary_reason
, p_proposed_salary_n => l_salary
, p_date_to => l_end_date
-- In / Out
, p_object_version_number => l_ovn_ppp
--
, p_multiple_components => 'N'
, p_approved => l_salary_status
, p_validate => false
-- Out
, p_inv_next_sal_date_warning => l_inv_next_sal_date_warning
, p_proposed_salary_warning => l_proposed_salary_warning
, p_approved_warning => l_approved_warning
, p_payroll_warning => l_payroll_warning
);
if l_ovn_ppp > 3 then
dbms_output.put_line('Salary updated');
commit;
elsif (l_inv_next_sal_date_warning = true or l_proposed_salary_warning = true
or l_approved_warning = true or l_payroll_warning = true) then
dbms_output.put_line('Salary updatetion failed '||sqlerrm);
rollback;
end if;
end if;
--
exception
when others then
dbms_output.put_line('hr_maintain_proposal_api API failed with error :'||sqlerrm);
rollback;
end;
--
Nice Blog !!..
ReplyDeleteIT Infrastructure Services
HRMS Services
JAVA Development Services
HR Management Services
Keep sharing such a valuable information. Thanks..
ReplyDeleteincome verification
NOT WORKING
ReplyDeleteThere must be some error message, why it failed?
Delete