0 Replies Latest reply: Jan 13, 2013 10:13 PM by 984587 RSS

    ORA-20001:Invalid position error in hr_assignment_api.update_emp_asg_critea

    984587
      Hi,

      I am gettign folowing error while updatign the employee assignment using API hr_assignment_api.update_emp_asg_criteria:

      Error report:
      ORA-20001: Invalid position

      This position does not exist at all, or is not completely within the assignment's date range.
      ORA-06512: at "APPS.HR_ASSIGNMENT_API", line 16489
      ORA-06512: at "APPS.HR_ASSIGNMENT_API", line 15052
      ORA-06512: at "APPS.HR_ASSIGNMENT_API", line 14837
      ORA-06512: at line 57

      My script is as follows:

      declare

      l_assignment_id per_all_assignments_f.assignment_id%type;
      l_soft_coding_keyflex_id per_all_assignments_f.soft_coding_keyflex_id%type;
      l_people_group_id per_all_assignments_f.people_group_id%type;
      l_effective_start_date per_all_assignments_f.effective_start_date%type;
      l_effective_end_date per_all_assignments_f.effective_end_date%type;
      l_effective_date per_all_assignments_f.effective_start_date%type;
      l_assignment_sequence per_all_assignments_f.assignment_sequence%type;
      l_comment_id per_all_assignments_f.comment_id%type;
      l_concatenated_segments varchar2(240);
      l_group_name varchar2(100);
      l_other_manager_warning boolean;
      l_org_now_no_manager_warning boolean;
      l_spp_delete_warning boolean;
      l_entries_changed_warning varchar2(200);
      l_tax_district_changed_warning boolean;
      l_special_ceiling_step_id number;
      l_no_managers_warning boolean;
      l_other_manager_warnings boolean;
      l_cagr_grade_def_id number;
      l_cagr_concatenated_segments varchar2(100);
      l_object_version_number per_all_assignments_f.object_version_number%type;
      L_SEGMENT1 VARCHAR2(50);
      L_HOURLY_SALARIED_WARNING BOOLEAN;
      l_gsp_post_process_warning VARCHAR2(100);
      al_gsp_post_process_warning VARCHAR2(100);

      begin

      L_ASSIGNMENT_ID :='150';
      l_object_version_number :='3';
      l_segment1 :='I';

      L_EFFECTIVE_DATE :=TO_DATE('12-DEC-2001', 'DD-MON-RRRR');

      hr_assignment_api.update_emp_asg(p_validate => false
      ,p_effective_date => l_effective_date
      ,P_DATETRACK_UPDATE_MODE => 'CORRECTION'
      ,p_assignment_id => l_assignment_id
      ,P_OBJECT_VERSION_NUMBER => L_OBJECT_VERSION_NUMBER
      ,P_PROJECTED_ASSIGNMENT_END => NULL
      ,p_default_code_comb_id =>3001
      ,p_soft_coding_keyflex_id => l_soft_coding_keyflex_id
      ,p_comment_id => l_comment_id
      ,p_effective_start_date => l_effective_start_date
      ,p_effective_end_date => l_effective_end_date
      ,p_concatenated_segments => l_concatenated_segments
      ,p_no_managers_warning => l_no_managers_warning
      ,p_other_manager_warning => l_other_manager_warnings
      ,p_cagr_grade_def_id => l_cagr_grade_def_id
      ,P_CAGR_CONCATENATED_SEGMENTS => L_CAGR_CONCATENATED_SEGMENTS
      ,P_HOURLY_SALARIED_WARNING =>L_HOURLY_SALARIED_WARNING
      ,p_gsp_post_process_warning => l_gsp_post_process_warning
      );

      hr_assignment_api.update_emp_asg_criteria( p_effective_date => l_effective_date,
           p_datetrack_update_mode => 'CORRECTION',
           P_ASSIGNMENT_ID => L_ASSIGNMENT_ID,
      -- p_validate => false,     
      P_POSITION_ID => 2061,--L_POSITION_ID,
           p_job_id => 62,--l_Job_Id,     
           p_segment1 => l_segment1,
           p_object_version_number => l_object_version_number,
           p_special_ceiling_step_id => l_special_ceiling_step_id,--out parameter
           P_PEOPLE_GROUP_ID => L_PEOPLE_GROUP_ID,
           p_soft_coding_keyflex_id      => l_Soft_Coding_Keyflex_Id,
           p_Group_Name      => l_Group_Name,
           p_Effective_Start_Date      => l_Effective_Start_Date,
           p_Effective_End_Date      => l_Effective_End_Date,
           P_ORG_NOW_NO_MANAGER_WARNING => L_ORG_NOW_NO_MANAGER_WARNING,
                p_Other_Manager_Warning => l_Other_Manager_Warning,
      p_Spp_Delete_Warning => l_Spp_Delete_Warning,
      p_entries_changed_warning => l_entries_changed_warning,
      p_tax_district_changed_warning => l_tax_district_changed_warning,
      p_concatenated_segments => l_concatenated_segments
      );

      dbms_output.put_line ('p:'||l_concatenated_segments);

      end;

      The object version nubmer is correct. there is only one position in the system whose start date is "04-JAN-13" and same for job.
      the employee assignmnet efefctive date is "12-DEC-01".

      Please help me.

      Regards,
      Amit sutar