Added calls to verify indexes and update indexes right after receiving and releasing material. Refactored codebase to adjust work order quantities instead of recalculate quantities.

Removing reliance on transaction queue for receive and releaase

Added unlock call in case write fails
This commit is contained in:
Infineon\StieberD
2025-09-30 13:45:55 -07:00
parent a2f61d11c9
commit beaac0d38a
17 changed files with 1272 additions and 778 deletions

View File

@ -695,9 +695,15 @@ PerformQuery:
end end
end end
If ErrorMsg EQ '' then If ErrorMsg EQ '' then
WOKeys = SRP_Array('SortSimpleList', WOKeys, 'DescendingNumbers', @VM) If WOKeys NE '' then
End_Dialog(@WINDOW,WOKeys) WOKeys = SRP_Array('SortSimpleList', WOKeys, 'DescendingNumbers', @VM)
End_Dialog(@WINDOW,WOKeys)
end else
Def = ''
Def<MICON$> = '*'
Msg(@Window, Def, 'OK', '', 'Query Results':@FM:'No work orders found')
end
end else end else
Msg(@Window, '', 'OK', '', 'Process Error':@FM:ErrorMsg) Msg(@Window, '', 'OK', '', 'Process Error':@FM:ErrorMsg)
end end

View File

@ -973,6 +973,7 @@ end service
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
Service WriteDataColumn(TableName, KeyID, ColumnNo, Value, IgnoreSelfLock, IgnoreMFSRoutines, IgnoreAllLocks) Service WriteDataColumn(TableName, KeyID, ColumnNo, Value, IgnoreSelfLock, IgnoreMFSRoutines, IgnoreAllLocks)
ErrorMsg = ''
If TableName NE '' AND KeyID NE '' AND ColumnNo NE '' then If TableName NE '' AND KeyID NE '' AND ColumnNo NE '' then
If ( Num(ColumnNo) and (ColumnNo GT 0) ) then If ( Num(ColumnNo) and (ColumnNo GT 0) ) then
@ -1009,7 +1010,13 @@ Service WriteDataColumn(TableName, KeyID, ColumnNo, Value, IgnoreSelfLock, Ignor
end end
end end
If IgnoreAllLocks EQ False$ then If IgnoreAllLocks EQ False$ then
If Error_Services('HasError') then
ErrorMsg = Error_Services('GetMessage')
end
Database_Services('ReleaseKeyIDLock', TableName, KeyID) Database_Services('ReleaseKeyIDLock', TableName, KeyID)
If ErrorMsg NE '' then
Error_Services('Add', ErrorMsg)
end
end end
end else end else
Error_Services('Add', 'Unable to lock ' : KeyID : ' for the ' : TableName : ' table in the ' : Service : ' service.') Error_Services('Add', 'Unable to lock ' : KeyID : ' for the ' : TableName : ' table in the ' : Service : ' service.')
@ -1109,4 +1116,3 @@ end service
// Internal GoSubs // Internal GoSubs
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -273,7 +273,8 @@ WRITE_RECORD:
Next RDSNo Next RDSNo
If (OrgQty NE NewQty) then If (OrgQty NE NewQty) then
Service_Services('PostProcedure', 'WORK_ORDER_SERVICES', 'UpdateScrappedQty':SD$:WorkOrderNo) ScrapAdj = NewQty - OrgQty
Work_Order_Services('AdjustScrappedQty', WorkOrderNo, ScrapAdj)
end end
// On the write of the record, read then write associated WM_IN and WM_OUT records to trigger the WM_MFS. // On the write of the record, read then write associated WM_IN and WM_OUT records to trigger the WM_MFS.
@ -294,44 +295,41 @@ WRITE_RECORD:
Database_Services('WriteDataRow', 'WM_OUT', WMOKey, WMORec, True$, True$, False$) Database_Services('WriteDataRow', 'WM_OUT', WMOKey, WMORec, True$, True$, False$)
end end
SAPTestFlag = Xlate('APP_INFO', 'SAP_TEST_FLAG', 1, 'X') // If NCR created after cassette has received a batch number, then inform SAP of new quantities
If SAPTestFlag then SAPBatchNo = Xlate('WO_MAT', WOMatKey, 'SAP_BATCH_NO', 'X')
// If NCR created after cassette has received a batch number, then inform SAP of new quantities IF SAPBatchNo NE '' THEN
SAPBatchNo = Xlate('WO_MAT', WOMatKey, 'SAP_BATCH_NO', 'X')
IF SAPBatchNo NE '' THEN IF (ReactorType = 'EPP') OR (ReactorType = 'EpiPro') THEN
WMOutKey = Xlate('WO_MAT', WOMatKey, 'WMO_KEY', 'X')
IF (ReactorType = 'EPP') OR (ReactorType = 'EpiPro') THEN CassStatus = Xlate('WM_OUT', WMOutKey, 'CURR_STATUS', 'X')
WMOutKey = Xlate('WO_MAT', WOMatKey, 'WMO_KEY', 'X')
CassStatus = Xlate('WM_OUT', WMOutKey, 'CURR_STATUS', 'X') END ELSE
// Non-EpiPro
END ELSE RDSNo = Xlate('WO_MAT', WoMatKey, 'RDS_NO', 'X')
// Non-EpiPro CassStatus = Xlate('RDS', RDSNo, 'CURR_STATUS', 'X')
RDSNo = Xlate('WO_MAT', WoMatKey, 'RDS_NO', 'X') END
CassStatus = Xlate('RDS', RDSNo, 'CURR_STATUS', 'X')
END // Add SAP transaction
IF OrigRecord = '' THEN
// Add SAP transaction TransQty = NewQty
IF OrigRecord = '' THEN END ELSE
TransQty = NewQty TransQty = NewQty - OrgQty
END ELSE END
TransQty = NewQty - OrgQty IF TransQty NE 0 THEN
END obj_SAP('AddTransaction','SCRAP_IN':@RM:WorkOrderNo:@RM:CassNo:@RM:TransQty)
IF TransQty NE 0 THEN
obj_SAP('AddTransaction','SCRAP_IN':@RM:WorkOrderNo:@RM:CassNo:@RM:TransQty) If TransQty LT 0 then
// Log negative SAP scrap transaction to capture metrics to submit for SAP change request
If TransQty LT 0 then LogData = ''
// Log negative SAP scrap transaction to capture metrics to submit for SAP change request LogData<1> = LoggingDTM
LogData = '' LogData<2> = @User4
LogData<1> = LoggingDTM LogData<3> = Name
LogData<2> = @User4 LogData<4> = SAPBatchNo
LogData<3> = Name LogData<5> = TransQty
LogData<4> = SAPBatchNo Logging_Services('AppendLog', objSAPLog, LogData, @RM, @FM)
LogData<5> = TransQty end
Logging_Services('AppendLog', objSAPLog, LogData, @RM, @FM) end
end end
end
end
end
OrigStatus = OrigRecord<NCR_STATUS$> OrigStatus = OrigRecord<NCR_STATUS$>
NewStatus = Record<NCR_STATUS$> NewStatus = Record<NCR_STATUS$>
@ -666,6 +664,7 @@ WRITE_RECORD:
end end
end end
end end
return return
DELETE_RECORD_PRE: DELETE_RECORD_PRE:
@ -746,11 +745,13 @@ DELETE_RECORD:
Pass_To_SQL('WRITE', 'RDS', RDSNo) Pass_To_SQL('WRITE', 'RDS', RDSNo)
Next RDSNo Next RDSNo
Service_Services('PostProcedure', 'WORK_ORDER_SERVICES', 'UpdateScrappedQty':SD$:WorkOrderNo) OrgQty = Sum(obj_NCR('RejQty',NCRNo:@RM:OrigRecord))
NewQty = 0
AdjustQty = NewQty - OrgQty
Work_Order_Services('AdjustScrappedQty', WorkOrderNo, AdjustQty)
return return
// ----- Internal Methods ---------------------------------------------------------------------------------------------- // ----- Internal Methods ----------------------------------------------------------------------------------------------

View File

@ -22,7 +22,7 @@ DECLARE FUNCTION Return_To_Fab_Services
DECLARE FUNCTION Logging_Services, Environment_Services, Error_Services, Signature_Services, Lot_Services, Supplement_Services DECLARE FUNCTION Logging_Services, Environment_Services, Error_Services, Signature_Services, Lot_Services, Supplement_Services
DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, Send_Dyn, obj_WO_Step, obj_RDS_Layer, obj_RDS_Test, obj_WM_In DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, Send_Dyn, obj_WO_Step, obj_RDS_Layer, obj_RDS_Test, obj_WM_In
DECLARE SUBROUTINE Btree.Extract, RDS_React_Run, Environment_Services, Logging_Services, Error_Services, Send_Info DECLARE SUBROUTINE Btree.Extract, RDS_React_Run, Environment_Services, Logging_Services, Error_Services, Send_Info
DECLARE SUBROUTINE SRP_Stopwatch, Database_Services, Lot_Services, Supplement_Services DECLARE SUBROUTINE SRP_Stopwatch, Database_Services, Lot_Services, Supplement_Services, RDS_Services
$INSERT MSG_EQUATES $INSERT MSG_EQUATES
$INSERT WO_VERIFY_EQU $INSERT WO_VERIFY_EQU
@ -375,6 +375,10 @@ Create:
Result = '' Result = ''
END ELSE END ELSE
RDS_Services('VerifyWOLogRDSKeyIndex', RDSNo)
RDS_Services('VerifyWOMatRDSNoIndex', RDSNo)
RDS_Services('VerifyWOStepRDSKeyIndex', RDSNo)
NewLotId = Lot_Services('CreateNewLot', 'RDS', '', WaferQty, SubPartNo, LotNo, SubVendCd, @User4, '', RDSNo) NewLotId = Lot_Services('CreateNewLot', 'RDS', '', WaferQty, SubPartNo, LotNo, SubVendCd, @User4, '', RDSNo)
If Rds_Services('IsEpiPro', RDSNo) then If Rds_Services('IsEpiPro', RDSNo) then
@ -1250,4 +1254,3 @@ CalcThickTarget:
RETURN RETURN

View File

@ -20,7 +20,7 @@ DECLARE FUNCTION Get_Status, Msg, Utility, obj_Tables, NextKey, obj_WO_Verify, o
DECLARE FUNCTION Database_Services, obj_RDS2, Logging_Services, Environment_Services, Error_Services DECLARE FUNCTION Database_Services, obj_RDS2, Logging_Services, Environment_Services, Error_Services
DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, Send_Dyn, obj_WO_Step, obj_RDS_Layer, obj_RDS_Test, Update_Index DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, Send_Dyn, obj_WO_Step, obj_RDS_Layer, obj_RDS_Test, Update_Index
DECLARE SUBROUTINE obj_Post_Log, obj_WO_Mat_Log,obj_WO_Wfr, Set_Property, Database_Services, Extract_SI_Keys DECLARE SUBROUTINE obj_Post_Log, obj_WO_Mat_Log,obj_WO_Wfr, Set_Property, Database_Services, Extract_SI_Keys
DECLARE SUBROUTINE Logging_Services, obj_Notes DECLARE SUBROUTINE Logging_Services, obj_Notes, WM_In_Services
$INSERT MSG_EQUATES $INSERT MSG_EQUATES
$INSERT WO_LOG_EQU $INSERT WO_LOG_EQU
@ -128,6 +128,9 @@ Create:
LogData<7> = WaferQty LogData<7> = WaferQty
Logging_Services('AppendLog', objLog, LogData, @RM, @FM) Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
Done = True$ Done = True$
WM_In_Services('VerifyWoStepWMIKeyIndex', WMInKey)
WM_In_Services('VerifyWOLogWMIKeyIndex', WMInKey)
WM_In_Services('VerifyWOMatWMIKeyIndex', WMInKey)
end end
Until ( (NumAttempts EQ 10) or (Done EQ True$) ) Until ( (NumAttempts EQ 10) or (Done EQ True$) )
Repeat Repeat
@ -940,6 +943,3 @@ RepProdTW:
RETURN RETURN

View File

@ -23,7 +23,7 @@ Declare Function Database_Services, SRP_Array, Return_To_Fab_Services
Declare Subroutine Set_Status, Msg, obj_Tables, Send_Dyn, obj_WO_Step, obj_RDS_Layer, obj_RDS_Test, Btree.Extract Declare Subroutine Set_Status, Msg, obj_Tables, Send_Dyn, obj_WO_Step, obj_RDS_Layer, obj_RDS_Test, Btree.Extract
Declare Subroutine Extract_SI_Keys, obj_WM_Out, obj_WO_Mat, obj_Post_Log, obj_WO_Mat_Log, ErrMsg, obj_WO_Wfr Declare Subroutine Extract_SI_Keys, obj_WM_Out, obj_WO_Mat, obj_Post_Log, obj_WO_Mat_Log, ErrMsg, obj_WO_Wfr
Declare Subroutine Logging_Services, Material_Services, Database_Services, Update_Index, Work_Order_Services Declare Subroutine Logging_Services, Material_Services, Database_Services, Update_Index, Work_Order_Services
Declare Subroutine Service_Services, obj_Notes, Delay Declare Subroutine Service_Services, obj_Notes, Delay, WM_Out_Services
$Insert MSG_EQUATES $Insert MSG_EQUATES
$Insert APP_INSERTS $Insert APP_INSERTS
@ -40,7 +40,7 @@ $Insert CLEAN_INSP_EQUATES
$Insert WMO_WFRS_EQUATES $Insert WMO_WFRS_EQUATES
$Insert REACT_RUN_EQUATES $Insert REACT_RUN_EQUATES
EQU NUM_RETRIES$ TO 50 EQU NUM_RETRIES$ TO 60
ErrTitle = 'Error in Stored Procedure "obj_WM_Out"' ErrTitle = 'Error in Stored Procedure "obj_WM_Out"'
ErrorMsg = '' ErrorMsg = ''
@ -115,13 +115,12 @@ Create:
WONo = Parms[1,@RM] WONo = Parms[1,@RM]
WOStep = Parms[COL2()+1,@RM] WOStep = Parms[COL2()+1,@RM]
NewCassNos = Parms[COL2()+1,@RM] NewCassNo = Parms[COL2()+1,@RM]
CassLoadQty = Parms[COL2()+1,@RM] CassLoadQty = Parms[COL2()+1,@RM]
IF WONo = '' THEN ErrorMsg = 'Null Parameter "WONo" passed to routine. (':Method:')' IF WONo = '' THEN ErrorMsg = 'Null Parameter "WONo" passed to routine. (':Method:')'
IF WOStep = '' THEN ErrorMsg = 'Null Parameter "WOStep" passed to routine. (':Method:')' IF WOStep = '' THEN ErrorMsg = 'Null Parameter "WOStep" passed to routine. (':Method:')'
IF NewCassNos = '' THEN ErrorMsg = 'Null Parameter "NewCassNos" passed to routine. (':Method:')' IF NewCassNo = '' THEN ErrorMsg = 'Null Parameter "NewCassNo" passed to routine. (':Method:')'
IF ErrorMsg NE '' THEN RETURN IF ErrorMsg NE '' THEN RETURN
@ -161,11 +160,8 @@ Create:
WORec = XLATE('WO_LOG',WONo,'','X') WORec = XLATE('WO_LOG',WONo,'','X')
InboundWaferQty = 0 InboundWaferQty = 0
FOR I = 1 TO COUNT(NewCassNos,@VM) + (NewCassNos NE '') CassWfrQty = XLATE('WO_MAT',WONo:'*':NewCassNo,WO_MAT_WAFER_QTY$,'X')
NewCassNo = NewCassNos<1,I> InboundWaferQty += CassWfrQty
CassWfrQty = XLATE('WO_MAT',WONo:'*':NewCassNo,WO_MAT_WAFER_QTY$,'X')
InboundWaferQty += CassWfrQty
NEXT I
WMOutKeys = XLATE('WO_STEP',WONo:'*':WOStep,WO_STEP_WM_OUT_KEYS$,'X') WMOutKeys = XLATE('WO_STEP',WONo:'*':WOStep,WO_STEP_WM_OUT_KEYS$,'X')
@ -214,7 +210,7 @@ Create:
OutOnlyCassIDs = '' ;* List of Outbound only Cassette IDs added 8/12/1011 JCH OutOnlyCassIDs = '' ;* List of Outbound only Cassette IDs added 8/12/1011 JCH
LOOP LOOP
UNTIL InboundWaferQty = 0 UNTIL InboundWaferQty EQ 0
WMOutKey = WONo:'*':WOStep:'*':WMOCassNo WMOutKey = WONo:'*':WOStep:'*':WMOCassNo
WMOutRec = XLATE('WM_OUT',WMOutKey,'','X') ;* In case there is a partial box WMOutRec = XLATE('WM_OUT',WMOutKey,'','X') ;* In case there is a partial box
NewBoxFlag = '' NewBoxFlag = ''
@ -250,7 +246,7 @@ Create:
NumAttempts = 0 NumAttempts = 0
Loop Loop
NumAttempts += 1 NumAttempts += 1
If NumAttempts GT 1 then Delay(NumAttempts) If NumAttempts GT 1 then Delay(1)
Database_Services('WriteDataRow', 'WM_OUT', WMOutKey, WMOutRec, True$, False$, False$) Database_Services('WriteDataRow', 'WM_OUT', WMOutKey, WMOutRec, True$, False$, False$)
If Error_Services('HasError') then If Error_Services('HasError') then
// Log the error // Log the error
@ -272,6 +268,9 @@ Create:
LogData<6> = WMOCassNo LogData<6> = WMOCassNo
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
Done = True$ Done = True$
WM_Out_Services('VerifyWOLogWMOKeyIndex', WONo:'*':WOStep:'*':WMOCassNo)
WM_Out_Services('VerifyWOMatWMOKeyIndex', WONo:'*':WOStep:'*':WMOCassNo)
WM_Out_Services('VerifyWoStepWMOKeyIndex', WONo:'*':WOStep:'*':WMOCassNo)
end end
Until ( (NumAttempts GT NUM_RETRIES$) or (Done EQ True$) ) Until ( (NumAttempts GT NUM_RETRIES$) or (Done EQ True$) )
Repeat Repeat
@ -1999,6 +1998,3 @@ ConvertCleanInsp:
RETURN RETURN

View File

@ -23,7 +23,7 @@ DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, Send_Dyn, Btree.Extract, ErrMsg,
DECLARE SUBROUTINE obj_Order_Change, obj_Vision, obj_Notes, obj_WM_In, obj_WM_Out, Msg, obj_WO_Mat, obj_Reprocess DECLARE SUBROUTINE obj_Order_Change, obj_Vision, obj_Notes, obj_WM_In, obj_WM_Out, Msg, obj_WO_Mat, obj_Reprocess
DECLARE SUBROUTINE obj_WO_Wfr, obj_WO_Step, Send_Info, obj_RDS2, obj_RDS, obj_Post_Log, obj_WO_Mat_Log, Sleepery DECLARE SUBROUTINE obj_WO_Wfr, obj_WO_Step, Send_Info, obj_RDS2, obj_RDS, obj_Post_Log, obj_WO_Mat_Log, Sleepery
DECLARE SUBROUTINE Environment_Services, Logging_Services, Error_Services, Database_Services, Update_Index DECLARE SUBROUTINE Environment_Services, Logging_Services, Error_Services, Database_Services, Update_Index
DECLARE SUBROUTINE Work_Order_Services, Delay, Transaction_Services DECLARE SUBROUTINE Work_Order_Services, Delay, Transaction_Services, RDS_Services, WM_In_Services, WM_Out_Services
$INSERT MSG_EQUATES $INSERT MSG_EQUATES
$INSERT ORDER_EQU $INSERT ORDER_EQU
@ -53,7 +53,7 @@ $INSERT LOGICAL
$INSERT APPCOLORS $INSERT APPCOLORS
$INSERT WM_IN_EQUATES $INSERT WM_IN_EQUATES
EQU NUM_RETRIES$ TO 50 EQU NUM_RETRIES$ TO 60
EQU CRLF$ TO \0D0A\ EQU CRLF$ TO \0D0A\
EQU COMMA$ TO ',' EQU COMMA$ TO ','
@ -103,7 +103,7 @@ BEGIN CASE
CASE Method = 'OpenWONos' ; GOSUB OpenWONos CASE Method = 'OpenWONos' ; GOSUB OpenWONos
CASE Method = 'ShipWONos' ; GOSUB ShipWONos CASE Method = 'ShipWONos' ; GOSUB ShipWONos
CASE Method = 'WOStepStatus' ; GOSUB WOStepStatus CASE Method = 'WOStepStatus' ; GOSUB WOStepStatus
CASE Method = 'ReleaseCassettes' ; GOSUB ReleaseCassettes CASE Method = 'ReleaseCassette' ; GOSUB ReleaseCassette
CASE Method = 'RecallWO' ; GOSUB RecallWO CASE Method = 'RecallWO' ; GOSUB RecallWO
CASE Method = 'ChangeLotNo' ; GOSUB ChangeLotNo CASE Method = 'ChangeLotNo' ; GOSUB ChangeLotNo
CASE Method = 'ChangeCassQty' ; GOSUB ChangeCassQty CASE Method = 'ChangeCassQty' ; GOSUB ChangeCassQty
@ -967,11 +967,11 @@ RETURN
* * * * * * * * * * * * * *
ReleaseCassettes: ReleaseCassette:
* * * * * * * * * * * * * *
WONo = Parms[1,@RM] WONo = Parms[1,@RM]
CassNos = Parms[COL2()+1,@RM] CassNo = Parms[COL2()+1,@RM]
ReleaseUser = Parms[COL2()+1,@RM] ReleaseUser = Parms[COL2()+1,@RM]
RelDtm = Parms[COL2()+1,@RM] RelDtm = Parms[COL2()+1,@RM]
@ -979,7 +979,7 @@ ReleaseCassettes:
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<2> = ReleaseUser LogData<2> = ReleaseUser
LogData<3> = WONo LogData<3> = WONo
LogData<4> = 'WONo: ':WONo:' CassNos: ':CassNos:' ReleaseUser: ':ReleaseUser:' ||| Beginning ReleaseCassettes routine.' LogData<4> = 'WONo: ':WONo:' CassNo: ':CassNo:' ReleaseUser: ':ReleaseUser:' ||| Beginning ReleaseCassette routine.'
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
IF WONo = '' THEN ErrorMsg = 'Null parameter WONo passed to routine (':Method:').' IF WONo = '' THEN ErrorMsg = 'Null parameter WONo passed to routine (':Method:').'
@ -1050,12 +1050,7 @@ ReleaseCassettes:
OrdSummary = '' ;* Holds Order Detail Lot Numbers and Associated Order Item Numbers OrdSummary = '' ;* Holds Order Detail Lot Numbers and Associated Order Item Numbers
CassCnt = COUNT(CassNos,@VM) + (CassNos NE '') WOMKey = WONo:'*':CassNo
WOMKeys = ''
FOR K = 1 TO CassCnt
WOMKeys<1,K> = WONo:'*':CassNos<1,K>
NEXT K
WOMTableVar = Database_Services('GetTableHandle', 'WO_MAT') WOMTableVar = Database_Services('GetTableHandle', 'WO_MAT')
@ -1065,7 +1060,7 @@ ReleaseCassettes:
END END
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' CassNos:':CassNos:' ||| Trace 1' LogData<4> = 'WONo:':WONo:' CassNo:':CassNo:' ||| Trace 1'
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
EpiPN = WORec<WO_LOG_EPI_PART_NO$> EpiPN = WORec<WO_LOG_EPI_PART_NO$>
@ -1093,149 +1088,138 @@ ReleaseCassettes:
// Log variables before obj_WM_Out('Create') // Log variables before obj_WM_Out('Create')
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' WMOLoadQty:':WMOLoadQty LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
IF ReactorType = 'EPP' THEN IF ReactorType = 'EPP' THEN
Send_Info('Creating WM_OUT records for WOStep ':WOStep:'...') Send_Info('Creating WM_OUT records for WOStep ':WOStep:'...')
OutOnlyCassIDS = obj_WM_Out('Create',WONO:@RM:WOStep:@RM:CassNos:@RM:WMOLoadQty) OutOnlyCassIDs = obj_WM_Out('Create',WONO:@RM:WOStep:@RM:CassNo:@RM:WMOLoadQty)
END ELSE END ELSE
OutOnlyCassIDs = '' OutOnlyCassIDs = ''
END END
StepRDSNos = '' StepRDSNos = ''
CassCnt = COUNT(CassNos,@VM) + (CassNos NE '')
// Log variables after obj_WM_Out('Create') // Log variables after obj_WM_Out('Create')
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2' LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2'
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
FOR N = 1 TO CassCnt IF ReactorType EQ 'EPP' THEN
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') CassWaferQty = XLATE('WO_MAT',WONo:'*':CassNo,WO_MAT_WAFER_QTY$,'X')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.':N WMIKey = WONo:'*':WOStep:'*':CassNo
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) obj_WM_IN('Create',WONo:@RM:WOStep:@RM:CassNo:@RM:CassWaferQty)
CassNo = CassNos<1,N> END ELSE
IF ReactorType EQ 'EPP' THEN WOMatRec = XLATE('WO_MAT',WoNo:'*':CassNo,'','X')
RDSNoCheck = WOMatRec<WO_MAT_RDS_NO$>
If RDSNoCheck EQ '' then
CassWaferQty = XLATE('WO_MAT',WONo:'*':CassNo,WO_MAT_WAFER_QTY$,'X') CassLotNo = WOMatRec<WO_MAT_LOT_NO$>
WMIKey = WONo:'*':WOStep:'*':CassNo CassWaferQty = WOMatRec<WO_MAT_WAFER_QTY$>
obj_WM_IN('Create',WONo:@RM:WOStep:@RM:CassNo:@RM:CassWaferQty) CassCustPartNo = WOMatRec<WO_MAT_CUST_PART_NO$>
CassSubPartNo = WOMatRec<WO_MAT_SUB_PART_NO$>
CassSubInvID = ''
CassOrderItem = WOMatRec<WO_MAT_ORDER_ITEM$>
ReprocessedMat = WOMatRec<WO_MAT_REPROCESSED_MAT$>
CassSubVendCd = WOMatRec<WO_MAT_SUB_VEND_CD$>
END ELSE IF OrderNo = '' THEN
QuoteNo = ''
END ELSE
QuoteNo = XLATE('ORDER_DET',OrderNo:'*':CassOrderItem,ORDER_DET_QUOTE_NO$,'X')
END
WOMatRec = XLATE('WO_MAT',WoNo:'*':CassNo,'','X') Parms = WONo:@RM
RDSNoCheck = WOMatRec<WO_MAT_RDS_NO$> Parms := WOStep:@RM
If RDSNoCheck EQ '' then Parms := LastStep:@RM
Parms := CassNo:@RM
Parms := QuoteNo:@RM
Parms := OrderNo:@RM
Parms := CassOrderItem:@RM
Parms := CustNo:@RM
Parms := PONo:@RM
Parms := ProcPSN:@RM
Parms := SubSupplyBy:@RM
Parms := SubPreClean:@RM
Parms := SubPostClean:@RM
Parms := PromiseDt:@RM
Parms := CassLotNo:@RM
Parms := CassCustPartNo:@RM
Parms := CassWaferQty:@RM
Parms := CassSubPartNo:@RM
Parms := '':@RM ;* QXJ Flag
Parms := CassSubVendCd
IF ReactorType NE 'GAN' then
CassLotNo = WOMatRec<WO_MAT_LOT_NO$> LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
CassWaferQty = WOMatRec<WO_MAT_WAFER_QTY$> LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.1 - Start obj_RDS("Create")'
CassCustPartNo = WOMatRec<WO_MAT_CUST_PART_NO$> Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
CassSubPartNo = WOMatRec<WO_MAT_SUB_PART_NO$> Done = False$
CassSubInvID = '' For AttemptIndex = 1 to NUM_RETRIES$
CassOrderItem = WOMatRec<WO_MAT_ORDER_ITEM$> If (AttemptIndex GT 1) then Delay(1)
ReprocessedMat = WOMatRec<WO_MAT_REPROCESSED_MAT$> NewRDSNo = obj_RDS('Create',Parms)
CassSubVendCd = WOMatRec<WO_MAT_SUB_VEND_CD$> errCode = ''
Begin Case
Case Get_Status(errCode)
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.1.1 - Attempt ':AttemptIndex:'. Error calling obj_RDS("Create"). Error message: ':errCode
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
Case (NewRDSNo EQ 0) or (NewRDSNo EQ '')
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.1.1 - Attempt ':AttemptIndex:'. Error calling obj_RDS("Create"). Invalid RDSNo ':Quote(RDSNo):' returned.'
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
Case RowExists('RDS', NewRDSNo)
Done = True$
End Case
Until Done
Next AttemptIndex
IF OrderNo = '' THEN LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
QuoteNo = '' LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.2 - End obj_RDS("Create")'
END ELSE Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
QuoteNo = XLATE('ORDER_DET',OrderNo:'*':CassOrderItem,ORDER_DET_QUOTE_NO$,'X')
END
Parms = WONo:@RM If ( (NewRDSNo EQ 0) or (NewRDSNo EQ '') ) then
Parms := WOStep:@RM
Parms := LastStep:@RM
Parms := CassNo:@RM
Parms := QuoteNo:@RM
Parms := OrderNo:@RM
Parms := CassOrderItem:@RM
Parms := CustNo:@RM
Parms := PONo:@RM
Parms := ProcPSN:@RM
Parms := SubSupplyBy:@RM
Parms := SubPreClean:@RM
Parms := SubPostClean:@RM
Parms := PromiseDt:@RM
Parms := CassLotNo:@RM
Parms := CassCustPartNo:@RM
Parms := CassWaferQty:@RM
Parms := CassSubPartNo:@RM
Parms := '':@RM ;* QXJ Flag
Parms := CassSubVendCd
IF ReactorType NE 'GAN' then
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') ErrMsg(errCode)
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.':N:'.1 - Start obj_RDS("Create")' ErrorMsg = "RDS '" : NewRDSNo : "' Create Failure - Check for missing data on Work Order"
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) If Error_Services('HasError') then
Done = False$ ErrMsg = Error_Services('GetMessage')
For AttemptIndex = 1 to NUM_RETRIES$ LogData = LoggingDTM : ',' : ReleaseUser : ',' : WONo : ',' : ErrMsg
If (AttemptIndex GT 1) then Delay(AttemptIndex) Logging_Services('AppendLog', objLog, LogData, CRLF$, COMMA$, False$, '', LogData)
NewRDSNo = obj_RDS('Create',Parms)
errCode = ''
Begin Case
Case Get_Status(errCode)
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.':N:'.1.1 - Attempt ':AttemptIndex:'. Error calling obj_RDS("Create"). Error message: ':errCode
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
Case (NewRDSNo EQ 0) or (NewRDSNo EQ '')
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.':N:'.1.1 - Attempt ':AttemptIndex:'. Error calling obj_RDS("Create"). Invalid RDSNo ':Quote(RDSNo):' returned.'
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
Case RowExists('RDS', NewRDSNo)
Done = True$
End Case
Until Done
Next AttemptIndex
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 2.':N:'.2 - End obj_RDS("Create")'
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
If ( (NewRDSNo EQ 0) or (NewRDSNo EQ '') ) then
ErrMsg(errCode)
ErrorMsg = "RDS '" : NewRDSNo : "' Create Failure - Check for missing data on Work Order"
If Error_Services('HasError') then
ErrMsg = Error_Services('GetMessage')
LogData = LoggingDTM : ',' : ReleaseUser : ',' : WONo : ',' : ErrMsg
Logging_Services('AppendLog', objLog, LogData, CRLF$, COMMA$, False$, '', LogData)
end
RTParms = 'RDS'
FOR I = 1 TO COUNT(StepRdsNos,@VM) + (StepRdsNos NE '')
RdsNo = StepRdsNos<1,I>
RTParms = FieldStore(RTParms, @RM, 2, 1, RdsNo)
obj_Tables('DeleteRec',RTParms)
NEXT I
RETURN
END else
// No error creating RDS record -> add it to the batch list.
StepRDSNos<1,-1> = NewRDSNo
end end
IF ReprocessedMat THEN RTParms = 'RDS'
OrgRDSNo = CassLotNo FOR I = 1 TO COUNT(StepRdsNos,@VM) + (StepRdsNos NE '')
obj_Reprocess('FixUp',OrgRDSNo:@RM:NewRDSNo) RdsNo = StepRdsNos<1,I>
END RTParms = FieldStore(RTParms, @RM, 2, 1, RdsNo)
obj_Tables('DeleteRec',RTParms)
END ;* End of check for GAN reactor NEXT I
END ;* End of Check for existing RDS RETURN
END ;* End of check for EpiPRO reactor type END else
NEXT N // No error creating RDS record -> add it to the batch list.
StepRDSNos<1,-1> = NewRDSNo
end
IF ReprocessedMat THEN
OrgRDSNo = CassLotNo
obj_Reprocess('FixUp',OrgRDSNo:@RM:NewRDSNo)
END
END ;* End of check for GAN reactor
END ;* End of Check for existing RDS
END ;* End of check for EpiPRO reactor type
NEXT WOStep NEXT WOStep
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3' LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3'
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
If RelDtm EQ '' then If RelDtm EQ '' then
@ -1251,95 +1235,91 @@ ReleaseCassettes:
MaxShipQty = Xlate('WO_LOG', WONo, 'CUST_EPI_PART_SHIP_QTY', 'X') MaxShipQty = Xlate('WO_LOG', WONo, 'CUST_EPI_PART_SHIP_QTY', 'X')
FOR N = 1 TO CassCnt CassNo = FIELD(WOMKey,'*',2)
WOMKey = WOMKeys<1,N> // Keep trying to get the lock. Another process may be updating this record at the same time.
CassNo = FIELD(WOMKey,'*',2) Done = False$
// Keep trying to get the lock. Another process may be updating this record at the same time. For AttemptIndex = 1 to NUM_RETRIES$
Done = False$
For AttemptIndex = 1 to NUM_RETRIES$ LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
If (AttemptIndex GT 1) then Delay(1)
HaveLock = Database_Services('GetKeyIDLock', 'WO_MAT', WOMKey, True$)
If HaveLock then
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex:' Have lock!'
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
If (AttemptIndex GT 1) then Delay(AttemptIndex) WOMatRec = XLATE('WO_MAT',WOMKey,'','X') ;* We have the lock, so just get the record this way
HaveLock = Database_Services('GetKeyIDLock', 'WO_MAT', WOMKey)
If HaveLock then IF WOMatRec<WO_MAT_REL_DTM$> = '' THEN
WOMatRec<WO_MAT_REL_DTM$> = IConv(RelDTM,'DT')
WOMatRec<WO_MAT_REL_BY$> = ReleaseUser
WOMatRec<WO_MAT_ORG_COMMIT_DT$> = PromiseDt
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') IF SubPreClean = 'No' OR SubPreClean = '' THEN
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex:' Have lock!' WOMatRec<WO_MAT_WMI_CURR_STATUS$> = 'RTU'
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) END ELSE
WOMatRec<WO_MAT_WMI_CURR_STATUS$> = 'PREC'
END
WOMatRec = XLATE('WO_MAT',WOMKey,'','X') ;* We have the lock, so just get the record this way WOMatRec<WO_MAT_WMO_CURR_STATUS$> = 'RTB'
IF WOMatRec<WO_MAT_REL_DTM$> = '' THEN thisInvDTM = ICONV(RelDTM,'DT')
WOMatRec<WO_MAT_REL_DTM$> = IConv(RelDTM,'DT')
WOMatRec<WO_MAT_REL_BY$> = ReleaseUser WHCd = 'SR'
WOMatRec<WO_MAT_ORG_COMMIT_DT$> = PromiseDt LocCd = 'RB'
InvAction = 'REL'
ScanUserID = ReleaseUser
Tag = ''
ToolID = ''
LOCATE thisInvDTM IN WOMatRec<WO_MAT_INV_DTM$> BY 'AR' USING @VM SETTING Pos ELSE
IF SubPreClean = 'No' OR SubPreClean = '' THEN WOMatRec = INSERT(WOMatRec,WO_MAT_INV_WH$,Pos,0,WHCd)
WOMatRec<WO_MAT_WMI_CURR_STATUS$> = 'RTU' WOMatRec = INSERT(WOMatRec,WO_MAT_INV_LOCATION$,Pos,0,LocCd)
END ELSE WOMatRec = INSERT(WOMatRec,WO_MAT_INV_ACTION$,Pos,0,InvAction)
WOMatRec<WO_MAT_WMI_CURR_STATUS$> = 'PREC' WOMatRec = INSERT(WOMatRec,WO_MAT_INV_DTM$,Pos,0,thisInvDTM)
END WOMatRec = INSERT(WOMatRec,WO_MAT_INV_USER$,Pos,0,ScanUserID)
WOMatRec = INSERT(WOMatRec,WO_MAT_INV_TAG$,Pos,0,Tag)
WOMatRec = INSERT(WOMatRec,WO_MAT_INV_TOOL_ID$,Pos,0,ToolID)
WOMatRec = INSERT(WOMatRec,WO_MAT_INV_SCAN_ENTRY$,Pos,0,False$)
WOMatRec<WO_MAT_WMO_CURR_STATUS$> = 'RTB' END
thisInvDTM = ICONV(RelDTM,'DT') WOMatParms = 'WO_MAT':@RM:WOMKey:@RM:WOMTableVar:@RM:WOMatRec
obj_Tables('WriteRec',WOMatParms) ;* This writes and unlocks the WO_MAT records
WHCd = 'SR'
LocCd = 'RB' If Not(Get_Status(errCode)) then
InvAction = 'REL' Done = True$
ScanUserID = ReleaseUser
Tag = ''
ToolID = ''
LOCATE thisInvDTM IN WOMatRec<WO_MAT_INV_DTM$> BY 'AR' USING @VM SETTING Pos ELSE
WOMatRec = INSERT(WOMatRec,WO_MAT_INV_WH$,Pos,0,WHCd)
WOMatRec = INSERT(WOMatRec,WO_MAT_INV_LOCATION$,Pos,0,LocCd)
WOMatRec = INSERT(WOMatRec,WO_MAT_INV_ACTION$,Pos,0,InvAction)
WOMatRec = INSERT(WOMatRec,WO_MAT_INV_DTM$,Pos,0,thisInvDTM)
WOMatRec = INSERT(WOMatRec,WO_MAT_INV_USER$,Pos,0,ScanUserID)
WOMatRec = INSERT(WOMatRec,WO_MAT_INV_TAG$,Pos,0,Tag)
WOMatRec = INSERT(WOMatRec,WO_MAT_INV_TOOL_ID$,Pos,0,ToolID)
WOMatRec = INSERT(WOMatRec,WO_MAT_INV_SCAN_ENTRY$,Pos,0,False$)
END
WOMatParms = 'WO_MAT':@RM:WOMKey:@RM:WOMTableVar:@RM:WOMatRec
obj_Tables('WriteRec',WOMatParms) ;* This writes and unlocks the WO_MAT records
If Not(Get_Status(errCode)) then
Done = True$
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex:' Successfully updated WO_MAT record ':WOMKey:' with REL operation.'
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
end else
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex:' Failed to update WO_MAT record ':WOMKey:' with REL operation.'
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
end
IF ReactType = 'EPP' OR ReactType = 'GAN' THEN
obj_WO_Wfr('CassRel',WOMKey) ;* Added 3/17/2016 JCH for wafer history
END
END else
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex:' Error! REL_DTM is not null.' LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex:' Successfully updated WO_MAT record ':WOMKey:' with REL operation.'
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
end else
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex:' Failed to update WO_MAT record ':WOMKey:' with REL operation.'
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
end end
IF ReactType = 'EPP' OR ReactType = 'GAN' THEN
obj_WO_Wfr('CassRel',WOMKey) ;* Added 3/17/2016 JCH for wafer history
END
END else
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 3.':AttemptIndex:' Error! REL_DTM is not null.'
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
end end
Until Done end
Next AttemptIndex Until Done
Next AttemptIndex
NEXT N
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 4' LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 4'
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
OutOnlyCnt = COUNT(OutOnlyCassIDs,@VM) + (OutOnlyCassIDs NE '') OutOnlyCnt = DCount(OutOnlyCassIDs, @VM)
ExistingWOMatKeys = WORec<WO_LOG_WO_MAT_KEY$> ExistingWOMatKeys = WORec<WO_LOG_WO_MAT_KEY$>
NewWOMatKeys = ExistingWOMatKeys NewWOMatKeys = ExistingWOMatKeys
FOR I = 1 TO OutOnlyCnt FOR I = 1 TO OutOnlyCnt
@ -1351,7 +1331,7 @@ ReleaseCassettes:
NEXT I NEXT I
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Trace 5' LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Trace 5'
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
ReactNos = obj_Sched('GetReactNos',WONo) ; // 5/26/2-15 JCH Added schedule ReactNos and check for WO_START_DTM$ ReactNos = obj_Sched('GetReactNos',WONo) ; // 5/26/2-15 JCH Added schedule ReactNos and check for WO_START_DTM$
@ -1401,12 +1381,12 @@ ReleaseCassettes:
If ErrorMsg NE '' then If ErrorMsg NE '' then
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Error Message: ':ErrorMsg LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Error Message: ':ErrorMsg
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
end end
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS')
LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty:' ||| Ending ReleaseCassettes routine' LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNo:':CassNo:' WMOLoadQty:':WMOLoadQty:' ||| Ending ReleaseCassette routine'
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
RETURN RETURN
@ -2348,7 +2328,6 @@ Route:
IF Get_Status(errCode) THEN RETURN IF Get_Status(errCode) THEN RETURN
WOStepKeys = WOLogRec<WO_LOG_WO_STEP_KEY$> WOStepKeys = WOLogRec<WO_LOG_WO_STEP_KEY$>
IF WOStepKeys NE '' THEN IF WOStepKeys NE '' THEN
@ -2386,7 +2365,6 @@ Route:
DefWMOCassQtys = XLATE('CUST_EPI_PART',CustNo:'*':EpiPartNo,CUST_EPI_PART_WMO_LOAD_CNT$,'X') DefWMOCassQtys = XLATE('CUST_EPI_PART',CustNo:'*':EpiPartNo,CUST_EPI_PART_WMO_LOAD_CNT$,'X')
WOStepKeys = '' WOStepKeys = ''
DefWMOCassQty = '' DefWMOCassQty = ''
@ -2418,8 +2396,43 @@ Route:
WOLogRec<WO_LOG_CUST_PART_NO$> = EpiPN WOLogRec<WO_LOG_CUST_PART_NO$> = EpiPN
END END
WOLogRec<WO_LOG_PROD_VER_NO$> = ProdVerNo WOLogRec<WO_LOG_PROD_VER_NO$> = ProdVerNo
WOLogRec<WO_LOG_CUST_NO$> = CustNo WOLogRec<WO_LOG_CUST_NO$> = CustNo
WOQty = WOLogRec<WO_LOG_WO_QTY$>
If WOQty EQ '' then
WOQty = 0
WOLogRec<WO_LOG_WO_QTY$> = WOQty
end
RxQty = WOLogRec<WO_LOG_RX_QTY_STATIC$>
If RxQty EQ '' then
RxQty = 0
WOLOgRec<WO_LOG_RX_QTY_STATIC$> = RxQty
end
RelQty = WOLogRec<WO_LOG_REL_QTY_STATIC$>
If RelQty EQ '' then
RelQty = 0
WOLogRec<WO_LOG_REL_QTY_STATIC$> = RelQty
end
UnRelQty = WOLogRec<WO_LOG_UNREL_QTY_STATIC$>
If UnRelQty EQ '' then
UnRelQty = WOQty - RelQty
end
OpenQty = WOLogRec<WO_LOG_OPEN_QTY_STATIC$>
If OpenQty EQ '' then
OpenQty = WOQty - RxQty
WOLogRec<WO_LOG_OPEN_QTY_STATIC$> = OpenQty
end
ScrapQty = WOLogRec<WO_LOG_SCRAP_QTY_STATIC$>
If ScrapQty EQ '' then
ScrapQty = 0
WOLogRec<WO_LOG_SCRAP_QTY_STATIC$> = ScrapQty
end
ShippedQty = WOLogRec<WO_LOG_STATIC_SHIP_QTY$>
If ShippedQty EQ '' then
ShippedQty = 0
WOLogRec<WO_LOG_STATIC_SHIP_QTY$> = ShippedQty
end
otParms = FIELDSTORE(otParms,@RM,4,0,WOLogRec) otParms = FIELDSTORE(otParms,@RM,4,0,WOLogRec)
obj_Tables('WriteRec',otParms) obj_Tables('WriteRec',otParms)

View File

@ -551,23 +551,32 @@ RemQAMet:
IF WOMatQARec<WO_MAT_QA_SIG$,DelPos> = '' THEN IF WOMatQARec<WO_MAT_QA_SIG$,DelPos> = '' THEN
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_PROFILE$, DelPos, 0) WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_PROFILE$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_PROP$,DelPos,0) WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_PROP$,DelPos,0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_TOOL_CLASS$, DelPos, 0) WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_TOOL_CLASS$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_STAGE$, DelPos, 0) WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_STAGE$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_MIN$, DelPos, 0) WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_MIN$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_MAX$, DelPos, 0) WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_MAX$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_SLOT$, DelPos, 0) WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_SLOT$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_RECIPE$, DelPos, 0) WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_RECIPE$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_RECIPE_PATTERN$, DelPos, 0) WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_RECIPE_PATTERN$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_SIG$, DelPos, 0) WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_SIG$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_SIG_DTM$, DelPos, 0) WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_SIG_DTM$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_STD_MAX$, DelPos, 0) WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_STD_MAX$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_STD_RESULT$, DelPos, 0) WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_STD_RESULT$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_WFR_QTY$, DelPos, 0) WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_WFR_QTY$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_WFR_TYPE$, DelPos, 0) WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_WFR_TYPE$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_REACT_SCHED$, DelPos, 0) WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_REACT_SCHED$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_SHIP_DOC$, DelPos, 0) WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_SHIP_DOC$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_DATA_POINTS$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_MIN_RESULT$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_MAX_RESULT$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_RANGE_PCT_RESULT$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_EDGE_MEAN_RESULT$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_5MM_PCT_RESULT$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_OUT_OF_SPEC$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_PHASE_MIN$, DelPos, 0)
WOMatQARec = DELETE(WOMatQARec, WO_MAT_QA_FAIL_REASON$, DelPos, 0)
otParms = FIELDSTORE(otParms,@RM,4,0,WOMatQARec) otParms = FIELDSTORE(otParms,@RM,4,0,WOMatQARec)
obj_Tables('WriteRec',otParms) obj_Tables('WriteRec',otParms)
@ -754,5 +763,3 @@ QAResults:
RETURN RETURN

View File

@ -68,7 +68,7 @@ Declare function Tool_Parms_Services, Signature_Services, obj_WO_Mat_QA, Date
Declare function Rds_Services, SRP_DateTime, SRP_Math, obj_WO_Mat, Lot_Services, SRP_Array Declare function Rds_Services, SRP_DateTime, SRP_Math, obj_WO_Mat, Lot_Services, SRP_Array
Declare function Lot_Event_Services, GetTickCount, Work_Order_Services Declare function Lot_Event_Services, GetTickCount, Work_Order_Services
Declare subroutine Error_Services, Database_Services, Logging_Services, Service_Services, obj_WO_React Declare subroutine Error_Services, Database_Services, Logging_Services, Service_Services, obj_WO_React
Declare Subroutine Mona_Services Declare Subroutine Mona_Services, Work_Order_Services
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\RDS' LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\RDS'
LogDate = Oconv(Date(), 'D4/') LogDate = Oconv(Date(), 'D4/')
@ -916,7 +916,12 @@ WRITE_RECORD:
OrigPocketChar = OrigRecord<RDS_POCKET_CHAR$> OrigPocketChar = OrigRecord<RDS_POCKET_CHAR$>
NewPocketChar = Record<RDS_POCKET_CHAR$> NewPocketChar = Record<RDS_POCKET_CHAR$>
If (OrigPocketChar NE NewPocketChar) then If (OrigPocketChar NE NewPocketChar) then
Service_Services('PostProcedure', 'WORK_ORDER_SERVICES', 'UpdateScrappedQty':SD$:WONo) OrigScrapQty = Count(OrigPocketChar, 'TEST')
NewScrapQty = Count(NewPocketChar, 'TEST')
AdjustQty = NewScrapQty - OrigScrapQty
If AdjustQty NE 0 then
Work_Order_Services('AdjustScrappedQty', WONo, AdjustQty)
end
end end
If {WO} NE '' then Service_Services('PostProcedure', 'RDS_SERVICES', 'VerifyWOLogRDSKeyIndex':SD$:Name) If {WO} NE '' then Service_Services('PostProcedure', 'RDS_SERVICES', 'VerifyWOLogRDSKeyIndex':SD$:Name)
@ -1018,3 +1023,4 @@ Restore_System_Variables:
return return

View File

@ -131,11 +131,13 @@ EQU NEW_EXIST$ To 0 ; * Reduce Mode 0
equ NEXT_CUR$ To 1 equ NEXT_CUR$ To 1
equ ADD_EXIST$ to 2 equ ADD_EXIST$ to 2
Equ NUM_ATTEMPTS$ to 60
AutoDisplayErrors = FALSE$ ; // Set this to True$ when debugging so all errors will automatically display. AutoDisplayErrors = FALSE$ ; // Set this to True$ when debugging so all errors will automatically display.
Declare subroutine SRP_Stopwatch, Error_Services, obj_Tables, Metrology_Services, obj_RDS_Test, SRP_JSON, Logging_Services Declare subroutine SRP_Stopwatch, Error_Services, obj_Tables, Metrology_Services, obj_RDS_Test, SRP_JSON, Logging_Services
Declare subroutine RTI_Set_Debugger, Database_Services, Btree.Extract, Extract_SI_Keys, Obj_WO_Mat, Obj_WO_Mat_Log Declare subroutine RTI_Set_Debugger, Database_Services, Btree.Extract, Extract_SI_Keys, Obj_WO_Mat, Obj_WO_Mat_Log
Declare subroutine Dialog_Box, Obj_Notes, RList, Set_Status, Errmsg, Obj_React_Status, Reactor_Services Declare subroutine Dialog_Box, Obj_Notes, RList, Set_Status, Errmsg, Obj_React_Status, Reactor_Services, Delay
Declare subroutine Rds_Services, Obj_Post_Log, Mona_Services, Transaction_Services, Reduce, Update_Index Declare subroutine Rds_Services, Obj_Post_Log, Mona_Services, Transaction_Services, Reduce, Update_Index
Declare function SRP_Sort_Array, Metrology_Services, obj_RDS_Test, obj_Test_Point_Map, Database_Services Declare function SRP_Sort_Array, Metrology_Services, obj_RDS_Test, obj_Test_Point_Map, Database_Services
Declare function Work_Order_Services, SRP_JSON, Logging_Services, Environment_Services, SRP_Trim, Error_Services Declare function Work_Order_Services, SRP_JSON, Logging_Services, Environment_Services, SRP_Trim, Error_Services
@ -2259,10 +2261,9 @@ Service VerifyWOMatRDSNoIndex(RDSNo)
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !RDS WO_MAT{RDS_NO} Log.csv' LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !RDS WO_MAT{RDS_NO} Log.csv'
Headers = 'Logging DTM':@FM:'RDSNo':@FM:'WOMatKey':@FM:'Result' Headers = 'Logging DTM':@FM:'RDSNo':@FM:'WOMatKey':@FM:'Result'
objVerifyRDSNoLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$) objVerifyRDSNoLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = '' LogData = ''
LogData<1> = LoggingDtm LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<2> = RDSNo LogData<2> = RDSNo
LogData<4> = 'Begin ':Service LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
@ -2273,35 +2274,48 @@ Service VerifyWOMatRDSNoIndex(RDSNo)
WOMatKey = Xlate('RDS', RDSNo, 'WO_MAT_KEY', 'X') WOMatKey = Xlate('RDS', RDSNo, 'WO_MAT_KEY', 'X')
If WOMatKey NE '' then If WOMatKey NE '' then
WOMatRDSNo = Xlate('WO_MAT', WOMatKey, 'RDS_NO', 'X') WOMatRDSNo = Xlate('WO_MAT', WOMatKey, 'RDS_NO', 'X')
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<3> = WOMatKey LogData<3> = WOMatKey
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
If WOMatRDSNo EQ '' then If WOMatRDSNo EQ '' then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'RDSNo missing from WO_MAT record. Generating index transaction.' LogData<4> = 'RDSNo missing from WO_MAT record. Generating index transaction.'
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
// Add index transaction to update RDS_NO relational index (target WO_MAT table) // Add index transaction to update RDS_NO relational index (target WO_MAT table)
IndexTransactionRow = 'WO_MAT*RDS_NO*AR':@FM:RDSNo:@FM:"":@FM:WOMatKey:@FM IndexTransactionRow = 'WO_MAT*RDS_NO*AR':@FM:RDSNo:@FM:"":@FM:WOMatKey:@FM
Open "!RDS" to BangTable then Open "!RDS" to BangTable then
Lock BangTable, 0 then Done = False$
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM For AttemptNo = 1 to NUM_ATTEMPTS$
PendingTrans := IndexTransactionRow If AttemptNo GT 1 then Delay(1)
Write PendingTrans on BangTable, 0 then Lock BangTable, 0 then
LogData<4> = 'Index transaction successfully added.' Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM) PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
Done = True$
end else
ErrorMsg = 'Unable to write index transaction to !RDS. ':RDSNo
end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !RDS to add index transaction. ':RDSNo
end else end else
ErrorMsg = 'Unable to write index transaction to !RDS. ':RDSNo If AttemptNo GE NUM_ATTEMPTS$ then
ErrorMsg = 'Unable to Lock !RDS to add index transaction. ':RDSNo
end
end end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !RDS to add index transaction. ':RDSNo Until Done or ErrorMsg
end else Next AttemptNo
ErrorMsg = 'Unable to Lock !RDS to add index transaction. ':RDSNo
end
end else end else
ErrorMsg = 'Unable to Open !RDS to add index transaction. ':RDSNo ErrorMsg = 'Unable to Open !RDS to add index transaction. ':RDSNo
end end
end else end else
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'Index ok. RDSNo not missing from WO_MAT record.' LogData<4> = 'Index ok. RDSNo not missing from WO_MAT record.'
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
end end
end else end else
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WO_MAT key for RDS ':RDSNo:' is null. Nothing to update.' LogData<4> = 'WO_MAT key for RDS ':RDSNo:' is null. Nothing to update.'
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
end end
@ -2309,10 +2323,12 @@ Service VerifyWOMatRDSNoIndex(RDSNo)
end end
If ErrorMsg NE '' then If ErrorMsg NE '' then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = ErrorMsg LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
end end
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'End ':Service LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
@ -2323,16 +2339,15 @@ end service
Service VerifyWOStepRDSKeyIndex(RDSNo) Service VerifyWOStepRDSKeyIndex(RDSNo)
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\RDS' LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\RDS'
LogDate = Oconv(Date(), 'D4/') LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS') LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !RDS WO_STEP{RDS_KEY} Log.csv' LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !RDS WO_STEP{RDS_KEY} Log.csv'
Headers = 'Logging DTM':@FM:'RDSNo':@FM:'WOStep':@FM:'Result' Headers = 'Logging DTM':@FM:'RDSNo':@FM:'WOStep':@FM:'Result'
objVerifyRDSKeyLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$) objVerifyRDSKeyLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = '' LogData = ''
LogData<1> = LoggingDtm LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<2> = RDSNo LogData<2> = RDSNo
LogData<4> = 'Begin ':Service LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
@ -2343,35 +2358,48 @@ Service VerifyWOStepRDSKeyIndex(RDSNo)
WOStepKey = Xlate('RDS', RDSNo, 'WO_STEP_KEY', 'X') WOStepKey = Xlate('RDS', RDSNo, 'WO_STEP_KEY', 'X')
If WOStepKey NE '' then If WOStepKey NE '' then
WOStepRDSKeys = Xlate('WO_STEP', WOStepKey, 'RDS_KEY', 'X') WOStepRDSKeys = Xlate('WO_STEP', WOStepKey, 'RDS_KEY', 'X')
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<3> = WOStepKey LogData<3> = WOStepKey
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
Locate RDSNo in WOStepRDSKeys using @VM setting vPos then Locate RDSNo in WOStepRDSKeys using @VM setting vPos then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'Index ok. RDSNo not missing from WO_STEP record.' LogData<4> = 'Index ok. RDSNo not missing from WO_STEP record.'
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
end else end else
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'RDSNo missing from WO_STEP record. Generating index transaction.' LogData<4> = 'RDSNo missing from WO_STEP record. Generating index transaction.'
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
// Add index transaction to update RDS_KEY relational index (target WO_STEP table) // Add index transaction to update RDS_KEY relational index (target WO_STEP table)
IndexTransactionRow = 'WO_STEP*RDS_KEY*AR':@FM:RDSNo:@FM:"":@FM:WOStepKey:@FM IndexTransactionRow = 'WO_STEP*RDS_KEY*AR':@FM:RDSNo:@FM:"":@FM:WOStepKey:@FM
Open "!RDS" to BangTable then Open "!RDS" to BangTable then
Lock BangTable, 0 then Done = False$
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM For AttemptNo = 1 to NUM_ATTEMPTS$
PendingTrans := IndexTransactionRow If AttemptNo GT 1 then Delay(1)
Write PendingTrans on BangTable, 0 then Lock BangTable, 0 then
LogData<4> = 'Index transaction successfully added.' Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM) PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
Done = True$
end else
ErrorMsg = 'Unable to write index transaction to !RDS. ':RDSNo
end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !RDS to add index transaction. ':RDSNo
end else end else
ErrorMsg = 'Unable to write index transaction to !RDS. ':RDSNo If AttemptNo GE NUM_ATTEMPTS$ then
ErrorMsg = 'Unable to Lock !RDS to add index transaction. ':RDSNo
end
end end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !RDS to add index transaction. ':RDSNo Until Done or ErrorMsg
end else Next AttemptNo
ErrorMsg = 'Unable to Lock !RDS to add index transaction. ':RDSNo
end
end else end else
ErrorMsg = 'Unable to Open !RDS to add index transaction. ':RDSNo ErrorMsg = 'Unable to Open !RDS to add index transaction. ':RDSNo
end end
end end
end else end else
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WO_STEP key for RDS ':RDSNo:' is null. Nothing to update.' LogData<4> = 'WO_STEP key for RDS ':RDSNo:' is null. Nothing to update.'
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
end end
@ -2379,10 +2407,12 @@ Service VerifyWOStepRDSKeyIndex(RDSNo)
end end
If ErrorMsg NE '' then If ErrorMsg NE '' then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = ErrorMsg LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
end end
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'End ':Service LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
@ -2399,10 +2429,9 @@ Service VerifyWOLogRDSKeyIndex(RDSNo)
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !RDS RDS{WO} Log.csv' LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !RDS RDS{WO} Log.csv'
Headers = 'Logging DTM':@FM:'RDSNo':@FM:'WOStep':@FM:'Result' Headers = 'Logging DTM':@FM:'RDSNo':@FM:'WOStep':@FM:'Result'
objVerifyRDSWoIndexLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$) objVerifyRDSWoIndexLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = '' LogData = ''
LogData<1> = LoggingDtm LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<2> = RDSNo LogData<2> = RDSNo
LogData<4> = 'Begin ':Service LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
@ -2417,32 +2446,44 @@ Service VerifyWOLogRDSKeyIndex(RDSNo)
LogData<3> = WONo LogData<3> = WONo
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
Locate RDSNo in WOLogRDSKeys using @VM setting vPos then Locate RDSNo in WOLogRDSKeys using @VM setting vPos then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'Index ok. RDSNo not missing from Btree index.' LogData<4> = 'Index ok. RDSNo not missing from Btree index.'
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
end else end else
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'RDSNo missing from Btree index. Generating index transaction.' LogData<4> = 'RDSNo missing from Btree index. Generating index transaction.'
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
// Add index transaction to update RDS_KEY relational index (target WO_STEP table) // Add index transaction to update RDS_KEY relational index (target WO_STEP table)
IndexTransactionRow = 'WO':@FM:RDSNo:@FM:"":@FM:WONo:@FM IndexTransactionRow = 'WO':@FM:RDSNo:@FM:"":@FM:WONo:@FM
Open "!RDS" to BangTable then Open "!RDS" to BangTable then
Lock BangTable, 0 then Done = False$
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM For AttemptNo = 1 to NUM_ATTEMPTS$
PendingTrans := IndexTransactionRow If AttemptNo GT 1 then Delay(1)
Write PendingTrans on BangTable, 0 then Lock BangTable, 0 then
LogData<4> = 'Index transaction successfully added.' Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM) PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
Done = True$
end else
ErrorMsg = 'Error in ':Service:' service. Unable to write index transaction to !RDS. ':RDSNo
end
Unlock BangTable, 0 else ErrorMsg = 'Error in ':Service:' service. Unable to Open !RDS to add index transaction. ':RDSNo
end else end else
ErrorMsg = 'Error in ':Service:' service. Unable to write index transaction to !RDS. ':RDSNo If AttemptNo GE NUM_ATTEMPTS$ then
ErrorMsg = 'Error in ':Service:' service. Unable to Lock !RDS to add index transaction. ':RDSNo
end
end end
Unlock BangTable, 0 else ErrorMsg = 'Error in ':Service:' service. Unable to Open !RDS to add index transaction. ':RDSNo Until Done or ErrorMsg
end else Next AttemptNo
ErrorMsg = 'Error in ':Service:' service. Unable to Lock !RDS to add index transaction. ':RDSNo
end
end else end else
ErrorMsg = 'Error in ':Service:' service. Unable to Open !RDS to add index transaction. ':RDSNo ErrorMsg = 'Error in ':Service:' service. Unable to Open !RDS to add index transaction. ':RDSNo
end end
end end
end else end else
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WONo for RDS ':RDSNo:' is null. Nothing to update.' LogData<4> = 'WONo for RDS ':RDSNo:' is null. Nothing to update.'
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
end end
@ -2452,10 +2493,12 @@ Service VerifyWOLogRDSKeyIndex(RDSNo)
end end
If ErrorMsg NE '' then If ErrorMsg NE '' then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = ErrorMsg LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
end end
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'End ':Service LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)

View File

@ -3719,6 +3719,226 @@ Service SendRefreshMessage()
end service end service
Service AdjustWorkOrderScheduleQty(WONo, ModifyQty)
ErrorMsg = ''
Begin Case
Case (WONo EQ '')
ErrorMsg = 'Error in ':Service:' service. WONo cannot be null.'
Case (ModifyQty EQ '')
ErrorMsg = 'Error in ':Service:' service. ModifyQty cannot be null.'
End Case
If (ErrorMsg EQ '') then
WOQty = Xlate('WO_LOG', WONo, 'WO_QTY', 'X')
OrigQty = WOQty - ModifyQty
NewQty = WOQty + ModifyQty
SchedDetNGKey = ''
Begin Case
Case ModifyQty GT 0
LogData = ''
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<2> = 'WO_LOG_ACTIONS'
LogData<3> = 'Work order ':WONo:' quantity increased from ':OrigQty:' to ':NewQty:'.'
Schedule_Services('LogActivity', '', LogData, False$)
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Searching for a scheduled event to increase the quantity.'
Schedule_Services('LogActivity', '', LogData, False$)
// Search schedule for most recent event and increase that event quantity by the difference.
Query = 'SELECT SCHED_DET_NG WITH WO_NO EQ ':WONo:' BY-DSND STOP_DTM'
GoSub ClearCursors
Set_Status(0)
RList(Query, TARGET_ACTIVELIST$, '', '', False$)
errCode = ''
If Get_Status(errCode) then
ErrorMsg = 'Error retrieving event list in WO_LOG_Actions. RList error code ':errCode:'.'
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = ErrorMsg
Schedule_Services('LogActivity', '', LogData, False$)
Error_Services('Add', ErrorMsg)
end else
EOF = False$
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Query successful. Number of keys found: ':@RecCount:'.'
Schedule_Services('LogActivity', '', LogData, False$)
ReadNext SchedDetNGKey else EOF = True$
If SchedDetNGKey NE '' then
EventRec = Database_Services('ReadDataRow', 'SCHED_DET_NG', SchedDetNGKey)
StopDTM = EventRec<SCHED_DET_NG.STOP_DTM$>
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Work order record ':WONo:' quantity increased from ':OrigQty:' to ':NewQty:'.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Scheduled event ':SchedDetNGKey:' found.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
// Only modify the event if it is still running or is scheduled in the future.
If StopDTM GT Datetime() then
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Event stop DTM ':OConv(StopDtm, 'DT2/^H'):' less than current DTM, so increasing event quantity.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
ReactNo = EventRec<SCHED_DET_NG.REACT_NO$>
WONo = EventRec<SCHED_DET_NG.WO_NO$>
StartDTM = EventRec<SCHED_DET_NG.START_DTM$>
Desc = EventRec<SCHED_DET_NG.DESC$>
EventQty = EventRec<SCHED_DET_NG.EVENT_TOTAL_WFRS$>
NewEventQty = EventQty + ModifyQty
Schedule_Services('ModifySchedEvent', SchedDetNGKey, ReactNo, WONo, StartDTM, StopDTM, Desc, NewEventQty)
// Adjust reactor events as needed.
Schedule_Services('AdjustScheduleEvents', ReactNo)
end else
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Event stop DTM ':OConv(StopDtm, 'DT2/^H'):' greater than current DTM.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Event quantity not increased.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
end
end
end
GoSub ClearCursors
Case ModifyQty LT 0
LogData = ''
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<2> = 'WO_LOG_ACTIONS'
LogData<3> = 'Work order ':WONo:' quantity decreased from ':OrigQty:' to ':NewQty:'.'
Schedule_Services('LogActivity', '', LogData, False$)
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Searching for a scheduled event to decrease the quantity.'
Schedule_Services('LogActivity', '', LogData, False$)
// Search schedule for most recent events and decrease/delete those events as needed.
Query = 'SELECT SCHED_DET_NG WITH WO_NO EQ ':WONo:' BY-DSND STOP_DTM'
GoSub ClearCursors
Set_Status(0)
RList(Query, TARGET_ACTIVELIST$, '', '', False$)
errCode = ''
If Get_Status(errCode) then
ErrorMsg = 'Error retrieving event list in WO_LOG_Actions. RList error code ':errCode:'.'
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = ErrorMsg
Schedule_Services('LogActivity', '', LogData, False$)
Error_Services('Add', ErrorMsg)
end else
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Query successful. Number of keys found: ':@RecCount:'.'
Schedule_Services('LogActivity', '', LogData, False$)
EOF = False$
Done = False$
UpdateReq = False$
Loop
ReadNext SchedDetNGKey else EOF = True$
Until EOF EQ True$
If SchedDetNGKey NE '' then
EventRec = Database_Services('ReadDataRow', 'SCHED_DET_NG', SchedDetNGKey)
StopDTM = EventRec<SCHED_DET_NG.STOP_DTM$>
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Work order record ':WONo:' quantity decreased from ':OrigQty:' to ':NewQty:'.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Scheduled event ':SchedDetNGKey:' found.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
// Only modify the event if it is still running or is scheduled in the future.
If StopDTM GT Datetime() then
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Event stop DTM ':OConv(StopDtm, 'DT2/^H'):' less than current DTM, so decreasing event quantity.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
UpdateReq = True$
ReactNo = EventRec<SCHED_DET_NG.REACT_NO$>
WONo = EventRec<SCHED_DET_NG.WO_NO$>
StartDTM = EventRec<SCHED_DET_NG.START_DTM$>
Desc = EventRec<SCHED_DET_NG.DESC$>
EventQty = EventRec<SCHED_DET_NG.EVENT_TOTAL_WFRS$>
If EventQty GT Abs(ModifyQty) then
// This event has enough wafers, so just reduce the quantity.
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Event quantity ':EventQty:' greater than quantity reduction ':ModifyQty:', so decreasing event quantity.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
Done = True$
NewEventQty = EventQty + ModifyQty
Schedule_Services('ModifySchedEvent', SchedDetNGKey, ReactNo, WONo, StartDTM, StopDTM, Desc, NewEventQty)
end else
// This event has fewer wafers than are being removed. Delete this event and continue
// onto the next event.
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Event quantity ':EventQty:' less than quantity reduction ':ModifyQty:', so canceling event.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
Schedule_Services('CancelScheduleEvent', SchedDetNGKey, True$)
ModifyQty += EventQty
end
end else
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Event stop DTM ':OConv(StopDtm, 'DT2/^H'):' greater than current DTM.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Event quantity not decreased.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
end
end
Until Done EQ True$
Repeat
If UpdateReq then
// Adjust reactor events as needed.
Schedule_Services('AdjustScheduleEvents', ReactNo)
end
end
GoSub ClearCursors
Case Otherwise$
Null
End Case
end
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Internal GoSubs // Internal GoSubs
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -155,17 +155,23 @@ WRITE_RECORD_PRE:
return return
WRITE_RECORD: WRITE_RECORD:
OrigQty = OrigRecord<TW_USE_TW_QTY$> OrigQty = OrigRecord<TW_USE_TW_QTY$>
NewQty = Record<TW_USE_TW_QTY$> NewQty = Record<TW_USE_TW_QTY$>
OrigSig = OrigRecord<TW_USE_SIGNATURE$> OrigSig = OrigRecord<TW_USE_SIGNATURE$>
NewSig = OrigRecord<TW_USE_SIGNATURE$> NewSig = OrigRecord<TW_USE_SIGNATURE$>
If OrigRecord EQ '' or OrigQty NE NewQty or OrigSig NE NewSig then If ( (OrigRecord EQ '') or (OrigQty NE NewQty) or (OrigSig NE NewSig) ) then
MetrologyID = Field(Name, '*', 1) MetrologyID = Field(Name, '*', 1)
RDSNo = Xlate('RDS_TEST', MetrologyID, RDS_TEST_RDS_NO$, 'X') RDSNo = Xlate('RDS_TEST', MetrologyID, RDS_TEST_RDS_NO$, 'X')
Service_Services('PostProcedure', 'RDS_SERVICES', 'AllTWUseSigned':SD$:RDSNo) Service_Services('PostProcedure', 'RDS_SERVICES', 'AllTWUseSigned':SD$:RDSNo)
end end
If (OrigQty NE NewQty) then
ScrapAdj = NewQty - OrigQty
Work_Order_Services('AdjustScrappedQty', {WO_NO}, ScrapAdj)
end
return return
DELETE_RECORD_PRE: DELETE_RECORD_PRE:
@ -180,6 +186,11 @@ DELETE_RECORD:
LogData<3> = Name LogData<3> = Name
Logging_Services('AppendLog', objLog, LogData, @RM, @FM) Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
OrigQty = OrigRecord<TW_USE_TW_QTY$>
NewQty = 0
ScrapAdj = NewQty - OrigQty
Work_Order_Services('AdjustScrappedQty', {WO_NO}, ScrapAdj)
return return
@ -228,3 +239,4 @@ Restore_System_Variables:
@FILE.ERROR = OrigFileError @FILE.ERROR = OrigFileError
return return

View File

@ -60,6 +60,8 @@ $Insert CUST_EPI_PART_EQUATES
$Insert QUOTE_SPEC_EQU $Insert QUOTE_SPEC_EQU
$Insert WO_STEP_EQUATES $Insert WO_STEP_EQUATES
Equ NUM_ATTEMPTS$ to 60
EQU PI$LEFT TO 1 EQU PI$LEFT TO 1
EQU PI$TOP TO 2 EQU PI$TOP TO 2
EQU PI$RIGHT TO 3 EQU PI$RIGHT TO 3
@ -77,7 +79,7 @@ EQU PS$PATTERN TO 11
Declare function PSN_Services, SRP_Rotate_Array, Datetime, Database_Services, Environment_Services, Logging_Services Declare function PSN_Services, SRP_Rotate_Array, Datetime, Database_Services, Environment_Services, Logging_Services
Declare function obj_Install, SRP_Json Declare function obj_Install, SRP_Json
Declare subroutine Database_Services, Set_Status, obj_Wo_Mat_Log, Logging_Services, Extract_Si_Keys, Btree.Extract Declare subroutine Database_Services, Set_Status, obj_Wo_Mat_Log, Logging_Services, Extract_Si_Keys, Btree.Extract
Declare subroutine SRP_Json Declare subroutine SRP_Json, Update_Index, Delay
GoToService else GoToService else
Error_Services('Set', Service : ' is not a valid service request within the ' : ServiceModule : ' services module.') Error_Services('Set', Service : ' is not a valid service request within the ' : ServiceModule : ' services module.')
@ -218,19 +220,27 @@ Service VerifyWoStepWMIKeyIndex(WMIKey)
// Add index transaction to update WM_IN_KEYS relational index (target WO_STEP table) // Add index transaction to update WM_IN_KEYS relational index (target WO_STEP table)
IndexTransactionRow = 'WO_STEP*WM_IN_KEYS*AR':@FM:WMIKey:@FM:"":@FM:WOStepKey:@FM IndexTransactionRow = 'WO_STEP*WM_IN_KEYS*AR':@FM:WMIKey:@FM:"":@FM:WOStepKey:@FM
Open "!WM_IN" to BangTable then Open "!WM_IN" to BangTable then
Lock BangTable, 0 then Done = False$
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM For AttemptNo = 1 to NUM_ATTEMPTS$
PendingTrans := IndexTransactionRow If AttemptNo GT 1 then Delay(1)
Write PendingTrans on BangTable, 0 then Lock BangTable, 0 then
LogData<4> = 'Index transaction successfully added.' Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
Logging_Services('AppendLog', objVerifyWMIKeyLog, LogData, @RM, @FM) PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyWMIKeyLog, LogData, @RM, @FM)
Done = True$
end else
ErrorMsg = 'Unable to write index transaction to !WM_IN. ':WMIKey
end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !WM_IN to add index transaction. ':WMIKey
end else end else
ErrorMsg = 'Unable to write index transaction to !WM_IN. ':WMIKey If AttemptNo GE NUM_ATTEMPTS$ then
ErrorMsg = 'Unable to Lock !WM_IN to add index transaction. ':WMIKey
end
end end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !WM_IN to add index transaction. ':WMIKey Until Done or ErrorMsg
end else Next AttemptNo
ErrorMsg = 'Unable to Lock !WM_IN to add index transaction. ':WMIKey
end
end else end else
ErrorMsg = 'Unable to Open !WM_IN to add index transaction. ':WMIKey ErrorMsg = 'Unable to Open !WM_IN to add index transaction. ':WMIKey
end end
@ -263,10 +273,9 @@ Service VerifyWOLogWMIKeyIndex(WMIKey)
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_IN WM_IN{WO_NO} Log.csv' LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_IN WM_IN{WO_NO} Log.csv'
Headers = 'Logging DTM':@FM:'WMIKey':@FM:'WOStep':@FM:'Result' Headers = 'Logging DTM':@FM:'WMIKey':@FM:'WOStep':@FM:'Result'
objVerifyWMIWoIndexLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$) objVerifyWMIWoIndexLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = '' LogData = ''
LogData<1> = LoggingDtm LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<2> = WMIKey LogData<2> = WMIKey
LogData<4> = 'Begin ':Service LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
@ -278,32 +287,44 @@ Service VerifyWOLogWMIKeyIndex(WMIKey)
If WONo NE '' then If WONo NE '' then
WOLogRDSKeys = '' WOLogRDSKeys = ''
Extract_Si_Keys('WM_IN', 'WO_NO', WONo, WOLogRDSKeys) Extract_Si_Keys('WM_IN', 'WO_NO', WONo, WOLogRDSKeys)
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<3> = WONo LogData<3> = WONo
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
Locate WMIKey in WOLogRDSKeys using @VM setting vPos else Locate WMIKey in WOLogRDSKeys using @VM setting vPos else
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WMIKey missing from Btree index. Generating index transaction.' LogData<4> = 'WMIKey missing from Btree index. Generating index transaction.'
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
// Add index transaction to update WO_NO btree index // Add index transaction to update WO_NO btree index
IndexTransactionRow = 'WO_NO':@FM:WMIKey:@FM:"":@FM:WONo:@FM IndexTransactionRow = 'WO_NO':@FM:WMIKey:@FM:"":@FM:WONo:@FM
Open "!WM_IN" to BangTable then Open "!WM_IN" to BangTable then
Lock BangTable, 0 then Done = False$
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM For AttemptNo = 1 to NUM_ATTEMPTS$
PendingTrans := IndexTransactionRow If AttemptNo GT 1 then Delay(1)
Write PendingTrans on BangTable, 0 then Lock BangTable, 0 then
LogData<4> = 'Index transaction successfully added.' Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM) PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
Done = True$
end else
ErrorMsg = 'Error in ':Service:' service. Unable to write index transaction to !WM_IN. ':WMIKey
end
Unlock BangTable, 0 else ErrorMsg = 'Error in ':Service:' service. Unable to Open !WM_IN to add index transaction. ':WMIKey
end else end else
ErrorMsg = 'Error in ':Service:' service. Unable to write index transaction to !WM_IN. ':WMIKey If AttemptNo GE NUM_ATTEMPTS$ then
ErrorMsg = 'Error in ':Service:' service. Unable to Lock !WM_IN to add index transaction. ':WMIKey
end
end end
Unlock BangTable, 0 else ErrorMsg = 'Error in ':Service:' service. Unable to Open !WM_IN to add index transaction. ':WMIKey Until Done or ErrorMsg
end else Next AttemptNo
ErrorMsg = 'Error in ':Service:' service. Unable to Lock !WM_IN to add index transaction. ':WMIKey
end
end else end else
ErrorMsg = 'Error in ':Service:' service. Unable to Open !WM_IN to add index transaction. ':WMIKey ErrorMsg = 'Error in ':Service:' service. Unable to Open !WM_IN to add index transaction. ':WMIKey
end end
end end
end else end else
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WONo for WM_IN ':WMIKey:' is null. Nothing to update.' LogData<4> = 'WONo for WM_IN ':WMIKey:' is null. Nothing to update.'
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
end end
@ -313,10 +334,12 @@ Service VerifyWOLogWMIKeyIndex(WMIKey)
end end
If ErrorMsg NE '' then If ErrorMsg NE '' then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = ErrorMsg LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
end end
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'End ':Service LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
@ -333,10 +356,9 @@ Service VerifyWOMatWMIKeyIndex(WMIKey)
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_IN WO_MAT{WMI_KEY} Log.csv' LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_IN WO_MAT{WMI_KEY} Log.csv'
Headers = 'Logging DTM':@FM:'WMIKey':@FM:'WOMatKey':@FM:'Result' Headers = 'Logging DTM':@FM:'WMIKey':@FM:'WOMatKey':@FM:'Result'
objVerifyWoMatWmiKeyLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$) objVerifyWoMatWmiKeyLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = '' LogData = ''
LogData<1> = LoggingDtm LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<2> = WMIKey LogData<2> = WMIKey
LogData<4> = 'Begin ':Service LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
@ -347,32 +369,44 @@ Service VerifyWOMatWMIKeyIndex(WMIKey)
WOMatKey = Field(WMIKey, '*', 1, 1):'*':Field(WMIKey, '*', 3, 1) WOMatKey = Field(WMIKey, '*', 1, 1):'*':Field(WMIKey, '*', 3, 1)
If WOMatKey NE '' then If WOMatKey NE '' then
WOMatWMIKey = Xlate('WO_MAT', WOMatKey, 'WMI_KEY', 'X') WOMatWMIKey = Xlate('WO_MAT', WOMatKey, 'WMI_KEY', 'X')
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<3> = WOMatKey LogData<3> = WOMatKey
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
If WOMatWMIKey EQ '' then If WOMatWMIKey EQ '' then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WMIKey missing from WO_MAT record. Generating index transaction.' LogData<4> = 'WMIKey missing from WO_MAT record. Generating index transaction.'
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
// Add index transaction to update WMI_KEY relational index (target WO_MAT table) // Add index transaction to update WMI_KEY relational index (target WO_MAT table)
IndexTransactionRow = 'WO_MAT*WMI_KEY*TOP':@FM:WMIKey:@FM:"":@FM:WOMatKey:@FM IndexTransactionRow = 'WO_MAT*WMI_KEY*TOP':@FM:WMIKey:@FM:"":@FM:WOMatKey:@FM
Open "!WM_IN" to BangTable then Open "!WM_IN" to BangTable then
Lock BangTable, 0 then Done = False$
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM For AttemptNo = 1 to NUM_ATTEMPTS$
PendingTrans := IndexTransactionRow If AttemptNo GT 1 then Delay(1)
Write PendingTrans on BangTable, 0 then Lock BangTable, 0 then
LogData<4> = 'Index transaction successfully added.' Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM) PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
Done = True$
end else
ErrorMsg = 'Unable to write index transaction to !WM_IN. ':WMIKey
end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !WM_IN to add index transaction. ':WMIKey
end else end else
ErrorMsg = 'Unable to write index transaction to !WM_IN. ':WMIKey If AttemptNo GE NUM_ATTEMPTS$ then
ErrorMsg = 'Unable to Lock !WM_IN to add index transaction. ':WMIKey
end
end end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !WM_IN to add index transaction. ':WMIKey Until Done or ErrorMsg
end else Next AttemptNo
ErrorMsg = 'Unable to Lock !WM_IN to add index transaction. ':WMIKey
end
end else end else
ErrorMsg = 'Unable to Open !WM_IN to add index transaction. ':WMIKey ErrorMsg = 'Unable to Open !WM_IN to add index transaction. ':WMIKey
end end
end end
end else end else
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WO_MAT key for WM_IN ':WMIKey:' is null. Nothing to update.' LogData<4> = 'WO_MAT key for WM_IN ':WMIKey:' is null. Nothing to update.'
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
end end
@ -380,10 +414,12 @@ Service VerifyWOMatWMIKeyIndex(WMIKey)
end end
If ErrorMsg NE '' then If ErrorMsg NE '' then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = ErrorMsg LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
end end
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'End ':Service LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)

View File

@ -57,18 +57,20 @@ $Insert WO_MAT_EQUATES
$Insert WO_LOG_EQUATES $Insert WO_LOG_EQUATES
$Insert COMPANY_EQUATES $Insert COMPANY_EQUATES
$Insert RETURN_TO_FAB_LOTS_EQUATES $Insert RETURN_TO_FAB_LOTS_EQUATES
$INSERT PROD_SPEC_EQUATES $Insert PROD_SPEC_EQUATES
$INSERT WO_STEP_EQUATES $Insert WO_STEP_EQUATES
$INSERT EPI_PART_EQUATES $Insert EPI_PART_EQUATES
$INSERT CUST_EPI_PART_EQUATES $Insert CUST_EPI_PART_EQUATES
$INSERT PRS_STAGE_EQUATES $Insert PRS_STAGE_EQUATES
$insert UNIT_EQUATES $Insert UNIT_EQUATES
Equ NUM_ATTEMPTS$ to 60
Declare function Database_Services, SRP_JSON, Error_Services, Clean_Insp_Services, WO_Mat_QA_Services Declare function Database_Services, SRP_JSON, Error_Services, Clean_Insp_Services, WO_Mat_QA_Services
Declare function PSN_Services, SRP_Rotate_Array, Datetime, Return_To_Fab_Services, Environment_Services Declare function PSN_Services, SRP_Rotate_Array, Datetime, Return_To_Fab_Services, Environment_Services
Declare function Logging_Services Declare function Logging_Services
Declare subroutine Database_Services, SRP_JSON, Error_Services, Extract_Si_Keys, Set_Status, obj_wo_mat_log Declare subroutine Database_Services, SRP_JSON, Error_Services, Extract_Si_Keys, Set_Status, obj_wo_mat_log
Declare subroutine Logging_Services, Btree.Extract Declare subroutine Logging_Services, Btree.Extract, Update_Index, Delay
GoToService else GoToService else
Error_Services('Set', Service : ' is not a valid service request within the ' : ServiceModule : ' services module.') Error_Services('Set', Service : ' is not a valid service request within the ' : ServiceModule : ' services module.')
@ -458,10 +460,9 @@ Service VerifyWoStepWMOKeyIndex(WMOKey)
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_OUT WO_STEP{WM_OUT_KEYS} Log.csv' LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_OUT WO_STEP{WM_OUT_KEYS} Log.csv'
Headers = 'Logging DTM':@FM:'WMOKey':@FM:'WOStep':@FM:'Result' Headers = 'Logging DTM':@FM:'WMOKey':@FM:'WOStep':@FM:'Result'
objVerifyWMOKeyLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$) objVerifyWMOKeyLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = '' LogData = ''
LogData<1> = LoggingDtm LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<2> = WMOKey LogData<2> = WMOKey
LogData<4> = 'Begin ':Service LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
@ -472,32 +473,44 @@ Service VerifyWoStepWMOKeyIndex(WMOKey)
WOStepKey = Field(WMOKey, '*', 1, 2) WOStepKey = Field(WMOKey, '*', 1, 2)
If WOStepKey NE '' then If WOStepKey NE '' then
WOStepWMOKeys = Xlate('WO_STEP', WOStepKey, 'WM_OUT_KEYS', 'X') WOStepWMOKeys = Xlate('WO_STEP', WOStepKey, 'WM_OUT_KEYS', 'X')
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<3> = WOStepKey LogData<3> = WOStepKey
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
Locate WMOKey in WOStepWMOKeys using @VM setting vPos else Locate WMOKey in WOStepWMOKeys using @VM setting vPos else
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WMOKey missing from WO_STEP record. Generating index transaction.' LogData<4> = 'WMOKey missing from WO_STEP record. Generating index transaction.'
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
// Add index transaction to update WM_OUT_KEYS relational index (target WO_STEP table) // Add index transaction to update WM_OUT_KEYS relational index (target WO_STEP table)
IndexTransactionRow = 'WO_STEP*WM_OUT_KEYS*AR':@FM:WMOKey:@FM:"":@FM:WOStepKey:@FM IndexTransactionRow = 'WO_STEP*WM_OUT_KEYS*AR':@FM:WMOKey:@FM:"":@FM:WOStepKey:@FM
Open "!WM_OUT" to BangTable then Open "!WM_OUT" to BangTable then
Lock BangTable, 0 then Done = False$
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM For AttemptNo = 1 to NUM_ATTEMPTS$
PendingTrans := IndexTransactionRow If AttemptNo GT 1 then Delay(1)
Write PendingTrans on BangTable, 0 then Lock BangTable, 0 then
LogData<4> = 'Index transaction successfully added.' Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM) PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
Done = True$
end else
ErrorMsg = 'Unable to write index transaction to !WM_OUT. ':WMOKey
end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey
end else end else
ErrorMsg = 'Unable to write index transaction to !WM_OUT. ':WMOKey If AttemptNo GE NUM_ATTEMPTS$ then
ErrorMsg = 'Unable to Lock !WM_OUT to add index transaction. ':WMOKey
end
end end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey Until Done or ErrorMsg
end else Next AttemptNo
ErrorMsg = 'Unable to Lock !WM_OUT to add index transaction. ':WMOKey
end
end else end else
ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey
end end
end end
end else end else
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WO_STEP key for WM_OUT ':WMOKey:' is null. Nothing to update.' LogData<4> = 'WO_STEP key for WM_OUT ':WMOKey:' is null. Nothing to update.'
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
end end
@ -505,10 +518,12 @@ Service VerifyWoStepWMOKeyIndex(WMOKey)
end end
If ErrorMsg NE '' then If ErrorMsg NE '' then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = ErrorMsg LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
end end
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'End ':Service LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
@ -525,10 +540,9 @@ Service VerifyWOLogWMOKeyIndex(WMOKey)
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_OUT WM_OUT{WO_NO} Log.csv' LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_OUT WM_OUT{WO_NO} Log.csv'
Headers = 'Logging DTM':@FM:'WMOKey':@FM:'WOStep':@FM:'Result' Headers = 'Logging DTM':@FM:'WMOKey':@FM:'WOStep':@FM:'Result'
objVerifyWMOWoIndexLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$) objVerifyWMOWoIndexLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = '' LogData = ''
LogData<1> = LoggingDtm LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<2> = WMOKey LogData<2> = WMOKey
LogData<4> = 'Begin ':Service LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
@ -540,6 +554,7 @@ Service VerifyWOLogWMOKeyIndex(WMOKey)
If WONo NE '' then If WONo NE '' then
WOLogRDSKeys = '' WOLogRDSKeys = ''
Extract_Si_Keys('WM_OUT', 'WO_NO', WONo, WOLogRDSKeys) Extract_Si_Keys('WM_OUT', 'WO_NO', WONo, WOLogRDSKeys)
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<3> = WONo LogData<3> = WONo
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
Locate WMOKey in WOLogRDSKeys using @VM setting vPos else Locate WMOKey in WOLogRDSKeys using @VM setting vPos else
@ -548,24 +563,34 @@ Service VerifyWOLogWMOKeyIndex(WMOKey)
// Add index transaction to update WO_NO btree index // Add index transaction to update WO_NO btree index
IndexTransactionRow = 'WO_NO':@FM:WMOKey:@FM:"":@FM:WONo:@FM IndexTransactionRow = 'WO_NO':@FM:WMOKey:@FM:"":@FM:WONo:@FM
Open "!WM_OUT" to BangTable then Open "!WM_OUT" to BangTable then
Lock BangTable, 0 then Done = False$
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM For AttemptNo = 1 to NUM_ATTEMPTS$
PendingTrans := IndexTransactionRow If AttemptNo GT 1 then Delay(1)
Write PendingTrans on BangTable, 0 then Lock BangTable, 0 then
LogData<4> = 'Index transaction successfully added.' Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM) PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
Done = True$
end else
ErrorMsg = 'Error in ':Service:' service. Unable to write index transaction to !WM_OUT. ':WMOKey
end
Unlock BangTable, 0 else ErrorMsg = 'Error in ':Service:' service. Unable to Open !WM_OUT to add index transaction. ':WMOKey
end else end else
ErrorMsg = 'Error in ':Service:' service. Unable to write index transaction to !WM_OUT. ':WMOKey If AttemptNo GE NUM_ATTEMPTS$ then
ErrorMsg = 'Error in ':Service:' service. Unable to Lock !WM_OUT to add index transaction. ':WMOKey
end
end end
Unlock BangTable, 0 else ErrorMsg = 'Error in ':Service:' service. Unable to Open !WM_OUT to add index transaction. ':WMOKey Until Done or ErrorMsg
end else Next AttemptNo
ErrorMsg = 'Error in ':Service:' service. Unable to Lock !WM_OUT to add index transaction. ':WMOKey
end
end else end else
ErrorMsg = 'Error in ':Service:' service. Unable to Open !WM_OUT to add index transaction. ':WMOKey ErrorMsg = 'Error in ':Service:' service. Unable to Open !WM_OUT to add index transaction. ':WMOKey
end end
end end
end else end else
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WONo for WM_OUT ':WMOKey:' is null. Nothing to update.' LogData<4> = 'WONo for WM_OUT ':WMOKey:' is null. Nothing to update.'
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
end end
@ -575,10 +600,12 @@ Service VerifyWOLogWMOKeyIndex(WMOKey)
end end
If ErrorMsg NE '' then If ErrorMsg NE '' then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = ErrorMsg LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
end end
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'End ':Service LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
@ -595,10 +622,9 @@ Service VerifyWOMatWMOKeyIndex(WMOKey)
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_OUT WO_MAT{WMO_KEY} Log.csv' LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_OUT WO_MAT{WMO_KEY} Log.csv'
Headers = 'Logging DTM':@FM:'WMOKey':@FM:'WOMatKey':@FM:'Result' Headers = 'Logging DTM':@FM:'WMOKey':@FM:'WOMatKey':@FM:'Result'
objVerifyWOMatWmoKeyLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$) objVerifyWOMatWmoKeyLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = '' LogData = ''
LogData<1> = LoggingDtm LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<2> = WMOKey LogData<2> = WMOKey
LogData<4> = 'Begin ':Service LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
@ -609,32 +635,44 @@ Service VerifyWOMatWMOKeyIndex(WMOKey)
WOMatKey = Field(WMOKey, '*', 1, 1):'*':Field(WMOKey, '*', 3, 1) WOMatKey = Field(WMOKey, '*', 1, 1):'*':Field(WMOKey, '*', 3, 1)
If WOMatKey NE '' then If WOMatKey NE '' then
WOMatWMOKey = Xlate('WO_MAT', WOMatKey, 'WMO_KEY', 'X') WOMatWMOKey = Xlate('WO_MAT', WOMatKey, 'WMO_KEY', 'X')
LogData<3> = WOMatKey LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<3> = WOMatKey
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
If WOMatWMOKey EQ '' then If WOMatWMOKey EQ '' then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WMOKey missing from WO_MAT record. Generating index transaction.' LogData<4> = 'WMOKey missing from WO_MAT record. Generating index transaction.'
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
// Add index transaction to update WMO_KEY relational index (target WO_MAT table) // Add index transaction to update WMO_KEY relational index (target WO_MAT table)
IndexTransactionRow = 'WO_MAT*WMO_KEY*TOP':@FM:WMOKey:@FM:"":@FM:WOMatKey:@FM IndexTransactionRow = 'WO_MAT*WMO_KEY*TOP':@FM:WMOKey:@FM:"":@FM:WOMatKey:@FM
Open "!WM_OUT" to BangTable then Open "!WM_OUT" to BangTable then
Lock BangTable, 0 then Done = False$
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM For AttemptNo = 1 to NUM_ATTEMPTS$
PendingTrans := IndexTransactionRow If AttemptNo GT 1 then Delay(1)
Write PendingTrans on BangTable, 0 then Lock BangTable, 0 then
LogData<4> = 'Index transaction successfully added.' Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM) PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
Done = True$
end else
ErrorMsg = 'Unable to write index transaction to !WM_OUT. ':WMOKey
end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey
end else end else
ErrorMsg = 'Unable to write index transaction to !WM_OUT. ':WMOKey If AttemptNo GE NUM_ATTEMPTS$ then
ErrorMsg = 'Unable to Lock !WM_OUT to add index transaction. ':WMOKey
end
end end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey Until Done or ErrorMsg
end else Next AttemptNo
ErrorMsg = 'Unable to Lock !WM_OUT to add index transaction. ':WMOKey
end
end else end else
ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey
end end
end end
end else end else
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WO_MAT key for WM_OUT ':WMOKey:' is null. Nothing to update.' LogData<4> = 'WO_MAT key for WM_OUT ':WMOKey:' is null. Nothing to update.'
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
end end
@ -642,10 +680,12 @@ Service VerifyWOMatWMOKeyIndex(WMOKey)
end end
If ErrorMsg NE '' then If ErrorMsg NE '' then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = ErrorMsg LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
end end
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'End ':Service LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM) Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
@ -653,6 +693,7 @@ Service VerifyWOMatWMOKeyIndex(WMOKey)
end service end service
Service GetWMOutKeys(WOLogId) Service GetWMOutKeys(WOLogId)
ErrorMsg = '' ErrorMsg = ''

View File

@ -694,17 +694,27 @@ Service ReceiveCassette(WONo, ReceiveUser, LotNo, CassQty, SubPartNo, SubVendorC
ErrCode = '' ErrCode = ''
If Not(Get_Status(ErrCode)) then If Not(Get_Status(ErrCode)) then
WOMatKey = WONo:'*':CassNo WOMatKey = WONo:'*':CassNo
Locate WOMatKey in WOMatKeys by 'AR' using @VM setting NewPos else Locate WOMatKey in WOMatKeys by 'AR' using @VM setting NewPos else
WOMatKeys<0, CassNo> = WOMatKey Done = False$
Transaction_Services('PostWriteFieldTransaction', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$, WOMatKey, CassNo) For AttemptNo = 1 to NUM_ATTEMPTS$
ErrCode = '' HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo, True$)
If Get_Status(ErrCode) then If HaveLock then
ErrorMsg = 'Error in ':Service:' service. Error message: ':ErrCode WOMatKeys = Database_Services('ReadDataColumn', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$)
WOMatKeys<0, CassNo> = WOMatKey
Database_Services('WriteDataColumn', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$, WOMatKeys, True$, False$, False$)
If Error_Services('NoError') then Done = True$
end
Until Done
Next AttemptNo
If Not(Done) then
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
Transaction_Services('PostWriteFieldTransaction', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$, WOMatKey, CassNo)
If Error_Services('HasError') then ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage')
end end
end end
If (ErrorMsg EQ '') then If (ErrorMsg EQ '') then
Recipients = '' Recipients = ''
SentFrom = ReceiveUser SentFrom = ReceiveUser
@ -795,7 +805,7 @@ Service ReleaseCassette(WOMatKey, ReleaseUser, RelDtm)
RelWONo = Field(WOMatKey, '*', 1, 1) RelWONo = Field(WOMatKey, '*', 1, 1)
RelCassNo = Field(WOMatKey, '*', 2, 1) RelCassNo = Field(WOMatKey, '*', 2, 1)
Set_Status(0) Set_Status(0)
obj_WO_Log('ReleaseCassettes',RelWONo:@RM:RelCassNo:@RM:ReleaseUser:@RM:RelDtm) obj_WO_Log('ReleaseCassette',RelWONo:@RM:RelCassNo:@RM:ReleaseUser:@RM:RelDtm)
errCode = '' errCode = ''
If Get_Status(errCode) then If Get_Status(errCode) then
ErrorMsg = 'Error in ':Service:' service. Error code ':errCode:'.' ErrorMsg = 'Error in ':Service:' service. Error code ':errCode:'.'
@ -830,7 +840,7 @@ end service
Service ReceiveReleaseCassette(WONo, ReceiveUser, LotNo, CassQty, SubPartNo, SubVendorCode, RecDtm) Service ReceiveReleaseCassette(WONo, ReceiveUser, LotNo, CassQty, SubPartNo, SubVendorCode, RecDtm)
WOMatKey = '' WOMatKey = ''
ErrorMsg = '' ErrorMsg = ''
Begin Case Begin Case
@ -1080,37 +1090,46 @@ Service UpdateReleasedQty(WONo)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
RelQty = '' RelQty = ''
UnRelQty = '' UnRelQty = ''
OrigRelQty = ''
OrigUnRelQty = ''
ErrorMsg = '' ErrorMsg = ''
If WONo NE '' then If WONo NE '' then
If RowExists('WO_LOG', WONo) then If RowExists('WO_LOG', WONo) then
WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo) WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo)
If Error_Services('NoError') then If Error_Services('NoError') then
RelQty = obj_WO_Log('RelQty', WONo:@RM:WORec) OrigRelQty = WORec<WO_LOG_REL_QTY_STATIC$>
WOQty = WORec<WO_LOG_QTY$> OrigUnRelQty = WORec<WO_LOG_UNREL_QTY_STATIC$>
RelQty = obj_WO_Log('RelQty', WONo:@RM:WORec)
WOQty = WORec<WO_LOG_QTY$>
If RelQty GT WOQty then If RelQty GT WOQty then
UnRelQty = 0 UnRelQty = 0
end else end else
UnRelQty = WOQty - RelQty UnRelQty = WOQty - RelQty
end end
Open 'WO_LOG' to hTable then If ( (OrigRelQty NE RelQty) or (OrigUnRelQty NE UnRelQty) ) then
Read WORec from hTable, WONo then Done = False$
OrigRelQty = WORec<WO_LOG_REL_QTY_STATIC$> For AttemptNo = 1 to NUM_ATTEMPTS$
OrigUnRelQty = WORec<WO_LOG_UNREL_QTY_STATIC$> If AttemptNo GT 1 then Delay(1)
If ( (OrigRelQty NE RelQty) or (OrigUnRelQty NE UnRelQty) ) then HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo)
WORec<WO_LOG_REL_QTY_STATIC$> = RelQty If HaveLock then
WORec<WO_LOG_UNREL_QTY_STATIC$> = UnRelQty WORec<WO_LOG_REL_QTY_STATIC$> = RelQty
Write WORec on hTable, WONo else WORec<WO_LOG_UNREL_QTY_STATIC$> = UnRelQty
ErrorMsg = 'Error in ':Service:' service. Failed to write unreleased quantity ':UnRelQty Database_Services('WriteDataRow', 'WO_LOG', WONo, WORec, True$, False$, False$)
ErrorMsg := ' and/or UNREL_QTY_STATIC field of WO_LOG record ':WONo:'.' If Error_Services('NoError') then
ErrorMsg := '@FILE_ERROR: ':@FILE_ERROR // Note: WriteDataRow will have unlocked the record
end Done = True$
end end else
end If AttemptNo GE NUM_ATTEMPTS$ then
end else ErrorMsg = 'Error in ':Service:' service. Failed to write released quantity ':RelQty
ErrorMsg = 'Error in ':Service:' service. Failed to open the WO_LOG table.' ErrorMsg := ' to the REL_QTY_STATIC field of WO_LOG record ':WONo:'. '
end ErrorMsg := 'Failed to write unreleased quantity ':UnRelQty:' to the UNREL_QTY_STATIC '
ErrorMsg := 'field of the WO_LOG record ':WONo:'. '
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
end
end
end
Until Done
Next AttemptNo
end
end else end else
ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. ' ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. '
ErrorMsg := 'Error message: ':Error_Services('GetMessage') ErrorMsg := 'Error message: ':Error_Services('GetMessage')
@ -1132,7 +1151,7 @@ Service UpdateReleasedQty(WONo)
Logging_Services('AppendLog', objUpRelLog, LogData, @RM, @FM) Logging_Services('AppendLog', objUpRelLog, LogData, @RM, @FM)
end else end else
LogResult = 'Failed to update WO_LOG record ':WONo:' field REL_QTY_STATIC with released quantity ':RelQty LogResult = 'Failed to update WO_LOG record ':WONo:' field REL_QTY_STATIC with released quantity ':RelQty
LogResult := ' or field UNREL_QTY_STATIC with unreleased quantity ':UnRelQty:'. Error message: ':ErrorMsg LogResult := ' and field UNREL_QTY_STATIC with unreleased quantity ':UnRelQty:'. Error message: ':ErrorMsg
LogData<3> = LogResult LogData<3> = LogResult
Logging_Services('AppendLog', objUpRelLog, LogData, @RM, @FM) Logging_Services('AppendLog', objUpRelLog, LogData, @RM, @FM)
Error_Services('Add', ErrorMsg) Error_Services('Add', ErrorMsg)
@ -1168,8 +1187,9 @@ Service AdjustReleasedQty(WONo, AdjustQty)
End Case End Case
If (ErrorMsg EQ '' ) then If (ErrorMsg EQ '' ) then
If RowExists('WO_LOG', WONo) then If RowExists('WO_LOG', WONo) then
Done = False$
For Attempt = 1 to NUM_ATTEMPTS$ For Attempt = 1 to NUM_ATTEMPTS$
If Attempt GT 0 then Delay(Attempt) If Attempt GT 1 then Delay(1)
HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo, True$) HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo, True$)
If HaveLock then If HaveLock then
WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo) WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo)
@ -1182,20 +1202,28 @@ Service AdjustReleasedQty(WONo, AdjustQty)
WORec<WO_LOG_REL_QTY_STATIC$> = RelQty WORec<WO_LOG_REL_QTY_STATIC$> = RelQty
WORec<WO_LOG_UNREL_QTY_STATIC$> = UnRelQty WORec<WO_LOG_UNREL_QTY_STATIC$> = UnRelQty
Database_Services('WriteDataRow', 'WO_LOG', WONo, WORec, True$, False$, False$) Database_Services('WriteDataRow', 'WO_LOG', WONo, WORec, True$, False$, False$)
If Error_Services('HasError') then If Error_Services('NoError') then
ErrorMsg = 'Error in ':Service:' service. Failed to write ':RelQty:' on REL_QTY_STATIC ' Done = True$
ErrorMsg := 'field and ':UnrelQty:' on UNREL_QTY_STATIC field of WO_LOG record ':WONo:'.' end else
ErrorMsg := 'Error message: ':Error_Services('GetMessage') If Attempt GE NUM_ATTEMPTS$ then
ErrorMsg = 'Error in ':Service:' service. Failed to write ':RelQty:' on REL_QTY_STATIC '
ErrorMsg := 'field and ':UnrelQty:' on UNREL_QTY_STATIC field of WO_LOG record ':WONo:'.'
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
end
end end
end else end else
ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. ' If Attempt GE NUM_ATTEMPTS$ then
ErrorMsg := 'Error message: ':Error_Services('GetMessage') ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. '
end ErrorMsg := 'Error message: ':Error_Services('GetMessage')
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
end
end
end end
If ( Not(HaveLock) and (Attempt GE NUM_ATTEMPTS$) ) then If ( Not(HaveLock) and (Attempt GE NUM_ATTEMPTS$) ) then
ErrorMsg = 'Error in ':Service:' service. Failed to lock WO_LOG ':WoNo:' for update after ':Attempt:' attempts.' ErrorMsg = 'Error in ':Service:' service. Failed to lock WO_LOG ':WoNo:' for update after ':Attempt:' attempts.'
end end
Until HaveLock or (ErrorMsg NE '') Until Done
Next Attempt Next Attempt
end else end else
ErrorMsg = 'Error in ':Service:' service. ':WONo:' does not exist in the WO_LOG table.' ErrorMsg = 'Error in ':Service:' service. ':WONo:' does not exist in the WO_LOG table.'
@ -1230,44 +1258,44 @@ Service UpdateReceivedQty(WONo)
Headers = 'Logging DTM' : @FM : 'WONo' : @FM : 'Notes' Headers = 'Logging DTM' : @FM : 'WONo' : @FM : 'Notes'
objUpRecLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$,',', Headers, '', False$, False$) objUpRecLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$,',', Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
RXQty = '' RxQty = ''
OrigRXQty = '' OpenQty = ''
ErrorMsg = '' ErrorMsg = ''
If WONo NE '' then If WONo NE '' then
If RowExists('WO_LOG', WONo) then If RowExists('WO_LOG', WONo) then
WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo) WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo)
If Error_Services('NoError') then If Error_Services('NoError') then
WOQty = WORec<WO_LOG_WO_QTY$> WOQty = WORec<WO_LOG_WO_QTY$>
RXQty = obj_WO_Log('RxQty', WONo:@RM:WORec) OrigRxQty = WORec<WO_LOG_RX_QTY_STATIC$>
OpenQty = WOQty - RXQty OrigOpenQty = WORec<WO_LOG_OPEN_QTY_STATIC$>
Open 'WO_LOG' to hTable then RxQty = obj_WO_Log('RxQty', WONo:@RM:WORec)
ReadV OrigRXQty from hTable, WONo, WO_LOG_RX_QTY_STATIC$ then OpenQty = WOQty - RxQty
If OrigRXQty NE RXQty then If ( (OrigRxQty NE RxQty) or (OrigOpenQty NE OpenQty) ) then
WriteV RXQty on hTable, WONo, WO_LOG_RX_QTY_STATIC$ else WORec<WO_LOG_RX_QTY_STATIC$> = RxQty
ErrorMsg = 'Error in ':Service:' service. Failed to write received quantity ':RXQty WORec<WO_LOG_OPEN_QTY_STATIC$> = OpenQty
ErrorMsg := ' to the RX_QTY_STATIC field of WO_LOG record ':WONo:'.' Done = False$
ErrorMsg := '@FILE_ERROR: ':@FILE_ERROR For AttemptNo = 1 to NUM_ATTEMPTS$
end If AttemptNo GT 1 then Delay(1)
end HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo)
end else If HaveLock then
ErrorMsg = 'Error in ':Service:' service. Error reading RX_QTY_STATIC column from WO_LOG ':WONo:'.' Database_Services('WriteDataRow', 'WO_LOG', WONo, WORec, True$, False$, False$)
end If Error_Services('NoError') then
If ErrorMsg EQ '' then // Note: WriteDataRow will have unlocked the record
ReadV OrigOpenQty from hTable, WONo, WO_LOG_OPEN_QTY_STATIC$ then Done = True$
If OrigOpenQty NE OpenQty then end else
WriteV OpenQty on hTable, WONo, WO_LOG_OPEN_QTY_STATIC$ else If AttemptNo GE NUM_ATTEMPTS$ then
ErrorMsg = 'Error in ':Service:' service. Failed to write received quantity ':RXQty ErrorMsg = 'Error in ':Service:' service. Failed to write received quantity ':RXQty
ErrorMsg := ' to the OPEN_QTY_STATIC field of WO_LOG record ':WONo:'.' ErrorMsg := ' to the RX_QTY_STATIC field of WO_LOG record ':WONo:'. '
ErrorMsg := '@FILE_ERROR: ':@FILE_ERROR ErrorMsg := 'Failed to write open quantity ':OpenQty
end ErrorMsg := ' to the OPEN_QTY_STATIC field of WO_LOG record ':WONo:'. '
end ErrorMsg := 'Error message: ':Error_Services('GetMessage')
end else Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
ErrorMsg = 'Error in ':Service:' service. Error reading OPEN_QTY_STATIC column from WO_LOG ':WONo:'.' end
end end
end end
end else Until Done
ErrorMsg = 'Error in ':Service:' service. Failed to open the WO_LOG table.' Next AttemptNo
end end
end else end else
ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. ' ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. '
ErrorMsg := 'Error message: ':Error_Services('GetMessage') ErrorMsg := 'Error message: ':Error_Services('GetMessage')
@ -1283,12 +1311,15 @@ Service UpdateReceivedQty(WONo)
LogData<1> = LoggingDtm LogData<1> = LoggingDtm
LogData<2> = WONo LogData<2> = WONo
If ErrorMsg EQ '' then If ErrorMsg EQ '' then
LogData<3> = 'Successfully updated WO_LOG record ':WONo:' field RX_QTY_STATIC with received quantity ':RXQty:'.' LogMsg = 'Successfully updated WO_LOG record ':WONo:' field RX_QTY_STATIC with received quantity ':RxQty:'.'
LogMsg := 'Successfully updated WO_LOG record ':WONo:' field OPEN_QTY_STATIC with open quantity ':OpenQty:'.'
LogData<3> = LogMsg
Logging_Services('AppendLog', objUpRecLog, LogData, @RM, @FM) Logging_Services('AppendLog', objUpRecLog, LogData, @RM, @FM)
end else end else
LogResult = 'Failed to update WO_LOG record ':WONo:' field RX_QTY_STATIC with received quantity ':RXQty LogMsg = 'Failed to update WO_LOG record ':WONo:' field RX_QTY_STATIC with received quantity ':RxQty:'. '
LogResult := '. Error message: ':ErrorMsg LogMsg := 'Failed to update WO_LOG record ':WONo:' field OPEN_QTY_STATIC with open quantity ':OpenQty:'. '
LogData<3> = LogResult LogMsg := 'Error message: ':ErrorMsg
LogData<3> = LogMsg
Logging_Services('AppendLog', objUpRecLog, LogData, @RM, @FM) Logging_Services('AppendLog', objUpRecLog, LogData, @RM, @FM)
Error_Services('Add', ErrorMsg) Error_Services('Add', ErrorMsg)
end end
@ -1322,8 +1353,9 @@ Service AdjustReceivedQty(WONo, AdjustQty)
End Case End Case
If (ErrorMsg EQ '' ) then If (ErrorMsg EQ '' ) then
If RowExists('WO_LOG', WONo) then If RowExists('WO_LOG', WONo) then
Done = False$
For Attempt = 1 to NUM_ATTEMPTS$ For Attempt = 1 to NUM_ATTEMPTS$
If Attempt GT 0 then Delay(Attempt) If Attempt GT 1 then Delay(1)
HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo, True$) HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo, True$)
If HaveLock then If HaveLock then
WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo) WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo)
@ -1331,24 +1363,32 @@ Service AdjustReceivedQty(WONo, AdjustQty)
WOQty = WORec<WO_LOG_WO_QTY$> WOQty = WORec<WO_LOG_WO_QTY$>
OrigRxQty = WORec<WO_LOG_RX_QTY_STATIC$> OrigRxQty = WORec<WO_LOG_RX_QTY_STATIC$>
RxQty = OrigRxQty + AdjustQty RxQty = OrigRxQty + AdjustQty
OpenQty = WOQty - RXQty OpenQty = WOQty - RxQty
WORec<WO_LOG_RX_QTY_STATIC$> = RxQty WORec<WO_LOG_RX_QTY_STATIC$> = RxQty
WORec<WO_LOG_OPEN_QTY_STATIC$> = OpenQty WORec<WO_LOG_OPEN_QTY_STATIC$> = OpenQty
Database_Services('WriteDataRow', 'WO_LOG', WONo, WORec, True$, False$, False$) Database_Services('WriteDataRow', 'WO_LOG', WONo, WORec, True$, False$, False$)
If Error_Services('HasError') then If Error_Services('NoError') then
ErrorMsg = 'Error in ':Service:' service. Failed to write ':RxQty:' on RX_QTY_STATIC field ' Done = True$
ErrorMsg := 'and ':OpenQty:' on OPEN_QTY_STATIC to WO_LOG ':WONo:'. Error message: ' end else
ErrorMsg := Error_Services('GetMessage') If Attempt GE NUM_ATTEMPTS$ then
ErrorMsg = 'Error in ':Service:' service. Failed to write ':RxQty:' on RX_QTY_STATIC field '
ErrorMsg := 'and ':OpenQty:' on OPEN_QTY_STATIC to WO_LOG ':WONo:'. Error message: '
ErrorMsg := Error_Services('GetMessage')
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
end
end end
end else end else
ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. ' If Attempt GE NUM_ATTEMPTS$ then
ErrorMsg := 'Error message: ':Error_Services('GetMessage') ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. '
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
end
end end
end end
If ( Not(HaveLock) and (Attempt GE NUM_ATTEMPTS$) ) then If ( Not(HaveLock) and (Attempt GE NUM_ATTEMPTS$) ) then
ErrorMsg = 'Error in ':Service:' service. Failed to lock WO_LOG ':WoNo:' for update after ':Attempt:' attempts.' ErrorMsg = 'Error in ':Service:' service. Failed to lock WO_LOG ':WoNo:' for update after ':Attempt:' attempts.'
end end
Until HaveLock or (ErrorMsg NE '') Until Done
Next Attempt Next Attempt
end else end else
ErrorMsg = 'Error in ':Service:' service. ':WONo:' does not exist in the WO_LOG table.' ErrorMsg = 'Error in ':Service:' service. ':WONo:' does not exist in the WO_LOG table.'
@ -1374,6 +1414,170 @@ Service AdjustReceivedQty(WONo, AdjustQty)
end service end service
Service AdjustScrappedQty(WONo, AdjustQty)
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Adjust Scrapped Qty Log.csv'
Headers = 'Logging DTM' : @FM : 'WONo' : @FM : 'Notes'
objAdjScrapLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$,',', Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
RXQty = ''
OrigRXQty = ''
ErrorMsg = ''
Begin Case
Case (WONo EQ '')
ErrorMsg = 'Error in ':Service:' service. Null WONo passed into service'
Case (AdjustQty EQ '')
ErrorMsg = 'Error in ':Service:' service. Null AdjustQty passed into service'
Case Not(Num(AdjustQty))
ErrorMsg = 'Error in ':Service:' service. AdjustQty is not a number'
Case Index(AdjustQty, '.', 1)
ErrorMsg = 'Error in ':Service:' service. AdjustQty cannot be a decimal value'
Case Otherwise$
Null
End Case
If (ErrorMsg EQ '' ) then
If RowExists('WO_LOG', WONo) then
Done = False$
For Attempt = 1 to NUM_ATTEMPTS$
If Attempt GT 1 then Delay(1)
HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo, True$)
If HaveLock then
WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo)
If Error_Services('NoError') then
OrigScrapQty = WORec<WO_LOG_SCRAP_QTY_STATIC$>
ScrapQty = OrigScrapQty + AdjustQty
Database_Services('WriteDataColumn', 'WO_LOG', WONo, WO_LOG_SCRAP_QTY_STATIC$, ScrapQty, True$, False$, False$)
If Error_Services('NoError') then
// Note: WriteDataColumn will release the lock
Done = True$
end else
If Attempt GE NUM_ATTEMPTS$ then
ErrorMsg = 'Error in ':Service:' service. Failed to write ':ScrapQty:' on SCRAP_QTY_STATIC field. '
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
end
end
end else
If Attempt GE NUM_ATTEMPTS$ then
ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. '
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
end
end
end
If ( Not(HaveLock) and (Attempt GE NUM_ATTEMPTS$) ) then
ErrorMsg = 'Error in ':Service:' service. Failed to lock WO_LOG ':WoNo:' for update after ':Attempt:' attempts.'
end
Until Done
Next Attempt
end else
ErrorMsg = 'Error in ':Service:' service. ':WONo:' does not exist in the WO_LOG table.'
end
end
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = WONo
If ErrorMsg EQ '' then
LogResult = 'Successfully adjusted WO_LOG ':WONo:' scrapped quantity by ':AdjustQty
LogResult := '. Updated WO_LOG record ':WONo:' field SCRAP_QTY_STATIC with scrap quantity ':ScrapQty:'.'
LogData<3> = LogResult
Logging_Services('AppendLog', objAdjScrapLog, LogData, @RM, @FM)
end else
LogResult = 'Failed to adjust WO_LOG ':WONo:' scrapped quantity by ':AdjustQty
LogData<3> = LogResult
Logging_Services('AppendLog', objAdjScrapLog, LogData, @RM, @FM)
Error_Services('Add', ErrorMsg)
end
end service
Service AdjustShippedQty(WONo, AdjustQty)
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Adjust Shipped Qty Log.csv'
Headers = 'Logging DTM' : @FM : 'WONo' : @FM : 'Notes'
objAdjShipLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$,',', Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
RXQty = ''
OrigRXQty = ''
ErrorMsg = ''
Begin Case
Case (WONo EQ '')
ErrorMsg = 'Error in ':Service:' service. Null WONo passed into service'
Case (AdjustQty EQ '')
ErrorMsg = 'Error in ':Service:' service. Null AdjustQty passed into service'
Case Not(Num(AdjustQty))
ErrorMsg = 'Error in ':Service:' service. AdjustQty is not a number'
Case Index(AdjustQty, '.', 1)
ErrorMsg = 'Error in ':Service:' service. AdjustQty cannot be a decimal value'
Case Otherwise$
Null
End Case
If (ErrorMsg EQ '' ) then
If RowExists('WO_LOG', WONo) then
Done = False$
For Attempt = 1 to NUM_ATTEMPTS$
If Attempt GT 1 then Delay(1)
HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo, True$)
If HaveLock then
WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo)
If Error_Services('NoError') then
OrigShipQty = WORec<WO_LOG_SHIP_QTY_STATIC$>
ShipQty = OrigShipQty + AdjustQty
Database_Services('WriteDataColumn', 'WO_LOG', WONo, WO_LOG_SHIP_QTY_STATIC$, ShipQty, True$, False$, False$)
If Error_Services('NoError') then
// Note: WriteDataColumn will release the lock
Done = True$
end else
If Attempt GE NUM_ATTEMPTS$ then
ErrorMsg = 'Error in ':Service:' service. Failed to write ':ShipQty:' on SHIP_QTY_STATIC field. '
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
end
end
end else
If Attempt GE NUM_ATTEMPTS$ then
ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. '
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
end
end
end
If ( Not(HaveLock) and (Attempt GE NUM_ATTEMPTS$) ) then
ErrorMsg = 'Error in ':Service:' service. Failed to lock WO_LOG ':WoNo:' for update after ':Attempt:' attempts.'
end
Until Done
Next Attempt
end else
ErrorMsg = 'Error in ':Service:' service. ':WONo:' does not exist in the WO_LOG table.'
end
end
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = WONo
If ErrorMsg EQ '' then
LogResult = 'Successfully adjusted WO_LOG ':WONo:' shipped quantity by ':AdjustQty
LogResult := '. Updated WO_LOG record ':WONo:' field SHIP_QTY_STATIC with scrap quantity ':ShipQty:'.'
LogData<3> = LogResult
Logging_Services('AppendLog', objAdjShipLog, LogData, @RM, @FM)
end else
LogResult = 'Failed to adjust WO_LOG ':WONo:' shipped quantity by ':AdjustQty
LogData<3> = LogResult
Logging_Services('AppendLog', objAdjShipLog, LogData, @RM, @FM)
Error_Services('Add', ErrorMsg)
end
end service
Service UpdateShippedQty(WONo) Service UpdateShippedQty(WONo)
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG' LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG'
@ -1384,28 +1588,34 @@ Service UpdateShippedQty(WONo)
objUpShipLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$,',', Headers, '', False$, False$) objUpShipLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$,',', Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
ShipQty = '' ShipQty = ''
OrigShipQty = ''
ErrorMsg = '' ErrorMsg = ''
If WONo NE '' then If WONo NE '' then
If RowExists('WO_LOG', WONo) then If RowExists('WO_LOG', WONo) then
WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo) WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo)
If Error_Services('NoError') then If Error_Services('NoError') then
ShipQty = obj_WO_Log('ShipQty', WONo:@RM:WORec) OrigShipQty = WORec<WO_LOG_SHIP_QTY_STATIC$>
Open 'WO_LOG' to hTable then ShipQty = obj_WO_Log('ShipQty', WONo:@RM:WORec)
ReadV OrigShipQty from hTable, WONo, WO_LOG_SHIP_QTY_STATIC$ then If OrigShipQty NE ShipQty then
If OrigShipQty NE ShipQty then Done = False$
WriteV ShipQty on hTable, WONo, WO_LOG_SHIP_QTY_STATIC$ else For AttemptNo = 1 to NUM_ATTEMPTS$
ErrorMsg = 'Error in ':Service:' service. Failed to write ':ShipQty If AttemptNo GT 1 then Delay(1)
ErrorMsg := ' to the SHIP_QTY_STATIC field of WO_LOG record ':WONo:'.' HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo)
ErrorMsg := '@FILE_ERROR: ':@FILE_ERROR If HaveLock then
end Database_Services('WriteDataColumn', 'WO_LOG', WONo, WO_LOG_SHIP_QTY_STATIC$, ShipQty, True$, False$, False$)
end If Error_Services('NoError') then
end else Done = True$
ErrorMsg = 'Error in ':Service:' service. Error reading SHIP_QTY_STATIC column from WO_LOG ':WONo:'.' end else
end If AttemptNo GE NUM_ATTEMPTS$ then
end else ErrorMsg = 'Error in ':Service:' service. Failed to write ':ShipQty
ErrorMsg = 'Error in ':Service:' service. Failed to open the WO_LOG table.' ErrorMsg := ' to the SHIP_QTY_STATIC field of WO_LOG record ':WONo:'. '
end ErrorMsg := 'Error message: ':Error_Services('GetMessage')
end
end
end
Until Done
Next AttemptNo
If Database_Services('IsKeyIDSelfLocked', 'WO_LOG', WONo) then Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
end
end else end else
ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. ' ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. '
ErrorMsg := 'Error message: ':Error_Services('GetMessage') ErrorMsg := 'Error message: ':Error_Services('GetMessage')
@ -1446,7 +1656,6 @@ Service UpdateScrappedQty(WONo)
objUpScrapLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$,',', Headers, '', False$, False$) objUpScrapLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$,',', Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime LoggingDTM = LogDate : ' ' : LogTime
ScrapQty = '' ScrapQty = ''
OrigScrapQty = ''
ErrorMsg = '' ErrorMsg = ''
If WONo NE '' then If WONo NE '' then
If RowExists('WO_LOG', WONo) then If RowExists('WO_LOG', WONo) then
@ -1458,21 +1667,29 @@ Service UpdateScrappedQty(WONo)
end else end else
ScrapQty = Sum(Xlate('WO_LOG', WONo, 'WO_MAT_SAP_CONFIRM_SCRAP', 'X')) ScrapQty = Sum(Xlate('WO_LOG', WONo, 'WO_MAT_SAP_CONFIRM_SCRAP', 'X'))
end end
Open 'WO_LOG' to hTable then OrigScrapQty = WORec<WO_LOG_SCRAP_QTY_STATIC$>
ReadV OrigScrapQty from hTable, WONo, WO_LOG_SCRAP_QTY_STATIC$ then If OrigScrapQty NE ScrapQty then
If OrigScrapQty NE ScrapQty then Done = False$
WriteV ScrapQty on hTable, WONo, WO_LOG_SCRAP_QTY_STATIC$ else For AttemptNo = 1 to NUM_ATTEMPTS$
ErrorMsg = 'Error in ':Service:' service. Failed to write ':ScrapQty If AttemptNo GT 1 then Delay(1)
ErrorMsg := ' to the SCRAP_QTY_STATIC field of WO_LOG record ':WONo:'.' HaveLock = Database_Services('GetKeyIDLock', 'WO_LOG', WONo)
ErrorMsg := '@FILE_ERROR: ':@FILE_ERROR If HaveLock then
end Database_Services('WriteDataColumn', 'WO_LOG', WONo, WO_LOG_SCRAP_QTY_STATIC$, ScrapQty, True$, False$, False$)
end If Error_Services('NoError') then
end else // Note: WriteDataColumn will have unlocked the record
ErrorMsg = 'Error in ':Service:' service. Error reading SCRAP_QTY_STATIC column from WO_LOG ':WONo:'.' Done = True$
end end else
end else If AttemptNo GE NUM_ATTEMPTS$ then
ErrorMsg = 'Error in ':Service:' service. Failed to open the WO_LOG table.' ErrorMsg = 'Error in ':Service:' service. Failed to write ':ScrapQty
end ErrorMsg := ' to the SCRAP_QTY_STATIC field of WO_LOG record ':WONo:'. '
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
Database_Services('ReleaseKeyIDLock', 'WO_LOG', WONo)
end
end
end
Until Done
Next AttemptNo
end
end else end else
ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. ' ErrorMsg = 'Error in ':Service:' service. Failed to read record ':WONo:' from the WO_LOG table. '
ErrorMsg := 'Error message: ':Error_Services('GetMessage') ErrorMsg := 'Error message: ':Error_Services('GetMessage')
@ -1569,6 +1786,8 @@ Service ConvertRecordToJSON(WONo, Record, ItemURL)
SRP_JSON(objChildCassette, 'SetValue', 'RelDtm', Date_Services('ConvertDateTimeToISO8601', WOMatRec<WO_MAT_REL_DTM$>)) SRP_JSON(objChildCassette, 'SetValue', 'RelDtm', Date_Services('ConvertDateTimeToISO8601', WOMatRec<WO_MAT_REL_DTM$>))
SRP_JSON(objChildCassette, 'SetValue', 'RecUser', OConv(WOMatRec<WO_MAT_RX_BY$>, '[XLATE_CONV,LSL_USERS*FIRST_LAST]')) SRP_JSON(objChildCassette, 'SetValue', 'RecUser', OConv(WOMatRec<WO_MAT_RX_BY$>, '[XLATE_CONV,LSL_USERS*FIRST_LAST]'))
SRP_JSON(objChildCassette, 'SetValue', 'RelUser', OConv(WOMatRec<WO_MAT_REL_BY$>, '[XLATE_CONV,LSL_USERS*FIRST_LAST]' )) SRP_JSON(objChildCassette, 'SetValue', 'RelUser', OConv(WOMatRec<WO_MAT_REL_BY$>, '[XLATE_CONV,LSL_USERS*FIRST_LAST]' ))
SRP_JSON(objChildCassette, 'SetValue', 'WMInKey', WOMatRec<WO_MAT_WMI_KEY$>)
SRP_JSON(objChildCassette, 'SetValue', 'WMOutKey', WOMatRec<WO_MAT_WMO_KEY$>)
SRP_JSON(objChildCassettes, 'Add', objChildCassette) SRP_JSON(objChildCassettes, 'Add', objChildCassette)
SRP_JSON(objChildCassette, 'Release') SRP_JSON(objChildCassette, 'Release')
end end

View File

@ -42,14 +42,15 @@ Function WO_LOG_Actions(Action, CalcColName, FSList, Handle, Name, FMC, Record,
***********************************************************************************************************************/ ***********************************************************************************************************************/
#pragma precomp SRP_PreCompiler #pragma precomp SRP_PreCompiler
$insert APP_INSERTS $Insert APP_INSERTS
$insert FILE.SYSTEM.EQUATES $Insert FILE.SYSTEM.EQUATES
$insert ACTION_SETUP $Insert ACTION_SETUP
$insert WO_MAT_EQUATES $Insert WO_MAT_EQUATES
$insert WO_LOG_EQUATES $Insert WO_LOG_EQUATES
$insert WO_STEP_EQUATES $Insert WO_STEP_EQUATES
$insert RLIST_EQUATES $Insert RLIST_EQUATES
$insert SCHED_DET_NG_EQUATES $Insert SCHED_DET_NG_EQUATES
$Insert IFX_EQUATES
Equ Comma$ to ',' Equ Comma$ to ','
@ -57,7 +58,7 @@ Declare function Error_Services, Database_Services, Environment_Services, Logg
Declare function GaN_Services, obj_WO_Log, SRP_Date Declare function GaN_Services, obj_WO_Log, SRP_Date
Declare subroutine Error_Services, Database_Services, Environment_Services, Logging_Services, Obj_SAP Declare subroutine Error_Services, Database_Services, Environment_Services, Logging_Services, Obj_SAP
Declare subroutine Logging_Services, Set_Status, Schedule_Services, Work_Order_Services, obj_Notes Declare subroutine Logging_Services, Set_Status, Schedule_Services, Work_Order_Services, obj_Notes
Declare subroutine Schedule_Services Declare subroutine Schedule_Services, Service_Services
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG' LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG'
LogDate = Oconv(Date(), 'D4/') LogDate = Oconv(Date(), 'D4/')
@ -205,12 +206,12 @@ WRITE_RECORD_PRE:
OrigQty = OrigRecord<WO_LOG_QTY$> OrigQty = OrigRecord<WO_LOG_QTY$>
NewQty = Record<WO_LOG_QTY$> NewQty = Record<WO_LOG_QTY$>
ModifyQty = NewQty - OrigQty
OrigCassList = OrigRecord<WO_LOG_WO_MAT_KEY$> OrigCassList = OrigRecord<WO_LOG_WO_MAT_KEY$>
NewCassList = Record<WO_LOG_WO_MAT_KEY$> NewCassList = Record<WO_LOG_WO_MAT_KEY$>
If ( (OrigQty NE NewQty) or (OrigCassList NE NewCassList) ) then If ( (OrigQty NE NewQty) or (OrigCassList NE NewCassList) ) then
// Update released, unreleased, and received quantities // Update unreleased, open (i.e., not received) quantities
RelQty = obj_WO_Log('RelQty', Name:@RM:Record) RelQty = OrigRecord<WO_LOG_REL_QTY_STATIC$>
Record<WO_LOG_REL_QTY_STATIC$> = RelQty
If RelQty GT NewQty then If RelQty GT NewQty then
UnRelQty = 0 UnRelQty = 0
end else end else
@ -218,9 +219,14 @@ WRITE_RECORD_PRE:
end end
Record<WO_LOG_UNREL_QTY_STATIC$> = UnRelQty Record<WO_LOG_UNREL_QTY_STATIC$> = UnRelQty
RXQty = obj_WO_Log('RxQty', Name:@RM:Record) RxQty = OrigRecord<WO_LOG_RX_QTY_STATIC$>
Record<WO_LOG_RX_QTY_STATIC$> = RXQty If RxQty GT NewQty then
SaveRecord = Record OpenQty = 0
end else
OpenQty = NewQty - RxQty
end
Record<WO_LOG_OPEN_QTY_STATIC$> = OpenQty
SaveRecord = Record
end end
// Check if we need to auto-close the work order // Check if we need to auto-close the work order
@ -278,202 +284,7 @@ WRITE_RECORD:
NewQty = Record<WO_LOG_QTY$> NewQty = Record<WO_LOG_QTY$>
ModifyQty = NewQty - OrigQty ModifyQty = NewQty - OrigQty
WONo = Name WONo = Name
SchedDetNGKey = '' If ModifyQty NE 0 then Service_Services('PostProcedure', 'SCHEDULE_SERVICES', 'AdjustWorkOrderScheduleQty':SD$:WONo:SD$:ModifyQty)
Begin Case
Case ModifyQty GT 0
LogData = ''
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<2> = 'WO_LOG_ACTIONS'
LogData<3> = 'Work order ':WONo:' quantity increased from ':OrigQty:' to ':NewQty:'.'
Schedule_Services('LogActivity', '', LogData, False$)
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Searching for a scheduled event to increase the quantity.'
Schedule_Services('LogActivity', '', LogData, False$)
// Search schedule for most recent event and increase that event quantity by the difference.
Query = 'SELECT SCHED_DET_NG WITH WO_NO EQ ':WONo:' BY-DSND STOP_DTM'
GoSub ClearCursors
Set_Status(0)
RList(Query, TARGET_ACTIVELIST$, '', '', False$)
errCode = ''
If Get_Status(errCode) then
ErrorMsg = 'Error retrieving event list in WO_LOG_Actions. RList error code ':errCode:'.'
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = ErrorMsg
Schedule_Services('LogActivity', '', LogData, False$)
Error_Services('Add', ErrorMsg)
end else
EOF = False$
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Query successful. Number of keys found: ':@RecCount:'.'
Schedule_Services('LogActivity', '', LogData, False$)
ReadNext SchedDetNGKey else EOF = True$
If SchedDetNGKey NE '' then
EventRec = Database_Services('ReadDataRow', 'SCHED_DET_NG', SchedDetNGKey)
StopDTM = EventRec<SCHED_DET_NG.STOP_DTM$>
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Work order record ':WONo:' quantity increased from ':OrigQty:' to ':NewQty:'.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Scheduled event ':SchedDetNGKey:' found.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
// Only modify the event if it is still running or is scheduled in the future.
If StopDTM GT Datetime() then
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Event stop DTM ':OConv(StopDtm, 'DT2/^H'):' less than current DTM, so increasing event quantity.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
ReactNo = EventRec<SCHED_DET_NG.REACT_NO$>
WONo = EventRec<SCHED_DET_NG.WO_NO$>
StartDTM = EventRec<SCHED_DET_NG.START_DTM$>
Desc = EventRec<SCHED_DET_NG.DESC$>
EventQty = EventRec<SCHED_DET_NG.EVENT_TOTAL_WFRS$>
NewEventQty = EventQty + ModifyQty
Schedule_Services('ModifySchedEvent', SchedDetNGKey, ReactNo, WONo, StartDTM, StopDTM, Desc, NewEventQty)
// Adjust reactor events as needed.
Schedule_Services('AdjustScheduleEvents', ReactNo)
end else
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Event stop DTM ':OConv(StopDtm, 'DT2/^H'):' greater than current DTM.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Event quantity not increased.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
end
end
end
GoSub ClearCursors
Case ModifyQty LT 0
LogData = ''
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<2> = 'WO_LOG_ACTIONS'
LogData<3> = 'Work order ':WONo:' quantity decreased from ':OrigQty:' to ':NewQty:'.'
Schedule_Services('LogActivity', '', LogData, False$)
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Searching for a scheduled event to decrease the quantity.'
Schedule_Services('LogActivity', '', LogData, False$)
// Search schedule for most recent events and decrease/delete those events as needed.
Query = 'SELECT SCHED_DET_NG WITH WO_NO EQ ':WONo:' BY-DSND STOP_DTM'
GoSub ClearCursors
Set_Status(0)
RList(Query, TARGET_ACTIVELIST$, '', '', False$)
errCode = ''
If Get_Status(errCode) then
ErrorMsg = 'Error retrieving event list in WO_LOG_Actions. RList error code ':errCode:'.'
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = ErrorMsg
Schedule_Services('LogActivity', '', LogData, False$)
Error_Services('Add', ErrorMsg)
end else
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Query successful. Number of keys found: ':@RecCount:'.'
Schedule_Services('LogActivity', '', LogData, False$)
EOF = False$
Done = False$
UpdateReq = False$
Loop
ReadNext SchedDetNGKey else EOF = True$
Until EOF EQ True$
If SchedDetNGKey NE '' then
EventRec = Database_Services('ReadDataRow', 'SCHED_DET_NG', SchedDetNGKey)
StopDTM = EventRec<SCHED_DET_NG.STOP_DTM$>
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Work order record ':WONo:' quantity decreased from ':OrigQty:' to ':NewQty:'.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Scheduled event ':SchedDetNGKey:' found.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
// Only modify the event if it is still running or is scheduled in the future.
If StopDTM GT Datetime() then
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Event stop DTM ':OConv(StopDtm, 'DT2/^H'):' less than current DTM, so decreasing event quantity.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
UpdateReq = True$
ReactNo = EventRec<SCHED_DET_NG.REACT_NO$>
WONo = EventRec<SCHED_DET_NG.WO_NO$>
StartDTM = EventRec<SCHED_DET_NG.START_DTM$>
Desc = EventRec<SCHED_DET_NG.DESC$>
EventQty = EventRec<SCHED_DET_NG.EVENT_TOTAL_WFRS$>
If EventQty GT Abs(ModifyQty) then
// This event has enough wafers, so just reduce the quantity.
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Event quantity ':EventQty:' greater than quantity reduction ':ModifyQty:', so decreasing event quantity.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
Done = True$
NewEventQty = EventQty + ModifyQty
Schedule_Services('ModifySchedEvent', SchedDetNGKey, ReactNo, WONo, StartDTM, StopDTM, Desc, NewEventQty)
end else
// This event has fewer wafers than are being removed. Delete this event and continue
// onto the next event.
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Event quantity ':EventQty:' less than quantity reduction ':ModifyQty:', so canceling event.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
Schedule_Services('CancelScheduleEvent', SchedDetNGKey, True$)
ModifyQty += EventQty
end
end else
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Event stop DTM ':OConv(StopDtm, 'DT2/^H'):' greater than current DTM.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<3> = 'Event quantity not decreased.'
Schedule_Services('LogActivity', EventRec<SCHED_DET_NG.REACT_NO$>, LogData, False$)
end
end
Until Done EQ True$
Repeat
If UpdateReq then
// Adjust reactor events as needed.
Schedule_Services('AdjustScheduleEvents', ReactNo)
end
end
GoSub ClearCursors
Case Otherwise$
Null
End Case
return return

View File

@ -44,16 +44,17 @@ Function WO_MAT_Actions(Action, CalcColName, FSList, Handle, Name, FMC, Record,
***********************************************************************************************************************/ ***********************************************************************************************************************/
$insert APP_INSERTS $Insert APP_INSERTS
$insert FILE.SYSTEM.EQUATES $Insert FILE.SYSTEM.EQUATES
$insert DICT_EQUATES $Insert DICT_EQUATES
$insert ACTION_SETUP $Insert ACTION_SETUP
$insert WO_MAT_EQUATES $Insert WO_MAT_EQUATES
$insert WO_LOG_EQUATES $Insert WO_LOG_EQUATES
$insert WO_STEP_EQUATES $Insert WO_STEP_EQUATES
$insert MAKEUP_WAFERS_EQUATES $Insert MAKEUP_WAFERS_EQUATES
$insert RLIST_EQUATES $Insert WM_OUT_EQUATES
$insert IFX_EQUATES $Insert RLIST_EQUATES
$Insert IFX_EQUATES
Equ Comma$ to ',' Equ Comma$ to ','
@ -610,13 +611,17 @@ WRITE_RECORD:
CassNo = Field(Name, '*', 2) CassNo = Field(Name, '*', 2)
WOMatKeyID = Name WOMatKeyID = Name
OrigWfrQty = OrigRecord<WO_MAT_WAFER_QTY$> OrigWfrQty = OrigRecord<WO_MAT_WAFER_QTY$>
NewWfrQty = Record<WO_MAT_WAFER_QTY$> NewWfrQty = Record<WO_MAT_WAFER_QTY$>
OrigRelDtm = OrigRecord<WO_MAT_REL_DTM$> OrigRelDtm = OrigRecord<WO_MAT_REL_DTM$>
NewRelDtm = Record<WO_MAT_REL_DTM$> NewRelDtm = Record<WO_MAT_REL_DTM$>
OrigRecDtm = OrigRecord<WO_MAT_RX_DTM$> OrigRecDtm = OrigRecord<WO_MAT_RX_DTM$>
NewRecDtm = Record<WO_MAT_RX_DTM$> NewRecDtm = Record<WO_MAT_RX_DTM$>
AdjustQty = NewWfrQty - OrigWfrQty OrigVoidFlag = OrigRecord<WO_MAT_VOID$>
NewVoidFlag = Record<WO_MAT_VOID$>
OrigShipNo = OrigRecord<WO_MAT_SHIP_NO$>
NewShipNo = Record<WO_MAT_SHIP_NO$>
AdjustQty = NewWfrQty - OrigWfrQty
If ( (OrigWfrQty NE '' ) and (OrigWfrQty NE NewWfrQty) and (OrigRecDtm NE '' and NewRecDtm NE '') ) then If ( (OrigWfrQty NE '' ) and (OrigWfrQty NE NewWfrQty) and (OrigRecDtm NE '' and NewRecDtm NE '') ) then
// Cassette already received, but casssette quantity has changed. // Cassette already received, but casssette quantity has changed.
@ -624,7 +629,7 @@ WRITE_RECORD:
end end
If ( (OrigRecDtm EQ '') and (NewRecDtm NE '') ) then If ( (OrigRecDtm EQ '') and (NewRecDtm NE '') ) then
// Cassette was just received. Increment received quantity of work order by the entire cassette wafer count. // Cassette was just received. Increment received quantity of work order by the entire cassette wafer count.
Work_Order_Services('AdjustReceivedQty', WONo, NewWfrQty) If NewWfrQty NE 0 then Work_Order_Services('AdjustReceivedQty', WONo, NewWfrQty)
end end
If ( (OrigWfrQty NE '') and (OrigWfrQty NE NewWfrQty) and ( (OrigRelDtm NE '') and (NewRelDtm NE '') ) ) then If ( (OrigWfrQty NE '') and (OrigWfrQty NE NewWfrQty) and ( (OrigRelDtm NE '') and (NewRelDtm NE '') ) ) then
@ -633,7 +638,47 @@ WRITE_RECORD:
end end
If ( (OrigRelDtm EQ '') and (NewRelDtm NE '') ) then If ( (OrigRelDtm EQ '') and (NewRelDtm NE '') ) then
// Cassette was just released. Increment released quantity of work order by the entire cassette wafer count. // Cassette was just released. Increment released quantity of work order by the entire cassette wafer count.
Work_Order_Services('AdjustReleasedQty', WONo, NewWfrQty) If NewWfrQty NE 0 then Work_Order_Services('AdjustReleasedQty', WONo, NewWfrQty)
end
If ( (OrigVoidFlag NE True$) and (NewVoidFlag EQ True$) ) then
If (NewWfrQty NE 0) then
If (NewRecDtm NE '') then Work_Order_Services('AdjustReceivedQty', WONo, Neg(NewWfrQty))
If (NewRelDtm NE '') then Work_Order_Services('AdjustReleasedQty', WONo, Neg(NewWfrQty))
end
end
If ( (NewVoidFlag NE True$) and (OrigVoidFlag EQ True$) ) then
If (NewWfrQty NE 0) then
If (NewRecDtm NE '') then Work_Order_Services('AdjustReceivedQty', WONo, NewWfrQty)
If (NewRelDtm NE '') then Work_Order_Services('AdjustReleasedQty', WONo, NewWfrQty)
end
end
If ( (OrigShipNo EQ '') and (NewShipNo NE '') ) then
ShipQty = 0
WMOKey = Record<WO_MAT_WMO_KEY$>
If (WMOKey NE '') then
CurrWfrCnt = Xlate('WM_OUT', WMOKey, 'WAFER_CNT', 'X')
ShipQty += CurrWfrCnt
end else
CurrWfrCnt = obj_WO_Mat('CurrWaferCnt',WOMatKeyID:@RM:Record)
ShipQty += CurrWfrCnt
end
If ShipQty NE 0 then Work_Order_Services('AdjustShippedQty', WONo, ShipQty)
end
If ( (NewShipNo EQ '') and (OrigShipNo NE '') ) then
ShipQty = 0
WMOKey = Record<WO_MAT_WMO_KEY$>
If (WMOKey NE '') then
CurrWfrCnt = Xlate('WM_OUT', WMOKey, 'WAFER_CNT', 'X')
ShipQty += CurrWfrCnt
end else
CurrWfrCnt = obj_WO_Mat('CurrWaferCnt',WOMatKeyID:@RM:Record)
ShipQty += CurrWfrCnt
end
If (ShipQty NE 0) then Work_Order_Services('AdjustShippedQty', WONo, Neg(ShipQty))
end end
If {REACTOR_TYPE} NE 'EPP' then If {REACTOR_TYPE} NE 'EPP' then
@ -889,6 +934,35 @@ return
DELETE_RECORD: DELETE_RECORD:
debug
WOMatKeyID = Name
WONo = Field(WOMatKeyID, '*', 1, 1)
OrigWfrQty = OrigRecord<WO_MAT_WAFER_QTY$>
OrigVoidFlag = OrigRecord<WO_MAT_VOID$>
OrigShipNo = OrigRecord<WO_MAT_SHIP_NO$>
OrigRelDtm = OrigRecord<WO_MAT_REL_DTM$>
OrigRecDtm = OrigRecord<WO_MAT_RX_DTM$>
If (OrigVoidFlag NE True$) then
If (OrigWfrQty NE 0) then
If (OrigRecDtm NE '') then Work_Order_Services('AdjustReceivedQty', WONo, Neg(OrigWfrQty))
If (OrigRelDtm NE '') then Work_Order_Services('AdjustReleasedQty', WONo, Neg(OrigWfrQty))
end
end
If (OrigShipNo NE '') then
ShipQty = 0
WMOKey = OrigRecord<WO_MAT_WMO_KEY$>
If (WMOKey NE '') then
CurrWfrCnt = Xlate('WM_OUT', WMOKey, 'WAFER_CNT', 'X')
ShipQty += CurrWfrCnt
end else
CurrWfrCnt = obj_WO_Mat('CurrWaferCnt',WOMatKeyID:@RM:OrigRecord)
ShipQty += CurrWfrCnt
end
If (ShipQty NE 0) then Work_Order_Services('AdjustShippedQty', WONo, Neg(ShipQty))
end
return return