--
declare
--
l_mode varchar2(10) := 'CRITERIA'; --'ASG'
--- DECLARE variables for HR_ASSIGNMENT_API.update_emp_asg
--- IN variables
l_assignment_id number := 123456;
l_normal_hours number := 37;
--per_assignment_status_types.assignment_status_type_id%TYPE;
l_assignment_status_type_id number := 1;
l_sob_id number := 1;
l_default_expense_ccid number := 1234;
--- OUT variables
l_org_now_no_manager_warning boolean := false;
l_no_managers_warning boolean := false;
l_other_manager_warning boolean := false;
l_hourly_salaried_warning boolean := false;
l_comment_id number;
l_effective_start_date date;
l_effective_end_date date;
l_soft_coding_keyflex_id number;
l_concatenated_segments varchar2(100);
--- DECLARE variables for HR_ASSIGNMENT_API.update_emp_asg_criteria
--- IN variables
l_payroll_id number := 125;
l_organization_id number := 5678;
l_position_id number := 9904567;
l_job_id number := 3456;
l_location_id number := 12345;
l_grade_id number := 12;
--- OUT variables
l_spp_delete_warning boolean := false;
l_entries_changed_warning varchar2(100) default null;
l_tax_district_changed_warning boolean := false;
l_people_group_id number;
l_people_group_name varchar2(100);
--
begin
--
if l_mode = 'ASG' then
/* This API updates contingent worker assignment.
* The assignment must exist as of the effective date, and must be a contingent
* worker assignment.
* updating the record. You must set to either UPDATE, CORRECTION,
* UPDATE_OVERRIDE or UPDATE_CHANGE_INSERT.
*/
hr_assignment_api.update_cwk_asg
(p_validate => false --in boolean default false
,p_effective_date => trunc(sysdate)
,p_datetrack_update_mode => 'CORRECTION'
,p_assignment_id => l_assignment_id
,p_assignment_status_type_id => l_assignment_status_type_id
,p_default_code_comb_id => l_default_expense_ccid
,p_set_of_books_id => l_sob_id
,p_normal_hours => l_normal_hours
--In/Out
,p_object_version_number => l_asg_object_version_number
--Out
,p_org_now_no_manager_warning => l_org_now_no_manager_warning
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
,p_comment_id => l_comment_id
,p_no_managers_warning => l_no_managers_warning
,p_other_manager_warning => l_other_manager_warning
,p_soft_coding_keyflex_id => l_soft_coding_keyflex_id
,p_concatenated_segments => l_concatenated_segments
,p_hourly_salaried_warning => l_hourly_salaried_warning
);
if (l_org_now_no_manager_warning= true or l_no_managers_warning = true or l_other_manager_warning = true or l_hourly_salaried_warning = true) then
dbms_output.put_line('Warning validating API: hr_assignment_api.update_cwk_asg');
rollback;
else
dbms_output.put_line('Success ');
commit;
end if;
elsif l_mode = 'CRITERIA' then
/* This API updates attributes of a contingent worker assignment that may
* affect the entitlement to element entries - currently Contingent Workers may
* not have element entries so this API is reserved for future use.
* The API updates the attributes of assignment.
*/
hr_assignment_api.update_cwk_asg_criteria
( p_effective_date => trunc(sysdate)
, p_datetrack_update_mode => 'CORRECTION'
, p_assignment_id => l_assignment_id
, p_validate => false --lb_validate_mode
, p_called_from_mass_update => false
, p_position_id => l_position_id
, p_job_id => l_job_id
, p_location_id => l_location_id
, p_organization_id => l_organization_id
-- In/Out
, p_object_version_number => l_asg_object_version_number
-- Out
,p_people_group_name => l_people_group_name
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
,p_people_group_id => l_people_group_id
,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
);
if (l_org_now_no_manager_warning= true or l_other_manager_warning = true or l_spp_delete_warning = true
or l_tax_district_changed_warning= true or l_entries_changed_warning is not null) then
dbms_output.put_line('Warning validating API: hr_assignment_api.update_cwk_asg_criteria');
rollback;
else
dbms_output.put_line('Success ');
commit;
end if;
end if ;
exception
when others then
dbms_output.put_line('Error: '||sqlerrm);
end;
--
declare
--
l_mode varchar2(10) := 'CRITERIA'; --'ASG'
--- DECLARE variables for HR_ASSIGNMENT_API.update_emp_asg
--- IN variables
l_assignment_id number := 123456;
l_normal_hours number := 37;
--per_assignment_status_types.assignment_status_type_id%TYPE;
l_assignment_status_type_id number := 1;
l_sob_id number := 1;
l_default_expense_ccid number := 1234;
--- OUT variables
l_org_now_no_manager_warning boolean := false;
l_no_managers_warning boolean := false;
l_other_manager_warning boolean := false;
l_hourly_salaried_warning boolean := false;
l_comment_id number;
l_effective_start_date date;
l_effective_end_date date;
l_soft_coding_keyflex_id number;
l_concatenated_segments varchar2(100);
--- DECLARE variables for HR_ASSIGNMENT_API.update_emp_asg_criteria
--- IN variables
l_payroll_id number := 125;
l_organization_id number := 5678;
l_position_id number := 9904567;
l_job_id number := 3456;
l_location_id number := 12345;
l_grade_id number := 12;
--- OUT variables
l_spp_delete_warning boolean := false;
l_entries_changed_warning varchar2(100) default null;
l_tax_district_changed_warning boolean := false;
l_people_group_id number;
l_people_group_name varchar2(100);
--
begin
--
if l_mode = 'ASG' then
/* This API updates contingent worker assignment.
* The assignment must exist as of the effective date, and must be a contingent
* worker assignment.
* updating the record. You must set to either UPDATE, CORRECTION,
* UPDATE_OVERRIDE or UPDATE_CHANGE_INSERT.
*/
hr_assignment_api.update_cwk_asg
(p_validate => false --in boolean default false
,p_effective_date => trunc(sysdate)
,p_datetrack_update_mode => 'CORRECTION'
,p_assignment_id => l_assignment_id
,p_assignment_status_type_id => l_assignment_status_type_id
,p_default_code_comb_id => l_default_expense_ccid
,p_set_of_books_id => l_sob_id
,p_normal_hours => l_normal_hours
--In/Out
,p_object_version_number => l_asg_object_version_number
--Out
,p_org_now_no_manager_warning => l_org_now_no_manager_warning
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
,p_comment_id => l_comment_id
,p_no_managers_warning => l_no_managers_warning
,p_other_manager_warning => l_other_manager_warning
,p_soft_coding_keyflex_id => l_soft_coding_keyflex_id
,p_concatenated_segments => l_concatenated_segments
,p_hourly_salaried_warning => l_hourly_salaried_warning
);
if (l_org_now_no_manager_warning= true or l_no_managers_warning = true or l_other_manager_warning = true or l_hourly_salaried_warning = true) then
dbms_output.put_line('Warning validating API: hr_assignment_api.update_cwk_asg');
rollback;
else
dbms_output.put_line('Success ');
commit;
end if;
elsif l_mode = 'CRITERIA' then
/* This API updates attributes of a contingent worker assignment that may
* affect the entitlement to element entries - currently Contingent Workers may
* not have element entries so this API is reserved for future use.
* The API updates the attributes of assignment.
*/
hr_assignment_api.update_cwk_asg_criteria
( p_effective_date => trunc(sysdate)
, p_datetrack_update_mode => 'CORRECTION'
, p_assignment_id => l_assignment_id
, p_validate => false --lb_validate_mode
, p_called_from_mass_update => false
, p_position_id => l_position_id
, p_job_id => l_job_id
, p_location_id => l_location_id
, p_organization_id => l_organization_id
-- In/Out
, p_object_version_number => l_asg_object_version_number
-- Out
,p_people_group_name => l_people_group_name
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
,p_people_group_id => l_people_group_id
,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
);
if (l_org_now_no_manager_warning= true or l_other_manager_warning = true or l_spp_delete_warning = true
or l_tax_district_changed_warning= true or l_entries_changed_warning is not null) then
dbms_output.put_line('Warning validating API: hr_assignment_api.update_cwk_asg_criteria');
rollback;
else
dbms_output.put_line('Success ');
commit;
end if;
end if ;
exception
when others then
dbms_output.put_line('Error: '||sqlerrm);
end;
--
This is very helpful. Thanks, Sri
ReplyDelete