2 Replies Latest reply: Nov 7, 2012 5:52 AM by M.Hassan_999 RSS

    HR_SIT_API.update_sit

    M.Hassan_999
      Dears

      I Tried To Update SIT Using API But He Sends The Same Value Every Time , i susbct in the loop but he get the loop correct by changeing the employee
      here is the code i use

      DECLARE
      l_EMPLOYEE_NUMBER VARCHAR2 (40);
      ln_segment5 number;

      ln_analysis_criteria_id NUMBER;
      ln_person_analysis_id NUMBER;
      ln_pea_object_version_number NUMBER;

      CURSOR c_user
      IS
      SELECT employee_number,segment5
      FROM apps.XXNBE_HR_SIT_INT where batch_id != 0 and employee_number in ('63364','101115');

      rec_user c_user%ROWTYPE;
      BEGIN
      FOR rec_user IN c_user
      LOOP

      l_EMPLOYEE_NUMBER := rec_user.employee_number;
      ln_segment5 := rec_user.segment5;

      select
      ppa.person_analysis_id,
      PpA.object_version_number

      into
      ln_person_analysis_id,
      ln_pea_object_version_number

      from Hr.PER_ALL_PEOPLE_F PEO,
      apps.PER_PERSON_ANALYSES PPA ,
      Apps.Per_Analysis_Criteria Pac,
      apps.fnd_id_flex_structures_vl ffs

      where
      sysdate between peo.effective_start_date and peo.effective_end_date
      and ppa.date_from = (select max(ppaa.date_from)
      from apps.PER_PERSON_ANALYSES PPAa
      where ppaa.person_id=peo.person_id)
      and ppa.person_id=peo.person_id
      and peo.employee_number= l_EMPLOYEE_NUMBER
      --and peo.person_id=l_person_ID
      And Ppa.Id_Flex_Num = Ffs.Id_Flex_Num
      And Ppa.Analysis_Criteria_Id = Pac.Analysis_Criteria_Id
      And Ffs.Id_Flex_Structure_Code = 'NBE_MILITARY';

      BEGIN

      apps.HR_SIT_API.update_sit
      (p_validate => FALSE
      ,p_person_analysis_id => ln_person_analysis_id
      ,p_pea_object_version_number => ln_pea_object_version_number
      ,p_analysis_criteria_id => ln_analysis_criteria_id
      ,p_segment5 => ln_segment5 -- Here Is The Problem He Send The Same Value Every Time With All The Employee
      );
      commit;
      EXCEPTION
      WHEN OTHERS
      THEN
      dbms_output.put_line (SQLERRM);

      END;
      END LOOP;
      END;