Thursday, 20 September 2018



HRMS API :Create Position Hierarchy by Using APIs (hr_pos_hierarchy_ele_api.create_pos_hierarchy_ele) 

 


Hierarchy Name Checking query
===========================

select * from per_position_structures where name='Sample Hierarchy'


Parent Position Name Checking Query
===================================

select * from hr_all_positions_f where position_id=3950 --1001.Operations Vice President

Subordinate Position Name Checking Query
==========================================

select * from hr_all_positions_f where position_id=60


Create Position Hierarchy by Using API

SELECT position_structure_id
           --INTO v_position_structure_id
           FROM per_position_structures
          WHERE NAME = 'Sample Hierarchy'
            AND business_group_id =202-- i.business_group_id;
    
      
         SELECT pos_structure_version_id
         --  INTO l_pos_structure_version_id
           FROM per_pos_structure_versions
          WHERE position_structure_id = 24127
            AND business_group_id = 202;


declare
   v_position_structure_id      NUMBER;
   l_pos_structure_version_id   NUMBER;
   v_pos_structure_element_id   NUMBER;
   v_object_version_number      NUMBER;
   BEGIN
         BEGIN
            hr_pos_hierarchy_ele_api.create_pos_hierarchy_ele
                   (p_parent_position_id            =>5,-- parent_pos_id,
                    p_pos_structure_version_id      => 27230,--Hierarchy id
                    p_subordinate_position_id       => 24,--sub ordinate pos_id,
                    p_business_group_id             => 202,--business_group_id,
                    p_hr_installed                  => NULL,
                    p_effective_date                => '20-jul-2018',--l_effective_date,
                    p_pos_structure_element_id      => v_pos_structure_element_id,
                    p_object_version_number         => v_object_version_number
                   );
            DBMS_OUTPUT.put_line (   'v_pos_structure_element_id = '
                                  || v_pos_structure_element_id
                                 );
            DBMS_OUTPUT.put_line (   'v_object_version_number = '
                                  || v_object_version_number
                                 );
         END;
   COMMIT;
END;



output of API STRUCTURE ELEMENT ID checking query

in this query we need get all the details like (Hierarchy id,Parent Position id ,Subordinate Position id)

select * from per_pos_structure_elements where POS_STRUCTURE_ELEMENT_ID=45005--45002

















1 comment: