Unable to Terminate Secondary Assignment on the Same Date it is Switched from Primary to Secondary Using API (Doc ID 2001898.1)

Last updated on MARCH 14, 2017

Applies to:

Oracle Human Resources - Version 12.1.3 to 12.1 HRMS RUP7 [Release 12.1]
Information in this document applies to any platform.
This note provides a brief overview of .

Symptoms

Problem Statement:

Unable to terminate secondary assignment using API(hr_assignment_api.actual_termination_emp_asg) at the date it was changed from primary to secondary.

Expected Records:

ASSIGNMENT_IDASSIGNMENT_NUMBEREFFECTIVE_START_DATEEFFECTIVE_END_DATEPRIMARY_FLAGASSIGNMENT_STATUS_TYPE_ID
36845 2285 01-JAN-2010 31-DEC-2014 Y 1 (Active Assignment)
36845 2285 01-JAN-2015 31-DEC-4712 N 3 (Terminated Assignment)
36846 2285-2 01-JAN-2015 31-DEC-4712 Y 1 (Active Assignment)

Actual Records:
p_actual_termination_date = date when the secondary assignment (primary_flag = 'N') starts.

ASSIGNMENT_IDASSIGNMENT_NUMBEREFFECTIVE_START_DATEEFFECTIVE_END_DATEPRIMARY_FLAGASSIGNMENT_STATUS_TYPE_ID
36845 2285 01-JAN-2010 31-DEC-2014 Y 1 (Active Assignment)
36845 2285 01-JAN-2015 01-JAN-2015 N 1 (Active Assignment)
36846 2285-2 01-JAN-2015 31-DEC-4712 Y 1 (Active Assignment)
36845 2285 02-JAN-2015 31-DEC-4712 N 3 (Terminated Assignment)

API throws the following HR_7999_ASG_INV_PRIM_ASG error if specifying p_actual_termination_date = a day before the date when the secondary assignment (primary_flag = 'N') starts.

ORA-20001: The assignment must not be a primary assignment.
ORA-06512: at "APPS.HR_ASSIGNMENT_API", line 2983
ORA-06512: at line 15

 

Steps to Reproduce:

The issue can be reproduced at will with the following steps:

  1.  Create an employee on 01-JAN-2010.
  2.  Create a secondary assignment on 01-JAN-2015 and save.
  3.  Check the "Primary" flag of the secondary assignment created in the above step 2 on effective date = 01-JAN-2015 and save.
     The assignment records look as below.

    ASSIGNMENT_ID ASSIGNMENT_NUMBER EFFECTIVE_STAR EFFECTIVE_END_ PRIMARY_FLAG ASSIGNMENT_STATUS_TYPE_ID
    ------------- ----------------- -------------- -------------- ------------ -------------------------
            36845 2285              01-JAN-2010    31-DEC-2014    Y                                    1
            36845 2285              01-JAN-2015    31-DEC-4712    N                                    1
            36846 2285-2           01-JAN-2015    31-DEC-4712    Y                                    1

  4. Run the API to terminate the secondary assignment(primary_flag='N') with p_actual_termination_date = 01-JAN-2015. Do not commit yet.

      7. Error "ORA-20001: The assignment must not be a primary assignment." occurs.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms