Monday, September 3, 2012

API to Delete Assignment


DECLARE
   p_validate                     BOOLEAN := FALSE;
   p_effective_date               DATE := TRUNC (SYSDATE);
   p_assignment_id                per_all_assignments_f.assignment_id%TYPE;
   p_object_version_number        per_all_assignments_f.object_version_number%TYPE;
   p_effective_start_date         per_all_assignments_f.effective_start_date%TYPE;
   p_effective_end_date           per_all_assignments_f.effective_end_date%TYPE;
   p_loc_change_tax_issues        BOOLEAN := NULL;
   p_delete_asg_budgets           BOOLEAN := NULL;
   p_org_now_no_manager_warning   BOOLEAN := NULL;
   p_element_salary_warning       BOOLEAN := NULL;
   p_element_entries_warning      BOOLEAN := NULL;
   p_spp_warning                  BOOLEAN := NULL;
   p_cost_warning                 BOOLEAN := NULL;
   p_life_events_exists           BOOLEAN := NULL;
   p_cobra_coverage_elements      BOOLEAN := NULL;
   p_assgt_term_elements          BOOLEAN := NULL;
   l_assignment_id                NUMBER (15);
   l_object_version_number        NUMBER;
BEGIN
   SELECT   paaf.assignment_id, paaf.object_version_number
     INTO   l_assignment_id, l_object_version_number
     FROM   per_all_assignments_f paaf
    WHERE       paaf.assignment_id = 24175
            AND paaf.assignment_status_type_id = 1
            AND paaf.effective_end_date < paaf.effective_start_date;

   hr_assignment_api.delete_assignment (
      p_validate                     => p_validate,
      p_effective_date               => p_effective_date,
      p_datetrack_mode               => 'DELETE',
      p_assignment_id                => l_assignment_id,
      p_object_version_number        => l_object_version_number,
      p_effective_start_date         => p_effective_start_date,
      p_effective_end_date           => p_effective_end_date,
      p_loc_change_tax_issues        => p_loc_change_tax_issues,
      p_delete_asg_budgets           => p_delete_asg_budgets,
      p_org_now_no_manager_warning   => p_org_now_no_manager_warning,
      p_element_salary_warning       => p_element_salary_warning,
      p_element_entries_warning      => p_element_entries_warning,
      p_spp_warning                  => p_spp_warning,
      p_cost_warning                 => p_cost_warning,
      p_life_events_exists           => p_life_events_exists,
      p_cobra_coverage_elements      => p_cobra_coverage_elements,
      p_assgt_term_elements          => p_assgt_term_elements
   );
   DBMS_OUTPUT.put_line ('SUCESS');
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line (SQLERRM);
END;

No comments:

Post a Comment