Thursday, 1 June 2017

HRMS Absence API in oracle applications R12.1.3

DECLARE
   l_absence_attendance_id       NUMBER;
   l_object_version_number       NUMBER;
   l_occurrence                  NUMBER;
   l_dur_dys_less_warning        BOOLEAN;
   l_dur_hrs_less_warning        BOOLEAN;
   l_exceeds_pto_entit_warning   BOOLEAN;
   l_exceeds_run_total_warning   BOOLEAN;
   l_abs_overlap_warning         BOOLEAN;
   l_abs_day_after_warning       BOOLEAN;
   l_dur_overwritten_warning     BOOLEAN;
   l_absence_days                NUMBER := NULL;
   l_absence_hours               NUMBER := NULL;
   error_msg                     VARCHAR2(500);
BEGIN
   fnd_global.APPS_INITIALIZE(user_id => 1741, resp_id => 50678, resp_appl_id => 800);

   HR_PERSON_ABSENCE_API.create_person_absence (
      p_validate                     => FALSE,
      p_effective_date               => SYSDATE,
      p_person_id                    => 2009,
      p_business_group_id            => 81,
      p_absence_attendance_type_id   => 1063,
      p_abs_attendance_reason_id     => NULL,
      p_comments                     => 'Uploaded through API',
      p_date_notification            => TO_DATE ('01-MAR-2017', 'DD-MON-YYYY'),
      p_date_start                   => TO_DATE ('02-MAR-2017', 'DD-MON-YYYY'),
      p_date_end                     => TO_DATE ('03-MAR-2017', 'DD-MON-YYYY'),
      p_absence_days                 => l_absence_days,
      p_absence_hours                => l_absence_hours,
      p_attribute_category           => 'Emergency Leave', -- Absence Type
      p_absence_attendance_id        => l_absence_attendance_id,
      p_object_version_number        => l_object_version_number,
      p_occurrence                   => l_occurrence,
      p_dur_dys_less_warning         => l_dur_dys_less_warning,
      p_dur_hrs_less_warning         => l_dur_hrs_less_warning,
      p_exceeds_pto_entit_warning    => l_exceeds_pto_entit_warning,
      p_exceeds_run_total_warning    => l_exceeds_run_total_warning,
      p_abs_overlap_warning          => l_abs_overlap_warning,
      p_abs_day_after_warning        => l_abs_day_after_warning,
      p_dur_overwritten_warning      => l_dur_overwritten_warning
   );
    COMMIT;
    dbms_output.put_line('p_absence_attendance_id Message: '||l_absence_attendance_id);
    dbms_output.put_line('p_occurrence: '||l_occurrence);
    dbms_output.put_line('p_absence_days: '||l_absence_days);
   exception when others then
    error_msg := SUBSTR (SQLERRM, 1, 99);
   dbms_output.put_line('Error Message: '||error_msg);
END;

No comments:

Post a Comment