Oracle HRMS API

By | February 14, 2016

API to Update People Group Field in Employee Assignment 

declare

l_effective_start_date DATE;
l_effective_end_date DATE;
l_people_group_id NUMBER := 62; — 2; –2067;
l_group_name VARCHAR2 (500);
l_org_now_no_manager_warning BOOLEAN;
l_other_manager_warning BOOLEAN;
l_spp_delete_warning BOOLEAN;
l_entries_changed_warning VARCHAR2 (500);
l_tax_district_changed_warning BOOLEAN;
l_special_ceiling_step_id NUMBER;
l_object_version_number NUMBER;
l_soft_coding_keyflex_id NUMBER;
———————
— Local Variables —
———————

l_concatenated_segments VARCHAR2 (400);
l_no_managers_warning BOOLEAN;
l_comment_id NUMBER;
l_batch_run_number hr_api_batch_message_lines.batch_run_number%TYPE;
l_dummy_line_id hr_api_batch_message_lines.line_id%TYPE;
l_person_id NUMBER;
l_supervisor_id NUMBER;
v_assignment_id number;
l_supervisor_assignment_id NUMBER;
l_action VARCHAR2 (100);
l_rows_processed NUMBER := 0;
l_status_flag VARCHAR2 (1);

cursor c1 is
select
ppf.employee_number,
ppf.full_name,
ppf.business_group_id,
paaf.assignment_id,
paaf.grade_id,
paaf.position_id ,
paaf.job_id,
paaf.payroll_id,
paaf.location_id,
paaf.organization_id,
paaf.pay_basis_id,
paaf.supervisor_id,
ppg.segment1,
ppg.segment2,
ppg.segment3,
ppg.segment4,
paaf.people_group_id,
paaf.object_version_number,
paaf.special_ceiling_step_id,
paaf.effective_start_date,
paaf.effective_end_date
from per_all_assignments_f paaf, per_all_people_f ppf,pay_people_groups ppg
where paaf.person_id = ppf.person_id
and trunc(sysdate) between paaf.effective_start_date and paaf.effective_end_date
and trunc(sysdate) between ppf.effective_start_date and ppf.effective_end_date
and ppf.employee_number = ‘603167’
and ppf.current_employee_flag = ‘Y’
and ppg.PEOPLE_GROUP_ID = paaf.people_group_id;

BEGIN
for r in c1 loop
begin
l_people_group_id := NULL;–r.people_group_id;
l_object_version_number :=r.object_version_number;
l_special_ceiling_step_id :=r.special_ceiling_step_id;
l_effective_start_date := r.effective_start_date;
l_effective_end_date := r.effective_end_date;
HR_ASSIGNMENT_API.UPDATE_EMP_ASG_CRITERIA
(p_effective_date => r.effective_start_date,
p_datetrack_update_mode => ‘CORRECTION’,
p_assignment_id => r.assignment_id,
p_validate => FALSE,
p_called_from_mass_update => FALSE,
p_segment2 => ‘KP’, –People Group Field for Divison
p_segment3 => ‘KPD’, –People Group Field for Department
————————-Out Variables Start Here
p_people_group_id => l_people_group_id,
p_object_version_number => l_object_version_number,
p_special_ceiling_step_id => l_special_ceiling_step_id,
p_group_name => l_group_name,
p_effective_start_date => l_effective_start_date,
p_effective_end_date => l_effective_end_date ,
p_org_now_no_manager_warning => l_org_now_no_manager_warning,
p_other_manager_warning => l_other_manager_warning,
p_spp_delete_warning => l_spp_delete_warning,
p_entries_changed_warning => l_entries_changed_warning,
p_tax_district_changed_warning => l_tax_district_changed_warning
);

dbms_output.put_line(‘r.employee_number ‘||r.employee_number ||’ r.assignment_id ‘ ||r.assignment_id
||’ l_people_group_id ‘||l_people_group_id||’ r.people_group_id ‘||r.people_group_id||’ l_group_name ‘||l_group_name);
exception when others then
dbms_output.put_line(‘Exception ‘||SQLERRM);
end ;
end loop;
END;