Search This Blog

Tuesday, December 6, 2022

Apps R12 Delete Absence API

 DECLARE

   CURSOR get_absence

   IS

      SELECT absence_attendance_id, object_version_number

        FROM per_absence_attendances

       WHERE PERSON_ID IN (SELECT PERSON_ID FROM PER_ALL_ASSIGNMENTS_F WHERE PAYROLL_ID =1002);

BEGIN

   FOR fetch_absence IN get_absence

   LOOP

      BEGIN

         hr_person_absence_api.

          delete_person_absence (

            p_validate                => FALSE,

            p_absence_attendance_id   => fetch_absence.absence_attendance_id,

            p_object_version_number   => fetch_absence.object_version_number);

         COMMIT;

         DBMS_OUTPUT.

          put_line (

            fetch_absence.absence_attendance_id

            || ' has been deleted Successfully !!!');

      EXCEPTION

         WHEN OTHERS

         THEN

            DBMS_OUTPUT.

             put_line (

                  'Inner Exception: '

               || fetch_absence.absence_attendance_id

               || ' - - '

               || SQLERRM);

      END;

   END LOOP;

EXCEPTION

   WHEN OTHERS

   THEN

      DBMS_OUTPUT.put_line ('Main Exception: ' || SQLERRM);

end;

No comments:

Post a Comment