/* Input Data */
INPUTS ARE OPERATION (text)
, LINESEQUENCE (number)
, LINEREPEAT (text)
, LINEREPEATNO (number)
, POSITION1 (text)
, POSITION2 (text)
, POSITION3 (text)
, POSITION4 (text)
, POSITION5 (text)
, POSITION6 (text)
, POSITION7 (text)
, POSITION8 (text)
DEFAULT FOR POSITION1 IS 'NO DATA'
DEFAULT FOR POSITION2 IS 'NO DATA'
DEFAULT FOR POSITION3 IS 'NO DATA'
DEFAULT FOR POSITION4 IS 'NO DATA'
DEFAULT FOR POSITION5 IS 'NO DATA'
DEFAULT FOR POSITION6 IS 'NO DATA'
DEFAULT FOR POSITION7 IS 'NO DATA'
DEFAULT FOR POSITION8 IS 'NO DATA'
DEFAULT FOR POSITION9 IS 'NO DATA'
DEFAULT FOR LINESEQUENCE IS 1
DEFAULT FOR LINEREPEATNO IS 1
DEFAULT FOR GLOBAL_PAY_INTERFACE_EXTRACTION_DATE is ' '
IF OPERATION='FILETYPE' THEN
OUTPUTVALUE='DELIMITED'
ELSE IF OPERATION='DELIMITER' THEN
OUTPUTVALUE='|'
ELSE IF OPERATION='READ' THEN
OUTPUTVALUE='NONE'
ELSE IF OPERATION = 'NUMBEROFBUSINESSOBJECTS' THEN
(
OUTPUTVALUE = '4'
RETURN OUTPUTVALUE
)
ELSE IF OPERATION = 'METADATALINEINFORMATION' THEN
(
METADATA1[1] = 'ElementEntry'
METADATA1[2] = 'ElementEntry'
METADATA1[3] = 'EffectiveEndDate'
METADATA1[4] = 'EffectiveStartDate'
METADATA1[5] = 'MultipleEntryCount'
METADATA1[6] = 'AssignmentNumber'
METADATA1[7] = 'CreatorType'
METADATA1[8] = 'ElementName'
METADATA1[9] = 'LegislativeDataGroupName'
METADATA1[10] = 'EntryType'
METADATA1[11] = 'ReplaceLastEffectiveEndDate'
METADATA1[12] = 'SourceSystemOwner'
METADATA1[13] = 'SourceSystemId'
METADATA2[1] = 'ElementEntry'
METADATA2[2] = 'ElementEntryValue'
METADATA2[3] = 'MultipleEntryCount'
METADATA2[4] = 'EffectiveEndDate'
METADATA2[5] = 'EffectiveStartDate'
METADATA2[6] = 'InputValueName'
METADATA2[7] = 'ScreenEntryValue'
METADATA2[8] = 'AssignmentNumber'
METADATA2[9] = 'ElementName'
METADATA2[10] = 'LegislativeDataGroupName'
METADATA2[11] = 'LegislationCode'
METADATA2[12] = 'EntryType'
METADATA2[13] = 'ReplaceLastEffectiveEndDate'
METADATA2[14] = 'SourceSystemOwner'
METADATA2[15] = 'SourceSystemId'
METADATA2[16] = 'ElementEntryId(SourceSystemId)'
METADATA3[1] = 'CostAllocation'
METADATA3[2] = 'CostAllocation'
METADATA3[3] = 'AssignmentNumber'
METADATA3[4] = 'MultipleEntryCount'
METADATA3[5] = 'EffectiveStartDate'
METADATA3[6] = 'EffectiveEndDate'
METADATA3[7] = 'SourceType'
METADATA3[8] = 'ElementTypeName'
METADATA3[9] = 'LegislativeDataGroupName'
METADATA3[10] = 'SourceSystemOwner'
METADATA3[11] = 'SourceSystemId'
METADATA4[1] = 'CostAllocationAccount'
METADATA4[2] = 'CostAllocationAccount'
METADATA4[3] = 'EffectiveDate'
METADATA4[4] = 'SourceType'
METADATA4[5] = 'AssignmentNumber'
METADATA4[6] = 'MultipleEntryCount'
METADATA4[7] = 'ElementTypeName'
METADATA4[8] = 'LegislativeDataGroupName'
METADATA4[9] = 'SourceSubType'
METADATA4[10] = 'Proportion'
METADATA4[11] = 'SubTypeSequence'
METADATA4[12] = 'Segment1'
METADATA4[13] = 'Segment2'
METADATA4[14] = 'Segment3'
METADATA4[15] = 'Segment4'
METADATA4[16] = 'Segment5'
METADATA4[17] = 'Segment6'
METADATA4[18] = 'Segment7'
METADATA4[19] = 'Segment8'
METADATA4[20] = 'SourceSystemOwner'
METADATA4[21] = 'SourceSystemId'
RETURN METADATA1,METADATA2
)
ELSE IF OPERATION='MAP' THEN
(
l_CMP = POSITION1
l_DEPTID = POSITION2
l_EMPLID = POSITION3
l_DUR = POSITION4
l_TRC = POSITION5
l_TL_Qty = POSITION6
l_EffDt = to_char(to_date(l_DUR, 'mmddyyyy'), 'yyyy/mm/dd')
l_Msg = ' '
l_Asg_Str = ' '
l_Asg_Number = ' '
l_PersonID = 'NONE'
l_Asg_DEPTID = ' '
l_Delimiter1_pos = 0
l_Delimiter2_pos = 0
l_Create_Costing = 'NO DATA'
l_Cost_Center = 'NO DATA'
If LINEREPEATNO = 1 Then (
l_Asg_Str = GET_VALUE_SET('GET_ASG_DETAILS','|=P_PER_NUM='''||l_EMPLID||''''||'|P_DATE='''||l_EffDt||'''')
l_Delimiter1_pos = INSTR(l_Asg_Str, '*',1,1)
l_Delimiter2_pos = INSTR(l_Asg_Str, '*',1,2)
l_Asg_Number = SUBSTR(l_Asg_Str, 1, l_Delimiter1_pos-1)
l_Asg_DEPTID = SUBSTR(l_Asg_Str, l_Delimiter1_pos+1, l_Delimiter2_pos-(l_Delimiter1_pos+1))
l_PersonID = SUBSTR(l_Asg_Str, l_Delimiter2_pos+1, Length(l_Asg_Str))
If isnull(l_Asg_Number) = 'N' Then (
l_Asg_Str = GET_VALUE_SET('GET_FUTURE_ASG','|=P_PER_NUM='''||l_EMPLID||''''||'|P_DATE='''||l_EffDt||'''')
l_Delimiter1_pos = INSTR(l_Asg_Str, '*',1,1)
l_Delimiter2_pos = INSTR(l_Asg_Str, '*',1,2)
l_Asg_Number = SUBSTR(l_Asg_Str, 1, l_Delimiter1_pos-1)
l_Asg_DEPTID = SUBSTR(l_Asg_Str, l_Delimiter1_pos+1, l_Delimiter2_pos-(l_Delimiter1_pos+1))
l_PersonID = SUBSTR(l_Asg_Str, l_Delimiter2_pos+1, Length(l_Asg_Str))
)
If l_DEPTID <> l_Asg_DEPTID and length(l_DEPTID) > 1 Then (
l_Create_Costing = 'Y'
l_Cost_Center = GET_VALUE_SET('GET_COST_CENTER','|=P_DEPTID='''||l_DEPTID||''''||'|P_CMP='''||l_CMP||''''||''''||'|P_DATE='''||l_EffDt||'''')
If isnull(l_Cost_Center) = 'N' Then (
l_Cost_Center = 'NO DATA'
)
)
/* ElementName = GET_VALUE_SET('GET_US_ELEMENT_NAME','|=P_TRC='''||l_TRC||'''') */
ElementName = l_TRC
AssignmentNumber = l_Asg_Number
EffectiveEndDate = GET_VALUE_SET('GET_PAY_END_DATE','|=DUR='''||l_EffDt||'''')
l_random_nbr = GET_VALUE_SET('TL_RANDOM_NUMBER')
l_Seq = to_char(to_date(l_DUR, 'mmddyyyy'), 'yyyymmdd') || lpad(TO_CHAR(LINESEQUENCE), 6, '0') || lpad(l_random_nbr, 3, '0')
MultipleEntryCount = To_Number(l_Seq)
WSA_SET('SEQNBR', l_Seq)
WSA_SET('ASGNUM', l_Asg_Number)
WSA_SET('ENDDATE', EffectiveEndDate)
WSA_SET('ELEMENTNAME',ElementName)
WSA_SET('COSTCENTER',l_Cost_Center)
WSA_SET('CCFLAG', l_Create_Costing)
)
Else (
AssignmentNumber = WSA_GET('ASGNUM','NO DATA')
EffectiveEndDate = WSA_GET('ENDDATE','NO DATA')
ElementName = WSA_GET('ELEMENTNAME', 'NO DATA')
l_Seq = WSA_GET('SEQNBR', 'NO DATA')
MultipleEntryCount = To_Number(l_Seq)
l_Cost_Center = WSA_GET('COSTCENTER', 'NO DATA')
l_Create_Costing = WSA_GET('CCFLAG', 'NO DATA')
Segment4 = l_Cost_Center
)
If isnull(AssignmentNumber) = 'N' or AssignmentNumber = 'NO DATA' or isnull(ElementName) = 'N' or ElementName = 'NO DATA' Then (
l_Create_Costing = 'N'
If isnull(ElementName) = 'N' or ElementName = 'NO DATA' Then (
l_Msg = l_TRC || ' TRC is invalid or not found'
)
If isnull(AssignmentNumber) = 'N' or AssignmentNumber = 'NO DATA' Then (
l_Msg = l_Msg || 'Assignment number not found - ' || l_EMPLID
AssignmentNumber = l_EMPLID
)
ElementName = trim(l_Msg)
)
DateEarned = l_EffDt
EffectiveStartDate = l_EffDt
CreatorType = 'F'
EntryType = 'E'
LegislationCode = 'US'
LegislativeDataGroupName = 'US Legislative Data Group'
ReplaceLastEffectiveEndDate = 'N'
SourceType = 'EE'
SourceSystemOwner = 'HRC_SQLLOADER'
SourceSystemId = AssignmentNumber||'-'||ElementName||'-'||to_char(MultipleEntryCount)
"ElementEntryId(SourceSystemId)" = AssignmentNumber||'-'||ElementName||'-'||to_char(MultipleEntryCount)
ElementTypeName = ElementName
EffectiveDate = EffectiveStartDate
SourceSubType = 'COST'
Proportion = '1'
BusinessOperation = 'MERGE'
FileName = 'ElementEntry'
If LINEREPEATNO = 1 Then (
LINEREPEAT = 'Y'
FileDiscriminator = 'ElementEntry'
Return BusinessOperation,FileName,FileDiscriminator,EffectiveStartDate,EffectiveEndDate,MultipleEntryCount,AssignmentNumber,CreatorType,ElementName,LegislativeDataGroupName,EntryType,ReplaceLastEffectiveEndDate,LINESEQUENCE,LINEREPEAT,LINEREPEATNO,SourceSystemOwner,SourceSystemId
)
Else If LINEREPEATNO = 2 Then (
If Length(l_TL_Qty) = 0 Then (
l_TL_Qty = '0'
)
l_TL_Qty_Num = to_number(l_TL_Qty) * 1
l_TL_Qty = to_char(l_TL_Qty_Num)
If l_TL_Qty_Num > -1 and l_TL_Qty_Num < 1 Then (
l_TL_Qty = Replace(l_TL_Qty, '.', '0.')
)
LINEREPEAT = 'Y'
FileDiscriminator = 'ElementEntryValue'
InputValueName = 'Hours'
ScreenEntryValue = l_TL_Qty
If (ElementName = 'Time Pay Min Wage') Then (
InputValueName = 'Amount'
)
Return BusinessOperation,FileName,FileDiscriminator,MultipleEntryCount,EffectiveStartDate,EffectiveEndDate,InputValueName,ScreenEntryValue,AssignmentNumber,ElementName,LegislativeDataGroupName,LegislationCode,EntryType,ReplaceLastEffectiveEndDate,LINESEQUENCE,LINEREPEAT,LINEREPEATNO
)
Else If LINEREPEATNO = 3 Then (
If l_Create_Costing = 'Y' Then (
LINEREPEAT = 'Y'
)
Else (
LINEREPEAT = 'N'
)
FileDiscriminator = 'ElementEntryValue'
InputValueName = 'Earned Date'
ScreenEntryValue = EffectiveStartDate
Return BusinessOperation,FileName,FileDiscriminator,MultipleEntryCount,EffectiveStartDate,EffectiveEndDate,InputValueName,ScreenEntryValue,AssignmentNumber,ElementName,LegislativeDataGroupName,LegislationCode,EntryType,ReplaceLastEffectiveEndDate,LINESEQUENCE,LINEREPEAT,LINEREPEATNO
)
Else If (LINEREPEATNO = 4 and l_Cost_Center != 'NO DATA' and length(l_Cost_Center) > 0) Then (
FileName = 'CostAllocation'
FileDiscriminator = 'CostAllocation'
LINEREPEAT = 'Y'
Return BusinessOperation,FileName,FileDiscriminator,AssignmentNumber,MultipleEntryCount,EffectiveStartDate,EffectiveEndDate,SourceType,ElementTypeName,LegislativeDataGroupName,SourceSystemOwner,SourceSystemId,LINESEQUENCE,LINEREPEAT,LINEREPEATNO
)
Else If (LINEREPEATNO = 5 and l_Cost_Center != 'NO DATA' and length(l_Cost_Center) > 0) Then (
FileName = 'CostAllocationAccount'
FileDiscriminator = 'CostAllocationAccount'
LINEREPEAT = 'N'
Return BusinessOperation,FileName,FileDiscriminator,AssignmentNumber,EffectiveDate,MultipleEntryCount,SourceType,ElementTypeName,LegislativeDataGroupName,SourceSubType,Proportion,Segment4,SourceSystemOwner,SourceSystemId,LINESEQUENCE,LINEREPEAT,LINEREPEATNO
)
Else (
LINEREPEAT = 'N'
OUTPUTVALUE = 'NONE'
Return OUTPUTVALUE,LINESEQUENCE,LINEREPEAT,LINEREPEATNO
)
)
ELSE
OUTPUTVALUE='NONE'
RETURN OUTPUTVALUE
/* End Formula Text */
HDL - Element Entry FF
Subscribe to:
Posts (Atom)
Oracle HCM Cloud technical tips to grow your skills
Few information around Oracle HCM Cloud.
No comments:
Post a Comment