Introduction:
The People Group flexfields lets you add your own key information to the
Employee Assignment. You use each segment to define the different groups of employees which exist within your own enterprise.
Goal:
update people group using “hr_assignment_api.update_emp_asg_criteria” API
Forms Or Pages:
Example:
Oracle HRMS API to update people group in oracle
API IN/OUT Parameters :
— IN p_effective_date IN DATE Required
— IN p_datetrack_update_mode IN VARCHAR2 Required
— IN p_assignment_id IN NUMBER Required
— IN p_validate IN BOOLEAN Required
— IN p_called_from_mass_update IN BOOLEAN Required
— IN p_organization_id IN NUMBER Required
— IN Out p_people_group_id NUMBER
— IN Out p_object_version_number NUMBER
— IN Out p_special_ceiling_step_id NUMBER
— Out p_group_name VARCHAR2
— Out p_effective_start_date DATE
— Out p_effective_end_date DATE
— Out p_org_now_no_manager_warning BOOLEAN
— Out p_other_manager_warning BOOLEAN
— Out p_spp_delete_warning BOOLEAN
— Out p_entries_changed_warning VARCHAR2
— Out p_tax_district_changed_warning BOOLEAN
— Out p_concatenated_segments BOOLEAN
API Parameters clarifications:
- @param p_effective_date Can be either the current date or a date in the future.
- @param p_datetrack_update_mode control parameter enables you to define the type of DateTrack change to be made.
- @param p_assignment_id System-generated primary key column Primary Key for “PER_ASSIGNMENTS_F”.
- @param p_validate control parameter (the default value is FALSE) to executes all validation for that business function.
- @param p_called_from_mass_update Set to TRUE if the API is called from the Mass Update Processes.
- @param p_organization_id Foreign Key for“HR_ALL_ORGANIZATION_UNITS”.
- @param p_people_group_id Foreign Key for “PAY_PEOPLE_GROUPS”.
- @param p_object_version_number Object Version Number (OVN) is a column in a database table. It is used to track multiple changes to a record. When a new row is inserted, the OVN is set to 1.
- @param p_special_ceiling_step_id API sets this attribute to null on the database and the latest value is passed out of the API. If you do not want to alter this attribute, set the calling logic variable to hr_api.g_number.???
- @param p_group_name Identifies the name of an existing group in the workspace.
- @param p_effective_start_date and @param p_effective_end_date are all maintained by DateTrack. The START_DATE is the date when the first record for this person was created. The earliest EFFECTIVE_START_DATE for a person is equal to the START_DATE, so that If p_validate is false, then set to the effective end date for the created assignment. If p_validate is true, then set to null.
- @param p_org_now_no_manager_warning Set to true if this assignment is a manager, the organization is updated and there is now no manager in the previous organization. Set to false if another manager exists in the previous organization.
- @param p_other_manager_warning If set to true, then a manager existed in the organization prior to calling this API and the manager flag has been set to ‘Y’ for yes.
- @param p_spp_delete_warning Set to true when grade step and point placements are date effectively ended or purged by the update of the assignment. Both types of change occur when the Grade is changed and spinal point placements exist over the updated date range. Set to false when no grade step and point placements are affected.
- @param p_entries_changed_warning This is set to ‘Y’, if at least one element entry was altered due to the assignment change. It is set to ‘S’, if at least one salary element entry was affected (This is a more specific case than ‘Y’).
- @param p_tax_district_changed_warning Always set to False, since contingent worker assignments are not eligible to have a Payroll, therefore cannot be included in the United Kingdom processing which determines the value of this parameter.
- @param p_concatenated_segments If p_validate is false, set to Soft Coded Key Flexfield concatenated segments, if p_validate is true, set to null.
API Calling example:
DECLARE
v_datetrack_update_mode VARCHAR2 (200);
v_assignment_id NUMBER (20);
v_assignment_number NUMBER;
v_object_version_number NUMBER (2);
v_people_group_id NUMBER (20);
v_special_ceiling_step_id NUMBER;
v_group_name VARCHAR2 (200);
v_effective_start_date DATE := NULL;
v_effective_date DATE;
v_effective_end_date DATE := NULL;
v_org_now_no_manager_warning BOOLEAN;
v_other_manager_warning BOOLEAN;
v_spp_delete_warning BOOLEAN;
v_entries_changed_warning VARCHAR2 (200);
v_tax_district_changed_warning BOOLEAN;
v_soft_coding_keyflex_id NUMBER (20);
v_concatenated_segments VARCHAR2 (200);
v_api_error VARCHAR (4000);
BEGIN
v_special_ceiling_step_id := NULL;
BEGIN
SELECT a.assignment_id
,a.assignment_number
,a.effective_start_date
,a.object_version_number
,a.people_group_id
INTO v_assignment_id
,v_assignment_number
,v_effective_date
,v_object_version_number
,v_people_group_id
FROM per_all_assignments_f a
WHERE person_id = 31418;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
BEGIN
v_datetrack_update_mode := 'UPDATE';
hr_assignment_api.update_emp_asg_criteria ( --in
p_effective_date => v_effective_date
,p_datetrack_update_mode => v_datetrack_update_mode
,p_assignment_id => v_assignment_id
,p_validate => FALSE
,p_called_from_mass_update => NULL
,p_organization_id => 202
,p_segment18 => 'ORAASK'
--in out
,p_people_group_id => v_people_group_id
,p_object_version_number => v_object_version_number
,p_special_ceiling_step_id => v_special_ceiling_step_id
, --out
p_group_name => v_group_name
,p_effective_start_date => v_effective_start_date
,p_effective_end_date => v_effective_end_date
,p_org_now_no_manager_warning => v_org_now_no_manager_warning
,p_other_manager_warning => v_other_manager_warning
,p_spp_delete_warning => v_spp_delete_warning
,p_entries_changed_warning => v_entries_changed_warning
,p_tax_district_changed_warning => v_tax_district_changed_warning
,p_soft_coding_keyflex_id => v_soft_coding_keyflex_id
,p_concatenated_segments => v_concatenated_segments);
COMMIT;
dbms_output.put_line ('*************************************');
dbms_output.put_line ('People Group Updated Successfully for assignment no : ' || v_assignment_number);
dbms_output.put_line ('*************************************');
EXCEPTION
WHEN OTHERS THEN
v_api_error := sqlerrm;
dbms_output.put_line ('*************************************');
dbms_output.put_line ('There is exception has been raised from API for assignment No : ' || v_assignment_number || ' with error message ' || v_api_error);
dbms_output.put_line ('*************************************');
--just if you use cursor
v_api_error := NULL;
v_people_group_id := NULL;
END;
END;
Final Result:
[convertkit form=1415728]Hope this helpful.
If you found it simple and easy to understand, we would love to provide you and your friends a simple solution for your problems.
Thanks.