The Compensation Default and Override formula type can be used to assign default values to cells in compensation worksheet cells. In below example we are pulling out an EIT attribute as of plan start date.
/* ---------------------------------------------------------------------
NAME : XYZ_CMP_DEFAULT_TESTATTR
TYPE : Compensation Default and Override
Requirement: The formula will fetch data from an Assignment EIT(MTI Information) for a compensation worksheet cell
---------------------------------------------------------------------*/
DEFAULT_DATA_VALUE FOR PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_TESTATTR IS 'NA'
DEFAULT_DATA_VALUE FOR PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_PERIOD_START IS '4712/12/31 00:00:00' (DATE)
DEFAULT_DATA_VALUE FOR PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_PERIOD_END IS '4712/12/31 00:00:00' (DATE)
DEFAULT FOR PER_ASG_START_DATE IS '1900/01/01 00:00:00' (date)
DEFAULT FOR PER_ASG_ASSIGNMENT_NUMBER IS 'NA'
INPUTS ARE CMP_IV_PLAN_START_DATE (text) ,CMP_IV_PLAN_END_DATE (text)
DEFAULT FOR CMP_IV_PLAN_START_DATE IS '1951/01/01'
DEFAULT FOR CMP_IV_PLAN_END_DATE IS '4712/12/31'
L_DATA_TYPE = 'CHAR'
Formula_Name = '[XYZ_CMP_DEFAULT_TESTATTR]'
L_PL_START_DATE = TO_DATE(CMP_IV_PLAN_START_DATE,'YYYY/MM/DD')
CHANGE_CONTEXTS(EFFECTIVE_DATE = L_PL_START_DATE)
(
l_asg_number=PER_ASG_ASSIGNMENT_NUMBER
I = PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_TESTATTR.FIRST(-1)
WHILE PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_TESTATTR.EXISTS(I) LOOP
(
IF L_PL_START_DATE >= PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_PERIOD_START[I]
AND L_PL_START_DATE <= PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_PERIOD_END[I] THEN
(
L_DEFAULT_VALUE = PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_TESTATTR[I]
RETURN L_DEFAULT_VALUE,L_DATA_TYPE
)
I = PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_TESTATTR.NEXT(I,-1)
)
)
RETURN L_DEFAULT_VALUE,L_DATA_TYPE
/* ---------------------------------------------------------------------
NAME : XYZ_CMP_DEFAULT_TESTATTR
TYPE : Compensation Default and Override
Requirement: The formula will fetch data from an Assignment EIT(MTI Information) for a compensation worksheet cell
---------------------------------------------------------------------*/
DEFAULT_DATA_VALUE FOR PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_TESTATTR IS 'NA'
DEFAULT_DATA_VALUE FOR PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_PERIOD_START IS '4712/12/31 00:00:00' (DATE)
DEFAULT_DATA_VALUE FOR PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_PERIOD_END IS '4712/12/31 00:00:00' (DATE)
DEFAULT FOR PER_ASG_START_DATE IS '1900/01/01 00:00:00' (date)
DEFAULT FOR PER_ASG_ASSIGNMENT_NUMBER IS 'NA'
INPUTS ARE CMP_IV_PLAN_START_DATE (text) ,CMP_IV_PLAN_END_DATE (text)
DEFAULT FOR CMP_IV_PLAN_START_DATE IS '1951/01/01'
DEFAULT FOR CMP_IV_PLAN_END_DATE IS '4712/12/31'
L_DATA_TYPE = 'CHAR'
Formula_Name = '[XYZ_CMP_DEFAULT_TESTATTR]'
L_PL_START_DATE = TO_DATE(CMP_IV_PLAN_START_DATE,'YYYY/MM/DD')
CHANGE_CONTEXTS(EFFECTIVE_DATE = L_PL_START_DATE)
(
l_asg_number=PER_ASG_ASSIGNMENT_NUMBER
I = PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_TESTATTR.FIRST(-1)
WHILE PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_TESTATTR.EXISTS(I) LOOP
(
IF L_PL_START_DATE >= PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_PERIOD_START[I]
AND L_PL_START_DATE <= PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_PERIOD_END[I] THEN
(
L_DEFAULT_VALUE = PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_TESTATTR[I]
RETURN L_DEFAULT_VALUE,L_DATA_TYPE
)
I = PER_ASSIGNMENT_EIT_EFF_USER_MTI_INFORMATION_TESTATTR.NEXT(I,-1)
)
)
RETURN L_DEFAULT_VALUE,L_DATA_TYPE
No comments:
Post a Comment