Sunday 29 October 2017

Element Links creation through API

DECLARE
   CURSOR c1
   IS
      SELECT   *
        FROM   pay_element_types_f
       WHERE  element_name = 'Employee Social Insurance Arrears Payment';

   l_bg_id                   NUMBER := 102;
   l_element_link_id         NUMBER;
   l_comment_id              NUMBER;
   l_object_version_number   NUMBER;
   l_effective_start_date    DATE;
   l_effective_end_date      DATE;
BEGIN
   FOR rec IN c1
   LOOP
      l_element_link_id := NULL;
      l_comment_id := NULL;
      l_object_version_number := NULL;
      l_effective_start_date := NULL;
      l_effective_end_date := NULL;

      pay_element_link_api.create_element_link (
         p_validate                       => FALSE,
         p_effective_date                 => TO_DATE ('1-Jan-1951'),
         p_element_type_id                => rec.element_type_id,
         p_business_group_id              => l_bg_id,
         p_costable_type                  => 'N',
         p_organization_id                => NULL,
         p_job_id                         => NULL,
         p_position_id                    => NULL,
         p_people_group_id                => NULL,
         p_cost_allocation_keyflex_id     => NULL,
         p_link_to_all_payrolls_flag      => 'Y',
         p_standard_link_flag             => 'N',
         p_transfer_to_gl_flag            => 'N',
         p_comments                       => NULL,
         -- p_organization_id                   => NULL,
         p_location_id                    => NULL,
         p_grade_id                       => NULL,
         p_balancing_keyflex_id           => NULL,
         p_element_set_id                 => NULL,
         p_qualifying_age                 => NULL,
         p_qualifying_length_of_service   => NULL,
         p_qualifying_units               => NULL,
         p_balance_concat_segments           => NULL,
         p_cost_concat_segments           => NULL,
         --         p_comments                   => 'Test Migration For Element Link',
         p_element_link_id                => l_element_link_id,
         p_comment_id                     => l_comment_id,
         p_object_version_number          => l_object_version_number,
         p_effective_start_date           => l_effective_start_date,
         p_effective_end_date             => l_effective_end_date
      );
     -- COMMIT;
      DBMS_OUTPUT.put_line (rec.element_name || ' link created');
   END LOOP;
END;

No comments:

Post a Comment