Hr_ex_employee_api

Hi All,
I need to use the hr_ex_employee_api.actual_termination_emp and hr_ex_employee_api.update_term_details_emp to terminate the employee
I just need to know that what should be passed to the parameters in both API's and which table am I supposed to use
thanks
Edited by: user2592339 on May 22, 2009 3:35 AM

Hi Srini,
OS- Linux red hat 32-bit
EBS-12.0.6
HR family pack version -12.0.6(shared hr)
in the code below we used per_people_v7_pkg.Update_Row API to end date/terminate the employee previously which i have commented out and now we are supposed to use the standard API hr_ex_employee_api.actual_termination_emp and hr_ex_employee_api.update_term_details_emp to terminate and update the terminated records. I am confused what table i need to use to pass the values to these two api's and what values should be passed as i am getting the error: wrong number or type of arguments in call to employee_termination
the code we are using is as follows:
     Employee Termination Process
procedure employee_termination (p_errmsg          out varchar2,
p_retcode          out varchar2,
               p_report_output_dir     in varchar2,
               p_error_email_addr     in varchar2) is
     -- Work fields
     l_emp_count          number;
     l_num_employee_number     number;
     l_notification_count     number;
     l_terminate_user     boolean;
     l_termination_date     date;
--people_rec              per_people_v7%ROWTYPE;
l_business_group_id number;
l_person_type_id per_person_types.person_type_id%TYPE;
     l_home_oe1          gl_code_combinations.segment3%TYPE;
     -- Existing employee cursor
     CURSOR csr_employee IS
     SELECT employee_number, person_id, full_name, user_name
     FROM per_people_f peop,
          fnd_user usr
     WHERE effective_start_date <= sysdate
     AND ((effective_end_date is null) or (effective_end_date >= sysdate))
     AND usr.employee_id(+) = peop.person_id
     AND peop.person_type_id = l_person_type_id
and employee_number = '93'
     ORDER BY full_name;
     -- PER_PEOPLE_F fields
     l_employee_number     per_people_f.employee_number%TYPE;
     l_person_id          per_people_f.person_id%TYPE;
     l_full_name          per_people_f.full_name%TYPE;
     l_user_name          fnd_user.user_name%TYPE;
     -- Project Data
     CURSOR csr_project IS
     SELECT prj.name, prj.segment1, org.name
     FROM pa_project_players play,
          pa_projects prj,
          hr_organization_units org
     WHERE play.person_id = l_person_id
     AND play.project_role_type = 'PROJECT MANAGER'
     AND play.start_date_active <= sysdate
     AND ((play.end_date_active is null) or (play.end_date_active >= sysdate))
     AND play.project_id = prj.project_id
     AND prj.project_status_code = 'APPROVED'
     AND org.organization_id = prj.carrying_out_organization_id
     ORDER BY segment1;
     -- Project Data
     l_name               pa_projects.name%TYPE;
     l_segment1          pa_projects.segment1%TYPE;
     l_project_org          hr_all_organization_units.name%TYPE;
     -- Position Fields
     l_pos_name          per_positions.name%TYPE;
     l_possub_name          per_positions.name%TYPE;
     l_pos_structure_version_id     per_pos_structure_versions.pos_structure_version_id%TYPE;
     -- Position Hierarchy Data
     CURSOR csr_position IS
     SELECT pos.name, possub.name
FROM per_assignments_f ass,
          per_positions pos,
          per_positions possub,
          per_pos_structure_elements_v str,
          per_assignments_f asssub
WHERE ass.person_id = l_person_id
AND ass.effective_start_date <= sysdate
AND ass.effective_end_date >= sysdate
     AND ass.position_id = pos.position_id
     AND ass.position_id = str.parent_position_id
     AND possub.position_id = str.subordinate_position_id
AND asssub.position_id = possub.position_id
AND asssub.effective_start_date <= sysdate
AND asssub.effective_end_date >= sysdate
     AND str.pos_structure_version_id = l_pos_structure_version_id
-- Email Error Output Files
l_output_file varchar2(100);
l_conc_reqid number;
l_email_conc_reqid number;
     l_send_email          boolean := false;
     -- Phone Cursor
     CURSOR csr_phone IS
     SELECT phone_id, object_version_number
     FROM per_phones
     WHERE parent_id = l_person_id
     AND parent_table = 'PER_ALL_PEOPLE_F'
     AND phone_type = 'W1';
--Employee termination fields
l_object_version_number number;
l_last_standard_process_date date;
-- l_actual_termination_date date;
l_supervisor_warning boolean;
l_event_warning boolean;
l_interview_warning boolean;
l_review_warning boolean;
l_recruiter_warning boolean;
l_asg_future_changes_warning boolean;
l_entries_changed_warning varchar2(10);
l_pay_proposal_warning boolean;
l_dod_warning boolean;
l_alu_change_warning varchar2(10);
l_assignment_status_type_id number;
l_leaving_reason varchar2(100);
l_atd_new number;
l_lspd_new number;
l_termination_accepted_person number;
l_accepted_termination_date date;
l_comments varchar2(100);
l_notified_termination_date date;
l_projected_termination_date date;
l_period_of_service_id per_assignments_f.period_of_service_id%type;
begin
     p_retcode := 0;
     p_errmsg := ' ';
-- Get the Business Group ID
l_business_group_id := fnd_profile.value ('PER_BUSINESS_GROUP_ID');
-- Get the Person Type ID for Employee
BEGIN
SELECT person_type_id
INTO l_person_type_id
FROM per_person_types
WHERE business_group_id = l_business_group_id
AND system_person_type = 'EMP';
EXCEPTION WHEN no_data_found THEN
fnd_file.put_line (FND_FILE.OUTPUT, 'Person Type ID cannot be found');
p_retcode := 1;
END;
     l_termination_date := trunc(sysdate -1);
/* Write out the headers */
fnd_file.put_line (FND_FILE.OUTPUT, 'Employee Termination');
fnd_file.put_line (FND_FILE.OUTPUT, '--------------------');
fnd_file.put_line (FND_FILE.OUTPUT, 'User ID Emp No Name OE1 Message');
fnd_file.put_line (FND_FILE.OUTPUT, '---------- ------ ------------------------------ ----- -----------------------------------');
     -- Find the current Requisition Default Hierarchy
     SELECT ver.pos_structure_version_id
     INTO l_pos_structure_version_id
     FROM per_pos_structure_versions ver,
po_document_types_v doct
     WHERE ver.date_from <= sysdate
AND (ver.date_to >= sysdate or ver.date_to is null)
AND doct.document_type_code = 'REQUISITION'
AND doct.document_subtype = 'PURCHASE'
AND doct.default_approval_path_id = ver.position_structure_id;
/* Read all active employees */
OPEN csr_employee;
loop
FETCH csr_employee INTO l_employee_number, l_person_id,
l_full_name, l_user_name;
EXIT WHEN csr_employee%notfound;
          -- Check that Employee Number is a valid CSIR Number
          BEGIN
               l_num_employee_number := l_employee_number;
          EXCEPTION WHEN others then
               GOTO next_record;
          END;
          -- See if employee still exists in CSIR PeopleSoft System
          SELECT count (*)
          INTO l_emp_count
          FROM xxmc_ps_emp_interface
          WHERE employee_number = l_employee_number
AND status = 'A'
AND non_employee = 'E';
          if (l_emp_count > 0) then
               GOTO next_record;
          end if;
          l_terminate_user := true;
          l_send_email := true;
          -- Find the Home OE1 to display in messages
          BEGIN
               SELECT glcc.segment3
               INTO l_home_oe1
               FROM per_assignments_f ass,
                    gl_code_combinations glcc
               WHERE person_id = l_person_id
               AND ass.effective_start_date <= sysdate
               AND ass.effective_end_date >= sysdate
               AND glcc.code_combination_id = ass.default_code_comb_id;
          EXCEPTION WHEN others THEN
               l_home_oe1 := ' ';
          END;
          -- Find out if employee is a project manager
OPEN csr_project;
loop
FETCH csr_project INTO l_name, l_segment1, l_project_org;
EXIT WHEN csr_project%notfound;
l_terminate_user := FALSE;
fnd_file.put_line (FND_FILE.OUTPUT,
RPAD(substr(NVL(l_user_name,' '),1,10),10,' ') || ' ' ||
RPAD(substr(l_employee_number,1,6),6,' ')
|| ' ' || RPAD(substr(l_full_name,1,30),30,' ') ||
' ' || RPAD(SUBSTR(REPLACE(l_project_org,'-',' '),1,5),5,' ') ||
' Project manager of project: ' ||
l_segment1 || ' ' || l_name);
end loop;
CLOSE csr_project;
          -- Find out of of employees has subordinates
OPEN csr_position;
loop
FETCH csr_position INTO l_pos_name, l_possub_name;
EXIT WHEN csr_position%notfound;
l_terminate_user := FALSE;
fnd_file.put_line (FND_FILE.OUTPUT,
RPAD(substr(NVL(l_user_name,' '),1,10),10,' ') || ' ' ||
RPAD(substr(l_employee_number,1,6),6,' ')
|| ' ' || RPAD(substr(l_full_name,1,30),30,' ') ||
' ' || RPAD(SUBSTR(l_home_oe1,1,5),5,' ') ||
' Employee position : ' || l_pos_name);
fnd_file.put_line (FND_FILE.OUTPUT,
RPAD(' ',59,' ') || 'has subordinate position : ' ||
l_possub_name);
end loop;
CLOSE csr_position;
          -- Read to see if employee has notifications
          SELECT count(*)
          INTO l_notification_count
          FROM wf_notifications
          WHERE recipient_role = l_user_name
          AND status = 'OPEN'
          AND message_name <> 'REQ_COMPLETION_W_URL';
          if (l_notification_count > 0) then
               l_terminate_user := FALSE;
fnd_file.put_line (FND_FILE.OUTPUT,
RPAD(substr(NVL(l_user_name,' '),1,10),10,' ') || ' ' ||
RPAD(substr(l_employee_number,1,6),6,' ')
|| ' ' || RPAD(substr(l_full_name,1,30),30,' ') ||
' ' || RPAD(SUBSTR(l_home_oe1,1,5),5,' ') ||
' Employee has Open Notifications, please reassign');
          end if;
          if (l_terminate_user = TRUE) then
               -- Delete the Phone Numbers else you get an error when terminating
               -- employee
               BEGIN
                    FOR phone_record IN csr_phone LOOP
                         hr_phone_api.delete_phone (FALSE,
                              phone_record.phone_id,
                              phone_record.object_version_number);
                    END LOOP;
                    commit;
               EXCEPTION WHEN others THEN
                    rollback;
fnd_file.put_line (FND_FILE.OUTPUT,
RPAD(substr(NVL(l_user_name,' '),1,10),10,' ') || ' ' ||
RPAD(substr(l_employee_number,1,6),6,' ')
|| ' ' || RPAD(substr(l_full_name,1,30),30,' ')
|| ' ' || RPAD(SUBSTR(l_home_oe1,1,5),5,' ')
|| ' ' || sqlerrm);
                    goto next_record;
               END;
               -- End Date the Employee
               BEGIN
select period_of_service_id
into l_period_of_service_id
from per_assignments_f ass
where ass.person_id = l_person_id
and effective_start_date <= l_termination_date
and effective_end_date > l_termination_date;
hr_ex_employee_api.actual_termination_emp (
p_validate => false,
p_effective_date => sysdate,
p_period_of_service_id => l_period_of_service_id ,
p_object_version_number => l_object_version_number,
p_actual_termination_date => l_termination_date,
p_last_standard_process_date => l_last_standard_process_date,
p_person_type_id => l_person_type_id,
P_ASSIGNMENT_STATUS_TYPE_ID => l_assignment_status_type_id,
P_LEAVING_REASON => l_leaving_reason,
P_ATD_NEW => l_atd_new,
P_LSPD_NEW => l_lspd_new,
p_supervisor_warning => l_supervisor_warning,
p_event_warning => l_event_warning,
p_interview_warning => l_interview_warning,
p_review_warning => l_review_warning,
p_recruiter_warning => l_recruiter_warning,
p_asg_future_changes_warning => l_asg_future_changes_warning,
p_entries_changed_warning => l_entries_changed_warning,
p_pay_proposal_warning => l_pay_proposal_warning,
p_dod_warning => l_dod_warning,
p_alu_change_warning => l_alu_change_warning);
hr_ex_employee_Api.update_term_details_emp (
p_validate => false,
p_effective_date => sysdate,
p_period_of_service_id => l_period_of_service_id,
p_object_version_number => l_object_version_number,
P_TERMINATION_ACCEPTED_PERSON => l_termination_accepted_person,
P_ACCEPTED_TERMINATION_DATE => l_accepted_termination_date,
P_COMMENTS => l_comments,
P_LEAVING_REASON => l_leaving_reason,
P_NOTIFIED_TERMINATION_DATE => l_notified_termination_date,
P_PROJECTED_TERMINATION_DATE => l_projected_termination_date );
select *
into people_rec
from per_people_v7
where person_id = l_person_id
and effective_start_date <= l_termination_date
and effective_end_date > l_termination_date;
per_people_v7_pkg.Update_Row (
x_rowid => ROWIDTOCHAR(people_rec.row_id),
x_person_id => people_rec.person_id,
x_effective_start_date => people_rec.effective_start_date,
x_effective_end_date => people_rec.effective_end_date,
x_business_group_id => people_rec.business_group_id,
x_person_type_id => people_rec.person_type_id,
x_last_name => people_rec.last_name,
x_start_date => people_rec.start_date,
x_hire_date => people_rec.hire_date,
x_s_hire_date => people_rec.hire_date,
x_period_of_service_id => people_rec.period_of_service_id,
x_termination_date => l_termination_date,
x_s_termination_date => people_rec.d_termination_date,
x_applicant_number => people_rec.applicant_number,
x_comment_id => people_rec.comment_id,
x_current_applicant_flag => people_rec.current_applicant_flag,
x_current_emp_or_apl_flag => people_rec.current_emp_or_apl_flag,
x_current_employee_flag => people_rec.current_employee_flag,
x_date_employee_data_verified => people_rec.date_employee_data_verified,
x_date_of_birth => people_rec.date_of_birth,
x_email_address => people_rec.email_address,
x_employee_number => people_rec.employee_number,
x_expense_check_to_address => people_rec.expense_check_send_to_address,
x_first_name => people_rec.first_name,
x_full_name => people_rec.full_name,
x_known_as => people_rec.known_as,
x_marital_status => people_rec.marital_status,
x_middle_names => people_rec.middle_names,
x_nationality => people_rec.nationality,
x_national_identifier => people_rec.national_identifier,
x_previous_last_name => people_rec.previous_last_name,
x_registered_disabled_flag => people_rec.registered_disabled_flag,
x_sex => people_rec.sex,
x_title => people_rec.title,
x_vendor_id => people_rec.vendor_id,
x_work_telephone => people_rec.work_telephone,
x_attribute_category => people_rec.attribute_category,
x_attribute1 => people_rec.attribute1,
x_attribute2 => people_rec.attribute2,
x_attribute3 => people_rec.attribute3,
x_attribute4 => people_rec.attribute4,
x_attribute5 => people_rec.attribute5,
x_attribute6 => people_rec.attribute6,
x_attribute7 => people_rec.attribute7,
x_attribute8 => people_rec.attribute8,
x_attribute9 => people_rec.attribute9,
x_attribute10 => people_rec.attribute10,
x_attribute11 => people_rec.attribute11,
x_attribute12 => people_rec.attribute12,
x_attribute13 => people_rec.attribute13,
x_attribute14 => people_rec.attribute14,
x_attribute15 => people_rec.attribute15,
x_attribute16 => people_rec.attribute16,
x_attribute17 => people_rec.attribute17,
x_attribute18 => people_rec.attribute18,
x_attribute19 => people_rec.attribute19,
x_attribute20 => people_rec.attribute20,
x_attribute21 => people_rec.attribute21,
x_attribute22 => people_rec.attribute22,
x_attribute23 => people_rec.attribute23,
x_attribute24 => people_rec.attribute24,
x_attribute25 => people_rec.attribute25,
x_attribute26 => people_rec.attribute26,
x_attribute27 => people_rec.attribute27,
x_attribute28 => people_rec.attribute28,
x_attribute29 => people_rec.attribute29,
x_attribute30 => people_rec.attribute30,
x_per_information_category => people_rec.per_information_category,
x_per_information1 => people_rec.per_information1,
x_per_information2 => people_rec.per_information2,
x_per_information3 => people_rec.per_information3,
x_per_information4 => people_rec.per_information4,
x_per_information5 => people_rec.per_information5,
x_per_information6 => people_rec.per_information6,
x_per_information7 => people_rec.per_information7,
x_per_information8 => people_rec.per_information8,
x_per_information9 => people_rec.per_information9,
x_per_information10 => people_rec.per_information10,
x_per_information11 => people_rec.per_information11,
x_per_information12 => people_rec.per_information12,
x_per_information13 => people_rec.per_information13,
x_per_information14 => people_rec.per_information14,
x_per_information15 => people_rec.per_information15,
x_per_information16 => people_rec.per_information16,
x_per_information17 => people_rec.per_information17,
x_per_information18 => people_rec.per_information18,
x_per_information19 => people_rec.per_information19,
x_per_information20 => people_rec.per_information20,
x_per_information21 => people_rec.per_information21,
x_per_information22 => people_rec.per_information22,
x_per_information23 => people_rec.per_information23,
x_per_information24 => people_rec.per_information24,
x_per_information25 => people_rec.per_information25,
x_per_information26 => people_rec.per_information26,
x_per_information27 => people_rec.per_information27,
x_per_information28 => people_rec.per_information28,
x_per_information29 => people_rec.per_information29,
x_per_information30 => people_rec.per_information30,
x_last_update_date => sysdate,
x_last_updated_by => fnd_global.user_id(),
x_last_update_login => fnd_global.login_id(),
x_current_application_id => fnd_global.prog_appl_id(),
X_Order_Name => people_rec.order_name,
X_Global_Name => people_rec.global_name,
X_Local_Name => people_rec.local_name);
                    -- Terminate the User
if (l_user_name is not null) then
fnd_user_pkg.DisableUser (l_user_name);
end if;
                    commit;
               EXCEPTION WHEN others THEN
                    rollback;
fnd_file.put_line (FND_FILE.OUTPUT,
RPAD(substr(NVL(l_user_name,' '),1,10),10,' ') || ' ' ||
RPAD(substr(l_employee_number,1,6),6,' ')
|| ' ' || RPAD(substr(l_full_name,1,30),30,' ')
|| ' ' || RPAD(SUBSTR(l_home_oe1,1,5),5,' ')
|| ' ' || sqlerrm);
                    goto next_record;
               END;
fnd_file.put_line (FND_FILE.OUTPUT,
RPAD(substr(NVL(l_user_name,' '),1,10),10,' ') || ' ' ||
RPAD(substr(l_employee_number,1,6),6,' ')
|| ' ' || RPAD(substr(l_full_name,1,30),30,' ')
|| ' ' || RPAD(SUBSTR(l_home_oe1,1,5),5,' ')
|| ' ' || 'Employee terminated');
          end if;
     <<next_record>>
          NULL;
end loop;
CLOSE csr_employee;
     COMMIT;
     -- Send Error Email when errors have occurred
     if l_send_email then
l_conc_reqid := fnd_global.conc_request_id();
l_output_file := 'o' || l_conc_reqid || '.out';
l_output_file := p_report_output_dir || '/' || l_output_file;
l_email_conc_reqid := fnd_request.submit_request (
'XXMC', 'XXMCMLBD', '', '', FALSE,
l_output_file || ':' || 'CSIR Employee Termination :' || p_error_email_addr,
chr(0), '', '', '', '', '', '', '', '',
if (l_email_conc_reqid = 0) then
p_errmsg := 'Email Concurrent Request Submission Failed';
p_retcode := 2;
end if;
     end if;
Exception when others then
p_retcode := 2;
p_errmsg := sqlerrm;
     fnd_file.put_line (FND_FILE.LOG, l_employee_number || '- ' || p_errmsg);
end employee_termination;
thanks a lot
Edited by: user2592339 on May 27, 2009 4:10 AM

Similar Messages

  • Request for sample code of hr_ex_employee_api.actual_termination_emp

    Hi,
    I need sample code for hr_ex_employee_api.actual_termination_emp . anyone who worked on this api or who have knowledge of this api,Please send the sample code
    Thanks and Regards
    Dixit

    I do not have sample code but it is not a difficult API to call. I have worked on it before, so if you have a specific question on it, happy to help out if I can.

  • Cannot Update Contingent Worker Number with API when no assignment exists

    Hi
    I am using hr_person_api.update_gb_person to update Contingent Worker Numbers (NPW_Number in PER_ALL_PEOPLE_F). This works fine apart from one exception. I get the following error: ORA-20001: You cannot enter a Contingent Worker number because you are not creating a Contingent Worker.
    The Contingent Worker failing has 4 records in PER_ALL_PEOPLE_F. The 3 date tracked (end dated) records update fine as expected....the new NPW_Number appears in PER_ALL_PEOPLE_F. However, the current active record does not update it returns the error mentioned. This appears to be because the person in question was terminated. (ie via Others and selecting End Placement in the screens).
    This person now shows as Ex-Agency Person Type. This process does not generate a record in PER_ALL_ASSIGNMENTS_F. I am wondering if this causes the API some confusion?
    I can go into the screen and manually change the Contingent Worker and it saves fine so I would expect the API to do the same. However it returns ORA-20001: You cannot enter a Contingent Worker number because you are not creating a Contingent Worker....for this single record only.
    Any suggestions as to what may be causing the API to return this and any workaround please?
    Many thanks in advance.

    Sometimes APIs are not behaving as Forms do.
    An ugly solution in this case could be reverse the termination (hr_ex_employee_api.reverse_terminate_employee), then update the Contingent Worker Number with your API, then terminate him/her again.

  • Issue with hr_person_type_usage_api.update_person_type_usage

    Hi,
    I'm trying to call the Oracle API: hr_person_type_usage_api.update_person_type_usage and I'm receiving the error: 'The HR object which is attempted to be locked is inconsistent with the corresponding object in the HR Schema.'
    Here's how it's being called:
           hr_person_type_usage_api.update_person_type_usage
             p_validate                    => false
           , p_person_type_usage_id        => l_person_type_usage_id
           , p_effective_date              => TO_DATE(20130801,'YYYY-MM-DD') -- Termination Date
           , p_datetrack_mode              => 'UPDATE'
           , p_object_version_number       => l_PTU_OBJECT_VERSION_NUMBER
           , p_person_type_id              => 11145 --Make them an ex-employee)
           , p_attribute_category          => NULL
           , p_attribute1                  => NULL
           , p_attribute2                  => NULL
           , p_attribute3                  => NULL
           , p_attribute4                  => NULL
           , p_attribute5                  => NULL
           , p_attribute6                  => NULL
           , p_attribute7                  => NULL
           , p_attribute8                  => NULL
           , p_attribute9                  => NULL
           , p_attribute10                 => NULL
           , p_attribute11                 => NULL
           , p_attribute12                 => NULL
           , p_attribute13                 => NULL
           , p_attribute14                 => NULL
           , p_attribute15                 => NULL
           , p_attribute16                 => NULL
           , p_attribute17                 => NULL
           , p_attribute18                 => NULL
           , p_attribute19                 => NULL
           , p_attribute20                 => NULL
           , p_attribute21                 => NULL
           , p_attribute22                 => NULL
           , p_attribute23                 => NULL
           , p_attribute24                 => NULL
           , p_attribute25                 => NULL
           , p_attribute26                 => NULL
           , p_attribute27                 => NULL
           , p_attribute28                 => NULL
           , p_attribute29                 => NULL
           , p_attribute30                 => NULL
           -- OUT
           , p_effective_start_date        => l_ptu_effective_start_date
           , p_effective_end_date          => l_ptu_effective_end_date
    Here's the data retrieval:
       SELECT
             ppf.full_name                         Emp_Name
          ,  ppf.employee_number                   Emp_Number
          ,  houT.name                             Organization
          ,  jbt.name                              Job
          ,  hlT.location_code                     Location
          ,  ppos.period_of_service_id             period_of_service_id
          ,  ppf.person_id                         person_id
          ,  ppt.person_type_id                    person_type_id
          ,  ptu.person_type_id                    person_type_id_ptu
          ,  ppt.user_person_type                  user_person_type
          ,  ptu.person_type_usage_id              person_type_usage_id
          ,  ptu.OBJECT_VERSION_NUMBER             PTU_OBJECT_VERSION_NUMBER
          ,  to_char(ptu.effective_start_date, 'YYYYMMDD')
          ,  to_char(ptu.effective_end_date, 'YYYYMMDD')
       FROM
             hr_all_organization_units_tl          houT
          ,  per_business_groups                   pbg
          ,  per_jobs_tl                           jbt
          ,  per_all_people_f                      ppf
          ,  hr_locations_all_tl                   hlT
          ,  per_periods_of_service                ppos
          ,  per_assignments_f                     paf
          ,  fnd_user                              usr
          ,  per_person_types                      ppt
          ,  per_person_type_usages_f              ptu
       WHERE
             paf.period_of_service_id            = ppos.period_of_service_id
         AND paf.person_id                       = ppf.person_id
         AND paf.business_group_id               = pbg.business_group_id
         AND paf.organization_id                 = houT.organization_id
         AND houT.language                       = userenv('LANG')
         AND paf.job_id                          = jbt.job_id(+)
         AND jbt.language(+)                    = userenv('LANG')
         AND paf.location_id                     = hlT.location_id(+)
         AND hlT.language(+)                     = userenv('LANG')
         AND SYSDATE                             BETWEEN paf.effective_start_date and paf.effective_end_date
         AND SYSDATE                             BETWEEN ppf.effective_start_date and ppf.effective_end_date
         AND SYSDATE                             BETWEEN ptu.effective_start_date and ptu.effective_end_date
         AND ppf.person_id                       = usr.employee_id(+)
         AND ppf.PERSON_TYPE_ID                  = ppt.PERSON_TYPE_ID
         AND paf.business_group_id               = ppt.BUSINESS_GROUP_ID
         AND paf.person_id                       = ptu.person_id;
    I know the values are correct because when i audit the table 'per_person_type_usages_f ' I can see that I should be updating the correct record.  All I'm trying to do is update the data for a terminated employee.
    Can someone tell me if the parameters that I have defined are correctly?

    Hi,
    I managed to find the issue.  What I didn't realize was that the API 'hr_ex_employee_api.actual_termination_emp' (which I was calling prior to this API), actually created the record in the table 'per_person_type_usages_f'.  I needed to perform a 'CORRECTION' instead of an 'update' as well as having to retrieve the most current record (that was created).

  • Not able to terminate an Emp, Error: The person must exist as an employee at the time specified by Date Start

    HI Guru's
    We are sourcing Employee records from upstream system and the Effective_start_date for particular record of Employee is getting changed, consider a below scenario.
    EXISTING RECORD.
    Person_id, effective_start_date,Effective_end_date, person_type
    123,       01-JAN-2001         ,31-MAY-2001,        EMP
    123,       01-JUN-2001         ,31-DEC-4712,        EMP
    MODIFIED DRECORD
    Person_id, effective_start_date,Effective_end_date, person_type
    123,       01-JAN-2001         ,14-MAY-2001,        EMP
    123,       15-MAY-2001         ,31-DEC-4712,        EMP
    So when i am able to change the effective_start_date for 2nd record from 01-JUN-2001 to 15-MAY-2001 using an API "hr_person_api.update_person" with p_datetrack_update_mode as 'UPDATE_OVERRIDE'..
    but after this when i am trying to terminate the employee using an API "hr_ex_employee_api.actual_termination_emp" for below scenario, i am getting the following error: "The person must exist as an employee at the time specified by Date Start".
    For Termination:
    Person_id, effective_start_date,Effective_end_date, person_type
    123,       01-JAN-2001         ,14-MAY-2001,        EMP
    123,       15-MAY-2001        ,09-JUL-2001,        EMP
    123,       10-JUL-2001         ,31-DEC-4712,       EX_EMP  ----> Not able to process erroing
    Please help me in resolving this issue..
    Regards,
    Mushtaq

    Hi,
    Just wondering if this is an ATG related question.
    Thanks,
    Gopinath Ramasamy

  • How To Use HR-API to Terminate An Employee

    I have a problem with the API-procedures
    hr_ex_employee_api.actual_termination_emp and hr_ex_employee_api.final_process_emp:
    To be able to rehire an employee the day after he/she has been terminated (sounds ugly, doesn't it :-),
    the final_process_date has to be the same as the actual_termination_date. I can enter these correctly via
    the PERWSTEM-form (e.g. actual_termination_date: 30-APR-2002, last_standard_process_date: 30-APR-2002
    final_process_date: 30-APR-2002), but when I try to call the api-procedures with these example-dates,
    I get exception APP-51008 telling me that the employee_status at the time of the final_process_date must be EX_EMP.
    How do I cope with this?

    I have a problem with the API-procedures
    hr_ex_employee_api.actual_termination_emp and hr_ex_employee_api.final_process_emp:
    To be able to rehire an employee the day after he/she has been terminated (sounds ugly, doesn't it :-),
    the final_process_date has to be the same as the actual_termination_date. I can enter these correctly via
    the PERWSTEM-form (e.g. actual_termination_date: 30-APR-2002, last_standard_process_date: 30-APR-2002
    final_process_date: 30-APR-2002), but when I try to call the api-procedures with these example-dates,
    I get exception APP-51008 telling me that the employee_status at the time of the final_process_date must be EX_EMP.
    How do I cope with this?

  • General Doubt while Terminating Employees

    Hi All,
    I am creating a program where we have to terminate all the employees whose contract end date is todays date.
    i am using below mentioned APIs for the same.
    HR_EX_EMPLOYEE_API.ACTUAL_TERMINATION_EMP
    HR_EX_EMPLOYEE_API.UPDATE_TERM_DETAILS_EMP
    But when I terminate the employee, its creating 3( 1 original and 2 new) records in per_all_assignments_f
    -- the assignment record got end dated on the given date , this is original record
    --- One with the new assignment id, effective_start_date from the next date to entered termination date to effective_end_date AND with assignment_type as 'B', i think this is normal behavior...
    -- But, one more records has got created with same assignment_id as that of terminated assginment_id, effective_start_date from the next date to the entered termination date to effective_end_date AND with assignment_status_type as 3 (i.e. 'Terminate Assignment')
    My question is, is this the proper functionality, or I am doing something wrong??
    we are on 11i
    Kindly advise
    Thanks,
    S

    Can u tell more about the Profile Option+* , to get rid of the B(enefits) assignment records. the B(enefits) assignment records.                                                                                                                                                                                                                                                                       

  • Reverse Termination in Oracle 11.5.9

    Hi ,
    We are sourcing the Employee data from R12 instance to 11i instance.
    And in source (i.e. R12) instance the employee records are getting reverse terminated from Front end application.
    We came to know that we can handle the same by Back End via OOB APIs in R12.
    We want to know that, how can we handle the same in 11i? Is there any API or Program present for the same?
    Thanks,
    Naveen.

    Hi Vignesh,
    In Oracle 11.5.9, hr_ex_employee_api API is not containing 'reverse_terminate_employee' procedure.
    Is there any API with different name or something?
    Thanks,
    Naveen.

  • Update end date on terminated assignment

    I have to change (extend) the effective_end_date of a terminated assignment. I have changed (extended) the final prcess date through using hr_periods_of_service_api.UPDATE_PDS_DETAILS.
    Can anyone help me wich API to use to change the effective_end_date of the terminated assignment
    Edited by: JohanndT on Feb 23, 2009 10:22 AM

    Try using 'HR_EX_EMPLOYEE_API.UPDATE_TERM_DETAILS_EMP' API to update the terminated employee information..
    Best Regards
    Arun Kumar S.R
    Apps Associates

  • How to Update the Final Process Date in Termiantion Screen Oracle HRMS

    Hi Gurus,
    I have a requirement where i need to update the Final Process Date. is there any standard api to update the final process date. i know there is a update to update the termination details like actual termination date,last standard process but how about final process date.
    Eg : For one assignment the final process date is 31-March-2013 and as of now he is a exemployee in system as he was terminated on 31-DEC-2012. now i want to prepone the final process date to 31-JAN-2012.
    any replies on this is highly appreciable.
    Thanks in advance.

    I would reverse the termination then terminate the employee with the right FPD.
    hr_ex_employee_api.reverse_terminate_employee
    hr_ex_employee_api.actual_termination_emp
    hr_ex_employee_api.final_process_emp
    Maybe also the below might work:
    hr_periods_of_service_api.update_pds_details
    Please note that there should be no payroll result in your case after January payroll.
    On a side note, you can also termiante employee without setting the FPD, and then put it only when approved by the business - in this way wou can avoid the prepone.

  • Re Hire EX Employee

    Hi ALL,
    Actually we terminated employee, Now scenario is that we want to reverse termination in Back Date. Let's say termination Date is 14-aug-2010 and re hire date is 15-sep-2010.
    How we can accomplish this. If the date is greater than termination date then I know we can use HR_EMPLOYEE_API.RE_HIRE_EX_EMPLOYEE API but what about if the date is less than termination date.
    I was searching over the metalink and found API hr_ex_employee_api.reverse_terminate_employee but did not find one for R11i. I also got hrempter.cancel_termination but that I don't know whether its recommended OR not?
    Thanks
    J

    Ideally you should pass the object version number of the record currently being dealt with. So if you are calling the API for the record with effective_start_date = '4/16/1990', pass the OVN of this record to the API.
    But I wonder why you are not able to reverse terminate a person using the API hrempter.cancel_termination only. I tried to do the same and could reverse terminate a terminated employee perfectly. Here is the sample call used by me:-
    DECLARE
    BEGIN
    hrempter.cancel_termination ( p_person_id => 22411
    ,p_actual_termination_date => trunc(sysdate) -- the person was terminated today
    ,p_clear_details => 'Y');
    EXCEPTION WHEN OTHERS THEN
    dbms_output.put_line(substr(sqlerrm,1,255));
    END ;
    This not only removed all the termination details but also correctly updated records in person_type_usages table. Can you check if you are using the same call.

  • Mass Termination WebADI

    Hi Gurus,
    I am new to tehnicalities of Oracle HRMS.I have to develop a code for Mass Termination of Emp/Contractors in our system.
    Can anybody suggest or provide sample code for this? Would appreciate a lot
    Regards.
    S

    You can use the following Pl/Sql APIs -
    hr_ex_employee_api.actual_termination_emp(...)
    hr_ex_employee_api.final_process_emp(...)
    For complete API documentation check -
    http://irep.oracle.com/index.html
    Cheers,
    VB

  • HRMS Web ADI Termination employee

    Hi All,
    Oracle HRMS Web ADI. After termination employee, explain clearly what are the steps involved internally. And wt are the standard tables and API's effecting.
    Application Desktop Integrator is it possible to update tables thru API's ?
    Thanks n Regards,
    user12509536 .

    Hi,
    You can use hr_ex_employee_api.actual_termination_emp API for ternination of employee.
    Cheers,
    Jayaraj.S

  • Conversion of Employees and Applicants.

    We are in the process of designing the conversion mapping and scripts.
    Our client has requested that we migrate all Histroy data pertaining to an Employee which means a person could have been an applicant and then later becomes an Employee.
    In such a scenario how would we migrate an applicant and later also migrate the same person as an employee. Pls advice.
    Also can an employee creation be date tracked when importing using the create_employee API .
    I see that the effective_start_date and effective_End_date are out parameters and not in parameters.
    Thanks,
    Muthu.

    Hi Muthu,
    From where are you migrating the data ?
    Is it from one instance of Oracle Apps to another ? say 11i to R12 ?
    Are you merging systems ?
    Not many people would do migration of such extent.
    I'm afraid you might have to loop through all the records for each person and then use APIs suitable.
    HR_APPLICANT_API;
    HR_EMPLOYEE_API;
    HR_EX_EMPLOYEE_API;
    Also log an SR with Oracle to see if there is any conversion utility to ease the process.
    Cheers,
    Vignesh

Maybe you are looking for

  • Two complete live shows on a single DVD+R double layer disc

    Hello! I am a new customer of Adobe's and have gone from Sonic MyDVD v6.1 to v9.0, then to Adobe Premiere Element 3.0 last month, and finally to Adobe Premiere Pro CS3 with Adobe Encore CS3 a few days ago with the digital downloads. Absolutely no pro

  • Keeping text crisp in a PDF export

    Hi all, I'm self-taught in InDesign, so forgive me if the question is basic. I created a document and exported it to PDF using the "press quality" setting. When I print from the PDF, it looks like the text has been converted to little dots rather tha

  • How to find Correct IDoc Status in SAP

    Hi All, I need some help on IDoc scenario, I have custom program to create Idoc and as well it will send IDoc to XI. I want to know idoc staus in the program to update custom table whether idoc sent successfully or not but idoc giving status as 03 (D

  • No audio from new nano

    Hi, The nano unit stopped outouting audio. The display and menus work but no output. volume level indicator is working, I can hear a clicking noise and some static when putting the head phones in ,but no sound out of it... tried 3 different head sets

  • Making Payment for Parked Vendor Invoice

    Hi All Is it possible to make payment for parked vendor invoice? if yes,please let me know how does it possible and what are the required configuration? Thanks in Advance Regards Praveen P C Edited by: Praveen Chirakkel on Apr 5, 2011 5:44 AM