Introduction:
Special Information Types (SIT) can use to capture additional person information.
Its a KFF ( Keyflexfield ) called (Personal Analysis Keyflexfield) in HRM.
Goal:
Add a New special Information Type using “hr_sit_api.create_sit” API.
Forms Or Pages:
Example:
API to create SIT in oracle HRMS
API IN/OUT Parameters :
— IN p_person_id IN NUMBER Required
— IN p_business_group_id IN NUMBER Required
— IN p_id_flex_num IN NUMBER Required
— p_effective_date IN DATE Required
— p_analysis_criteria_id IN NUMBER Out
— p_person_analysis_id IN NUMBER Out
— p_pea_object_version_number IN NUMBER Out
API Parameters clarifications:
- @param p_person_id System-generated primary key column “PER_ALL_PEOPLE_F”.
- @param p_business_group_id Identifier of Enterprise, used for multi-tenancy partitioning. Foreign key to “HR_ORGANIZATION_UNITS”.
- @param p_id_flex_num is the database attribute for Flexfield structure number. To uniquely identify a Flexfield structure.
- @param p_effective_date Can be either the current date or a date in the future.
- @param p_pea_object_version_number The API usually sets the object.
- @param p_person_analysis_id is Unique identifier to PER_PERSON_ANALYSES table.
- @param p_analysis_criteria_id is unique identifier to PER_ANALYSIS_CRITERIA (KFF table) which hold the segment values and combinations.
version number to 1. Whenever that row is updated in the database, the object version number is incremented. The row keeps that object version number until it is next updated or deleted. The number is not decremented or reset to a previous value.
API Calling example:
/* CREATE TABLE XXX_API_SIT_Data ( person_id NUMBER (10), business_group_id NUMBER (10), p_id_flex_num NUMBER (10), p_effective_date DATE, Status VARCHAR2 (10), analysis_criteria_id NUMBER (10), ERROR_MSG VARCHAR2 (600) ); --* add "segments" to the script with a valide data that you want to insert *-- --verify your correct insertion by showing date from tow tables 1-PER_PERSON_ANALYSES (to get "analysis_criteria_id" based on "person_id" ) 2-PER_ANALYSIS_CRITERIA (to get data that you insert based on "analysis_criteria_id" ) */
— Create SIT API in oracle HRMS:–
DECLARE v_api_error VARCHAR2 (500); v_error_msg VARCHAR2 (500) := NULL; --in p_person_id NUMBER (10); p_business_group_id NUMBER (10); p_id_flex_num NUMBER (10); p_effective_date DATE; --out p_analysis_criteria_id NUMBER (10); p_person_analysis_id NUMBER (10); p_pea_object_version_number NUMBER (10); CURSOR xxx_sit IS SELECT * FROM xxx_api_sit_data; BEGIN FOR sit_data IN xxx_sit LOOP BEGIN p_pea_object_version_number := NULL; hr_sit_api.create_sit (--in p_person_id => sit_data.person_id ,p_business_group_id => sit_data.business_group_id ,p_id_flex_num => sit_data.p_id_flex_num ,p_effective_date => sit_data.p_effective_date ,p_segment1 => 'SIT' ,--out p_analysis_criteria_id => p_analysis_criteria_id ,p_person_analysis_id => p_person_analysis_id ,p_pea_object_version_number => p_pea_object_version_number); COMMIT; --To ensure that the data inserted successfully BEGIN UPDATE xxx_api_sit_data SET status = 'Done', analysis_criteria_id = p_analysis_criteria_id, error_msg = NULL WHERE person_id = sit_data.person_id; EXCEPTION WHEN OTHERS THEN NULL; END; -- To handle unexpected errors and unsuccessful data insertion<br> EXCEPTION WHEN OTHERS THEN v_api_error := sqlerrm; v_error_msg := v_error_msg || ' ' || v_api_error; UPDATE xxx_api_sit_data SET error_msg = v_error_msg, status = 'Error' WHERE person_id = sit_data.person_id; COMMIT; END; END LOOP; END; /