diff --git a/LSL2/STPROC/DEVELOPMENT_SERVICES.txt b/LSL2/STPROC/DEVELOPMENT_SERVICES.txt index 47697b0..a8ff4a7 100644 --- a/LSL2/STPROC/DEVELOPMENT_SERVICES.txt +++ b/LSL2/STPROC/DEVELOPMENT_SERVICES.txt @@ -245,7 +245,7 @@ end service Service DeployHGCV() - debug + ! Get list of work orders in production today. SchedEvents = Schedule_Services('GetScheduleEvents', (date() - 7), (date() + 7)) WOList = '' @@ -350,7 +350,7 @@ Service DeployHGCV() HgCVList = Database_Services('ReadDataRow', 'SYSLISTS', 'HGCV_UAT') For each WoMatQAKey in HgCVList using @VM - If WOMatQAKey EQ '167798*67' then debug + Database_Services('ActivateRecord', 'WO_MAT_QA', WoMatQAKey) Profiles = {PROFILE} ThickRecipeFound = False$ @@ -586,7 +586,8 @@ Service SetupDevServices() DevDBServices = 'Update Material Logs':@VM:'Log Transaction Postings':@VM:'Process Wafer Image Queue':@VM DevDBServices := 'Process UCL Requests':@VM:'Process ROTR Requests':@VM:'Process Wafer Image Requests':@VM - DevDBServices := 'Process SQL Requests':@VM:'Send Notes':@VM:'Update Notification Groups' + DevDBServices := 'Process SQL Requests':@VM:'Send Notes':@VM:'Update Notification Groups':@VM + DevDBServices := 'Update Security Groups':@VM:'Auto Scheduler' Query = "SELECT SERVICES" diff --git a/LSL2/STPROC/NCR_ACTIONS.txt b/LSL2/STPROC/NCR_ACTIONS.txt index 1616b16..efbe183 100644 --- a/LSL2/STPROC/NCR_ACTIONS.txt +++ b/LSL2/STPROC/NCR_ACTIONS.txt @@ -74,7 +74,7 @@ EQU COL$TAGS TO 9 EQU COL$TOOL_ID TO 10 Declare function Database_Services, obj_NCR, obj_SAP, Environment_Services, Logging_Services, obj_Tables -Declare function obj_WO_Mat, obj_RDS, Error_Services, MemberOf +Declare function obj_WO_Mat, obj_RDS, Error_Services, MemberOf, SRP_Array Declare subroutine Error_Services, Database_Services, obj_NCR, obj_SAP, Material_Services, Work_Order_Services Declare subroutine Logging_Services, Set_Status, obj_WO_Mat, obj_WO_Mat_Log, Schedule_Services, obj_Tables Declare subroutine obj_RDS, SAP_Services, Pass_To_SQL, NCR_Services @@ -331,6 +331,7 @@ WRITE_RECORD: OrigStatus = OrigRecord NewStatus = Record + If ( (OrigStatus NE NewStatus) and (NewStatus EQ 'C') ) then ******************** @@ -374,6 +375,8 @@ WRITE_RECORD: WOMatKey = WONo:'*':CassNo If (ReactorType EQ 'EPP') then + + InCassNos = {CASS_NO} **************************************************************************** * Verify the need to "Auto-Sign" the box after returning from the NCR form * @@ -498,12 +501,7 @@ WRITE_RECORD: END END END - END - - *********************************************************** - * Mark the cassette as "processed" for scheduler purposes * - *********************************************************** - Schedule_Services('MarkCassProcessed', WONo, CassNo, SigDTM) + END *********************************************************************** * Send CASS_COMP transaction to SAP to inform SAP of the rejected box * @@ -651,12 +649,7 @@ WRITE_RECORD: END END END - END - - *********************************************************** - * Mark the cassette as "processed" for scheduler purposes * - *********************************************************** - Schedule_Services('MarkCassProcessed', WONo, CassNo, SigDTM) + END *********************************************************************** * Send CASS_COMP transaction to SAP to inform SAP of the rejected box * diff --git a/LSL2/STPROC/NDW_WO_LOG_EVENTS.txt b/LSL2/STPROC/NDW_WO_LOG_EVENTS.txt index f6a708e..7e289cf 100644 --- a/LSL2/STPROC/NDW_WO_LOG_EVENTS.txt +++ b/LSL2/STPROC/NDW_WO_LOG_EVENTS.txt @@ -846,7 +846,15 @@ Event PUB_CHANGE_CASS_QTY.CLICK() IF Get_Status(errCode) THEN ErrMsg(errCode) // Set CtrlMap variable to the control(s) that need to be updated - CtrlMap = 'EDT_CASS_NO' + CtrlMap = '' + CtrlMap<1> = @Window:'.EDL_WO_QTY' + CtrlMap<2> = @Window:'.EDL_RX_QTY' + CtrlMap<3> = @Window:'.EDL_REL_QTY' + CtrlMap<4> = @Window:'.EDL_UNREL_QTY' + CtrlMap<5> = @Window:'.EDL_SAP_CONFIRM_SCRAP_QTY' + CtrlMap<6> = @Window:'.EDL_SAP_YIELD_QTY' + CtrlMap<7> = @Window:'.EDL_SHIP_QTY' + CtrlMap<8> = @Window:'.EDT_CASS_NO' GoSub PopulateControls END @@ -2155,4 +2163,3 @@ StartStopDate: return - diff --git a/LSL2/STPROC/OBJ_RDS.txt b/LSL2/STPROC/OBJ_RDS.txt index e8d133f..a752ea7 100644 --- a/LSL2/STPROC/OBJ_RDS.txt +++ b/LSL2/STPROC/OBJ_RDS.txt @@ -1473,4 +1473,3 @@ CalcThickTarget: RETURN - diff --git a/LSL2/STPROC/OBJ_TABLES.txt b/LSL2/STPROC/OBJ_TABLES.txt index 175154b..b7991fb 100644 --- a/LSL2/STPROC/OBJ_TABLES.txt +++ b/LSL2/STPROC/OBJ_TABLES.txt @@ -117,160 +117,160 @@ RETURN Result * * * * * * * OpenTable: * * * * * * * - -IF TableName = '' THEN ErrorMsg = 'Null parameter "TableName" passed to subroutine' - -IF ErrorMsg = '' THEN - OPEN TableName TO TableVar THEN - Result = TableVar - Parms = FieldStore(Parms,@RM,3,1,TableVar) ;* Added 1/22/2007 JCH - END ELSE - ErrorMsg = 'Unable to open Table ':QUOTE(TableName) + + IF TableName = '' THEN ErrorMsg = 'Null parameter "TableName" passed to subroutine' + + IF ErrorMsg = '' THEN + OPEN TableName TO TableVar THEN + Result = TableVar + Parms = FieldStore(Parms,@RM,3,1,TableVar) ;* Added 1/22/2007 JCH + END ELSE + ErrorMsg = 'Unable to open Table ':QUOTE(TableName) + END END -END - - + + RETURN * * * * * * * ReadRec: * * * * * * * - -GOSUB LockRec - -IF ErrorMsg NE '' THEN RETURN - -* * * * * * * + + GOSUB LockRec + + IF ErrorMsg NE '' THEN RETURN + + * * * * * * * ReadOnlyRec: * * * * * * * - -IF TableName = '' THEN ErrorMsg = 'Null parameter "TableName" passed to subroutine' -IF TableKey = '' THEN ErrorMsg = 'Null parameter "TableKey" passed to subroutine' -IF TableVar = '' THEN - GOSUB OpenTable - IF ErrorMsg THEN RETURN -END - -READ TableRec FROM TableVar,TableKey THEN - Result = TableRec -END ELSE - // Log failure to read - LogData = '' - LogData<1> = LoggingDTM - LogData<2> = @User4 - LogData<3> = Method - LogData<4> = TableName - LogData<5> = TableKey - LogData<6> = 'Error code: ':@FILE_ERROR<1>:' Error message: ':@FILE_ERROR<2>:' Error detail: ':@FILE_ERROR<3> - Logging_Services('AppendLog', objLog, LogData, @RM, @FM) - - IF @FILE_ERROR<1> = 100 THEN -* Record doesn't exist -* 04/20/2021 - DJS - Moved unlock call outside of this specific error condition so that the record is always -* unlocked if the record fails to be read. -* GOSUB UnlockRec - Null - END ELSE - Set_FSError() - ErrorMsg = 'Record ':QUOTE(TableKey):' not found in Table ':QUOTE(TableName) + + IF TableName = '' THEN ErrorMsg = 'Null parameter "TableName" passed to subroutine' + IF TableKey = '' THEN ErrorMsg = 'Null parameter "TableKey" passed to subroutine' + IF TableVar = '' THEN + GOSUB OpenTable + IF ErrorMsg THEN RETURN END - Result = '' - - If ( (TableName NE '') and (TableKey NE '') ) then - RecordLocked = Database_Services('IsKeyIDLocked', TableName, TableKey, False$) - If RecordLocked EQ True$ then Database_Services('ReleaseKeyIDLock', TableName, TableKey) - end - -END - + + READ TableRec FROM TableVar,TableKey THEN + Result = TableRec + END ELSE + // Log failure to read + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = @User4 + LogData<3> = Method + LogData<4> = TableName + LogData<5> = TableKey + LogData<6> = 'Error code: ':@FILE_ERROR<1>:' Error message: ':@FILE_ERROR<2>:' Error detail: ':@FILE_ERROR<3> + Logging_Services('AppendLog', objLog, LogData, @RM, @FM) + + IF @FILE_ERROR<1> = 100 THEN + * Record doesn't exist + * 04/20/2021 - DJS - Moved unlock call outside of this specific error condition so that the record is always + * unlocked if the record fails to be read. + * GOSUB UnlockRec + Null + END ELSE + Set_FSError() + ErrorMsg = 'Record ':QUOTE(TableKey):' not found in Table ':QUOTE(TableName) + END + Result = '' + + If ( (TableName NE '') and (TableKey NE '') ) then + RecordLocked = Database_Services('IsKeyIDLocked', TableName, TableKey, False$) + If RecordLocked EQ True$ then Database_Services('ReleaseKeyIDLock', TableName, TableKey) + end + + END + RETURN * * * * * * * WriteRec: * * * * * * * - -IF TableName = '' THEN ErrorMsg = 'Null parameter "TableName" passed to subroutine' -IF TableKey = '' THEN ErrorMsg = 'Null parameter "TableKey" passed to subroutine' -IF TableVar = '' THEN GOSUB OpenTable - -IF ErrorMsg THEN RETURN - -IF ErrorMsg = '' THEN - - TestRec = TableRec - CONVERT @SVM:@VM:@FM TO '' IN TestRec + IF TableName = '' THEN ErrorMsg = 'Null parameter "TableName" passed to subroutine' + IF TableKey = '' THEN ErrorMsg = 'Null parameter "TableKey" passed to subroutine' + IF TableVar = '' THEN GOSUB OpenTable - IF TestRec = '' THEN - DELETE TableVar,TableKey ELSE Null -* ErrorMsg = 'Blank table rec with ':QUOTE(TableKey):' on ':QUOTE(TableName):' table.'; *added 4/9/21 for debugging -* Set_FSError() - END ELSE - Set_Status(0) - rv = Get_Status(errCode) - WRITE TableRec ON TableVar,TableKey THEN - rv = Get_Status(errCode) + IF ErrorMsg THEN RETURN + + IF ErrorMsg = '' THEN + + TestRec = TableRec + + CONVERT @SVM:@VM:@FM TO '' IN TestRec + + IF TestRec = '' THEN + DELETE TableVar,TableKey ELSE Null + * ErrorMsg = 'Blank table rec with ':QUOTE(TableKey):' on ':QUOTE(TableName):' table.'; *added 4/9/21 for debugging + * Set_FSError() END ELSE - ErrorMsg = 'Unable to write ':QUOTE(TableKey):' on ':QUOTE(TableName):' table.' + Set_Status(0) + rv = Get_Status(errCode) + WRITE TableRec ON TableVar,TableKey THEN + rv = Get_Status(errCode) + END ELSE + ErrorMsg = 'Unable to write ':QUOTE(TableKey):' on ':QUOTE(TableName):' table.' + END + END + If ( (TableName NE '') and (TableKey NE '') ) then + RecordLocked = Database_Services('IsKeyIDLocked', TableName, TableKey, False$) + If RecordLocked EQ True$ then Database_Services('ReleaseKeyIDLock', TableName, TableKey) + end + END - If ( (TableName NE '') and (TableKey NE '') ) then - RecordLocked = Database_Services('IsKeyIDLocked', TableName, TableKey, False$) - If RecordLocked EQ True$ then Database_Services('ReleaseKeyIDLock', TableName, TableKey) - end - -END - RETURN * * * * * * * WriteOnlyRec: * * * * * * * - -IF TableName = '' THEN ErrorMsg = 'Null parameter "TableName" passed to subroutine' -IF TableKey = '' THEN ErrorMsg = 'Null parameter "TableKey" passed to subroutine' -IF TableVar = '' THEN GOSUB OpenTable - -IF ErrorMsg THEN RETURN - -IF ErrorMsg = '' THEN - - TestRec = TableRec - CONVERT @SVM:@VM:@FM TO '' IN TestRec + IF TableName = '' THEN ErrorMsg = 'Null parameter "TableName" passed to subroutine' + IF TableKey = '' THEN ErrorMsg = 'Null parameter "TableKey" passed to subroutine' + IF TableVar = '' THEN GOSUB OpenTable - IF TestRec = '' THEN - DELETE TableVar,TableKey ELSE Null - END ELSE - WRITE TableRec ON TableVar,TableKey ELSE - ErrorMsg = 'Unable to write ':QUOTE(TableKey):' on ':QUOTE(TableName):' table.' + IF ErrorMsg THEN RETURN + + IF ErrorMsg = '' THEN + + TestRec = TableRec + + CONVERT @SVM:@VM:@FM TO '' IN TestRec + + IF TestRec = '' THEN + DELETE TableVar,TableKey ELSE Null + END ELSE + WRITE TableRec ON TableVar,TableKey ELSE + ErrorMsg = 'Unable to write ':QUOTE(TableKey):' on ':QUOTE(TableName):' table.' + END END END -END - + RETURN * * * * * * * DeleteRec: * * * * * * * - -IF TableName = '' THEN ErrorMsg = 'Null parameter "TableName" passed to subroutine' -IF TableKey = '' THEN ErrorMsg = 'Null parameter "TableKey" passed to subroutine' -IF TableVar = '' THEN GOSUB OpenTable - -IF ErrorMsg THEN RETURN - -IF ErrorMsg = '' THEN - DELETE TableVar,TableKey THEN - GOSUB UnlockRec + + IF TableName = '' THEN ErrorMsg = 'Null parameter "TableName" passed to subroutine' + IF TableKey = '' THEN ErrorMsg = 'Null parameter "TableKey" passed to subroutine' + IF TableVar = '' THEN GOSUB OpenTable + + IF ErrorMsg THEN RETURN + + IF ErrorMsg = '' THEN + DELETE TableVar,TableKey THEN + GOSUB UnlockRec + END END -END - + RETURN @@ -278,117 +278,114 @@ RETURN * * * * * * * LockRec: * * * * * * * - -IF TableName = '' THEN ErrorMsg = 'Null parameter "TableName" passed to subroutine' -IF TableKey = '' THEN ErrorMsg = 'Null parameter "TableKey" passed to subroutine' -IF TableVar = '' THEN GOSUB OpenTable - -IF ErrorMsg THEN RETURN - -LockData = '' -Locked = FALSE$ -RetryCnt = 0 - -LOOP - - LOCK TableVar,TableKey THEN - Locked = TRUE$ - END ELSE - - BEGIN CASE - CASE @FILE_ERROR NE '' - Set_FSError() - ErrorMsg = 'Unable to Lock ':QUOTE(TableKey):' in Table ':QUOTE(TableName) - - CASE Get_Status(errCode) - ErrorMsg = QUOTE(TableKey):' in Table ':QUOTE(TableName):' Locked by another workstation.' - - CASE 1 - ErrorMsg = QUOTE(TableKey):' in Table ':QUOTE(TableName):' Locked by This workstation.' - - END CASE + + IF TableName = '' THEN ErrorMsg = 'Null parameter "TableName" passed to subroutine' + IF TableKey = '' THEN ErrorMsg = 'Null parameter "TableKey" passed to subroutine' + IF TableVar = '' THEN GOSUB OpenTable + + IF ErrorMsg THEN RETURN + + LockData = '' + Locked = FALSE$ + RetryCnt = 0 + + LOOP - RetryCnt += 1 - END - -UNTIL Locked OR RetryCnt = 10 REPEAT - - + LOCK TableVar,TableKey THEN + Locked = TRUE$ + END ELSE + + BEGIN CASE + CASE @FILE_ERROR NE '' + Set_FSError() + ErrorMsg = 'Unable to Lock ':QUOTE(TableKey):' in Table ':QUOTE(TableName) + + CASE Get_Status(errCode) + ErrorMsg = QUOTE(TableKey):' in Table ':QUOTE(TableName):' Locked by another workstation.' + + CASE 1 + ErrorMsg = QUOTE(TableKey):' in Table ':QUOTE(TableName):' Locked by This workstation.' + + END CASE + + RetryCnt += 1 + END + + UNTIL Locked OR RetryCnt = 10 REPEAT + + RETURN * * * * * * * UnlockRec: * * * * * * * - -RecordLocked = Database_Services('IsKeyIDLocked', TableName, TableKey, False$) -If RecordLocked EQ True$ then Database_Services('ReleaseKeyIDLock', TableName, TableKey) - + + RecordLocked = Database_Services('IsKeyIDLocked', TableName, TableKey, False$) + If RecordLocked EQ True$ then Database_Services('ReleaseKeyIDLock', TableName, TableKey) + RETURN * * * * * * * LockSet: * * * * * * * - -IF TableName = '' THEN ErrorMsg = 'Null parameter "TableName" passed to subroutine' -IF TableKey = '' THEN ErrorMsg = 'Null parameter "TableKey" passed to subroutine' -IF TableVar = '' THEN GOSUB OpenTable - -TableKeys = TableKey ;* Pass in @VM'd list of keys In TableKey - -IF ErrorMsg THEN RETURN - -IF TableKeys = '' THEN RETURN - -Set_Status(0) - -LockedTableKeys = '' - -FOR I = 1 TO COUNT(TableKeys,@VM) + (TableKeys NE '') - TableKey = TableKeys<1,I> - GOSUB LockRec - If Locked THEN - LockedTableKeys<1,-1> = TableKey - End ELSE - For N = 1 To Count(LockedTableKeys,@VM) + (LockedTableKeys NE '') - TableKey = LockedTableKeys<1,N> - Gosub UnlockRec - Next N - End + IF TableName = '' THEN ErrorMsg = 'Null parameter "TableName" passed to subroutine' + IF TableKey = '' THEN ErrorMsg = 'Null parameter "TableKey" passed to subroutine' + IF TableVar = '' THEN GOSUB OpenTable + + TableKeys = TableKey ;* Pass in @VM'd list of keys In TableKey + + IF ErrorMsg THEN RETURN + + IF TableKeys = '' THEN RETURN + + Set_Status(0) + + LockedTableKeys = '' + + FOR I = 1 TO COUNT(TableKeys,@VM) + (TableKeys NE '') + TableKey = TableKeys<1,I> + GOSUB LockRec + + If Locked THEN + LockedTableKeys<1,-1> = TableKey + End ELSE + For N = 1 To Count(LockedTableKeys,@VM) + (LockedTableKeys NE '') + TableKey = LockedTableKeys<1,N> + Gosub UnlockRec + Next N + End + + NEXT I + + Result = TableVar -NEXT I - -Result = TableVar - RETURN * * * * * * * UnlockSet: * * * * * * * - -IF TableName = '' THEN ErrorMsg = 'Null parameter "TableName" passed to subroutine' -IF TableKey = '' THEN ErrorMsg = 'Null parameter "TableKey" passed to subroutine' -IF TableVar = '' THEN ErrorMsg = 'Null parameter "TableVar" passed to subroutine' - -LockedTableKeys = TableKey ;* Pass in @VM'd list of keys In TableKey - -IF ErrorMsg THEN RETURN - -IF LockedTableKeys = '' THEN RETURN - -Set_Status(0) - - -FOR I = 1 TO COUNT(LockedTableKeys,@VM) + (LockedTableKeys NE '') - TableKey = LockedTableKeys<1,I> - GOSUB UnlockRec -NEXT I - + + IF TableName = '' THEN ErrorMsg = 'Null parameter "TableName" passed to subroutine' + IF TableKey = '' THEN ErrorMsg = 'Null parameter "TableKey" passed to subroutine' + IF TableVar = '' THEN ErrorMsg = 'Null parameter "TableVar" passed to subroutine' + + LockedTableKeys = TableKey ;* Pass in @VM'd list of keys In TableKey + + IF ErrorMsg THEN RETURN + + IF LockedTableKeys = '' THEN RETURN + + Set_Status(0) + + + FOR I = 1 TO COUNT(LockedTableKeys,@VM) + (LockedTableKeys NE '') + TableKey = LockedTableKeys<1,I> + GOSUB UnlockRec + NEXT I + RETURN - - - diff --git a/LSL2/STPROC/OBJ_WM_IN.txt b/LSL2/STPROC/OBJ_WM_IN.txt index 29b1cbf..cfd33f3 100644 --- a/LSL2/STPROC/OBJ_WM_IN.txt +++ b/LSL2/STPROC/OBJ_WM_IN.txt @@ -66,7 +66,7 @@ BEGIN CASE CASE Method = 'RunProdTest' ; GOSUB RunProdTest CASE 1 NULL - + END CASE IF ErrorMsg NE '' THEN @@ -79,216 +79,216 @@ RETURN Result * * * * * * * Create: * * * * * * * - -WONo = Parms[1,@RM] -WOStep = Parms[COL2()+1,@RM] -CassNo = Parms[COL2()+1,@RM] -WaferQty = Parms[COL2()+1,@RM] - - -IF WONo = '' THEN ErrorMsg = 'Null Parameter "WONo" passed to routine. (':Method:')' -IF WOStep = '' THEN ErrorMsg = 'Null Parameter "WOStep" passed to routine. (':Method:')' -IF CassNo = '' THEN ErrorMsg = 'Null Parameter "CassNo" passed to routine. (':Method:')' -IF WaferQty = '' THEN ErrorMsg = 'Null Parameter "WaferQty" passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN - -WMInKey = WONo:'*':WOStep:'*':CassNo - -WMInRec = '' - -FOR I = 1 TO WaferQty - WMInRec = I -NEXT I -Done = False$ -NumAttempts = 0 -Loop - - NumAttempts += 1 - Database_Services('WriteDataRow', 'WM_IN', WMInKey, WMInRec) - If Error_Services('HasError') then - // Log the error - LogData = '' - LogData<1> = LoggingDTM - LogData<2> = Error_Services('GetMessage') - LogData<3> = NumAttempts - LogData<4> = WONo - LogData<5> = WOStep - LogData<6> = CassNo - LogData<7> = WaferQty - Logging_Services('AppendLog', objLog, LogData, @RM, @FM) - end else - LogData = '' - LogData<1> = LoggingDTM - LogData<2> = 'Success' - LogData<3> = NumAttempts - LogData<4> = WONo - LogData<5> = WOStep - LogData<6> = CassNo - LogData<7> = WaferQty - Logging_Services('AppendLog', objLog, LogData, @RM, @FM) - Done = True$ - end -Until ( (NumAttempts EQ 10) or (Done EQ True$) ) -Repeat - -WMInRec = Database_Services('ReadDataRow', 'WM_IN', WMInKey) -If WMInRec EQ '' then - // Record did not write to the database - LogData = '' - LogData<1> = LoggingDTM - LogData<2> = WMInKey - LogData<3> = WMInRec - LogData<4> = 'Record does not exist after obj_WM_IN("Create") call.' - Machine = Environment_Services('GetServer') - If Machine NE 'MESSA01EC' then - EmailAddr = 'dstieber@srpcs.com,6613649828@txt.att.net' - EmailMsg = 'WM_IN record ':WMInKey:' does not exist after obj_WM_IN("Create") call.' - Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$, EmailAddr, EmailMsg) - end else - Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) - end -end - -* obj_Tables('WriteRec','WM_IN':@RM:WMInKey:@RM:@RM:WMInRec) - + + WONo = Parms[1,@RM] + WOStep = Parms[COL2()+1,@RM] + CassNo = Parms[COL2()+1,@RM] + WaferQty = Parms[COL2()+1,@RM] + + + IF WONo = '' THEN ErrorMsg = 'Null Parameter "WONo" passed to routine. (':Method:')' + IF WOStep = '' THEN ErrorMsg = 'Null Parameter "WOStep" passed to routine. (':Method:')' + IF CassNo = '' THEN ErrorMsg = 'Null Parameter "CassNo" passed to routine. (':Method:')' + IF WaferQty = '' THEN ErrorMsg = 'Null Parameter "WaferQty" passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + WMInKey = WONo:'*':WOStep:'*':CassNo + + WMInRec = '' + + FOR I = 1 TO WaferQty + WMInRec = I + NEXT I + Done = False$ + NumAttempts = 0 + Loop + + NumAttempts += 1 + Database_Services('WriteDataRow', 'WM_IN', WMInKey, WMInRec) + If Error_Services('HasError') then + // Log the error + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = Error_Services('GetMessage') + LogData<3> = NumAttempts + LogData<4> = WONo + LogData<5> = WOStep + LogData<6> = CassNo + LogData<7> = WaferQty + Logging_Services('AppendLog', objLog, LogData, @RM, @FM) + end else + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = 'Success' + LogData<3> = NumAttempts + LogData<4> = WONo + LogData<5> = WOStep + LogData<6> = CassNo + LogData<7> = WaferQty + Logging_Services('AppendLog', objLog, LogData, @RM, @FM) + Done = True$ + end + Until ( (NumAttempts EQ 10) or (Done EQ True$) ) + Repeat + + WMInRec = Database_Services('ReadDataRow', 'WM_IN', WMInKey) + If WMInRec EQ '' then + // Record did not write to the database + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = WMInKey + LogData<3> = WMInRec + LogData<4> = 'Record does not exist after obj_WM_IN("Create") call.' + Machine = Environment_Services('GetServer') + If Machine NE 'MESSA01EC' then + EmailAddr = 'dstieber@srpcs.com,6613649828@txt.att.net' + EmailMsg = 'WM_IN record ':WMInKey:' does not exist after obj_WM_IN("Create") call.' + Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$, EmailAddr, EmailMsg) + end else + Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) + end + end + + * obj_Tables('WriteRec','WM_IN':@RM:WMInKey:@RM:@RM:WMInRec) + RETURN * * * * * * * Delete: * * * * * * * - -WMInKeys = Parms[1,@RM] - -IF WMInKeys = '' THEN RETURN - -NCRs = XLATE('WM_IN',WMInKeys,'NCR_NOS','X') - -CONVERT @FM TO @VM IN NCRs - -TestString = NCRs - -CONVERT @VM TO '' IN TestString - -IF TestString NE '' THEN - FOR I = 1 TO COUNT(NCRs,@VM) + (NCRs NE '') - IF NCRs<1,I> NE '' THEN - Result<1,-1> = WMInKeys<1,I> ;* Return list of WMInKeys that have started processing and cannot be deleted + + WMInKeys = Parms[1,@RM] + + IF WMInKeys = '' THEN RETURN + + NCRs = XLATE('WM_IN',WMInKeys,'NCR_NOS','X') + + CONVERT @FM TO @VM IN NCRs + + TestString = NCRs + + CONVERT @VM TO '' IN TestString + + IF TestString NE '' THEN + FOR I = 1 TO COUNT(NCRs,@VM) + (NCRs NE '') + IF NCRs<1,I> NE '' THEN + Result<1,-1> = WMInKeys<1,I> ;* Return list of WMInKeys that have started processing and cannot be deleted + END + NEXT I + ErrorMsg = 'Material has been rejected' + RETURN + END + + Set_Status(0) + WMiParms = 'WM_IN' + LockedWMInKeys = '' + + FOR I = 1 TO COUNT(WMInKeys,@VM) + (WMInKeys NE '') + WMInKey = WMInKeys<1,I> + WMiParms = FieldStore(WMiParms, @RM, 2, 1, WMInKey) + obj_Tables('LockRec',WMiParms) + IF Get_Status(errCode) THEN + FOR N = 1 TO COUNT(LockedWMInKeys,@VM) + (LockedWMInKeys NE '') + WMiParms = FieldStore(WMiParms, @RM, 2, 1, LockedWMInKeys<1,N>) + obj_Tables('UnlockRec',WMiParms) ;* Unlock everything locked up to here + NEXT N + ErrorMsg = 'Unable to lock RDS ':QUOTE(WMInKey):' for delete.' + RETURN + END ELSE + LockedWMInKeys<1,I> = WMInKey END NEXT I - ErrorMsg = 'Material has been rejected' - RETURN -END - -Set_Status(0) -WMiParms = 'WM_IN' -LockedWMInKeys = '' - -FOR I = 1 TO COUNT(WMInKeys,@VM) + (WMInKeys NE '') - WMInKey = WMInKeys<1,I> - WMiParms = FieldStore(WMiParms, @RM, 2, 1, WMInKey) - obj_Tables('LockRec',WMiParms) - IF Get_Status(errCode) THEN - FOR N = 1 TO COUNT(LockedWMInKeys,@VM) + (LockedWMInKeys NE '') - WMiParms = FieldStore(WMiParms, @RM, 2, 1, LockedWMInKeys<1,N>) - obj_Tables('UnlockRec',WMiParms) ;* Unlock everything locked up to here - NEXT N - ErrorMsg = 'Unable to lock RDS ':QUOTE(WMInKey):' for delete.' - RETURN - END ELSE - LockedWMInKeys<1,I> = WMInKey - END -NEXT I - -TableVar = FIELD(WMiParms,@RM,3,1) - - -FOR I = 1 TO COUNT(WMInKeys,@VM) + (WMInKeys NE '') - WMInKey = WMInKeys<1,I> - WMiParms = 'WM_IN':@RM:WMInKey:@RM:TableVar:@RM - obj_Tables('DeleteRec',WMiParms) ;* Deletes and removes the lock -NEXT I - + + TableVar = FIELD(WMiParms,@RM,3,1) + + + FOR I = 1 TO COUNT(WMInKeys,@VM) + (WMInKeys NE '') + WMInKey = WMInKeys<1,I> + WMiParms = 'WM_IN':@RM:WMInKey:@RM:TableVar:@RM + obj_Tables('DeleteRec',WMiParms) ;* Deletes and removes the lock + NEXT I + RETURN * * * * * * * CurrStatus: * * * * * * * - -WMInKey = Parms[1,@RM] -WMInRec = Parms[COL2()+1,@RM] -WOMatRec = Parms[COL2()+1,@RM] - -IF WMInKey = '' THEN RETURN -IF WMInRec = '' THEN WMInRec = XLATE('WM_IN',WMInKey,'','X') - -*IF WMInRec = '' THEN RETURN - - -IF WMInRec = 1 THEN - Result = 'VOID' - RETURN -END - -* Check for completion or abnormal condition - -IF WOMatRec = '' THEN - WONo = WMInKey[1,'*'] - CassNo = WMInKey[-1,'B*'] - WOMatKey = WONo:'*':CassNo - WOMatRec = XLATE('WO_MAT',WOMatKey,'','X') -END - - -IF WOMatRec = 1 AND WOMatRec = 'WM_IN' THEN - Result = 'HOLD' - RETURN -END - -GOSUB NCRNos - -NCRNos = Result -Result = '' - -NCRStatuses = XLATE('NCR',NCRNos,7,'X') - -IF INDEX(NCRStatuses,'O',1) THEN - Result = 'NCR' ;* Open NCR associated with box - RETURN -END - -* Check for sequential status points - - -RemoveCount = 0 - -SlotCount = COUNT(WMInRec,@VM) + (WMInRec NE '') -FOR I = 1 TO SlotCount - IF (WMInRec NE '' OR WMInRec NE '') THEN RemoveCount += 1 -NEXT I - -IF RemoveCount = SlotCount THEN - Result = 'MT' ;* Empty - RETURN -END - -/* -IF RemoveCount = 0 THEN - PreClean = XLATE('WM_IN',WMInKey,'PRE_CLEAN','X') - IF PreClean[1,2] = 'No' OR PreClean = '' THEN - NULL - END ELSE - Result = 'PREC' ;* Post Clean if Required + WMInKey = Parms[1,@RM] + WMInRec = Parms[COL2()+1,@RM] + WOMatRec = Parms[COL2()+1,@RM] + + IF WMInKey = '' THEN RETURN + IF WMInRec = '' THEN WMInRec = XLATE('WM_IN',WMInKey,'','X') + + *IF WMInRec = '' THEN RETURN + + + IF WMInRec = 1 THEN + Result = 'VOID' RETURN END -END -*/ - -Result = 'RFW' ;* Changed 10/27/2011 - + + * Check for completion or abnormal condition + + IF WOMatRec = '' THEN + WONo = WMInKey[1,'*'] + CassNo = WMInKey[-1,'B*'] + WOMatKey = WONo:'*':CassNo + WOMatRec = XLATE('WO_MAT',WOMatKey,'','X') + END + + + IF WOMatRec = 1 AND WOMatRec = 'WM_IN' THEN + Result = 'HOLD' + RETURN + END + + GOSUB NCRNos + + NCRNos = Result + Result = '' + + NCRStatuses = XLATE('NCR',NCRNos,7,'X') + + IF INDEX(NCRStatuses,'O',1) THEN + Result = 'NCR' ;* Open NCR associated with box + RETURN + END + + * Check for sequential status points + + + RemoveCount = 0 + + SlotCount = COUNT(WMInRec,@VM) + (WMInRec NE '') + FOR I = 1 TO SlotCount + IF (WMInRec NE '' OR WMInRec NE '') THEN RemoveCount += 1 + NEXT I + + IF RemoveCount = SlotCount THEN + Result = 'MT' ;* Empty + RETURN + END + + /* + IF RemoveCount = 0 THEN + + PreClean = XLATE('WM_IN',WMInKey,'PRE_CLEAN','X') + IF PreClean[1,2] = 'No' OR PreClean = '' THEN + NULL + END ELSE + Result = 'PREC' ;* Post Clean if Required + RETURN + END + END + */ + + Result = 'RFW' ;* Changed 10/27/2011 + RETURN @@ -296,413 +296,413 @@ RETURN * * * * * * * RemainingSlots: * * * * * * * - -WONo = Parms[1,@RM] -WOStep = Parms[COL2()+1,@RM] -CassNos = Parms[COL2()+1,@RM] - -IF WONo = '' THEN ErrorMsg = 'Null Parameter "WONo" passed to routine. (':Method:')' -IF WOStep = '' THEN ErrorMsg = 'Null Parameter "WOStep" passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN - -IF CassNos = '' THEN - CassNos = XLATE('WO_LOG',WONo,'WO_MAT_CASS_NO','X') -END - -CassCnt = COUNT(CassNos,@VM) + (CassNos NE '') - -* Start Counting at the last box and work backward - -FOR I = CassCnt TO 1 STEP -1 - - CassNo = CassNos<1,I> - - WMInRec = XLATE('WM_IN',WONo:'*':WOStep:'*':CassNo,'','X') - WOMatRec = XLATE('WO_MAT',WONo:'*':CassNo,'','X') - IF WOMatRec = 1 AND WOMatRec = 'WM_IN' THEN - NULL ;* Box is on hold - skip it - END ELSE - SlotCnt = COUNT(WMInRec,@VM) + (WMInRec NE '') - - FOR N = SlotCnt TO 1 STEP -1 - SlotNo = WMInRec - IF WMInRec = '' AND WMInRec = '' THEN - WMIWfrKey = WONo:'*':WOStep:'*':CassNo:'*':SlotNo - IF NOT(RowExists('WMI_WFRS', WMIWfrKey)) THEN - Result = INSERT(Result,1,0,0,I:@VM:N) ;* Plate-o-lator (LIFO) style - END - END - NEXT N + WONo = Parms[1,@RM] + WOStep = Parms[COL2()+1,@RM] + CassNos = Parms[COL2()+1,@RM] + + IF WONo = '' THEN ErrorMsg = 'Null Parameter "WONo" passed to routine. (':Method:')' + IF WOStep = '' THEN ErrorMsg = 'Null Parameter "WOStep" passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + IF CassNos = '' THEN + CassNos = XLATE('WO_LOG',WONo,'WO_MAT_CASS_NO','X') END - -NEXT I - + + CassCnt = COUNT(CassNos,@VM) + (CassNos NE '') + + * Start Counting at the last box and work backward + + FOR I = CassCnt TO 1 STEP -1 + + CassNo = CassNos<1,I> + + WMInRec = XLATE('WM_IN',WONo:'*':WOStep:'*':CassNo,'','X') + WOMatRec = XLATE('WO_MAT',WONo:'*':CassNo,'','X') + + IF WOMatRec = 1 AND WOMatRec = 'WM_IN' THEN + NULL ;* Box is on hold - skip it + END ELSE + SlotCnt = COUNT(WMInRec,@VM) + (WMInRec NE '') + + FOR N = SlotCnt TO 1 STEP -1 + SlotNo = WMInRec + IF WMInRec = '' AND WMInRec = '' THEN + WMIWfrKey = WONo:'*':WOStep:'*':CassNo:'*':SlotNo + IF NOT(RowExists('WMI_WFRS', WMIWfrKey)) THEN + Result = INSERT(Result,1,0,0,I:@VM:N) ;* Plate-o-lator (LIFO) style + END + END + NEXT N + END + + NEXT I + RETURN * * * * * * * RemoveWafer: * * * * * * * - -WONo = Parms[1,@RM] -WOStep = Parms[COL2()+1,@RM] -CassNo = Parms[COL2()+1,@RM] - -SlotNos = Parms[COL2()+1,@RM] -RDSNos = Parms[COL2()+1,@RM] -PocketNos = Parms[COL2()+1,@RM] -Zones = Parms[COL2()+1,@RM] - - -IF WONo = '' THEN ErrorMsg = 'Null Parameter "WONo" passed to routine. (':Method:')' -IF WOStep = '' THEN ErrorMsg = 'Null Parameter "WOStep" passed to routine. (':Method:')' -IF CassNo = '' THEN ErrorMsg = 'Null Parameter "CassNo" passed to routine. (':Method:')' -IF SlotNos = '' THEN ErrorMsg = 'Null Parameter "SlotNos" passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN - -SlotCnt = COUNT(SlotNos,@VM) + (SlotNos NE '') - -FOR I = 1 TO SlotCnt - RDSNo = RDSNos<1,I> - PocketNo = PocketNos<1,I> - Zone = Zones<1,I> + WONo = Parms[1,@RM] + WOStep = Parms[COL2()+1,@RM] + CassNo = Parms[COL2()+1,@RM] - IF RDSNo = '' THEN ErrorMsg = 'Null Parameter Value (':I:') in "RDSNos" passed to routine. (':Method:')' - IF PocketNo = '' THEN ErrorMsg = 'Null Parameter Value (':I:') in "PocketNos" passed to routine. (':Method:')' - IF Zone = '' THEN ErrorMsg = 'Null Parameter Value (':I:') in "Zones" passed to routine. (':Method:')' + SlotNos = Parms[COL2()+1,@RM] + RDSNos = Parms[COL2()+1,@RM] + PocketNos = Parms[COL2()+1,@RM] + Zones = Parms[COL2()+1,@RM] + + + IF WONo = '' THEN ErrorMsg = 'Null Parameter "WONo" passed to routine. (':Method:')' + IF WOStep = '' THEN ErrorMsg = 'Null Parameter "WOStep" passed to routine. (':Method:')' + IF CassNo = '' THEN ErrorMsg = 'Null Parameter "CassNo" passed to routine. (':Method:')' + IF SlotNos = '' THEN ErrorMsg = 'Null Parameter "SlotNos" passed to routine. (':Method:')' IF ErrorMsg NE '' THEN RETURN -NEXT I - -otParms = 'WM_IN':@RM:WONo:'*':WOStep:'*':CassNo -WMInRec = obj_Tables('ReadRec',otParms) - -IF Get_Status(errCode) THEN RETURN - -FirstWafer = 0 -FirstRDSNo = '' - -LoadDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS') - -WfrIDs = '' ;* Added 9/7/2016 JCH -RunLocs = '' ;* Added 9/7/2016 JCH -CurrSlotIDs = '' ;* Added 9/7/2016 JCH - - - -FOR I = 1 TO SlotCnt - SlotNo = SlotNos<1,I> + SlotCnt = COUNT(SlotNos,@VM) + (SlotNos NE '') - IF SlotNo = 1 THEN - FirstWafer = 1 - FirstRDSNo = RDSNos<1,I> - END + FOR I = 1 TO SlotCnt + + RDSNo = RDSNos<1,I> + PocketNo = PocketNos<1,I> + Zone = Zones<1,I> + + IF RDSNo = '' THEN ErrorMsg = 'Null Parameter Value (':I:') in "RDSNos" passed to routine. (':Method:')' + IF PocketNo = '' THEN ErrorMsg = 'Null Parameter Value (':I:') in "PocketNos" passed to routine. (':Method:')' + IF Zone = '' THEN ErrorMsg = 'Null Parameter Value (':I:') in "Zones" passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + NEXT I - LOCATE SlotNo IN WMInRec USING @VM SETTING Pos THEN - - ReactNo = XLATE('RDS',RDSNos<1,I>,RDS_REACTOR$,'X') - - WMInRec = RDSNos<1,I> - WMInRec = PocketNos<1,I> - WMInRec = Zones<1,I> - - WfrIDs<1,-1> = WONo:'*':CassNo:'*':SlotNo ;* Added 9/7/2016 JCH - RunLocs<1,-1> = RDSNos<1,I>:'*':PocketNos<1,I>:'*':Zones<1,I> ;* Added 9/7/2016 JCH - CurrSlotIDs<1,-1> = WONo:'*':CassNo:'*':SlotNo ;* Added 9/7/2016 JCH + otParms = 'WM_IN':@RM:WONo:'*':WOStep:'*':CassNo + WMInRec = obj_Tables('ReadRec',otParms) - * * * * Added 3/22/2016 JCH - wafer history * * * * + IF Get_Status(errCode) THEN RETURN + + FirstWafer = 0 + FirstRDSNo = '' + + LoadDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS') + + WfrIDs = '' ;* Added 9/7/2016 JCH + RunLocs = '' ;* Added 9/7/2016 JCH + CurrSlotIDs = '' ;* Added 9/7/2016 JCH + + + + FOR I = 1 TO SlotCnt + SlotNo = SlotNos<1,I> - Parms = WONo:'*':CassNo:'*':SlotNo:@RM ;* WfrID + IF SlotNo = 1 THEN + FirstWafer = 1 + FirstRDSNo = RDSNos<1,I> + END + + LOCATE SlotNo IN WMInRec USING @VM SETTING Pos THEN + + ReactNo = XLATE('RDS',RDSNos<1,I>,RDS_REACTOR$,'X') + + WMInRec = RDSNos<1,I> + WMInRec = PocketNos<1,I> + WMInRec = Zones<1,I> + + WfrIDs<1,-1> = WONo:'*':CassNo:'*':SlotNo ;* Added 9/7/2016 JCH + RunLocs<1,-1> = RDSNos<1,I>:'*':PocketNos<1,I>:'*':Zones<1,I> ;* Added 9/7/2016 JCH + CurrSlotIDs<1,-1> = WONo:'*':CassNo:'*':SlotNo ;* Added 9/7/2016 JCH + + * * * * Added 3/22/2016 JCH - wafer history * * * * + + Parms = WONo:'*':CassNo:'*':SlotNo:@RM ;* WfrID + Parms := LoadDTM:@RM ;* EventDtm + Parms := @USER4:@RM ;* EventBy + Parms := 'LOAD':@RM ;* Event + Parms := '':@RM ;* NewSlotID + Parms := RDSNos<1,I>:'*':PocketNos<1,I>:'*':Zones<1,I>:@RM ;* RunLoc + Parms := '':@RM ;* NCRNo + Parms := '':@RM ;* TWUse + Parms := WONo:'*':CassNo:'*':SlotNo:@RM ;* CurrSlotID + Parms := 'R':ReactNo:@RM ;* NewToolID (Load Tool) + Parms := '':@RM ;* CurrToolID + Parms := '':@RM ;* NewInvLoc + Parms := '':@RM ;* CurrInvLoc + Parms := 'I' ;* Wfr Side + + + obj_WO_Wfr('AddEvent',Parms) + + END + + NEXT I + + + /* + + * * * * * Added 9/7/2016 JCH * * * * * * + + IF WfrIDs NE '' THEN + + Parms = WfrIDs:@RM ;* WfrID - mv Parms := LoadDTM:@RM ;* EventDtm Parms := @USER4:@RM ;* EventBy Parms := 'LOAD':@RM ;* Event - Parms := '':@RM ;* NewSlotID - Parms := RDSNos<1,I>:'*':PocketNos<1,I>:'*':Zones<1,I>:@RM ;* RunLoc + Parms := '':@RM ;* NewSlotID - mv + Parms := RunLocs:@RM ;* RunLoc - mv Parms := '':@RM ;* NCRNo Parms := '':@RM ;* TWUse - Parms := WONo:'*':CassNo:'*':SlotNo:@RM ;* CurrSlotID + Parms := CurrSlotIDs:@RM ;* CurrSlotID - mv Parms := 'R':ReactNo:@RM ;* NewToolID (Load Tool) Parms := '':@RM ;* CurrToolID Parms := '':@RM ;* NewInvLoc Parms := '':@RM ;* CurrInvLoc Parms := 'I' ;* Wfr Side - - + + obj_WO_Wfr('AddEvent',Parms) - + END -NEXT I - - -/* - -* * * * * Added 9/7/2016 JCH * * * * * * - -IF WfrIDs NE '' THEN - - Parms = WfrIDs:@RM ;* WfrID - mv - Parms := LoadDTM:@RM ;* EventDtm - Parms := @USER4:@RM ;* EventBy - Parms := 'LOAD':@RM ;* Event - Parms := '':@RM ;* NewSlotID - mv - Parms := RunLocs:@RM ;* RunLoc - mv - Parms := '':@RM ;* NCRNo - Parms := '':@RM ;* TWUse - Parms := CurrSlotIDs:@RM ;* CurrSlotID - mv - Parms := 'R':ReactNo:@RM ;* NewToolID (Load Tool) - Parms := '':@RM ;* CurrToolID - Parms := '':@RM ;* NewInvLoc - Parms := '':@RM ;* CurrInvLoc - Parms := 'I' ;* Wfr Side - - - obj_WO_Wfr('AddEvent',Parms) - -END - -*/ - -otParms = FieldStore(otParms,@RM,4,0,WMInRec) ;* Put record in 4th field of OtParms -obj_Tables('WriteRec',otParms) - -* Added 11/8/2012 JCH * - -WIPStartDTM = XLATE('WO_MAT',WONo:'*':CassNo,WO_MAT_WIP_START_DTM$,'X') - -DTMSecond = '0.0000115741' ;*********** Constant for 1 Second in DTM internal format - -IF WIPStartDTM = '' THEN - - CurrTime = Time() - CurrDTM = OCONV(Date(),'D4/'):' ':OCONV(CurrTime,'MTS') - CurrDTM1 = OCONV(Date(),'D4/'):' ':OCONV(CurrTime + 1,'MTS') - - obj_Post_Log('Create','WO_MAT':@RM:WONo:'*':CassNo:@RM:WO_MAT_WIP_START_DTM$:@RM:ICONV(CurrDTM,'DT')) - -END ELSE - - CurrDTM = OCONV(WipStartDTM,'DT4/^S') ;* CurrDTM in OCONV format - CurrDTM1 = OCONV(WipStartDTM + DTMSecond,'DT4/^S') - -END - -* Added 2/4/2013 by JCH - -IF FirstWafer THEN - - Reactor = XLATE('REACT_RUN',FirstRDSNo,REACT_RUN_REACTOR$ ,'X') - - IF Reactor = '' THEN - ReactWH = 'CR' - ReactLoc = 'EPR' - END ELSE - ReactWH = XLATE('REACTOR',Reactor,'TOOL_WH','X') - ReactLoc = XLATE('REACTOR',Reactor,'TOOL_LOC','X') - END - - /* - BEGIN CASE - CASE Reactor = '40' OR Reactor = '42' ; ToolID = 'R4042' - CASE Reactor = '44' OR Reactor = '46' ; ToolID = 'R4446' - CASE Reactor = '48' OR Reactor = '50' ; ToolID = 'R4850' - CASE Reactor = '52' OR Reactor = '54' ; ToolID = 'R5254' - CASE 1 ; ToolID = '' - END CASE */ + otParms = FieldStore(otParms,@RM,4,0,WMInRec) ;* Put record in 4th field of OtParms + obj_Tables('WriteRec',otParms) + * Added 11/8/2012 JCH * + + WIPStartDTM = XLATE('WO_MAT',WONo:'*':CassNo,WO_MAT_WIP_START_DTM$,'X') + + DTMSecond = '0.0000115741' ;*********** Constant for 1 Second in DTM internal format + + IF WIPStartDTM = '' THEN + + CurrTime = Time() + CurrDTM = OCONV(Date(),'D4/'):' ':OCONV(CurrTime,'MTS') + CurrDTM1 = OCONV(Date(),'D4/'):' ':OCONV(CurrTime + 1,'MTS') + + obj_Post_Log('Create','WO_MAT':@RM:WONo:'*':CassNo:@RM:WO_MAT_WIP_START_DTM$:@RM:ICONV(CurrDTM,'DT')) + + END ELSE + + CurrDTM = OCONV(WipStartDTM,'DT4/^S') ;* CurrDTM in OCONV format + CurrDTM1 = OCONV(WipStartDTM + DTMSecond,'DT4/^S') - LogFile = 'WO_MAT' ; WOMLParms = LogFile:@RM - LogDTM = CurrDTM ; WOMLParms := LogDTM:@RM - Action = WOStep:'VER' ; WOMLParms := Action:@RM - WhCd = 'CR' ; WOMLParms := WhCd:@RM - LocCd = 'EPR' ; WOMLParms := LocCd:@RM - WONos = WONo ; WOMLParms := WONos:@RM - CassNos = CassNo ; WOMLParms := CassNos:@RM - UserID = @USER4 ; WOMLParms := UserID:@RM - Tags = '' ; WOMLParms := Tags:@RM - ToolID = '' ; WOMLParms := ToolID - - obj_WO_Mat_Log('Create',WOMLParms) ;* Stage PSTC log entry - - IF Get_Status(errCode) THEN - RETURN END - Reactor = XLATE('REACT_RUN',FirstRDSNo,REACT_RUN_REACTOR$ ,'X') + * Added 2/4/2013 by JCH - IF Reactor = '' THEN - ReactWH = 'CR' - ReactLoc = 'EPR' - END ELSE - ReactWH = XLATE('REACTOR',Reactor,'TOOL_WH','X') - ReactLoc = XLATE('REACTOR',Reactor,'TOOL_LOC','X') + IF FirstWafer THEN + + Reactor = XLATE('REACT_RUN',FirstRDSNo,REACT_RUN_REACTOR$ ,'X') + + IF Reactor = '' THEN + ReactWH = 'CR' + ReactLoc = 'EPR' + END ELSE + ReactWH = XLATE('REACTOR',Reactor,'TOOL_WH','X') + ReactLoc = XLATE('REACTOR',Reactor,'TOOL_LOC','X') + END + + /* + BEGIN CASE + CASE Reactor = '40' OR Reactor = '42' ; ToolID = 'R4042' + CASE Reactor = '44' OR Reactor = '46' ; ToolID = 'R4446' + CASE Reactor = '48' OR Reactor = '50' ; ToolID = 'R4850' + CASE Reactor = '52' OR Reactor = '54' ; ToolID = 'R5254' + CASE 1 ; ToolID = '' + END CASE + */ + + + + LogFile = 'WO_MAT' ; WOMLParms = LogFile:@RM + LogDTM = CurrDTM ; WOMLParms := LogDTM:@RM + Action = WOStep:'VER' ; WOMLParms := Action:@RM + WhCd = 'CR' ; WOMLParms := WhCd:@RM + LocCd = 'EPR' ; WOMLParms := LocCd:@RM + WONos = WONo ; WOMLParms := WONos:@RM + CassNos = CassNo ; WOMLParms := CassNos:@RM + UserID = @USER4 ; WOMLParms := UserID:@RM + Tags = '' ; WOMLParms := Tags:@RM + ToolID = '' ; WOMLParms := ToolID + + obj_WO_Mat_Log('Create',WOMLParms) ;* Stage PSTC log entry + + IF Get_Status(errCode) THEN + RETURN + END + + Reactor = XLATE('REACT_RUN',FirstRDSNo,REACT_RUN_REACTOR$ ,'X') + + IF Reactor = '' THEN + ReactWH = 'CR' + ReactLoc = 'EPR' + END ELSE + ReactWH = XLATE('REACTOR',Reactor,'TOOL_WH','X') + ReactLoc = XLATE('REACTOR',Reactor,'TOOL_LOC','X') + END + + BEGIN CASE + CASE Reactor = '40' OR Reactor = '42' ; ToolID = 'R4042' + CASE Reactor = '44' OR Reactor = '46' ; ToolID = 'R4446' + CASE Reactor = '48' OR Reactor = '50' ; ToolID = 'R4850' + CASE Reactor = '52' OR Reactor = '54' ; ToolID = 'R5254' + END CASE + + LogFile = 'WO_MAT' ; WOMLParms = LogFile:@RM + LogDTM = CurrDTM1 ; WOMLParms := LogDTM:@RM + Action = WOStep:'LOAD' ; WOMLParms := Action:@RM + WhCd = ReactWH ; WOMLParms := WhCd:@RM + LocCd = ReactLoc ; WOMLParms := LocCd:@RM + WONos = WONo ; WOMLParms := WONos:@RM + CassNos = CassNo ; WOMLParms := CassNos:@RM + UserID = @USER4 ; WOMLParms := UserID:@RM + Tags = '' ; WOMLParms := Tags:@RM + *ToolID = '' ; WOMLParms := ToolID + + obj_WO_Mat_Log('Create',WOMLParms) ;* Stage PSTC log entry + + IF Get_Status(errCode) THEN + RETURN + END + END - BEGIN CASE - CASE Reactor = '40' OR Reactor = '42' ; ToolID = 'R4042' - CASE Reactor = '44' OR Reactor = '46' ; ToolID = 'R4446' - CASE Reactor = '48' OR Reactor = '50' ; ToolID = 'R4850' - CASE Reactor = '52' OR Reactor = '54' ; ToolID = 'R5254' - END CASE - LogFile = 'WO_MAT' ; WOMLParms = LogFile:@RM - LogDTM = CurrDTM1 ; WOMLParms := LogDTM:@RM - Action = WOStep:'LOAD' ; WOMLParms := Action:@RM - WhCd = ReactWH ; WOMLParms := WhCd:@RM - LocCd = ReactLoc ; WOMLParms := LocCd:@RM - WONos = WONo ; WOMLParms := WONos:@RM - CassNos = CassNo ; WOMLParms := CassNos:@RM - UserID = @USER4 ; WOMLParms := UserID:@RM - Tags = '' ; WOMLParms := Tags:@RM - *ToolID = '' ; WOMLParms := ToolID - - obj_WO_Mat_Log('Create',WOMLParms) ;* Stage PSTC log entry - - IF Get_Status(errCode) THEN - RETURN - END - -END - - RETURN * * * * * * * ReplaceWafer: * * * * * * * - -WONo = Parms[1,@RM] -WOStep = Parms[COL2()+1,@RM] -CassNo = Parms[COL2()+1,@RM] -SlotNos = Parms[COL2()+1,@RM] - -IF WONo = '' THEN ErrorMsg = 'Null Parameter "WONo" passed to routine. (':Method:')' -IF WOStep = '' THEN ErrorMsg = 'Null Parameter "WOStep" passed to routine. (':Method:')' -IF CassNo = '' THEN ErrorMsg = 'Null Parameter "CassNo" passed to routine. (':Method:')' -IF SlotNos = '' THEN ErrorMsg = 'Null Parameter "SlotNos" passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN - -Set_Status(0) - -otParms = 'WM_IN':@RM:WONo:'*':WOStep:'*':CassNo -WMInRec = obj_Tables('ReadRec',otParms) - -IF Get_Status(errCode) THEN RETURN - -ReplaceDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS') - -WfrIDs = '' ;* Added 9/7/2016 JCH -NewSlotIDs = '' ;* Added 9/7/2016 JCH - - -FOR I = 1 TO COUNT(SlotNos,@VM) + (SlotNos NE '') - SlotNo = SlotNos<1,I> - LOCATE SlotNo IN WMInRec USING @VM SETTING Pos THEN - RdsNo = WMInRec - ReactNo = XLATE('RDS',RdsNo,RDS_REACTOR$,'X') - - WMInRec = '' - WMInRec = '' - WMInRec = '' - - WfrIDs<1,-1> = WONo:'*':CassNo:'*':SlotNo - NewSlotIDs<1,-1> = WONo:'*':CassNo:'*':SlotNo - - * * * * Added 3/22/2016 JCH - wafer history * * * * - - Parms = WONo:'*':CassNo:'*':SlotNo:@RM ;* WfrID + WONo = Parms[1,@RM] + WOStep = Parms[COL2()+1,@RM] + CassNo = Parms[COL2()+1,@RM] + SlotNos = Parms[COL2()+1,@RM] + + IF WONo = '' THEN ErrorMsg = 'Null Parameter "WONo" passed to routine. (':Method:')' + IF WOStep = '' THEN ErrorMsg = 'Null Parameter "WOStep" passed to routine. (':Method:')' + IF CassNo = '' THEN ErrorMsg = 'Null Parameter "CassNo" passed to routine. (':Method:')' + IF SlotNos = '' THEN ErrorMsg = 'Null Parameter "SlotNos" passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + Set_Status(0) + + otParms = 'WM_IN':@RM:WONo:'*':WOStep:'*':CassNo + WMInRec = obj_Tables('ReadRec',otParms) + + IF Get_Status(errCode) THEN RETURN + + ReplaceDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS') + + WfrIDs = '' ;* Added 9/7/2016 JCH + NewSlotIDs = '' ;* Added 9/7/2016 JCH + + + FOR I = 1 TO COUNT(SlotNos,@VM) + (SlotNos NE '') + SlotNo = SlotNos<1,I> + LOCATE SlotNo IN WMInRec USING @VM SETTING Pos THEN + + RdsNo = WMInRec + ReactNo = XLATE('RDS',RdsNo,RDS_REACTOR$,'X') + + WMInRec = '' + WMInRec = '' + WMInRec = '' + + WfrIDs<1,-1> = WONo:'*':CassNo:'*':SlotNo + NewSlotIDs<1,-1> = WONo:'*':CassNo:'*':SlotNo + + * * * * Added 3/22/2016 JCH - wafer history * * * * + + Parms = WONo:'*':CassNo:'*':SlotNo:@RM ;* WfrID + Parms := ReplaceDTM:@RM ;* EventDtm + Parms := @USER4:@RM ;* EventBy + Parms := 'REPLACE':@RM ;* Event + Parms := WONo:'*':CassNo:'*':SlotNo:@RM ;* NewSlotID + Parms := '':@RM ;* RunLoc + Parms := '':@RM ;* NCRNo + Parms := '':@RM ;* TWUse + Parms := '':@RM ;* CurrSlotID + Parms := '':@RM ;* NewToolID (Load Tool) + Parms := 'R':ReactNo:@RM ;* CurrToolID (Unload Tool) + Parms := '':@RM ;* NewInvLoc + Parms := '':@RM ;* CurrInvLoc + Parms := 'I' ;* Wfr Side + + + obj_WO_Wfr('AddEvent',Parms) + + END + NEXT I + + /* + + IF WfrIDs NE '' THEN + + * * * * Added 9/7/2016 JCH - wafer history * * * * + + Parms = WfrIDs:@RM ;* WfrID - mv Parms := ReplaceDTM:@RM ;* EventDtm Parms := @USER4:@RM ;* EventBy Parms := 'REPLACE':@RM ;* Event - Parms := WONo:'*':CassNo:'*':SlotNo:@RM ;* NewSlotID - Parms := '':@RM ;* RunLoc + Parms := NewSlotIDs:@RM ;* NewSlotID - mv + Parms := '':@RM ;* RunLoc - mv Parms := '':@RM ;* NCRNo Parms := '':@RM ;* TWUse - Parms := '':@RM ;* CurrSlotID + Parms := '':@RM ;* CurrSlotID - mv Parms := '':@RM ;* NewToolID (Load Tool) Parms := 'R':ReactNo:@RM ;* CurrToolID (Unload Tool) Parms := '':@RM ;* NewInvLoc Parms := '':@RM ;* CurrInvLoc Parms := 'I' ;* Wfr Side - obj_WO_Wfr('AddEvent',Parms) - - END -NEXT I - -/* - -IF WfrIDs NE '' THEN - - * * * * Added 9/7/2016 JCH - wafer history * * * * - - Parms = WfrIDs:@RM ;* WfrID - mv - Parms := ReplaceDTM:@RM ;* EventDtm - Parms := @USER4:@RM ;* EventBy - Parms := 'REPLACE':@RM ;* Event - Parms := NewSlotIDs:@RM ;* NewSlotID - mv - Parms := '':@RM ;* RunLoc - mv - Parms := '':@RM ;* NCRNo - Parms := '':@RM ;* TWUse - Parms := '':@RM ;* CurrSlotID - mv - Parms := '':@RM ;* NewToolID (Load Tool) - Parms := 'R':ReactNo:@RM ;* CurrToolID (Unload Tool) - Parms := '':@RM ;* NewInvLoc - Parms := '':@RM ;* CurrInvLoc - Parms := 'I' ;* Wfr Side - obj_WO_Wfr('AddEvent',Parms) - -END - -*/ - -otParms = FieldStore(otParms,@RM,4,0,WMInRec) ;* Put record in 4th field of OtParms -obj_Tables('WriteRec',otParms) - + END + + */ + + otParms = FieldStore(otParms,@RM,4,0,WMInRec) ;* Put record in 4th field of OtParms + obj_Tables('WriteRec',otParms) + RETURN * * * * * * * AddWafer: * * * * * * * - -WONo = Parms[1,@RM] -WOStep = Parms[COL2()+1,@RM] -CassNo = Parms[COL2()+1,@RM] -SlotNo = Parms[COL2()+1,@RM] - -IF WONo = '' THEN ErrorMsg = 'Null Parameter "WONo" passed to routine. (':Method:')' -IF WOStep = '' THEN ErrorMsg = 'Null Parameter "WOStep" passed to routine. (':Method:')' -IF CassNo = '' THEN ErrorMsg = 'Null Parameter "CassNo" passed to routine. (':Method:')' -IF SlotNo = '' THEN ErrorMsg = 'Null Parameter "SlotNo" passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN - -otParms = 'WM_IN':@RM:WONo:'*':WOStep:'*':CassNo -WMInRec = obj_Tables('ReadRec',otParms) - -LOCATE SlotNo IN WMInRec USING @VM SETTING Pos THEN - WMInRec = '' ;* Clears NCR numbers -END - - -*WMInRec = SlotNo ;* Slot numbers are the same as the position in the list. - -otParms = FieldStore(otParms,@RM,4,0,WMInRec) ;* Put record in 4th field of OtParms -obj_Tables('WriteRec',otParms) - + + WONo = Parms[1,@RM] + WOStep = Parms[COL2()+1,@RM] + CassNo = Parms[COL2()+1,@RM] + SlotNo = Parms[COL2()+1,@RM] + + IF WONo = '' THEN ErrorMsg = 'Null Parameter "WONo" passed to routine. (':Method:')' + IF WOStep = '' THEN ErrorMsg = 'Null Parameter "WOStep" passed to routine. (':Method:')' + IF CassNo = '' THEN ErrorMsg = 'Null Parameter "CassNo" passed to routine. (':Method:')' + IF SlotNo = '' THEN ErrorMsg = 'Null Parameter "SlotNo" passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + otParms = 'WM_IN':@RM:WONo:'*':WOStep:'*':CassNo + WMInRec = obj_Tables('ReadRec',otParms) + + LOCATE SlotNo IN WMInRec USING @VM SETTING Pos THEN + WMInRec = '' ;* Clears NCR numbers + END + + + *WMInRec = SlotNo ;* Slot numbers are the same as the position in the list. + + otParms = FieldStore(otParms,@RM,4,0,WMInRec) ;* Put record in 4th field of OtParms + obj_Tables('WriteRec',otParms) + RETURN @@ -710,83 +710,83 @@ RETURN * * * * * * * NCRNos: * * * * * * * - -IF NOT(ASSIGNED(WMInKey)) THEN - * Called externally - WMInKey = Parms[1,@RM] - WMInRec = Parms[COL2()+1,@RM] -END - -IF WMInKey = '' THEN RETURN -IF WMInRec = '' THEN WMInRec = XLATE('WM_IN',WMInKey,'','X') - -SlotNCRs = WMInRec - -FOR I = 1 TO COUNT(SlotNCRs,@VM) + (SlotNCRs NE '') - SlotNCR = SlotNCRs<1,I> - IF SlotNCR NE '' THEN - LOCATE SlotNCR in Result BY 'AR' USING @VM SETTING Pos ELSE - Result = INSERT(Result,1,Pos,0,SlotNCR) - END - END -NEXT I - + + IF NOT(ASSIGNED(WMInKey)) THEN + * Called externally + WMInKey = Parms[1,@RM] + WMInRec = Parms[COL2()+1,@RM] + END + + IF WMInKey = '' THEN RETURN + IF WMInRec = '' THEN WMInRec = XLATE('WM_IN',WMInKey,'','X') + + SlotNCRs = WMInRec + + FOR I = 1 TO COUNT(SlotNCRs,@VM) + (SlotNCRs NE '') + SlotNCR = SlotNCRs<1,I> + IF SlotNCR NE '' THEN + LOCATE SlotNCR in Result BY 'AR' USING @VM SETTING Pos ELSE + Result = INSERT(Result,1,Pos,0,SlotNCR) + END + END + NEXT I + RETURN * * * * * * * RunProdTest: * * * * * * * - -WMIKey = Parms[1,@RM] -WMIRec = Parms[COL2()+1,@RM] - -IF WMIKey = '' THEN RETURN - -IF WMIRec = '' THEN - WMIRec = XLATE('WM_IN',WMIKey,'','X') -END - -IF WMIRec = '' THEN RETURN - -CassNo = FIELD(WMIKey,'*',3) - -SlotNos = WMIRec - -SlotCnt = COUNT(SlotNos,@VM) + ( SlotNos NE '') - -Ans = '' - -FOR I = 1 TO SlotCnt - - RDSNo = WMIRec - RDSRec = XLATE('RDS',RDSNo,'','X') - Pockets = RDSRec + WMIKey = Parms[1,@RM] + WMIRec = Parms[COL2()+1,@RM] - pktCnt = COUNT(Pockets,@VM) + (Pockets NE '') + IF WMIKey = '' THEN RETURN - FOR N = 1 TO pktCnt + IF WMIRec = '' THEN + WMIRec = XLATE('WM_IN',WMIKey,'','X') + END - InCassNo = RDSRec - InSlotNo = RDSRec - PktChar = RDSRec - WfrChar = RDSRec + IF WMIRec = '' THEN RETURN + + CassNo = FIELD(WMIKey,'*',3) + + SlotNos = WMIRec + + SlotCnt = COUNT(SlotNos,@VM) + ( SlotNos NE '') + + Ans = '' + + FOR I = 1 TO SlotCnt - IF InCassNo = CassNo AND InSlotNo = I THEN + RDSNo = WMIRec + RDSRec = XLATE('RDS',RDSNo,'','X') + + Pockets = RDSRec + + pktCnt = COUNT(Pockets,@VM) + (Pockets NE '') + + FOR N = 1 TO pktCnt - IF PktChar = 'TEST' AND WfrChar = 'PROD' THEN - Ans<1,I> = 1 - END ELSE - Ans<1,I> = '' - END - END ;* End of check for matching Cassette and Slot number in the RDS - NEXT N - -NEXT I - -Result = Ans - + InCassNo = RDSRec + InSlotNo = RDSRec + PktChar = RDSRec + WfrChar = RDSRec + + IF InCassNo = CassNo AND InSlotNo = I THEN + + IF PktChar = 'TEST' AND WfrChar = 'PROD' THEN + Ans<1,I> = 1 + END ELSE + Ans<1,I> = '' + END + END ;* End of check for matching Cassette and Slot number in the RDS + NEXT N + + NEXT I + + Result = Ans + RETURN @@ -795,54 +795,54 @@ RETURN * * * * * * * RebuildUnload: * * * * * * * - -WMInID = Parms[1,@RM] - -IF WMInID = '' THEN RETURN - -WONo = WMInID[1,'*'] -ProcStep = WMInID[COL2()+1,'*'] -CassNo = WMInID[COL2()+1,'*'] - -Update_Index ("RDS", "WO", "") - -Extract_SI_Keys( 'RDS', 'WO', WONo, RDSNos ) ;* Original Code - -WOBoxCnt = COUNT( RDSNos, @VM ) + ( RDSNos NE '' ) - - -FOR I = 1 TO WOBoxCnt - RDSNo = RDSNos<1,I> - RDSRec = XLATE('RDS',RDSNo,'','X') - IF FIELD(WMInID,'*',1,2) = RDSRec THEN + WMInID = Parms[1,@RM] + + IF WMInID = '' THEN RETURN + + WONo = WMInID[1,'*'] + ProcStep = WMInID[COL2()+1,'*'] + CassNo = WMInID[COL2()+1,'*'] + + Update_Index ("RDS", "WO", "") + + Extract_SI_Keys( 'RDS', 'WO', WONo, RDSNos ) ;* Original Code + + WOBoxCnt = COUNT( RDSNos, @VM ) + ( RDSNos NE '' ) + + + FOR I = 1 TO WOBoxCnt + RDSNo = RDSNos<1,I> + RDSRec = XLATE('RDS',RDSNo,'','X') - A = RDSRec - IF INDEX(RDSRec,CassNo,1) THEN - - otParms = 'WM_IN':@RM:WMInID - WMInRec = obj_Tables('ReadRec',otParms) ;* Reads and sets lock - - IF Get_Status(errCode) THEN RETURN ;* Problems getting the lock - - FOR N = 1 TO COUNT(RDSRec,@VM) + (RDSRec NE '') - IF RDSRec = CassNo THEN - InSlotNo = RDSRec - WMInRec = InSlotNo - WMInRec = RDSNo - WMInRec = RDSRec - WMInRec = RDSRec - END - - NEXT N - - otParms = FIELDSTORE(otParms,@RM,4,0,WMInRec) - obj_Tables('WriteRec',otParms) + IF FIELD(WMInID,'*',1,2) = RDSRec THEN + A = RDSRec + IF INDEX(RDSRec,CassNo,1) THEN + + otParms = 'WM_IN':@RM:WMInID + WMInRec = obj_Tables('ReadRec',otParms) ;* Reads and sets lock + + IF Get_Status(errCode) THEN RETURN ;* Problems getting the lock + + FOR N = 1 TO COUNT(RDSRec,@VM) + (RDSRec NE '') + IF RDSRec = CassNo THEN + InSlotNo = RDSRec + WMInRec = InSlotNo + WMInRec = RDSNo + WMInRec = RDSRec + WMInRec = RDSRec + END + + NEXT N + + otParms = FIELDSTORE(otParms,@RM,4,0,WMInRec) + obj_Tables('WriteRec',otParms) + + END END - END -NEXT I - + NEXT I + RETURN @@ -850,88 +850,88 @@ RETURN RemProdTW: * * * * * * * - -WONo = Parms[1,@RM] -WOCassNo = Parms[COL2()+1,@RM] -MetNo = Parms[COL2()+1,@RM] -SlotNos = Parms[COL2()+1,@RM] - -IF WONo = '' THEN ErrorMsg = 'Null Parm "WONo" passed to routine. (':Method:')' -IF WOCassNo = '' THEN ErrorMsg = 'Null Parm "WOCassNo" passed to routine. (':Method:')' -IF MetNo = '' THEN ErrorMsg = 'Null Parm "MetNo" passed to routine. (':Method:')' -IF SlotNos = '' THEN ErrorMsg = 'Null Parm "SlotNos" passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN - -StepNo = 1 - -otParms = 'WM_IN':@RM:WONo:'*':StepNo:'*':WOCassNo - -WMInRec = obj_Tables('ReadRec',otParms) ;* Reads and sets lock - -PulledWaferIDs = '' - -IF Get_Status(errCode) THEN - NULL -END ELSE - SlotCnt = COUNT(SlotNos,@VM) + (SlotNos NE '') - PulledWaferIDs = '' - FOR I = 1 TO SlotCnt - SlotNo = SlotNos<1,I> - PulledWaferIDs<1,-1> = WONo:'.':WOCassNo:'.':SlotNo - WMInRec = MetNo - NEXT I - otParms = FIELDSTORE(otParms,@RM,4,0,WMInRec) - obj_Tables('WriteRec',otParms) + WONo = Parms[1,@RM] + WOCassNo = Parms[COL2()+1,@RM] + MetNo = Parms[COL2()+1,@RM] + SlotNos = Parms[COL2()+1,@RM] + + IF WONo = '' THEN ErrorMsg = 'Null Parm "WONo" passed to routine. (':Method:')' + IF WOCassNo = '' THEN ErrorMsg = 'Null Parm "WOCassNo" passed to routine. (':Method:')' + IF MetNo = '' THEN ErrorMsg = 'Null Parm "MetNo" passed to routine. (':Method:')' + IF SlotNos = '' THEN ErrorMsg = 'Null Parm "SlotNos" passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + StepNo = 1 + + otParms = 'WM_IN':@RM:WONo:'*':StepNo:'*':WOCassNo + + WMInRec = obj_Tables('ReadRec',otParms) ;* Reads and sets lock + + PulledWaferIDs = '' + + IF Get_Status(errCode) THEN + NULL + END ELSE + SlotCnt = COUNT(SlotNos,@VM) + (SlotNos NE '') + PulledWaferIDs = '' + FOR I = 1 TO SlotCnt + SlotNo = SlotNos<1,I> + PulledWaferIDs<1,-1> = WONo:'.':WOCassNo:'.':SlotNo + WMInRec = MetNo + NEXT I + + otParms = FIELDSTORE(otParms,@RM,4,0,WMInRec) + obj_Tables('WriteRec',otParms) + + END + + Result = PulledWaferIDs -END - -Result = PulledWaferIDs - RETURN * * * * * * * RepProdTW: * * * * * * * - -WONo = Parms[1,@RM] -WOCassNo = Parms[COL2()+1,@RM] -MetNo = Parms[COL2()+1,@RM] -WaferIDs = Parms[COL2()+1,@RM] - -IF NOT(ASSIGNED(WONo)) THEN ErrorMsg = 'Unassigned Parm "WONo" passed to routine. (':Method:')' -IF NOT(ASSIGNED(WOCassNo)) THEN ErrorMsg = 'Unassigned Parm "WOCassNo" passed to routine. (':Method:')' -IF NOT(ASSIGNED(MetNo)) THEN ErrorMsg = 'Unassigned Parm "MetNo" passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN - -StepNo = 1 - -otParms = 'WM_IN':@RM:WONo:'*':StepNo:'*':WOCassNo -WMInRec = obj_Tables('ReadRec',otParms) ;* Reads and sets lock - -IF WaferIDs = '' THEN - MetNos = WMInRec - WaferIDCnt = COUNT(MetNos,@VM) + (MetNos NE '') - - FOR I = 1 TO WaferIDCnt - IF WMInRec = MetNo THEN - WMInRec = '' - END - NEXT I -END ELSE - WaferIDCnt = COUNT(WaferIDs,',') + (WaferIDs NE '') - FOR I = 1 TO WaferIDCnt - WaferID = FIELD(WaferIDs,',',I) - SlotNo = WaferID[-1,'B.'] - WMInRec = '' - NEXT I -END - -otParms = FIELDSTORE(otParms,@RM,4,0,WMInRec) -obj_Tables('WriteRec',otParms) - + + WONo = Parms[1,@RM] + WOCassNo = Parms[COL2()+1,@RM] + MetNo = Parms[COL2()+1,@RM] + WaferIDs = Parms[COL2()+1,@RM] + + IF NOT(ASSIGNED(WONo)) THEN ErrorMsg = 'Unassigned Parm "WONo" passed to routine. (':Method:')' + IF NOT(ASSIGNED(WOCassNo)) THEN ErrorMsg = 'Unassigned Parm "WOCassNo" passed to routine. (':Method:')' + IF NOT(ASSIGNED(MetNo)) THEN ErrorMsg = 'Unassigned Parm "MetNo" passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + StepNo = 1 + + otParms = 'WM_IN':@RM:WONo:'*':StepNo:'*':WOCassNo + WMInRec = obj_Tables('ReadRec',otParms) ;* Reads and sets lock + + IF WaferIDs = '' THEN + MetNos = WMInRec + WaferIDCnt = COUNT(MetNos,@VM) + (MetNos NE '') + + FOR I = 1 TO WaferIDCnt + IF WMInRec = MetNo THEN + WMInRec = '' + END + NEXT I + END ELSE + WaferIDCnt = COUNT(WaferIDs,',') + (WaferIDs NE '') + FOR I = 1 TO WaferIDCnt + WaferID = FIELD(WaferIDs,',',I) + SlotNo = WaferID[-1,'B.'] + WMInRec = '' + NEXT I + END + + otParms = FIELDSTORE(otParms,@RM,4,0,WMInRec) + obj_Tables('WriteRec',otParms) + RETURN diff --git a/LSL2/STPROC/OBJ_WO_LOG.txt b/LSL2/STPROC/OBJ_WO_LOG.txt index d7bf85c..422bbee 100644 --- a/LSL2/STPROC/OBJ_WO_LOG.txt +++ b/LSL2/STPROC/OBJ_WO_LOG.txt @@ -49,6 +49,7 @@ $INSERT PRS_STAGE_EQUATES $INSERT PRS_LAYER_EQUATES $INSERT LOGICAL $INSERT APPCOLORS +$INSERT WM_IN_EQUATES EQU CRLF$ TO \0D0A\ EQU COMMA$ TO ',' @@ -124,7 +125,7 @@ BEGIN CASE CASE Method = 'SchedReacts' ; GOSUB SchedReacts CASE 1 ErrorMsg = 'Unknown Method ':QUOTE(Method):' passed to routine.' - + END CASE IF ErrorMsg NE '' THEN @@ -138,234 +139,234 @@ RETURN Result * * * * * * * Find: * * * * * * * - -OrderKeys = Dialog_Box( 'DIALOG_WO_FIND', @WINDOW, '' ) - -Result = OrderKeys - + + OrderKeys = Dialog_Box( 'DIALOG_WO_FIND', @WINDOW, '' ) + + Result = OrderKeys + RETURN * * * * * * * SAPCreate: * * * * * * * - -FileIn = Parms[1,@RM] - -TimeStamp = ICONV(OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTH'),'DT') - -* Create the WO_LOG Record - -ProdOrdNo = FileIn<1,1> -CustPONo = FileIn<1,2> -PromiseShipDt = FileIn<1,3> -EpiPartNo = FileIn<1,4> -SubPartNo = FileIn<1,5> -SubRevNo = FileIn<1,6> -WOQty = FileIn<1,7> -VendCd = FileIn<1,8> - -* Add Parameter checking here -> problems then log errors and message Cust Service, no problems just the message - -ErrFields = '' -ErrValues = '' -ErrDescs = '' -ErrCnt = 0 - -IF ProdOrdNo = '' THEN - ErrCnt += 1 - ErrFields<1,ErrCnt> = 'PROD_ORD_NO' - ErrDescs<1,ErrCnt> = 'Null Value' - ErrValues<1,ErrCnt> = '' -END - -IF NOT( ProdOrdNo MATCHES "'M'6N'.1'" OR ProdOrdNo MATCHES "7X'.1'" ) THEN - ErrCnt += 1 - ErrFields<1,ErrCnt> = 'PROD_ORD_NO' - ErrDescs<1,ErrCnt> = 'Incorrect Format' - ErrValues<1,ErrCnt> = ProdOrdNo -END - -* * * * * * Section added 12/2/2011 JCH for duplicate Prod_Ord_No checking from SAP - -OPEN 'DICT.WO_LOG' TO WOLogDictVar ELSE - RETURN -END - -SearchString = 'PROD_ORD_NO':@VM:ProdOrdNO:@FM -ExistingWOMatKey = '' -Option = '' -Flag = '' - -Btree.Extract(SearchString,'WO_LOG',WOLogDictVar,ExistingWOMatKey,Option,Flag) - -IF Get_Status(errCode) THEN RETURN - - -IF ExistingWOMatKey NE '' THEN - Result = 1 - RETURN ;* 3/12/2013 JCH -END - - -* * * * * * * - -IF CustPONo = '' THEN - ErrCnt += 1 - ErrFields<1,ErrCnt> = 'CUST_PO_NO' - ErrDescs<1,ErrCnt> = 'Null Value' - ErrValues<1,ErrCnt> = '' -END - -IF PromiseShipDt = '' THEN - ErrCnt += 1 - ErrFields<1,ErrCnt> = 'PROMISE_SHIP_DT' - ErrDescs<1,ErrCnt> = 'Null Value' - ErrValues<1,ErrCnt> = '' -END - -IF EpiPartNo = '' THEN - ErrCnt += 1 - ErrFields<1,ErrCnt> = 'EPI_PART_NO' - ErrDescs<1,ErrCnt> = 'Null Value' - ErrValues<1,ErrCnt> = '' -END - -IF WOQty = '' THEN - ErrCnt += 1 - ErrFields<1,ErrCnt> = 'QTY' - ErrDescs<1,ErrCnt> = 'Null Value' - ErrValues<1,ErrCnt> = '' -END - -thisPromiseShipDt = ICONV(PromiseShipDt,'D') - -IF thisPromiseShipDt = '' THEN - ErrCnt += 1 - ErrFields<1,ErrCnt> = 'PROMISE_SHIP_DT' - ErrDescs<1,ErrCnt> = 'Invalid Data' - ErrValues<1,ErrCnt> = PromiseShipDt -END - -// Check for VRM SAP part number conversion record -* Open 'DICT.EPI_PART' to hDictEpiPart then -* IntEpiPartNo = '' -* Flag = '' -* Option = 'E' ; // Suppress error messages -* SearchString = 'VARM_PART_NO':@VM:EpiPartNo:@FM -* Btree.Extract(SearchString, 'EPI_PART', hDictEpiPart, IntEpiPartNo, '', Flag) -* If Flag EQ 0 then -* If IntEpiPartNo NE '' then -* // Transate Varm part no to IFX part no -* EpiPartNo = IntEpiPartNo -* end -* end else -* ErrCnt += 1 -* ErrFields<1,ErrCnt> = 'Btree.Extract' -* ErrDescs<1,ErrCnt> = 'EPI_PART lookup failed.' -* ErrValues<1,ErrCnt> = IntEpiPartNo -* end -* end - -EpiPartRec = XLATE('EPI_PART',EpiPartNo,'','X') -ProdVerNos = EpiPartRec - -IF EpiPartRec = '' THEN - ErrCnt += 1 - ErrFields<1,ErrCnt> = 'EPI_PART_NO' - ErrDescs<1,ErrCnt> = 'Invalid EpiPart No' - ErrValues<1,ErrCnt> = EpiPartNo -END - -IF ErrFields NE '' THEN - - LogNo = NextKey('SAP_LOG') - LogRec = '' - LogRec = ICONV(OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS'),'DT') - LogRec = 'Missing or Invalid Order Release from SAP Received' - LogRec = ProdOrdNo - LogRec = ErrFields - LogRec = ErrDescs - LogRec = ErrValues - logParms = 'SAP_LOG':@RM:LogNo:@RM:@RM:LogRec - obj_Tables('WriteRec',logParms) + FileIn = Parms[1,@RM] - Recipients = Xlate('SEC_GROUPS', 'SAP_ADMIN', 'USER', 'X') - SentFrom = "SAP Posting Process" - Subject = 'SAP Error Logged ':LogNo - Message = 'Work Order Posting Error from SAP' - AttachWindow = 'SAP_LOG' - AttachKey = LogNo - SendToGroup = '' - - Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup - obj_Notes('Create',Parms) + TimeStamp = ICONV(OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTH'),'DT') - RETURN + * Create the WO_LOG Record -END ELSE - Result = 1 ;* Set to 1 if we were successful in creating the WO_LOG Record, 0 if we just logged the problems. -END - -NextWOLogNo = NextKey('WO_LOG') + ProdOrdNo = FileIn<1,1> + CustPONo = FileIn<1,2> + PromiseShipDt = FileIn<1,3> + EpiPartNo = FileIn<1,4> + SubPartNo = FileIn<1,5> + SubRevNo = FileIn<1,6> + WOQty = FileIn<1,7> + VendCd = FileIn<1,8> -WOLogRec = '' - -IF WOQty > 2475 THEN + * Add Parameter checking here -> problems then log errors and message Cust Service, no problems just the message + + ErrFields = '' + ErrValues = '' + ErrDescs = '' + ErrCnt = 0 + + IF ProdOrdNo = '' THEN + ErrCnt += 1 + ErrFields<1,ErrCnt> = 'PROD_ORD_NO' + ErrDescs<1,ErrCnt> = 'Null Value' + ErrValues<1,ErrCnt> = '' + END + + IF NOT( ProdOrdNo MATCHES "'M'6N'.1'" OR ProdOrdNo MATCHES "7X'.1'" ) THEN + ErrCnt += 1 + ErrFields<1,ErrCnt> = 'PROD_ORD_NO' + ErrDescs<1,ErrCnt> = 'Incorrect Format' + ErrValues<1,ErrCnt> = ProdOrdNo + END + + * * * * * * Section added 12/2/2011 JCH for duplicate Prod_Ord_No checking from SAP + + OPEN 'DICT.WO_LOG' TO WOLogDictVar ELSE + RETURN + END + + SearchString = 'PROD_ORD_NO':@VM:ProdOrdNO:@FM + ExistingWOMatKey = '' + Option = '' + Flag = '' + + Btree.Extract(SearchString,'WO_LOG',WOLogDictVar,ExistingWOMatKey,Option,Flag) + + IF Get_Status(errCode) THEN RETURN + + + IF ExistingWOMatKey NE '' THEN + Result = 1 + RETURN ;* 3/12/2013 JCH + END + + + * * * * * * * + + IF CustPONo = '' THEN + ErrCnt += 1 + ErrFields<1,ErrCnt> = 'CUST_PO_NO' + ErrDescs<1,ErrCnt> = 'Null Value' + ErrValues<1,ErrCnt> = '' + END + + IF PromiseShipDt = '' THEN + ErrCnt += 1 + ErrFields<1,ErrCnt> = 'PROMISE_SHIP_DT' + ErrDescs<1,ErrCnt> = 'Null Value' + ErrValues<1,ErrCnt> = '' + END + + IF EpiPartNo = '' THEN + ErrCnt += 1 + ErrFields<1,ErrCnt> = 'EPI_PART_NO' + ErrDescs<1,ErrCnt> = 'Null Value' + ErrValues<1,ErrCnt> = '' + END + + IF WOQty = '' THEN + ErrCnt += 1 + ErrFields<1,ErrCnt> = 'QTY' + ErrDescs<1,ErrCnt> = 'Null Value' + ErrValues<1,ErrCnt> = '' + END + + thisPromiseShipDt = ICONV(PromiseShipDt,'D') + + IF thisPromiseShipDt = '' THEN + ErrCnt += 1 + ErrFields<1,ErrCnt> = 'PROMISE_SHIP_DT' + ErrDescs<1,ErrCnt> = 'Invalid Data' + ErrValues<1,ErrCnt> = PromiseShipDt + END + + // Check for VRM SAP part number conversion record + * Open 'DICT.EPI_PART' to hDictEpiPart then + * IntEpiPartNo = '' + * Flag = '' + * Option = 'E' ; // Suppress error messages + * SearchString = 'VARM_PART_NO':@VM:EpiPartNo:@FM + * Btree.Extract(SearchString, 'EPI_PART', hDictEpiPart, IntEpiPartNo, '', Flag) + * If Flag EQ 0 then + * If IntEpiPartNo NE '' then + * // Transate Varm part no to IFX part no + * EpiPartNo = IntEpiPartNo + * end + * end else + * ErrCnt += 1 + * ErrFields<1,ErrCnt> = 'Btree.Extract' + * ErrDescs<1,ErrCnt> = 'EPI_PART lookup failed.' + * ErrValues<1,ErrCnt> = IntEpiPartNo + * end + * end + + EpiPartRec = XLATE('EPI_PART',EpiPartNo,'','X') + ProdVerNos = EpiPartRec + + IF EpiPartRec = '' THEN + ErrCnt += 1 + ErrFields<1,ErrCnt> = 'EPI_PART_NO' + ErrDescs<1,ErrCnt> = 'Invalid EpiPart No' + ErrValues<1,ErrCnt> = EpiPartNo + END + + IF ErrFields NE '' THEN - Recipients = Xlate('SEC_GROUPS', 'SAP_ADMIN', 'USER', 'X') ; - SentFrom = "SAP Posting Process" - Subject = 'SAP WO Qty > 2475 when received on ':LogNo - Message = 'WO Qty changed from ':WOQty:' to 2475 (SAP Maximum) prior to WO_LOG record creation' - AttachWindow = 'SAP_LOG' - AttachKey = LogNo + LogNo = NextKey('SAP_LOG') + LogRec = '' + LogRec = ICONV(OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS'),'DT') + LogRec = 'Missing or Invalid Order Release from SAP Received' + LogRec = ProdOrdNo + LogRec = ErrFields + LogRec = ErrDescs + LogRec = ErrValues + + logParms = 'SAP_LOG':@RM:LogNo:@RM:@RM:LogRec + obj_Tables('WriteRec',logParms) + + Recipients = Xlate('SEC_GROUPS', 'SAP_ADMIN', 'USER', 'X') + SentFrom = "SAP Posting Process" + Subject = 'SAP Error Logged ':LogNo + Message = 'Work Order Posting Error from SAP' + AttachWindow = 'SAP_LOG' + AttachKey = LogNo + SendToGroup = '' + + Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup + obj_Notes('Create',Parms) + + RETURN + + END ELSE + Result = 1 ;* Set to 1 if we were successful in creating the WO_LOG Record, 0 if we just logged the problems. + END + + NextWOLogNo = NextKey('WO_LOG') + + WOLogRec = '' + + IF WOQty > 2475 THEN + + Recipients = Xlate('SEC_GROUPS', 'SAP_ADMIN', 'USER', 'X') ; + SentFrom = "SAP Posting Process" + Subject = 'SAP WO Qty > 2475 when received on ':LogNo + Message = 'WO Qty changed from ':WOQty:' to 2475 (SAP Maximum) prior to WO_LOG record creation' + AttachWindow = 'SAP_LOG' + AttachKey = LogNo + SendToGroup = '' + + Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup + obj_Notes('Create',Parms) + + WOQty = 2475 ;* Don't throw an error for this just set the qty to 2475 + + + END ;* End of check for maximum SAP WO Qty. This is 99 cassettes + + + WOLogRec = 'SAP' + WOLogRec = Date() + WOLogRec = WOQty + WOLogRec = WOQty + WOLogRec = EpiPartNo + WOLogRec = ICONV(PromiseShipDt,'D') + WOLogRec = ProdOrdNo + WOLogRec = SubPartNo + WOLogRec = SubRevNo + WOLogRec = CustPONo + WOLogRec = 'S' ;* Originated from SAP System + WOLogRec = 'P3' ;* + WOLogRec = VendCd ;* Added 4/4/2014 JCH + + obj_Tables('WriteRec','WO_LOG':@RM:NextWOLogNo:@RM:@RM:WOLogRec) ;* WO Record created + + CustType = XLATE('EPI_PART',EpiPartNo,'CUST_TYPE','X')<1,1> + + Recipients = XLATE('NOTIFICATION','WO_ENTRY',NOTIFICATION_USER_ID$,'X') + SentFrom = @USER4 + Message = CustType:' WO ':NextWOLogNo:' (ProdOrder ':ProdOrdNo:') Created' + NewForm = Xlate('APP_INFO', 'NEW_WO_FORM', '', 'X') + If NewForm then + AttachWindow = 'NDW_WO_LOG' + end else + AttachWindow = 'WO_LOG2' + end + AttachKey = NextWOLogNo SendToGroup = '' - + + Subject = CustType:' WO ':NextWOLogNo:' (ProdOrder ':ProdOrdNo:') Created' + Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup obj_Notes('Create',Parms) - WOQty = 2475 ;* Don't throw an error for this just set the qty to 2475 - - -END ;* End of check for maximum SAP WO Qty. This is 99 cassettes - - -WOLogRec = 'SAP' -WOLogRec = Date() -WOLogRec = WOQty -WOLogRec = WOQty -WOLogRec = EpiPartNo -WOLogRec = ICONV(PromiseShipDt,'D') -WOLogRec = ProdOrdNo -WOLogRec = SubPartNo -WOLogRec = SubRevNo -WOLogRec = CustPONo -WOLogRec = 'S' ;* Originated from SAP System -WOLogRec = 'P3' ;* -WOLogRec = VendCd ;* Added 4/4/2014 JCH - -obj_Tables('WriteRec','WO_LOG':@RM:NextWOLogNo:@RM:@RM:WOLogRec) ;* WO Record created - -CustType = XLATE('EPI_PART',EpiPartNo,'CUST_TYPE','X')<1,1> - -Recipients = XLATE('NOTIFICATION','WO_ENTRY',NOTIFICATION_USER_ID$,'X') -SentFrom = @USER4 -Message = CustType:' WO ':NextWOLogNo:' (ProdOrder ':ProdOrdNo:') Created' -NewForm = Xlate('APP_INFO', 'NEW_WO_FORM', '', 'X') -If NewForm then - AttachWindow = 'NDW_WO_LOG' -end else - AttachWindow = 'WO_LOG2' -end -AttachKey = NextWOLogNo -SendToGroup = '' - -Subject = CustType:' WO ':NextWOLogNo:' (ProdOrder ':ProdOrdNo:') Created' - -Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup -obj_Notes('Create',Parms) - RETURN @@ -373,465 +374,465 @@ RETURN * * * * * * * SetWOSteps: * * * * * * * - -* This has moved to the Route method for SAP - -WONo = Parms[1,@RM] - -IF WONo = '' THEN RETURN - -otParms = 'WO_LOG':@RM:WONo -WOLogRec = obj_Tables('ReadRec',otParms) - -IF Get_Status(errCode) THEN RETURN - -ProdVerNo = WOLogRec - -ProdVerRec = XLATE('PROD_VER',ProdVerNo,'','X') - -ProcSteps = ProdVerRec -ProcPSNs = ProdVerRec -ProcDescs = ProdVerRec - -ProcPSNStatuses = XLATE('PROD_SPEC',ProcPSNs,PROD_SPEC_STATUS$,'X') - -FOR P = 1 TO COUNT(ProcPSNStatuses,@VM) + (ProcPSNStatuses NE '') - IF ProcPSNStatuses<1,P> NE 'A' THEN - ErrorMsg = 'Inactive Product Spec on Prod Ver No.' - obj_Tables('UnlockRec',otParms) + + * This has moved to the Route method for SAP + + WONo = Parms[1,@RM] + + IF WONo = '' THEN RETURN + + otParms = 'WO_LOG':@RM:WONo + WOLogRec = obj_Tables('ReadRec',otParms) + + IF Get_Status(errCode) THEN RETURN + + ProdVerNo = WOLogRec + + ProdVerRec = XLATE('PROD_VER',ProdVerNo,'','X') + + ProcSteps = ProdVerRec + ProcPSNs = ProdVerRec + ProcDescs = ProdVerRec + + ProcPSNStatuses = XLATE('PROD_SPEC',ProcPSNs,PROD_SPEC_STATUS$,'X') + + FOR P = 1 TO COUNT(ProcPSNStatuses,@VM) + (ProcPSNStatuses NE '') + IF ProcPSNStatuses<1,P> NE 'A' THEN + ErrorMsg = 'Inactive Product Spec on Prod Ver No.' + obj_Tables('UnlockRec',otParms) - RETURN - END -NEXT P - -DefWMOCassQtys = XLATE('PROD_SPEC',ProcPSNs,PROD_SPEC_WMO_LOAD_CNT$,'X') - -WOStepKeys = '' -DefWMOCassQty = '' - -FOR N = 1 TO COUNT(ProcSteps,@VM) + (ProcSteps NE '') - - ProcStep = ProcSteps<1,N> - ProcPSN = ProcPSNs<1,N> - ProcDesc = ProcDescs<1,N> + RETURN + END + NEXT P - obj_WO_Step('Create',WONo:@RM:ProcStep:@RM:ProcPSN:@RM:ProcDesc) + DefWMOCassQtys = XLATE('PROD_SPEC',ProcPSNs,PROD_SPEC_WMO_LOAD_CNT$,'X') - IF DefWMOCassQtys<1,N> NE '' THEN DefWMOCassQty = DefWMOCassQtys<1,N> + WOStepKeys = '' + DefWMOCassQty = '' - WOStepKeys<1,N> = WONo:'*':ProcStep + FOR N = 1 TO COUNT(ProcSteps,@VM) + (ProcSteps NE '') + + ProcStep = ProcSteps<1,N> + ProcPSN = ProcPSNs<1,N> + ProcDesc = ProcDescs<1,N> + + obj_WO_Step('Create',WONo:@RM:ProcStep:@RM:ProcPSN:@RM:ProcDesc) + + IF DefWMOCassQtys<1,N> NE '' THEN DefWMOCassQty = DefWMOCassQtys<1,N> + + WOStepKeys<1,N> = WONo:'*':ProcStep + + NEXT N + + WOLogRec = DefWMOCassQty + + otParms = FieldStore(otParms,@RM,4,1,WOLogRec) + obj_Tables('WriteRec',otParms) -NEXT N - -WOLogRec = DefWMOCassQty - -otParms = FieldStore(otParms,@RM,4,1,WOLogRec) -obj_Tables('WriteRec',otParms) - RETURN * * * * * * * Create: * * * * * * * - -OrderNo = Parms[1,@RM] -OrderItemNos = Parms[COL2()+1,@RM] -QuoteNo = Parms[COL2()+1,@RM] - -IF OrderNo = '' OR OrderItemNos = '' OR QuoteNo = '' THEN RETURN - -QuoteRec = XLATE('QUOTE',QuoteNo,'','X') - -ProcSteps = QuoteRec -ProcPSNs = QuoteRec -ProcDescs = QuoteRec - - -ProcPSNStatuses = XLATE('PROD_SPEC',ProcPSNs,PROD_SPEC_STATUS$,'X') - -FOR I = 1 TO COUNT(ProcPSNStatuses,@VM) + (ProcPSNStatuses NE '') - IF ProcPSNStatuses<1,I> NE 'A' THEN - ErrorMsg = "The Process Step PSN ":QUOTE(ProcPSNs<1,I>):" on this Quote is Inactive.":CRLF$:CRLF$:"Unable to Create a Work Order." - RETURN - END -NEXT I - -NextWOLogNo = NextKey('WO_LOG') - -UserName = @USER4 - -WOLogRec = '' -WOLogRec = OrderNo -WOLogRec = OrderItemNos -WOLogRec = UserName -WOLogRec = Date() -WOLogRec = QuoteNo -WOLogRec = 'M' ;* Work Originated in Mesa MES system - -* Following updated 9/1/2011 JCH ********************************* - -WOQty = '' -ProdVerNo = '' - -FOR I = 1 TO COUNT(OrderItemNos,@VM) + (OrderItemNos NE '') - IF I = 1 THEN - OrderDetRec = XLATE('ORDER_DET',OrderNo:'*':OrderItemNos<1,I>,'','X') + + OrderNo = Parms[1,@RM] + OrderItemNos = Parms[COL2()+1,@RM] + QuoteNo = Parms[COL2()+1,@RM] + + IF OrderNo = '' OR OrderItemNos = '' OR QuoteNo = '' THEN RETURN + + QuoteRec = XLATE('QUOTE',QuoteNo,'','X') + + ProcSteps = QuoteRec + ProcPSNs = QuoteRec + ProcDescs = QuoteRec + + + ProcPSNStatuses = XLATE('PROD_SPEC',ProcPSNs,PROD_SPEC_STATUS$,'X') + + FOR I = 1 TO COUNT(ProcPSNStatuses,@VM) + (ProcPSNStatuses NE '') + IF ProcPSNStatuses<1,I> NE 'A' THEN + ErrorMsg = "The Process Step PSN ":QUOTE(ProcPSNs<1,I>):" on this Quote is Inactive.":CRLF$:CRLF$:"Unable to Create a Work Order." + RETURN + END + NEXT I + + NextWOLogNo = NextKey('WO_LOG') + + UserName = @USER4 + + WOLogRec = '' + WOLogRec = OrderNo + WOLogRec = OrderItemNos + WOLogRec = UserName + WOLogRec = Date() + WOLogRec = QuoteNo + WOLogRec = 'M' ;* Work Originated in Mesa MES system + + * Following updated 9/1/2011 JCH ********************************* + + WOQty = '' + ProdVerNo = '' + + FOR I = 1 TO COUNT(OrderItemNos,@VM) + (OrderItemNos NE '') + IF I = 1 THEN + OrderDetRec = XLATE('ORDER_DET',OrderNo:'*':OrderItemNos<1,I>,'','X') + + WOLogRec = OrderDetRec + WOLogRec = OrderDetRec + WOLogRec = OrderDetRec + WOLogRec = OrderDetRec + WOLogRec = OrderDetRec + WOLogRec = OrderDetRec + END + WOQty += XLATE('ORDER_DET',OrderNo:'*':OrderItemNos<1,I>,ORDER_DET_ITEM_QTY$,'X') - WOLogRec = OrderDetRec - WOLogRec = OrderDetRec - WOLogRec = OrderDetRec - WOLogRec = OrderDetRec - WOLogRec = OrderDetRec - WOLogRec = OrderDetRec + NEXT I + + WOLogRec = WOQty + + * end of new code ************************************************** + + + WOLogRec = QuoteRec ;* Changed from ORDER table 9/1/2005 JCH - J.C. Henry & Co., Inc. + + DefWMOCassQtys = XLATE('PROD_SPEC',ProcPSNs,PROD_SPEC_WMO_LOAD_CNT$,'X') + DefWMOCassQty = '' + + FOR I = 1 TO COUNT(ProcSteps,@VM) + (ProcSteps NE '') + + ProcStep = ProcSteps<1,I> + ProcPSN = ProcPSNs<1,I> + ProcDesc = ProcDescs<1,I> + + obj_WO_Step('Create',NextWOLogNo:@RM:ProcStep:@RM:ProcPSN:@RM:ProcDesc) + + IF DefWMOCassQtys<1,I> NE '' THEN DefWMOCassQty = DefWMOCassQtys<1,I> + + NEXT I + + WOLogRec = DefWMOCassQty + + obj_Tables('WriteRec','WO_LOG':@RM:NextWOLogNo:@RM:@RM:WOLogRec) ;* WO Record created + + Recipients = XLATE('NOTIFICATION','WO_ENTRY',NOTIFICATION_USER_ID$,'X') + SentFrom = @USER4 + Subject = 'New Work Order Created ':NextWOLogNo + Message = 'New Work Order Created.' + NewForm = Xlate('APP_INFO', 'NEW_WO_FORM', '', 'X') + If NewForm then + AttachWindow = 'NDW_WO_LOG' + end else + AttachWindow = 'WO_LOG2' + end + AttachKey = NextWOLogNo + SendToGroup = '' + + Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup + obj_Notes('Create',Parms) + * 7/11/19 - TODO - create similar notification mechanism for Priscila's GaN team for GaN related work orders + IF Get_Status(errCode) THEN + ErrMsg(errCode) END - WOQty += XLATE('ORDER_DET',OrderNo:'*':OrderItemNos<1,I>,ORDER_DET_ITEM_QTY$,'X') - -NEXT I - -WOLogRec = WOQty - -* end of new code ************************************************** - - -WOLogRec = QuoteRec ;* Changed from ORDER table 9/1/2005 JCH - J.C. Henry & Co., Inc. - -DefWMOCassQtys = XLATE('PROD_SPEC',ProcPSNs,PROD_SPEC_WMO_LOAD_CNT$,'X') -DefWMOCassQty = '' - -FOR I = 1 TO COUNT(ProcSteps,@VM) + (ProcSteps NE '') - - ProcStep = ProcSteps<1,I> - ProcPSN = ProcPSNs<1,I> - ProcDesc = ProcDescs<1,I> - obj_WO_Step('Create',NextWOLogNo:@RM:ProcStep:@RM:ProcPSN:@RM:ProcDesc) + IF Get_Status(errCode) ELSE Result = NextWOLogNo - IF DefWMOCassQtys<1,I> NE '' THEN DefWMOCassQty = DefWMOCassQtys<1,I> - -NEXT I - -WOLogRec = DefWMOCassQty - -obj_Tables('WriteRec','WO_LOG':@RM:NextWOLogNo:@RM:@RM:WOLogRec) ;* WO Record created - -Recipients = XLATE('NOTIFICATION','WO_ENTRY',NOTIFICATION_USER_ID$,'X') -SentFrom = @USER4 -Subject = 'New Work Order Created ':NextWOLogNo -Message = 'New Work Order Created.' -NewForm = Xlate('APP_INFO', 'NEW_WO_FORM', '', 'X') -If NewForm then - AttachWindow = 'NDW_WO_LOG' -end else - AttachWindow = 'WO_LOG2' -end -AttachKey = NextWOLogNo -SendToGroup = '' - -Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup -obj_Notes('Create',Parms) -* 7/11/19 - TODO - create similar notification mechanism for Priscila's GaN team for GaN related work orders -IF Get_Status(errCode) THEN - ErrMsg(errCode) -END - -IF Get_Status(errCode) ELSE Result = NextWOLogNo - RETURN * * * * * * * Delete: * * * * * * * - -WONo = Parms[1,@RM] - -IF WONo = '' THEN ErrorMsg = 'Null parameter WONo passed to routine (':Method:').' -IF ErrorMsg NE '' THEN RETURN - -WOLogRec = XLATE('WO_LOG',WONo,'','X') -WOStepKeys = WOLogRec - -FOR I = 1 TO COUNT(WOStepKeys,@VM) + (WOStepKeys NE '') - WOStepRec = XLATE('WO_STEP',WOStepKeys<1,I>,'','X') - - IF WOStepRec NE '' THEN - ErrorMsg = 'Work Order Step currently has RDS records attached and may not be deleted.' - END - - IF WOStepRec NE '' THEN - ErrorMsg = 'Work Order Step currently has WM_IN records attached and may not be deleted.' - END - - IF WOStepRec NE '' THEN - ErrorMsg = 'Work Order Step currently has WM_OUT records attached and may not be deleted.' - END - IF ErrorMsg NE '' THEN RETURN -NEXT I - - -FOR I = 1 TO COUNT(WOStepKeys,@VM) + (WOStepKeys NE '') - WOStepKey = WOStepKeys<1,I> - CONVERT '*' TO @RM IN WOStepKey - Set_Status(0) - obj_WO_Step('Delete',WOStepKey) - IF Get_Status(errCode) THEN RETURN -NEXT I - -TableVar = '' -OtParms = 'WO_LOG':@RM:WONo:@RM:TableVar -WOLogRec = obj_Tables('DeleteRec',OtParms) ;* Locks and reads record for update - -IF Get_Status(errCode) THEN ErrMsg(errCode) - + WONo = Parms[1,@RM] + + IF WONo = '' THEN ErrorMsg = 'Null parameter WONo passed to routine (':Method:').' + IF ErrorMsg NE '' THEN RETURN + + WOLogRec = XLATE('WO_LOG',WONo,'','X') + WOStepKeys = WOLogRec + + FOR I = 1 TO COUNT(WOStepKeys,@VM) + (WOStepKeys NE '') + WOStepRec = XLATE('WO_STEP',WOStepKeys<1,I>,'','X') + + IF WOStepRec NE '' THEN + ErrorMsg = 'Work Order Step currently has RDS records attached and may not be deleted.' + END + + IF WOStepRec NE '' THEN + ErrorMsg = 'Work Order Step currently has WM_IN records attached and may not be deleted.' + END + + IF WOStepRec NE '' THEN + ErrorMsg = 'Work Order Step currently has WM_OUT records attached and may not be deleted.' + END + + IF ErrorMsg NE '' THEN RETURN + NEXT I + + + FOR I = 1 TO COUNT(WOStepKeys,@VM) + (WOStepKeys NE '') + WOStepKey = WOStepKeys<1,I> + CONVERT '*' TO @RM IN WOStepKey + Set_Status(0) + obj_WO_Step('Delete',WOStepKey) + IF Get_Status(errCode) THEN RETURN + NEXT I + + TableVar = '' + OtParms = 'WO_LOG':@RM:WONo:@RM:TableVar + WOLogRec = obj_Tables('DeleteRec',OtParms) ;* Locks and reads record for update + + IF Get_Status(errCode) THEN ErrMsg(errCode) + RETURN * * * * * * * CurrStatus: * * * * * * * - -IF NOT(ASSIGNED(WONo)) THEN WONo = Parms[1,@RM] -IF NOT(ASSIGNED(WORec)) THEN WORec = Parms[COL2()+1,@RM] - -IF WONo = '' THEN RETURN ;* This is used in the dictionary -> don't throw an error for a null parmeter - -IF WORec= '' THEN WORec = XLATE('WO_LOG',WONo,'','X') - -IF WORec NE '' THEN - Result = 'CL' ;* Manual Close - RETURN -END - -IF WORec = '' AND WORec = '' THEN - Result = 'NORD' ;* Junk from conversion - RETURN -END - -IF WORec NE '' AND WORec = '' THEN - Result = 'UNR' - RETURN -END - -WOQty = WORec - -GOSUB ShipQty - -ShipQty = Result - -StaticShipQty = WORec - -If ShipQty NE StaticShipQty then - // Log the discrepancy - LogData = '' - LogData<1> = LoggingDTM - LogData<2> = @User4 - LogData<3> = WONo - LogData<4> = ShipQty - LogData<5> = StaticShipQty - Logging_Services('AppendLog', objShipQtyLog, LogData, @RM, @FM) -end - -IF ShipQty = '' THEN ShipQty = 0 - -Result = '' - - -StepKeys = WORec -FirstStepRDSKeys = XLATE('WO_STEP',StepKeys<1,1>,WO_STEP_RDS_KEY$,'X') - -FirstWOMatKey = WORec - -FirstWOMatRelDTM = XLATE('WO_MAT',FirstWOMatKey,WO_MAT_REL_DTM$,'X') -FirstWOMatRxDTM = XLATE('WO_MAT',FirstWOMatKey,WO_MAT_RX_DTM$,'X') - -IF FirstWOMatRelDTM NE '' OR FirstStepRDSKeys NE '' THEN - - IF 1=0 THEN - StepKeys = WORec - StepStatusCodes = XLATE('WO_STEP',StepKeys,'CURR_STATUS','X') - - StepCnt = COUNT(StepKeys,@VM) + (StepKeys NE '') - - IF StepCnt > 1 THEN - LastStatus = StepStatusCodes<1,StepCnt> ;* 8/10/2009 - IF LastStatus = 'RX' THEN - Result = StepStatusCodes<1,(StepCnt - 1)> + IF NOT(ASSIGNED(WONo)) THEN WONo = Parms[1,@RM] + IF NOT(ASSIGNED(WORec)) THEN WORec = Parms[COL2()+1,@RM] + + IF WONo = '' THEN RETURN ;* This is used in the dictionary -> don't throw an error for a null parmeter + + IF WORec= '' THEN WORec = XLATE('WO_LOG',WONo,'','X') + + IF WORec NE '' THEN + Result = 'CL' ;* Manual Close + RETURN + END + + IF WORec = '' AND WORec = '' THEN + Result = 'NORD' ;* Junk from conversion + RETURN + END + + IF WORec NE '' AND WORec = '' THEN + Result = 'UNR' + RETURN + END + + WOQty = WORec + + GOSUB ShipQty + + ShipQty = Result + + StaticShipQty = WORec + + If ShipQty NE StaticShipQty then + // Log the discrepancy + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = @User4 + LogData<3> = WONo + LogData<4> = ShipQty + LogData<5> = StaticShipQty + Logging_Services('AppendLog', objShipQtyLog, LogData, @RM, @FM) + end + + IF ShipQty = '' THEN ShipQty = 0 + + Result = '' + + + StepKeys = WORec + FirstStepRDSKeys = XLATE('WO_STEP',StepKeys<1,1>,WO_STEP_RDS_KEY$,'X') + + FirstWOMatKey = WORec + + FirstWOMatRelDTM = XLATE('WO_MAT',FirstWOMatKey,WO_MAT_REL_DTM$,'X') + FirstWOMatRxDTM = XLATE('WO_MAT',FirstWOMatKey,WO_MAT_RX_DTM$,'X') + + IF FirstWOMatRelDTM NE '' OR FirstStepRDSKeys NE '' THEN + + IF 1=0 THEN + + StepKeys = WORec + StepStatusCodes = XLATE('WO_STEP',StepKeys,'CURR_STATUS','X') + + StepCnt = COUNT(StepKeys,@VM) + (StepKeys NE '') + + IF StepCnt > 1 THEN + LastStatus = StepStatusCodes<1,StepCnt> ;* 8/10/2009 + IF LastStatus = 'RX' THEN + Result = StepStatusCodes<1,(StepCnt - 1)> + END ELSE + Result = LastStatus + END END ELSE - Result = LastStatus + Result = StepStatusCodes + END + RETURN + END ELSE + + BEGIN CASE + CASE ShipQty = 0 ; Result = 'INPR' + CASE ShipQty < WOQty ; Result = 'SHIP' + CASE ShipQty >= WOQty ; Result = 'COMP' + END CASE + + IF Result NE '' THEN RETURN + + IF FirstWOMatRelDTM NE '' THEN + Result = 'REL' + RETURN + END + + IF FirstWOMatRxDTM NE '' THEN + Result = 'AWR' + RETURN + END + END + END + + + IF WORec = '' THEN + * Material not here yet + + /* + OrderNo = WORec + IF OrderNo = '' THEN + Result = 'NORD' + RETURN + END + + FirstOrderItem = WORec<1,1> + IF FirstOrderItem = '' THEN + Result = 'INC' + RETURN + END + */ + + EpiPN = WORec + + + SubSuppliedby = XLATE('EPI_PART',EpiPN,EPI_PART_SUB_SUPP_BY$,'X') + CustLotNos = WORec + IF SubSuppliedBy = 'C' THEN + IF CustLotNos = '' THEN + Result = 'ASN' + END ELSE + Result = 'AWM' END END ELSE - Result = StepStatusCodes + Result = 'RTP' END - RETURN - END ELSE - - BEGIN CASE - CASE ShipQty = 0 ; Result = 'INPR' - CASE ShipQty < WOQty ; Result = 'SHIP' - CASE ShipQty >= WOQty ; Result = 'COMP' - END CASE - - IF Result NE '' THEN RETURN - IF FirstWOMatRelDTM NE '' THEN - Result = 'REL' - RETURN - END - - IF FirstWOMatRxDTM NE '' THEN - Result = 'AWR' - RETURN - END + + + END -END - - -IF WORec = '' THEN - * Material not here yet - /* - OrderNo = WORec - IF OrderNo = '' THEN - Result = 'NORD' + IF Result NE '' THEN RETURN + + IF FirstWOMatRelDTM NE '' THEN + Result = 'REL' RETURN END - FirstOrderItem = WORec<1,1> - IF FirstOrderItem = '' THEN - Result = 'INC' + IF FirstWOMatRxDTM NE '' THEN + Result = 'AWR' RETURN END - */ - - EpiPN = WORec - SubSuppliedby = XLATE('EPI_PART',EpiPN,EPI_PART_SUB_SUPP_BY$,'X') - CustLotNos = WORec - IF SubSuppliedBy = 'C' THEN - IF CustLotNos = '' THEN - Result = 'ASN' - END ELSE - Result = 'AWM' - END - END ELSE - Result = 'RTP' - END - - -END - -IF Result NE '' THEN RETURN - -IF FirstWOMatRelDTM NE '' THEN - Result = 'REL' - RETURN -END - -IF FirstWOMatRxDTM NE '' THEN - Result = 'AWR' - RETURN -END - - - - -IF Result = '' THEN Result = 'INC' - - + IF Result = '' THEN Result = 'INC' + + RETURN * * * * * * * OpenWONos: * * * * * * * - -OPEN 'WO_LOG' TO WOLogTable ELSE - ErrorMsg = 'Unable to Open WO_LOG table in obj_WO_LOG for index lookup' - RETURN -END - -OPEN 'DICT.WO_LOG' TO DictWOLogTable ELSE - RETURN -END - -MsgUp = Msg(@WINDOW,'','SELECT_OPEN_WO') - - -WOKeys = '' - -* SelectStatement = 'CURR_STATUS':@VM:'RX':@VM:'INPR':@VM:'RTS':@VM:'SHIP':@VM:'HOLD':@FM ;* Inactivated by dkk 4/3/14 -SelectStatement = 'WO_STATUS':@VM:'OPEN':@FM ;* Added by dkk 4/3/14 - -Btree.Extract(SelectStatement,'WO_LOG',DictWOLogTable,WOKeys,'','') - -IF Get_Status(errCode) THEN - ErrMsg(errCode) + + OPEN 'WO_LOG' TO WOLogTable ELSE + ErrorMsg = 'Unable to Open WO_LOG table in obj_WO_LOG for index lookup' + RETURN + END + + OPEN 'DICT.WO_LOG' TO DictWOLogTable ELSE + RETURN + END + + MsgUp = Msg(@WINDOW,'','SELECT_OPEN_WO') + + + WOKeys = '' + + * SelectStatement = 'CURR_STATUS':@VM:'RX':@VM:'INPR':@VM:'RTS':@VM:'SHIP':@VM:'HOLD':@FM ;* Inactivated by dkk 4/3/14 + SelectStatement = 'WO_STATUS':@VM:'OPEN':@FM ;* Added by dkk 4/3/14 + + Btree.Extract(SelectStatement,'WO_LOG',DictWOLogTable,WOKeys,'','') + + IF Get_Status(errCode) THEN + ErrMsg(errCode) + Msg(@WINDOW,MsgUp) + RETURN + END + Msg(@WINDOW,MsgUp) - RETURN -END - -Msg(@WINDOW,MsgUp) - -TypeOver = '' -TypeOver = WOKeys -TypeOver = 'K' - -WONo = Popup(@WINDOW,TypeOver,'OPEN_WORK_ORDERS') - -IF Get_Status(errCode) THEN - ErrMsg(errCode) - RETURN -END - -Result = WONo - + + TypeOver = '' + TypeOver = WOKeys + TypeOver = 'K' + + WONo = Popup(@WINDOW,TypeOver,'OPEN_WORK_ORDERS') + + IF Get_Status(errCode) THEN + ErrMsg(errCode) + RETURN + END + + Result = WONo + RETURN * * * * * * * ShipWONos: * * * * * * * - -OPEN 'WO_LOG' TO WOLogTable ELSE - RETURN -END - -MsgUp = Msg(@WINDOW,'','SELECT_OPEN_WO') - -IF Get_Status(errCode) THEN RETURN - -SelectStatement = 'SELECT WO_LOG WITH CURR_STATUS = "INPR" ' -SelectStatement := ' OR WITH CURR_STATUS = "RTS"' -SelectStatement := ' OR WITH CURR_STATUS = "SHIP"' -SelectStatement := ' OR WITH CURR_STATUS = "HOLD"' -SelectStatement := ' BY COMMIT_DATE' - - -RList(SelectStatement, TARGET_ACTIVELIST$, '','','') - -IF Get_Status(errCode) THEN - ErrMsg(errCode) + + OPEN 'WO_LOG' TO WOLogTable ELSE + RETURN + END + + MsgUp = Msg(@WINDOW,'','SELECT_OPEN_WO') + + IF Get_Status(errCode) THEN RETURN + + SelectStatement = 'SELECT WO_LOG WITH CURR_STATUS = "INPR" ' + SelectStatement := ' OR WITH CURR_STATUS = "RTS"' + SelectStatement := ' OR WITH CURR_STATUS = "SHIP"' + SelectStatement := ' OR WITH CURR_STATUS = "HOLD"' + SelectStatement := ' BY COMMIT_DATE' + + + RList(SelectStatement, TARGET_ACTIVELIST$, '','','') + + IF Get_Status(errCode) THEN + ErrMsg(errCode) + Msg(@WINDOW,MsgUp) + RETURN + END + Msg(@WINDOW,MsgUp) - RETURN -END - -Msg(@WINDOW,MsgUp) - -WONo = Popup(@WINDOW,TypeOver,'OPEN_WORK_ORDERS') - -IF Get_Status(errCode) THEN - ErrMsg(errCode) - RETURN -END - -Result = WONo - + + WONo = Popup(@WINDOW,TypeOver,'OPEN_WORK_ORDERS') + + IF Get_Status(errCode) THEN + ErrMsg(errCode) + RETURN + END + + Result = WONo + RETURN @@ -840,537 +841,537 @@ RETURN * * * * * * * WOStepStatus: * * * * * * * - -* Method to maintain WO_STEP Status codes from the WO_Step table. - -WONo = Parms[1,@RM] -WOStepKey = Parms[COL2()+1,@RM] -CurrStatus = Parms[COL2()+1,@RM] - -IF WONo = '' THEN RETURN ;* Called from dictionary so don't throw an error -IF WOStepKey = '' THEN RETURN - -TableVar = '' -OtParms = 'WO_LOG':@RM:WONo:@RM:TableVar -WOLogRec = obj_Tables('ReadRec',OtParms) ;* Locks and reads record for update - -LOCATE WOStepKey IN WOLogRec USING @VM SETTING Pos THEN - WOLogRec = CurrStatus - OtParms = FieldStore(OtParms,@RM,4,1,WOLogRec) - obj_Tables('WriteRec',OtParms) -END ELSE - obj_Tables('UnlockRec',OtParms) -END - + + * Method to maintain WO_STEP Status codes from the WO_Step table. + + WONo = Parms[1,@RM] + WOStepKey = Parms[COL2()+1,@RM] + CurrStatus = Parms[COL2()+1,@RM] + + IF WONo = '' THEN RETURN ;* Called from dictionary so don't throw an error + IF WOStepKey = '' THEN RETURN + + TableVar = '' + OtParms = 'WO_LOG':@RM:WONo:@RM:TableVar + WOLogRec = obj_Tables('ReadRec',OtParms) ;* Locks and reads record for update + + LOCATE WOStepKey IN WOLogRec USING @VM SETTING Pos THEN + WOLogRec = CurrStatus + OtParms = FieldStore(OtParms,@RM,4,1,WOLogRec) + obj_Tables('WriteRec',OtParms) + END ELSE + obj_Tables('UnlockRec',OtParms) + END + RETURN * * * * * * * ReleaseCassettes: * * * * * * * - -WONo = Parms[1,@RM] -CassNos = Parms[COL2()+1,@RM] - -LogData = '' -LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') -LogData<2> = @User4 -LogData<3> = WONo -LogData<4> = 'Beginning ReleaseCassettes routine.' -Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) - -IF WONo = '' THEN ErrorMsg = 'Null parameter WONo passed to routine (':Method:').' -IF ErrorMsg NE '' THEN RETURN - -NewForm = Xlate('APP_INFO', 'NEW_WO_FORM', '', 'X') -If NewForm then - Form = 'NDW_WO_LOG' -end else - Form = 'WO_LOG2' -end -OrgColor = Set_Property(Form:'.STATUSLINE_FIX','BACKCOLOR',YELLOW$) ;* //////// Messaging - -TableVar = '' -OtParms = 'WO_LOG':@RM:WONo:@RM:TableVar -WORec = obj_Tables('ReadRec',OtParms) ;* Locks and reads record for update - -* Added 5/21/2015 JCH to check for previous releases on this work order - -WOMatKeys = WORec - -IF Get_Status(errCode) THEN Return - -OrderNo = WORec -OrderItems = WORec -CustNo = WORec -PromiseDt = WORec -WOStepKeys = WORec -EPIPartNo = WORec -ReactType = WORec ;* Added 5/28/2016 JCH - -IF OrderNo = '' AND ProdVerNo = '' THEN ErrorMsg = 'Both Order No and Prod Ver No blank on Work Order. WO Not Released. (':Method:')' - -IF CustNo = '' THEN ErrorMsg = 'No Cust Number on Work Order. WO Not Released. (':Method:')' -IF WOStepKeys = '' THEN ErrorMsg = 'Missing WO Step Keys. WO Not Released. (':Method:')' - -IF ErrorMsg NE '' THEN - obj_Tables('UnlockRec',OtParms) - - RETURN -END - - -* * * * * * * * * * * * * * * * * * * * * * * * * * - -IF ProdVerNo NE '' THEN - - ReactorType = XLATE('PROD_VER',ProdVerNo,PROD_VER_REACT_TYPE$,'X') - IF ReactorType NE 'EPP' THEN - - IF WORec = '' THEN - CurrDTM = ICONV(OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTHS'),'DT') - WORec = CurrDTM - END - END -END - -* * * * * * * * * * * * * * * * * * * * * * * * * * * - -Send_Info("Collecting Data for release...") ;* //////// Messaging - -IF OrderNo = '' THEN - OrderWaferQty = WORec - PONo = WORec - VisionOrderNo = WORec ;* SAP Production Order Number - VisionLineNos = '' - WMOLoadQty = XLATE('CUST_EPI_PART',CustNo:'*':EPIPartNo,CUST_EPI_PART_WMO_LOAD_CNT$,'X') - -END ELSE - - OrderRec = XLATE('ORDER',OrderNo,'','X') - OrderWaferQty = 0 - - FOR I = 1 TO COUNT(OrderItems,@VM) + (OrderItems NE '') - OrderDetRec = XLATE('ORDER_DET',OrderNo:'*':OrderItems<1,I>,'','X') - IF NOT(INDEX(OrderDetRec,'MISC',1)) THEN - OrderWaferQty = OrderWaferQty + OrderDetRec - END - NEXT I - - PONo = OrderRec - VisionOrderNo = OrderRec - VisionLineNos = XLATE('ORDER_DET',OrderItems,ORDER_DET_VISION_LINE_NO$,'X') -END - -OrdSummary = '' ;* Holds Order Detail Lot Numbers and Associated Order Item Numbers - -CassCnt = COUNT(CassNos,@VM) + (CassNos NE '') - -WOMKeys = '' -FOR K = 1 TO CassCnt - WOMKeys<1,K> = WONo:'*':CassNos<1,K> -NEXT K - -Send_Info('Locking WOMat records for update...') - -* WOMTableVar = obj_WO_Mat('LockSet',WOMKeys) -WOMTableVar = Database_Services('GetTableHandle', 'WO_MAT') - -IF Get_Status(errCode) THEN - obj_Tables('UnlockRec',OtParms) ;* Unlock WO_LOG record + WONo = Parms[1,@RM] + CassNos = Parms[COL2()+1,@RM] - Send_Info(STR(' ',60)) ;** - Messaging - ** + LogData = '' + LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') + LogData<2> = @User4 + LogData<3> = WONo + LogData<4> = 'Beginning ReleaseCassettes routine.' + Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) + + IF WONo = '' THEN ErrorMsg = 'Null parameter WONo passed to routine (':Method:').' + IF ErrorMsg NE '' THEN RETURN NewForm = Xlate('APP_INFO', 'NEW_WO_FORM', '', 'X') - If NewForm then - Form = 'NDW_WO_LOG' - end else - Form = 'WO_LOG2' - end + If NewForm then + Form = 'NDW_WO_LOG' + end else + Form = 'WO_LOG2' + end + OrgColor = Set_Property(Form:'.STATUSLINE_FIX','BACKCOLOR',YELLOW$) ;* //////// Messaging - Dummy = Set_Property(Form:'.STATUSLINE_FIX','BACKCOLOR',OrgColor) ;** - Messaging - ** - RETURN -END - -LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') -LogData<4> = 'Trace 1' -Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) - -* At this point the WO_LOG is locked and the WO_MAT (cassettes) are all locked for update - -EpiPN = WORec -EpiPartRec = XLATE('EPI_PART',EpiPN,'','X') - -SubSupplyBy = EpiPartRec - -ProdVerRec = XLATE('PROD_VER',ProdVerNo,'','X') - -ProcStepNos = ProdVerRec -ProcPSNs = ProdVerRec -ReactorType = ProdVerRec - -WOStepCnt = COUNT(ProcPSNs,@VM) + (ProcPSNs NE '') - -TableVar = '' -LastStep = '' - -FOR WOStep = 1 TO WOStepCnt - - WOStepKey = WORec - WOStepRec = XLATE('WO_STEP',WOStepKey,'','X') + TableVar = '' + OtParms = 'WO_LOG':@RM:WONo:@RM:TableVar + WORec = obj_Tables('ReadRec',OtParms) ;* Locks and reads record for update - IF WOStep = WOStepCnt THEN LastStep = 1 ELSE LastStep = 0 + * Added 5/21/2015 JCH to check for previous releases on this work order - ProcPSN = ProcPSNs<1,WOStep> + WOMatKeys = WORec - SubPreClean = XLATE('PRS_STAGE',ProcPSN:'*PRE',PRS_STAGE_CLEAN_TOOL$,'X') - SubPostClean = XLATE('PRS_STAGE',ProcPSN:'*POST',PRS_STAGE_CLEAN_TOOL$,'X') + IF Get_Status(errCode) THEN Return - // Log variables before obj_WM_Out('Create') - LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') - LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' WMOLoadQty:':WMOLoadQty - Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) + OrderNo = WORec + OrderItems = WORec + CustNo = WORec + PromiseDt = WORec + WOStepKeys = WORec + EPIPartNo = WORec + ReactType = WORec ;* Added 5/28/2016 JCH - IF ReactorType = 'EPP' THEN + IF OrderNo = '' AND ProdVerNo = '' THEN ErrorMsg = 'Both Order No and Prod Ver No blank on Work Order. WO Not Released. (':Method:')' + + IF CustNo = '' THEN ErrorMsg = 'No Cust Number on Work Order. WO Not Released. (':Method:')' + IF WOStepKeys = '' THEN ErrorMsg = 'Missing WO Step Keys. WO Not Released. (':Method:')' + + IF ErrorMsg NE '' THEN + obj_Tables('UnlockRec',OtParms) - Send_Info('Creating WM_OUT records for WOStep ':WOStep:'...') ;** - Messaging - ** - - OutOnlyCassIDS = obj_WM_Out('Create',WONO:@RM:WOStep:@RM:CassNos:@RM:WMOLoadQty) ;* Changed WMOLoadQty 9/14/2012 JCH ********* - - END ELSE - OutOnlyCassIDs = '' + RETURN END - StepRDSNos = '' + + * * * * * * * * * * * * * * * * * * * * * * * * * * + + IF ProdVerNo NE '' THEN + + ReactorType = XLATE('PROD_VER',ProdVerNo,PROD_VER_REACT_TYPE$,'X') + + IF ReactorType NE 'EPP' THEN + + IF WORec = '' THEN + CurrDTM = ICONV(OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTHS'),'DT') + WORec = CurrDTM + END + END + END + + * * * * * * * * * * * * * * * * * * * * * * * * * * * + + Send_Info("Collecting Data for release...") ;* //////// Messaging + + IF OrderNo = '' THEN + OrderWaferQty = WORec + PONo = WORec + VisionOrderNo = WORec ;* SAP Production Order Number + VisionLineNos = '' + WMOLoadQty = XLATE('CUST_EPI_PART',CustNo:'*':EPIPartNo,CUST_EPI_PART_WMO_LOAD_CNT$,'X') + + END ELSE + + OrderRec = XLATE('ORDER',OrderNo,'','X') + OrderWaferQty = 0 + + FOR I = 1 TO COUNT(OrderItems,@VM) + (OrderItems NE '') + OrderDetRec = XLATE('ORDER_DET',OrderNo:'*':OrderItems<1,I>,'','X') + IF NOT(INDEX(OrderDetRec,'MISC',1)) THEN + OrderWaferQty = OrderWaferQty + OrderDetRec + END + NEXT I + + PONo = OrderRec + VisionOrderNo = OrderRec + VisionLineNos = XLATE('ORDER_DET',OrderItems,ORDER_DET_VISION_LINE_NO$,'X') + END + + OrdSummary = '' ;* Holds Order Detail Lot Numbers and Associated Order Item Numbers CassCnt = COUNT(CassNos,@VM) + (CassNos NE '') - // Log variables after obj_WM_Out('Create') - LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') - LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty - Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) + WOMKeys = '' + FOR K = 1 TO CassCnt + WOMKeys<1,K> = WONo:'*':CassNos<1,K> + NEXT K - Def = "" - Def = "Releasing Cassettes for WO Step ":WOStep:"..." - Def = "G" - Def = CassCnt - Def = 600 + Send_Info('Locking WOMat records for update...') - MsgUp = Msg(@WINDOW, Def) + * WOMTableVar = obj_WO_Mat('LockSet',WOMKeys) + WOMTableVar = Database_Services('GetTableHandle', 'WO_MAT') - ReprocessedRDSNos = '' - - LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') - LogData<4> = 'Trace 2' - Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) - - FOR N = 1 TO CassCnt - - LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') - LogData<4> = 'Trace 2.':N - Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) - - CassNo = CassNos<1,N> + IF Get_Status(errCode) THEN + obj_Tables('UnlockRec',OtParms) ;* Unlock WO_LOG record - Void = Msg(@WINDOW, MsgUp, N, MSGINSTUPDATE$) + Send_Info(STR(' ',60)) ;** - Messaging - ** + + NewForm = Xlate('APP_INFO', 'NEW_WO_FORM', '', 'X') + If NewForm then + Form = 'NDW_WO_LOG' + end else + Form = 'WO_LOG2' + end + + Dummy = Set_Property(Form:'.STATUSLINE_FIX','BACKCOLOR',OrgColor) ;** - Messaging - ** + RETURN + END + + LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') + LogData<4> = 'Trace 1' + Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) + + * At this point the WO_LOG is locked and the WO_MAT (cassettes) are all locked for update + + EpiPN = WORec + EpiPartRec = XLATE('EPI_PART',EpiPN,'','X') + + SubSupplyBy = EpiPartRec + + ProdVerRec = XLATE('PROD_VER',ProdVerNo,'','X') + + ProcStepNos = ProdVerRec + ProcPSNs = ProdVerRec + ReactorType = ProdVerRec + + WOStepCnt = COUNT(ProcPSNs,@VM) + (ProcPSNs NE '') + + TableVar = '' + LastStep = '' + + FOR WOStep = 1 TO WOStepCnt + + WOStepKey = WORec + WOStepRec = XLATE('WO_STEP',WOStepKey,'','X') + + IF WOStep = WOStepCnt THEN LastStep = 1 ELSE LastStep = 0 + + ProcPSN = ProcPSNs<1,WOStep> + + SubPreClean = XLATE('PRS_STAGE',ProcPSN:'*PRE',PRS_STAGE_CLEAN_TOOL$,'X') + SubPostClean = XLATE('PRS_STAGE',ProcPSN:'*POST',PRS_STAGE_CLEAN_TOOL$,'X') + + // Log variables before obj_WM_Out('Create') + LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') + LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' WMOLoadQty:':WMOLoadQty + Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) IF ReactorType = 'EPP' THEN - CassWaferQty = XLATE('WO_MAT',WONo:'*':CassNo,WO_MAT_WAFER_QTY$,'X') - WMIKey = WONo:'*':WOStep:'*':CassNo - Send_Info('Creating WM_IN record "':WMIKey:'"...') ;** - Messaging - ** + Send_Info('Creating WM_OUT records for WOStep ':WOStep:'...') ;** - Messaging - ** - obj_WM_IN('Create',WONo:@RM:WOStep:@RM:CassNo:@RM:CassWaferQty) ;* ******************************** EpiPro 5000 Reactor -> create WM_IN records + OutOnlyCassIDS = obj_WM_Out('Create',WONO:@RM:WOStep:@RM:CassNos:@RM:WMOLoadQty) ;* Changed WMOLoadQty 9/14/2012 JCH ********* END ELSE + OutOnlyCassIDs = '' + END - IF WOStepRec = '' THEN - WOMatRec = XLATE('WO_MAT',WoNo:'*':CassNo,'','X') + StepRDSNos = '' + + CassCnt = COUNT(CassNos,@VM) + (CassNos NE '') + + // Log variables after obj_WM_Out('Create') + LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') + LogData<4> = 'WONo:':WONo:' WOStep:':WOStep:' CassNos:':CassNos:' CassCnt:':CassCnt:' WMOLoadQty:':WMOLoadQty + Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) + + Def = "" + Def = "Releasing Cassettes for WO Step ":WOStep:"..." + Def = "G" + Def = CassCnt + Def = 600 + + MsgUp = Msg(@WINDOW, Def) + + ReprocessedRDSNos = '' + + LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') + LogData<4> = 'Trace 2' + Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) + + FOR N = 1 TO CassCnt + + LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') + LogData<4> = 'Trace 2.':N + Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) + + CassNo = CassNos<1,N> + + Void = Msg(@WINDOW, MsgUp, N, MSGINSTUPDATE$) + + IF ReactorType = 'EPP' THEN + CassWaferQty = XLATE('WO_MAT',WONo:'*':CassNo,WO_MAT_WAFER_QTY$,'X') - CassLotNo = WOMatRec - CassWaferQty = WOMatRec - CassCustPartNo = WOMatRec - CassSubPartNo = WOMatRec - CassSubInvID = '' - CassOrderItem = WOMatRec - ReprocessedMat = WOMatRec - CassSubVendCd = WOMatRec + WMIKey = WONo:'*':WOStep:'*':CassNo + Send_Info('Creating WM_IN record "':WMIKey:'"...') ;** - Messaging - ** - IF OrderNo = '' THEN - QuoteNo = '' - END ELSE - QuoteNo = XLATE('ORDER_DET',OrderNo:'*':CassOrderItem,ORDER_DET_QUOTE_NO$,'X') - END + obj_WM_IN('Create',WONo:@RM:WOStep:@RM:CassNo:@RM:CassWaferQty) ;* ******************************** EpiPro 5000 Reactor -> create WM_IN records - Parms = WONo:@RM - 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 + END ELSE - Send_Info('Creating RDS for Cass No: ':CassNo:'...') ;** - Messaging - ** - - IF ReactorType = 'GAN' THEN - - NULL - - END ELSE - - LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') - LogData<4> = 'Trace 2.':N:'.1 - Start obj_RDS("Create")' - Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) - - NewRDSNo = obj_RDS('Create',Parms) + IF WOStepRec = '' THEN + WOMatRec = XLATE('WO_MAT',WoNo:'*':CassNo,'','X') - Loop - While (NewRDSNo EQ 0 or NewRDSNo EQ '') - MsgTxt = 'An error occured due to multiple users attempting to create an RDS simultaneously. ' | - : @SVM : 'Would you like to retry?' - Response = Msg(@Window, '', 'RETRY', '', MsgTxt) - Begin Case - Case Response EQ 1 - Retry = False$ ; // User Clicked Abort - Case Response EQ 2 - Retry = True$ ; // User Clicked Retry - Case Response EQ char(27) - Retry = False$ ; // User Pressed Escape Key - End Case - If Retry EQ True$ then - NewRDSNo = obj_RDS('Create', Parms) - end - Until Retry EQ False$ - Repeat + CassLotNo = WOMatRec + CassWaferQty = WOMatRec + CassCustPartNo = WOMatRec + CassSubPartNo = WOMatRec + CassSubInvID = '' + CassOrderItem = WOMatRec + ReprocessedMat = WOMatRec + CassSubVendCd = WOMatRec - LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') - LogData<4> = 'Trace 2.':N:'.2 - End obj_RDS("Create")' - Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) + IF OrderNo = '' THEN + QuoteNo = '' + END ELSE + QuoteNo = XLATE('ORDER_DET',OrderNo:'*':CassOrderItem,ORDER_DET_QUOTE_NO$,'X') + END - If (Get_Status(errCode)) or (Error_Services('HasError')) or (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') - EmailAddr = 'dstieber@srpcs.com,Dan.Crisp@infineon.com,jonathan.ouellette@infineon.com' - LogData = LoggingDTM : ',' : @USER4 : ',' : WONo : ',' : ErrMsg - Logging_Services('AppendLog', objLog, LogData, CRLF$, COMMA$, False$, EmailAddr, LogData) + Parms = WONo:@RM + 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 + + Send_Info('Creating RDS for Cass No: ':CassNo:'...') ;** - Messaging - ** + + IF ReactorType = 'GAN' THEN + + NULL + + END ELSE + + LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') + LogData<4> = 'Trace 2.':N:'.1 - Start obj_RDS("Create")' + Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) + + NewRDSNo = obj_RDS('Create',Parms) + + Loop + While (NewRDSNo EQ 0 or NewRDSNo EQ '') + MsgTxt = 'An error occured due to multiple users attempting to create an RDS simultaneously. ' | + : @SVM : 'Would you like to retry?' + Response = Msg(@Window, '', 'RETRY', '', MsgTxt) + Begin Case + Case Response EQ 1 + Retry = False$ ; // User Clicked Abort + Case Response EQ 2 + Retry = True$ ; // User Clicked Retry + Case Response EQ char(27) + Retry = False$ ; // User Pressed Escape Key + End Case + If Retry EQ True$ then + NewRDSNo = obj_RDS('Create', Parms) + end + Until Retry EQ False$ + Repeat + + LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') + LogData<4> = 'Trace 2.':N:'.2 - End obj_RDS("Create")' + Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) + + If (Get_Status(errCode)) or (Error_Services('HasError')) or (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') + EmailAddr = 'dstieber@srpcs.com,Dan.Crisp@infineon.com,jonathan.ouellette@infineon.com' + LogData = LoggingDTM : ',' : @USER4 : ',' : WONo : ',' : ErrMsg + Logging_Services('AppendLog', objLog, LogData, CRLF$, COMMA$, False$, EmailAddr, 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 + Msg(@WINDOW, MsgUp) ;* take down the gauge + RETURN ;*************************** Check this for WO_LOG being cleared + END else + // No error creating RDS record -> add it to the batch list. + StepRDSNos<1,-1> = NewRDSNo 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 - Msg(@WINDOW, MsgUp) ;* take down the gauge - RETURN ;*************************** Check this for WO_LOG being cleared - END else - // 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 - 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 on this WO_Step*CassetteNo - END ;* End of check for EpiPRO reactor type - NEXT N - Msg(@WINDOW, MsgUp) ;* take down the gauge -NEXT WOStep - -LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') -LogData<4> = 'Trace 3' -Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) - -Send_Info("Updating WO_Mat Records with release data...") - -RelDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTHS') ;* 12/31/2014 JCH & DKK moved to prevent time incrementing time during release -PtiDTM = OCONV(Date(),'D4/'):' ':OCONV(Time()+5,'MTHS') - -WOLogRec = Database_Services('ReadDataRow', 'WO_LOG', WONo) -* AvailOutSlots = WOLogRec -MaxShipQty = Xlate('WO_LOG', WONo, 'CUST_EPI_PART_SHIP_QTY', 'X') - -IF WOLogRec EQ '' then WOLogRec = '1*1' - -FOR N = 1 TO CassCnt - WOMKey = WOMKeys<1,N> - CassNo = FIELD(WOMKey,'*',2) + END ;* End of Check for existing RDS on this WO_Step*CassetteNo + END ;* End of check for EpiPRO reactor type + NEXT N + Msg(@WINDOW, MsgUp) ;* take down the gauge + NEXT WOStep - // Keep trying to get the lock. Another process may be updating this record at the same time. - For Attempt = 1 to 100 - HaveLock = Database_Services('GetKeyIDLock', 'WO_MAT', WOMKey) - If HaveLock then - WOMatRec = XLATE('WO_MAT',WOMKey,'','X') ;* We have the lock, so just get the record this way - - IF WOMatRec = '' THEN - WOMatRec = ICONV(RelDTM,'DT') - WOMatRec = @USER4 - WOMatRec = PromiseDt - - IF SubPreClean = 'No' OR SubPreClean = '' THEN - WOMatRec = 'RTU' - END ELSE - WOMatRec = 'PREC' - END - - WOMatRec = 'RTB' - - thisInvDTM = ICONV(RelDTM,'DT') - - WHCd = 'SR' - LocCd = 'RB' - InvAction = 'REL' - ScanUserID = @USER4 - Tag = '' - ToolID = '' - - LOCATE thisInvDTM IN WOMatRec 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 ReactType = 'EPP' OR ReactType = 'GAN' THEN - obj_WO_Wfr('CassRel',WOMKey) ;* Added 3/17/2016 JCH for wafer history *************************************** - END - END - end else - Sleepery(1000) - end - Until HaveLock EQ True$ - Next Attempt + LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') + LogData<4> = 'Trace 3' + Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) -NEXT N - -Database_Services('WriteDataRow', 'WO_LOG', WONo, WOLogRec, True$, False$, True$) - -LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') -LogData<4> = 'Trace 4' -Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) - -Send_Info(STR(' ',60)) ;** - Messaging - ** -NewForm = Xlate('APP_INFO', 'NEW_WO_FORM', '', 'X') -If NewForm then - Form = 'NDW_WO_LOG' -end else - Form = 'WO_LOG2' -end -Dummy = Set_Property(Form:'.STATUS_LINE_FIX','BACKCOLOR',OrgColor) ;** - Messaging - ** - - -* * * * * * WO_LOG record write was here - -OutOnlyCnt = COUNT(OutOnlyCassIDs,@VM) + (OutOnlyCassIDs NE '') - -ExistingWOMatKeys = WORec - -FOR I = 1 TO OutOnlyCnt - OutOnlyCassID = OutOnlyCassIDs<1,I> - LOCATE OutOnlyCassID IN ExistingWOMatKeys BY 'AR' USING @VM SETTING Pos ELSE - ExistingWOMatKeys = INSERT(ExistingWOMatKeys,1,Pos,0,OutOnlyCassID) - END -NEXT I - -WORec = ExistingWOMatKeys ;* Add OutOnly Cassettetes to list inWO_LOG record. - -Send_Info('Saving WO_LOG record...') - -OtParms = FieldStore(OtParms,@RM,4,1,WORec) - -obj_Tables('WriteRec',OtParms) ;* Writes and unlocks the record It only has one value updated - -LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') -LogData<4> = 'Trace 5' -Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) - -Send_Info(STR(' ',60)) ;** - Messaging - ** - -* * * * * * * * * * - -ReactNos = obj_Sched('GetReactNos',WONo) ;************************ 5/26/2-15 JCH Added schedule ReactNos and check for WO_START_DTM$ - -rnCnt = COUNT(ReactNos,@VM) + (ReactNos NE '') - -IF rnCnt GE 1 THEN - - BEGIN CASE - CASE rnCnt = 1 - Message = CassCnt:' Cassettes Released for Reactor No: ':ReactNos - - CASE rnCnt = 2 - SWAP @VM WITH ' and ' IN ReactNos - Message = CassCnt:' Cassettes Released for Reactor Nos: ':ReactNos - - CASE 1 - LastReact = ReactNos<1,rnCnt> - RestOfReacts = FIELD(ReactNos,@VM,1,rnCnt - 1) - SWAP @VM WITH ', ' IN RestOfReacts - Message = CassCnt:' Cassettes Release for Reactor Nos: ':RestOfReacts:', and ':LastReact - - END CASE - - - IF WORec NE '' THEN - Recipients = XLATE('NOTIFICATION','WO_RELEASE',NOTIFICATION_USER_ID$,'X') - SentFrom = @USER4 - Subject = 'Work Order Release on ':WONo + Send_Info("Updating WO_Mat Records with release data...") + + RelDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTHS') ;* 12/31/2014 JCH & DKK moved to prevent time incrementing time during release + PtiDTM = OCONV(Date(),'D4/'):' ':OCONV(Time()+5,'MTHS') + + WOLogRec = Database_Services('ReadDataRow', 'WO_LOG', WONo) + * AvailOutSlots = WOLogRec + MaxShipQty = Xlate('WO_LOG', WONo, 'CUST_EPI_PART_SHIP_QTY', 'X') + + IF WOLogRec EQ '' then WOLogRec = '1*1' + + FOR N = 1 TO CassCnt + WOMKey = WOMKeys<1,N> + CassNo = FIELD(WOMKey,'*',2) - IF ReactorType = 'EPP' THEN - AttachWindow = 'WO_PROD_EPI' - END ELSE - AttachWindow = 'WO_PROD' - END - - AttachKey = WONo:'*':1 - - SendToGroup = '' - - Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup - obj_Notes('Create',Parms) - - IF Get_Status(errCode) THEN - ErrMsg(errCode) - END - END + // Keep trying to get the lock. Another process may be updating this record at the same time. + For Attempt = 1 to 100 + HaveLock = Database_Services('GetKeyIDLock', 'WO_MAT', WOMKey) + If HaveLock then + WOMatRec = XLATE('WO_MAT',WOMKey,'','X') ;* We have the lock, so just get the record this way + + IF WOMatRec = '' THEN + WOMatRec = ICONV(RelDTM,'DT') + WOMatRec = @USER4 + WOMatRec = PromiseDt + + IF SubPreClean = 'No' OR SubPreClean = '' THEN + WOMatRec = 'RTU' + END ELSE + WOMatRec = 'PREC' + END + + WOMatRec = 'RTB' + + thisInvDTM = ICONV(RelDTM,'DT') + + WHCd = 'SR' + LocCd = 'RB' + InvAction = 'REL' + ScanUserID = @USER4 + Tag = '' + ToolID = '' + + LOCATE thisInvDTM IN WOMatRec 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 ReactType = 'EPP' OR ReactType = 'GAN' THEN + obj_WO_Wfr('CassRel',WOMKey) ;* Added 3/17/2016 JCH for wafer history *************************************** + END + END + end else + Sleepery(1000) + end + Until HaveLock EQ True$ + Next Attempt + + NEXT N + + Database_Services('WriteDataRow', 'WO_LOG', WONo, WOLogRec, True$, False$, True$) + + LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') + LogData<4> = 'Trace 4' + Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) + + Send_Info(STR(' ',60)) ;** - Messaging - ** + NewForm = Xlate('APP_INFO', 'NEW_WO_FORM', '', 'X') + If NewForm then + Form = 'NDW_WO_LOG' + end else + Form = 'WO_LOG2' + end + Dummy = Set_Property(Form:'.STATUS_LINE_FIX','BACKCOLOR',OrgColor) ;** - Messaging - ** + + + * * * * * * WO_LOG record write was here + + OutOnlyCnt = COUNT(OutOnlyCassIDs,@VM) + (OutOnlyCassIDs NE '') + + ExistingWOMatKeys = WORec + + FOR I = 1 TO OutOnlyCnt + OutOnlyCassID = OutOnlyCassIDs<1,I> + LOCATE OutOnlyCassID IN ExistingWOMatKeys BY 'AR' USING @VM SETTING Pos ELSE + ExistingWOMatKeys = INSERT(ExistingWOMatKeys,1,Pos,0,OutOnlyCassID) + END + NEXT I + + WORec = ExistingWOMatKeys ;* Add OutOnly Cassettetes to list inWO_LOG record. + + Send_Info('Saving WO_LOG record...') + + OtParms = FieldStore(OtParms,@RM,4,1,WORec) + + obj_Tables('WriteRec',OtParms) ;* Writes and unlocks the record It only has one value updated + + LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') + LogData<4> = 'Trace 5' + Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) + + Send_Info(STR(' ',60)) ;** - Messaging - ** + + * * * * * * * * * * + + ReactNos = obj_Sched('GetReactNos',WONo) ;************************ 5/26/2-15 JCH Added schedule ReactNos and check for WO_START_DTM$ + + rnCnt = COUNT(ReactNos,@VM) + (ReactNos NE '') + + IF rnCnt GE 1 THEN + + BEGIN CASE + CASE rnCnt = 1 + Message = CassCnt:' Cassettes Released for Reactor No: ':ReactNos + + CASE rnCnt = 2 + SWAP @VM WITH ' and ' IN ReactNos + Message = CassCnt:' Cassettes Released for Reactor Nos: ':ReactNos + + CASE 1 + LastReact = ReactNos<1,rnCnt> + RestOfReacts = FIELD(ReactNos,@VM,1,rnCnt - 1) + SWAP @VM WITH ', ' IN RestOfReacts + Message = CassCnt:' Cassettes Release for Reactor Nos: ':RestOfReacts:', and ':LastReact + + END CASE + + + IF WORec NE '' THEN + Recipients = XLATE('NOTIFICATION','WO_RELEASE',NOTIFICATION_USER_ID$,'X') + SentFrom = @USER4 + Subject = 'Work Order Release on ':WONo + + IF ReactorType = 'EPP' THEN + AttachWindow = 'WO_PROD_EPI' + END ELSE + AttachWindow = 'WO_PROD' + END + + AttachKey = WONo:'*':1 + + SendToGroup = '' + + Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup + obj_Notes('Create',Parms) + + IF Get_Status(errCode) THEN + ErrMsg(errCode) + END + END + + END ;* WO is not on the schedule + + * * * * * * * * * * + LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') + LogData<4> = 'Ending ReleaseCassettes routine' + Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) -END ;* WO is not on the schedule - -* * * * * * * * * * -LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') -LogData<4> = 'Ending ReleaseCassettes routine' -Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) - RETURN @@ -1379,559 +1380,558 @@ RETURN * * * * * * * RecallWO: * * * * * * * - -WONo = Parms[1,@RM] - -IF WONo = '' THEN ErrorMsg = 'Null parameter WONo passed to routine (':Method:').' -IF ErrorMsg NE '' THEN RETURN - -WORec = XLATE('WO_LOG',WONo,'','X') - - -CassNos = XLATE('WO_LOG',WONo,'WO_MAT_CASS_NO','X') - -CassCnt = COUNT(CassNos,@VM) + (CassNos NE '') - -WOMKeys = '' -FOR K = 1 TO CassCnt - WOMKeys<1,K> = WONo:'*':CassNos<1,K> -NEXT K - -WOMTableVar = obj_WO_Mat('LockSet',WOMKeys) ;* Locks all WO_MAT records on the Work Order -IF Get_Status(errCode) THEN RETURN ;* Couldn't lock all of the cassettes - - -WOMCnt = COUNT(WOMKeys,@VM) + (WOMKeys NE '') - -FOR I = 1 TO WOMCnt - WOMKey = WOMKeys<1,I> - - WOMatRec = XLATE('WO_MAT',WOMKey,'','X') ;* We have the lock, so just get the record this way - - WMIKey = WOMatRec - WMOKey = WOMatRec - IF WMIKey NE '' THEN obj_WM_In('Delete',WMIKey) - IF WMOKey NE '' THEN obj_WM_Out('Delete',WMOKey) + WONo = Parms[1,@RM] - IF WOMatRec NE '' THEN - - IF WOMatRec NE '' THEN + IF WONo = '' THEN ErrorMsg = 'Null parameter WONo passed to routine (':Method:').' + IF ErrorMsg NE '' THEN RETURN + + WORec = XLATE('WO_LOG',WONo,'','X') + + + CassNos = XLATE('WO_LOG',WONo,'WO_MAT_CASS_NO','X') + + CassCnt = COUNT(CassNos,@VM) + (CassNos NE '') + + WOMKeys = '' + FOR K = 1 TO CassCnt + WOMKeys<1,K> = WONo:'*':CassNos<1,K> + NEXT K + + WOMTableVar = obj_WO_Mat('LockSet',WOMKeys) ;* Locks all WO_MAT records on the Work Order + IF Get_Status(errCode) THEN RETURN ;* Couldn't lock all of the cassettes + + + WOMCnt = COUNT(WOMKeys,@VM) + (WOMKeys NE '') + + FOR I = 1 TO WOMCnt + WOMKey = WOMKeys<1,I> - RDSCnt = COUNT(WOMatRec,@VM) + (WOMatRec NE '') - - FOR N = 1 TO RDSCnt - Set_Status(0) - obj_RDS('Delete',WOMatRec) - NEXT I - END + WOMatRec = XLATE('WO_MAT',WOMKey,'','X') ;* We have the lock, so just get the record this way + + WMIKey = WOMatRec + WMOKey = WOMatRec IF WMIKey NE '' THEN obj_WM_In('Delete',WMIKey) IF WMOKey NE '' THEN obj_WM_Out('Delete',WMOKey) - obj_WO_Wfr('CassDel',WOMKey) ;* Added 3/17/2016 JCH for wafer tracking ********************************* - - WOMatRec = '' - WOMatRec = '' - WOMatRec = '' - - WOMatParms = 'WO_MAT':@RM:WOMKey:@RM:WOMTableVar:@RM:WOMatRec - obj_Tables('WriteRec',WOMatParms) ;* This writes and unlocks the WO_MAT records + IF WOMatRec NE '' THEN - END ELSE - obj_Tables('UnlockRec','WO_MAT':@RM:WOMKey) - ErrorMsg := " WO_Mat Record ":QUOTE(WOMKey):' has not been released':CRLF$ - END - -NEXT I - - + IF WOMatRec NE '' THEN + + RDSCnt = COUNT(WOMatRec,@VM) + (WOMatRec NE '') + + FOR N = 1 TO RDSCnt + Set_Status(0) + obj_RDS('Delete',WOMatRec) + NEXT I + END + + IF WMIKey NE '' THEN obj_WM_In('Delete',WMIKey) + IF WMOKey NE '' THEN obj_WM_Out('Delete',WMOKey) + + obj_WO_Wfr('CassDel',WOMKey) ;* Added 3/17/2016 JCH for wafer tracking ********************************* + + WOMatRec = '' + WOMatRec = '' + WOMatRec = '' + + WOMatParms = 'WO_MAT':@RM:WOMKey:@RM:WOMTableVar:@RM:WOMatRec + obj_Tables('WriteRec',WOMatParms) ;* This writes and unlocks the WO_MAT records + + END ELSE + obj_Tables('UnlockRec','WO_MAT':@RM:WOMKey) + ErrorMsg := " WO_Mat Record ":QUOTE(WOMKey):' has not been released':CRLF$ + END + + NEXT I + + RETURN * * * * * * * ChangeLotNo: * * * * * * * - -WONo = Parms[1,@RM] -OrgLotNo = Parms[COL2()+1,@RM] -NewLotNo = Parms[COL2()+1,@RM] -Reason = Parms[COL2()+1,@RM] -CassNos = Parms[COL2()+1,@RM] - -IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' -IF OrgLotNo = '' THEN ErrorMsg = 'Null parameter "Org Lot No" passed to routine. (':Method:')' -IF NewLotNo = '' THEN ErrorMsg = 'Null parameter "New Lot No" passed to routine. (':Method:')' -IF Reason = '' THEN ErrorMsg = 'Null parameter "Reason" passed to routine. (':Method:')' -IF CassNos = '' THEN ErrorMsg = 'Null parameter "CassNos" passed to routine. (':Method:')' - - -WOMatKeys = '' - -cCnt = COUNT(CassNos,@VM) + (CassNos NE '') - -FOR I = 1 TO cCnt - WOMatKeys<1,I> = WONo:'*':CassNos<1,I> -NEXT I - - -WOMCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '') - -FOR I = 1 TO WOMCnt - WOMatKey = WOMatKeys<1,I> - WOMatRec = XLATE('WO_MAT',WOMatKey,'','X') - IF WOMatRec = OrgLotNo THEN - RDSNos = WOMatRec - RDSCnt = COUNT(RDSNos,@VM) + (RDSNos NE '') - FOR N = 1 TO RDSCnt - oPLParms = 'RDS':@RM - oPLParms := RDSNos<1,N>:@RM - oPLParms := RDS_LOT_NUM$:@RM + WONo = Parms[1,@RM] + OrgLotNo = Parms[COL2()+1,@RM] + NewLotNo = Parms[COL2()+1,@RM] + Reason = Parms[COL2()+1,@RM] + CassNos = Parms[COL2()+1,@RM] + + IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' + IF OrgLotNo = '' THEN ErrorMsg = 'Null parameter "Org Lot No" passed to routine. (':Method:')' + IF NewLotNo = '' THEN ErrorMsg = 'Null parameter "New Lot No" passed to routine. (':Method:')' + IF Reason = '' THEN ErrorMsg = 'Null parameter "Reason" passed to routine. (':Method:')' + IF CassNos = '' THEN ErrorMsg = 'Null parameter "CassNos" passed to routine. (':Method:')' + + + WOMatKeys = '' + + cCnt = COUNT(CassNos,@VM) + (CassNos NE '') + + FOR I = 1 TO cCnt + WOMatKeys<1,I> = WONo:'*':CassNos<1,I> + NEXT I + + + WOMCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '') + + FOR I = 1 TO WOMCnt + WOMatKey = WOMatKeys<1,I> + WOMatRec = XLATE('WO_MAT',WOMatKey,'','X') + + IF WOMatRec = OrgLotNo THEN + RDSNos = WOMatRec + RDSCnt = COUNT(RDSNos,@VM) + (RDSNos NE '') + FOR N = 1 TO RDSCnt + oPLParms = 'RDS':@RM + oPLParms := RDSNos<1,N>:@RM + oPLParms := RDS_LOT_NUM$:@RM + oPLParms := NewLotNo + + obj_Post_Log('Create',oPLParms) + + NEXT N + + oPLParms = 'WO_MAT':@RM + oPLParms := WOMatKey:@RM + oPLParms := WO_MAT_LOT_NO$:@RM oPLParms := NewLotNo obj_Post_Log('Create',oPLParms) - NEXT N - - oPLParms = 'WO_MAT':@RM - oPLParms := WOMatKey:@RM - oPLParms := WO_MAT_LOT_NO$:@RM - oPLParms := NewLotNo - - obj_Post_Log('Create',oPLParms) - - - END -NEXT I - + + END + NEXT I + RETURN * * * * * * * ChangeCassQty: * * * * * * * - -WONo = Parms[1,@RM] -CassNo = Parms[COL2()+1,@RM] -NewCassQty = Parms[COL2()+1,@RM] -Reason = Parms[COL2()+1,@RM] - -IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' -IF CassNo = '' THEN ErrorMsg = 'Null parameter "CassNo" passed to routine. (':Method:')' -IF NewCassQty = '' THEN ErrorMsg = 'Null parameter "NewCassQty" passed to routine. (':Method:')' -IF Reason = '' THEN ErrorMsg = 'Null parameter "Reason" passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN - -WOMatRec = XLATE('WO_MAT',WONo:'*':CassNo,'','X') - -otParms = 'WO_LOG':@RM:WONo -WOLogRec = obj_Tables('ReadRec',otParms) - -IF Get_Status(errCode) THEN RETURN - -FirstRDS = WOMatRec - -If FirstRDS NE '' then - // There will only be an RDS if the cassette has been released already, otherwise this will fail. - obj_RDS('SetSchedWfrQty',FirstRDS:@RM:NewCassQty) - IF Get_Status(errCode) THEN - obj_Tables('UnlockRec',otParms) ;* Unlock WO Record - RETURN - END -end - -CurrWfrCnt = WOMatRec - -PrevWfrCnt = obj_WO_Mat('SetWfrQty',WONo:'*':CassNo:@RM:NewCassQty) - -IF Get_Status(errCode) THEN - obj_RDS('SetSchedWfrQty',FirstRDS:@RM:CurrWfrCnt) ;* Reset RDS Sched Qty to original - obj_Tables('UnlockRec',otParms) ;* Unlock WO Record + WONo = Parms[1,@RM] + CassNo = Parms[COL2()+1,@RM] + NewCassQty = Parms[COL2()+1,@RM] + Reason = Parms[COL2()+1,@RM] + + IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' + IF CassNo = '' THEN ErrorMsg = 'Null parameter "CassNo" passed to routine. (':Method:')' + IF NewCassQty = '' THEN ErrorMsg = 'Null parameter "NewCassQty" passed to routine. (':Method:')' + IF Reason = '' THEN ErrorMsg = 'Null parameter "Reason" passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + WOMatRec = XLATE('WO_MAT',WONo:'*':CassNo,'','X') + + otParms = 'WO_LOG':@RM:WONo + WOLogRec = obj_Tables('ReadRec',otParms) + + IF Get_Status(errCode) THEN RETURN + + FirstRDS = WOMatRec + + If FirstRDS NE '' then + // There will only be an RDS if the cassette has been released already, otherwise this will fail. + obj_RDS('SetSchedWfrQty',FirstRDS:@RM:NewCassQty) + IF Get_Status(errCode) THEN + obj_Tables('UnlockRec',otParms) ;* Unlock WO Record + RETURN + END + end + + CurrWfrCnt = WOMatRec + PrevWfrCnt = obj_WO_Mat('SetWfrQty',WONo:'*':CassNo:@RM:NewCassQty) + + IF Get_Status(errCode) THEN + + obj_RDS('SetSchedWfrQty',FirstRDS:@RM:CurrWfrCnt) ;* Reset RDS Sched Qty to original + obj_Tables('UnlockRec',otParms) ;* Unlock WO Record + + RETURN + END + + WOQtyDelta = PrevWfrCnt - NewCassQty + + IF WOQtyDelta NE 0 THEN + WOLogRec = WOLogRec + WOQtyDelta + END + + otParms = FieldStore(otParms,@RM,4,1,WOLogRec) + obj_Tables('WriteRec',otParms) - RETURN -END - -WOQtyDelta = PrevWfrCnt - NewCassQty - -IF WOQtyDelta NE 0 THEN - WOLogRec = WOLogRec + WOQtyDelta -END - -otParms = FieldStore(otParms,@RM,4,1,WOLogRec) -obj_Tables('WriteRec',otParms) - RETURN * * * * * * * ChangePONo: * * * * * * * - + RETURN * * * * * * * AddOrderItem: * * * * * * * - -WONo = Parms[1,@RM] -OrderNo = Parms[COL2()+1,@RM] -ItemNo = Parms[COL2()+1,@RM] - -IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' -IF OrderNo = '' THEN ErrorMsg = 'Null parameter "OrderNo" passed to routine. (':Method:')' -IF ItemNo = '' THEN ErrorMsg = 'Null parameter "ItemNo" passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN -WTParms = 'WO_LOG':@RM:WONo -WORec = obj_Tables('ReadRec',WTParms) - -IF WORec = OrderNo THEN - LOCATE ItemNo IN WORec BY 'AR' USING @VM SETTING Pos ELSE - WORec = INSERT(WORec,WO_LOG_ORDER_ITEM$,Pos,0,ItemNo) + WONo = Parms[1,@RM] + OrderNo = Parms[COL2()+1,@RM] + ItemNo = Parms[COL2()+1,@RM] + + IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' + IF OrderNo = '' THEN ErrorMsg = 'Null parameter "OrderNo" passed to routine. (':Method:')' + IF ItemNo = '' THEN ErrorMsg = 'Null parameter "ItemNo" passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + WTParms = 'WO_LOG':@RM:WONo + WORec = obj_Tables('ReadRec',WTParms) + + IF WORec = OrderNo THEN + LOCATE ItemNo IN WORec BY 'AR' USING @VM SETTING Pos ELSE + WORec = INSERT(WORec,WO_LOG_ORDER_ITEM$,Pos,0,ItemNo) + END + WTParms = FieldStore(WTParms,@RM,4,1,WORec) + obj_Tables('WriteRec',WTParms) + END ELSE + obj_Tables('UnlockRec',WTParms) END - WTParms = FieldStore(WTParms,@RM,4,1,WORec) - obj_Tables('WriteRec',WTParms) -END ELSE - obj_Tables('UnlockRec',WTParms) -END - + RETURN * * * * * * * RemOrderItem: * * * * * * * - -WONo = Parms[1,@RM] -OrderNo = Parms[COL2()+1,@RM] -ItemNo = Parms[COL2()+1,@RM] - -IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' -IF OrderNo = '' THEN ErrorMsg = 'Null parameter "OrderNo" passed to routine. (':Method:')' -IF ItemNo = '' THEN ErrorMsg = 'Null parameter "ItemNo" passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN - -WTParms = 'WO_LOG':@RM:WONo -WORec = obj_Tables('ReadRec',WTParms) - -IF WORec = OrderNo THEN - LOCATE ItemNo IN WORec BY 'AR' USING @VM SETTING Pos THEN - WORec = DELETE(WORec,WO_LOG_ORDER_ITEM$,Pos,0) + WONo = Parms[1,@RM] + OrderNo = Parms[COL2()+1,@RM] + ItemNo = Parms[COL2()+1,@RM] + + IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' + IF OrderNo = '' THEN ErrorMsg = 'Null parameter "OrderNo" passed to routine. (':Method:')' + IF ItemNo = '' THEN ErrorMsg = 'Null parameter "ItemNo" passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + + WTParms = 'WO_LOG':@RM:WONo + WORec = obj_Tables('ReadRec',WTParms) + + IF WORec = OrderNo THEN + LOCATE ItemNo IN WORec BY 'AR' USING @VM SETTING Pos THEN + WORec = DELETE(WORec,WO_LOG_ORDER_ITEM$,Pos,0) + END + WTParms = FieldStore(WTParms,@RM,4,1,WORec) + obj_Tables('WriteRec',WTParms) + END ELSE + obj_Tables('UnlockRec',WTParms) END - WTParms = FieldStore(WTParms,@RM,4,1,WORec) - obj_Tables('WriteRec',WTParms) -END ELSE - obj_Tables('UnlockRec',WTParms) -END - + RETURN * * * * * * * SetPromiseDt: * * * * * * * - -OrderNo = Parms[1,@RM] -OrderItems = Parms[COL2()+1,@RM] -WONo = Parms[COL2()+1,@RM] -PromiseDt = Parms[COL2()+1,@RM] -Reason = Parms[COL2()+1,@RM] - -*IF OrderNo = '' THEN ErrorMsg = 'Null parameter "OrderNo" passed to routine. (':Method:')' -*IF OrderItems = '' THEN ErrorMsg = 'Null parameter "OrderItems" passed to routine. (':Method:')' -IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' -IF PromiseDt = '' THEN ErrorMsg = 'Null parameter "PromiseDt" passed to routine. (':Method:')' -IF Reason = '' THEN ErrorMsg = 'Null parameter "Reason" passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN - -thisPromiseDt = ICONV(PromiseDt,'D') -IF thisPromiseDt = '' THEN ErrorMsg = 'Invalid PromiseDt ':QUOTE(PromiseDt):' passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN - - -OPEN 'DICT.RDS' TO DictVar ELSE - ErrorMsg = 'Unable to Open DICT.RDS table' - RETURN -END - -SearchString = 'WO':@VM:WONo:@FM -Flag = '' -Set_Status(0) -Btree.Extract(SearchString, 'RDS', DictVar, RDSNos, '', Flag) ; * Get RDS numbers for this Work Order - -IF Get_Status(errCode) THEN - RETURN -END - -OPEN 'DICT.WM_OUT' TO DictVar ELSE - ErrorMsg = 'Unable to Open DICT.WM_OUT table' - RETURN -END - -SearchString = 'WO_NO':@VM:WONo:@FM -Flag = '' -Set_Status(0) -Btree.Extract(SearchString, 'WM_OUT', DictVar, WMOutKeys, '', Flag) ; * Get WM_OUT Keys for this Work Order - -IF Get_Status(errCode) THEN - RETURN -END - -/* -OrderDetKeys = '' -FOR I = 1 TO COUNT(OrderItems,@VM) + (OrderItems NE '') - OrderDetKeys<1,-1> = OrderNo:'*':OrderItems<1,I> -NEXT I -*/ - -*OTParms = 'ORDER_DET' -RTParms = 'RDS' -WMParms = 'WM_OUT' -*LockedODKeys = '' -LockedRDSNos = '' -LockedWMOutKeys = '' - -/* -FOR M = 1 TO COUNT(OrderDetKeys,@VM) + (OrderDetKeys NE '') - OrderDetKey = OrderDetKeys<1,M> - OTParms = FieldStore(OTParms, @RM, 2, 1, OrderDetKey) - obj_Tables('LockRec',OTParms) + + OrderNo = Parms[1,@RM] + OrderItems = Parms[COL2()+1,@RM] + WONo = Parms[COL2()+1,@RM] + PromiseDt = Parms[COL2()+1,@RM] + Reason = Parms[COL2()+1,@RM] + + *IF OrderNo = '' THEN ErrorMsg = 'Null parameter "OrderNo" passed to routine. (':Method:')' + *IF OrderItems = '' THEN ErrorMsg = 'Null parameter "OrderItems" passed to routine. (':Method:')' + IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' + IF PromiseDt = '' THEN ErrorMsg = 'Null parameter "PromiseDt" passed to routine. (':Method:')' + IF Reason = '' THEN ErrorMsg = 'Null parameter "Reason" passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + thisPromiseDt = ICONV(PromiseDt,'D') + IF thisPromiseDt = '' THEN ErrorMsg = 'Invalid PromiseDt ':QUOTE(PromiseDt):' passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + + OPEN 'DICT.RDS' TO DictVar ELSE + ErrorMsg = 'Unable to Open DICT.RDS table' + RETURN + END + + SearchString = 'WO':@VM:WONo:@FM + Flag = '' + Set_Status(0) + Btree.Extract(SearchString, 'RDS', DictVar, RDSNos, '', Flag) ; * Get RDS numbers for this Work Order + IF Get_Status(errCode) THEN - FOR L = 1 TO COUNT(LockedODKeys,@VM) + (LockedODKeys NE '') - OTParms = FieldStore(OTParms, @RM, 2, 1, LockedODKeys<1,L>) - obj_Tables('UnlockRec',OTParms) ;* Unlock everything locked up to here - NEXT L + RETURN + END + + OPEN 'DICT.WM_OUT' TO DictVar ELSE + ErrorMsg = 'Unable to Open DICT.WM_OUT table' + RETURN + END + + SearchString = 'WO_NO':@VM:WONo:@FM + Flag = '' + Set_Status(0) + Btree.Extract(SearchString, 'WM_OUT', DictVar, WMOutKeys, '', Flag) ; * Get WM_OUT Keys for this Work Order + + IF Get_Status(errCode) THEN + RETURN + END + + /* + OrderDetKeys = '' + FOR I = 1 TO COUNT(OrderItems,@VM) + (OrderItems NE '') + OrderDetKeys<1,-1> = OrderNo:'*':OrderItems<1,I> + NEXT I + */ + + *OTParms = 'ORDER_DET' + RTParms = 'RDS' + WMParms = 'WM_OUT' + *LockedODKeys = '' + LockedRDSNos = '' + LockedWMOutKeys = '' + + /* + FOR M = 1 TO COUNT(OrderDetKeys,@VM) + (OrderDetKeys NE '') + OrderDetKey = OrderDetKeys<1,M> + OTParms = FieldStore(OTParms, @RM, 2, 1, OrderDetKey) + obj_Tables('LockRec',OTParms) + IF Get_Status(errCode) THEN + FOR L = 1 TO COUNT(LockedODKeys,@VM) + (LockedODKeys NE '') + OTParms = FieldStore(OTParms, @RM, 2, 1, LockedODKeys<1,L>) + obj_Tables('UnlockRec',OTParms) ;* Unlock everything locked up to here + NEXT L + + ErrorMsg = 'Unable to lock ORDER_DET record ':QUOTE(OrderDetKey):' for Update.' + RETURN + END ELSE + LockedODKeys<1,-1> = OrderDetKey + END + NEXT M + */ + + FOR I = 1 TO COUNT(RdsNos,@VM) + (RdsNos NE '') + RdsNo = RdsNos<1,I> + RTParms = FieldStore(RTParms, @RM, 2, 1, RdsNo) + + obj_Tables('LockRec',RTParms) + IF Get_Status(errCode) THEN - ErrorMsg = 'Unable to lock ORDER_DET record ':QUOTE(OrderDetKey):' for Update.' - RETURN - END ELSE - LockedODKeys<1,-1> = OrderDetKey - END -NEXT M -*/ - -FOR I = 1 TO COUNT(RdsNos,@VM) + (RdsNos NE '') - RdsNo = RdsNos<1,I> - RTParms = FieldStore(RTParms, @RM, 2, 1, RdsNo) - - obj_Tables('LockRec',RTParms) - IF Get_Status(errCode) THEN + FOR N = 1 TO COUNT(LockedRDSNos,@VM) + (LockedRDSNos NE '') + RTParms = FieldStore(RTParms, @RM, 2, 1, LockedRDSNos<1,N>) + obj_Tables('UnlockRec',RTParms) ;* Unlock everything locked up to here + NEXT N + + *FOR L = 1 TO COUNT(LockedODKeys,@VM) + (LockedODKeys NE '') + * OTParms = FieldStore(OTParms, @RM, 2, 1, LockedODKeys<1,L>) + * obj_Tables('UnlockRec',OTParms) ;* Unlock everything locked up to here + *NEXT L + + ErrorMsg = 'Unable to lock RDS ':QUOTE(RdsNo):' for delete.' + *obj_Tables('UnlockRec',OTParms) + RETURN + END ELSE + LockedRDSNos<1,-1> = RdsNo + END + NEXT I - FOR N = 1 TO COUNT(LockedRDSNos,@VM) + (LockedRDSNos NE '') - RTParms = FieldStore(RTParms, @RM, 2, 1, LockedRDSNos<1,N>) - obj_Tables('UnlockRec',RTParms) ;* Unlock everything locked up to here - NEXT N + + FOR I = 1 TO COUNT(WMOutKeys,@VM) + (WMOutKeys NE '') + WMOutKey = WMOutKeys<1,I> + WMParms = FieldStore(WMParms, @RM, 2, 1, WMOutKey) - *FOR L = 1 TO COUNT(LockedODKeys,@VM) + (LockedODKeys NE '') - * OTParms = FieldStore(OTParms, @RM, 2, 1, LockedODKeys<1,L>) - * obj_Tables('UnlockRec',OTParms) ;* Unlock everything locked up to here - *NEXT L + obj_Tables('LockRec',WMParms) + IF Get_Status(errCode) THEN + + FOR M = 1 TO COUNT(LockedWMOutKeys,@VM) + (LockedWMOutKeys NE '') + WMParms = FieldStore(WMParms, @RM, 2, 1, LockedWMOutKeys<1,M>) + obj_Tables('UnlockRec',WMParms) ;* Unlock everything locked up to here + NEXT M + + FOR N = 1 TO COUNT(LockedRDSNos,@VM) + (LockedRDSNos NE '') + RTParms = FieldStore(RTParms, @RM, 2, 1, LockedRDSNos<1,N>) + obj_Tables('UnlockRec',RTParms) ;* Unlock everything locked up to here + NEXT N + + *FOR L = 1 TO COUNT(LockedODKeys,@VM) + (LockedODKeys NE '') + * OTParms = FieldStore(OTParms, @RM, 2, 1, LockedODKeys<1,L>) + * obj_Tables('UnlockRec',OTParms) ;* Unlock everything locked up to here + *NEXT L + + ErrorMsg = 'Unable to lock RDS ':QUOTE(WMOutKey):' for delete.' + *obj_Tables('UnlockRec',OTParms) + RETURN + END ELSE + LockedWMOutKeys<1,-1> = WMOutKey + END + NEXT I + + *OCTableNames = '' ;* Buckets for stuff to pass to obj_Order_Change + *OCRecordKeys = '' + *OCColumns = '' + *OCValues = '' + *OCOldValues = '' + *OCNewValues = '' + *OCCnt = 0 + + *OrderTableVar = FIELD(OTParms,@RM,3) + RDSTableVar = FIELD(RTParms,@RM,3) + WMOTableVar = FIELD(WMParms,@RM,3) + + FOR I = 1 TO COUNT(LockedRDSNos,@VM) + (LockedRDSNos NE '') + LockedRDSNo = LockedRDSNos<1,I> + READ RDSRec FROM RDSTableVar,LockedRDSNo THEN + OldValue = RDSRec + RDSRec = thisPromiseDt + RTParms = FieldStore(RTParms, @RM, 2, 1, LockedRDSNo) + RTParms = FieldStore(RTParms, @RM, 4, 1, RDSRec) + obj_Tables('WriteRec',RTParms) ;* Write and unlock RDS records + END - ErrorMsg = 'Unable to lock RDS ':QUOTE(RdsNo):' for delete.' - *obj_Tables('UnlockRec',OTParms) - RETURN - END ELSE - LockedRDSNos<1,-1> = RdsNo - END -NEXT I - - -FOR I = 1 TO COUNT(WMOutKeys,@VM) + (WMOutKeys NE '') - WMOutKey = WMOutKeys<1,I> - WMParms = FieldStore(WMParms, @RM, 2, 1, WMOutKey) - - obj_Tables('LockRec',WMParms) - IF Get_Status(errCode) THEN - - FOR M = 1 TO COUNT(LockedWMOutKeys,@VM) + (LockedWMOutKeys NE '') - WMParms = FieldStore(WMParms, @RM, 2, 1, LockedWMOutKeys<1,M>) - obj_Tables('UnlockRec',WMParms) ;* Unlock everything locked up to here - NEXT M - - FOR N = 1 TO COUNT(LockedRDSNos,@VM) + (LockedRDSNos NE '') - RTParms = FieldStore(RTParms, @RM, 2, 1, LockedRDSNos<1,N>) - obj_Tables('UnlockRec',RTParms) ;* Unlock everything locked up to here - NEXT N + *OCCnt += 1 + *OCTableNames<1,OCCnt> = 'RDS' + *OCRecordKeys<1,OCCnt> = LockedRDSNo + *OCColumns<1,OCCnt> = 'COMMIT_DATE_FINAL' + *OCValues<1,OCCnt> = '' + *OCOldValues<1,OCCnt> = OldValue + *OCNewValues<1,OCCnt> = thisPromiseDt - *FOR L = 1 TO COUNT(LockedODKeys,@VM) + (LockedODKeys NE '') - * OTParms = FieldStore(OTParms, @RM, 2, 1, LockedODKeys<1,L>) - * obj_Tables('UnlockRec',OTParms) ;* Unlock everything locked up to here - *NEXT L + NEXT I + + **************************** This section added 6/29/2006 JCH J.C. Henry & Co. + + FOR I = 1 TO COUNT(LockedWMOutKeys,@VM) + (LockedWMOutKeys NE '') + LockedWMOutKey = LockedWMOutKeys<1,I> + READ WMOutRec FROM WMOTableVar,LockedWMOutKey THEN + OldValue = WMOutRec + WMOutRec = thisPromiseDt + WMParms = FieldStore(WMParms, @RM, 2, 1, LockedWMOutKey) + WMParms = FieldStore(WMParms, @RM, 4, 1, WMOutRec) + obj_Tables('WriteRec',WMParms) ;* Write and unlock RDS records + END - ErrorMsg = 'Unable to lock RDS ':QUOTE(WMOutKey):' for delete.' - *obj_Tables('UnlockRec',OTParms) - RETURN - END ELSE - LockedWMOutKeys<1,-1> = WMOutKey - END -NEXT I - -*OCTableNames = '' ;* Buckets for stuff to pass to obj_Order_Change -*OCRecordKeys = '' -*OCColumns = '' -*OCValues = '' -*OCOldValues = '' -*OCNewValues = '' -*OCCnt = 0 - -*OrderTableVar = FIELD(OTParms,@RM,3) -RDSTableVar = FIELD(RTParms,@RM,3) -WMOTableVar = FIELD(WMParms,@RM,3) - -FOR I = 1 TO COUNT(LockedRDSNos,@VM) + (LockedRDSNos NE '') - LockedRDSNo = LockedRDSNos<1,I> - READ RDSRec FROM RDSTableVar,LockedRDSNo THEN - OldValue = RDSRec - RDSRec = thisPromiseDt - RTParms = FieldStore(RTParms, @RM, 2, 1, LockedRDSNo) - RTParms = FieldStore(RTParms, @RM, 4, 1, RDSRec) - obj_Tables('WriteRec',RTParms) ;* Write and unlock RDS records - END - - *OCCnt += 1 - *OCTableNames<1,OCCnt> = 'RDS' - *OCRecordKeys<1,OCCnt> = LockedRDSNo - *OCColumns<1,OCCnt> = 'COMMIT_DATE_FINAL' - *OCValues<1,OCCnt> = '' - *OCOldValues<1,OCCnt> = OldValue - *OCNewValues<1,OCCnt> = thisPromiseDt - -NEXT I - -**************************** This section added 6/29/2006 JCH J.C. Henry & Co. - -FOR I = 1 TO COUNT(LockedWMOutKeys,@VM) + (LockedWMOutKeys NE '') - LockedWMOutKey = LockedWMOutKeys<1,I> - READ WMOutRec FROM WMOTableVar,LockedWMOutKey THEN - OldValue = WMOutRec - WMOutRec = thisPromiseDt - WMParms = FieldStore(WMParms, @RM, 2, 1, LockedWMOutKey) - WMParms = FieldStore(WMParms, @RM, 4, 1, WMOutRec) - obj_Tables('WriteRec',WMParms) ;* Write and unlock RDS records - END - - *OCCnt += 1 - *OCTableNames<1,OCCnt> = 'WM_OUT' - *OCRecordKeys<1,OCCnt> = LockedWMOutKey - *OCColumns<1,OCCnt> = 'COMMIT_DT' - *OCValues<1,OCCnt> = '' - *OCOldValues<1,OCCnt> = OldValue - *OCNewValues<1,OCCnt> = thisPromiseDt - -NEXT I - -***************************** -/* -FOR I = 1 TO COUNT(LockedODKeys,@VM) + (LockedODKeys NE '') - OrderDetKey = LockedODKEys<1,I> - READ OrderDetRec FROM OrderTableVar,OrderDetKey THEN - OldValue = OrderDetRec - OrderDetRec = thisPromiseDt - OTParms = FieldStore(OTParms,@RM,2,1,OrderDetKey) - OTParms = FieldStore(OTParms,@RM,4,1,OrderDetRec) - obj_Tables('WriteRec',OTParms) ;* Write and unlock ORDER_DET record + *OCCnt += 1 + *OCTableNames<1,OCCnt> = 'WM_OUT' + *OCRecordKeys<1,OCCnt> = LockedWMOutKey + *OCColumns<1,OCCnt> = 'COMMIT_DT' + *OCValues<1,OCCnt> = '' + *OCOldValues<1,OCCnt> = OldValue + *OCNewValues<1,OCCnt> = thisPromiseDt - OCCnt += 1 - OCTableNames<1,OCCnt> = 'ORDER_DET' - OCRecordKeys<1,OCCnt> = OrderDetKey - OCColumns<1,OCCnt> = 'PROMISE_DT' - OCValues<1,OCCnt> = '' - OCOldValues<1,OCCnt> = OldValue - OCNewValues<1,OCCnt> = thisPromiseDt - - END ELSE - obj_Tables('UnlockRec',OTParms) - END -NEXT I -*/ - -*obj_Order_Change('Create',OrderNo:@RM:OCTableNames:@RM:OCRecordKeys:@RM:OCColumns:@RM:OCValues:@RM:OCOldValues:@RM:OCNewValues:@RM:Reason) - - + NEXT I + + ***************************** + /* + FOR I = 1 TO COUNT(LockedODKeys,@VM) + (LockedODKeys NE '') + OrderDetKey = LockedODKEys<1,I> + READ OrderDetRec FROM OrderTableVar,OrderDetKey THEN + OldValue = OrderDetRec + OrderDetRec = thisPromiseDt + OTParms = FieldStore(OTParms,@RM,2,1,OrderDetKey) + OTParms = FieldStore(OTParms,@RM,4,1,OrderDetRec) + obj_Tables('WriteRec',OTParms) ;* Write and unlock ORDER_DET record + + OCCnt += 1 + OCTableNames<1,OCCnt> = 'ORDER_DET' + OCRecordKeys<1,OCCnt> = OrderDetKey + OCColumns<1,OCCnt> = 'PROMISE_DT' + OCValues<1,OCCnt> = '' + OCOldValues<1,OCCnt> = OldValue + OCNewValues<1,OCCnt> = thisPromiseDt + + END ELSE + obj_Tables('UnlockRec',OTParms) + END + NEXT I + */ + + *obj_Order_Change('Create',OrderNo:@RM:OCTableNames:@RM:OCRecordKeys:@RM:OCColumns:@RM:OCValues:@RM:OCOldValues:@RM:OCNewValues:@RM:Reason) + + RETURN * * * * * * * QuoteChange: * * * * * * * - -QuoteNo = Parms[1,@RM] -WONo = Parms[COL2()+1,@RM] - -IF QuoteNo = '' THEN ErrorMsg = 'Null parameter "QuoteNo" passed to routine. (':Method:')' -IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' - -QuoteRec = XLATE('QUOTE',QuoteNo,'','X') - -QuoteProcSteps = QuoteRec -QuoteProcStepPSNs = QuoteRec - -WTParms = 'WO_LOG':@RM:WONo -WORec = obj_Tables('ReadRec',WTParms) - -IF Get_Status(errCode) THEN - ErrMsg(errCode) - obj_Tables('UnlockRec',WTParms) - RETURN -END - -WOStepKeys = WORec - -LockedWOStepKeys = '' -wsParms = 'WO_STEP' - -FOR I = 1 TO COUNT(WOStepKeys,@VM) + (WOStepKeys NE '') - WOStepKey = WOStepKeys<1,I> - wsParms = FieldStore(wsParms, @RM, 2, 1, WOStepKey) - - obj_Tables('LockRec',wsParms) + + QuoteNo = Parms[1,@RM] + WONo = Parms[COL2()+1,@RM] + + IF QuoteNo = '' THEN ErrorMsg = 'Null parameter "QuoteNo" passed to routine. (':Method:')' + IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' + + QuoteRec = XLATE('QUOTE',QuoteNo,'','X') + + QuoteProcSteps = QuoteRec + QuoteProcStepPSNs = QuoteRec + + WTParms = 'WO_LOG':@RM:WONo + WORec = obj_Tables('ReadRec',WTParms) IF Get_Status(errCode) THEN - - FOR N = 1 TO COUNT(LockedWOStepKeys,@VM) + (LockedWOStepKeys NE '') - wsParms = FieldStore(wsParms, @RM, 2, 1, LockedWOStepKeys<1,N>) - obj_Tables('UnlockRec',wsParms) ;* Unlock everything locked up to here - NEXT N - - ErrorMsg = 'Unable to lock WO_STEP ':QUOTE(WOStepKey):' for Update.' + ErrMsg(errCode) obj_Tables('UnlockRec',WTParms) RETURN - END ELSE - LockedWOStepKeys<1,-1> = WOStepKey - END -NEXT I - -FOR I = 1 TO COUNT(LockedWOStepKeys,@VM) + (LockedWOStepKeys NE '') - LockedWOStepKey = LockedWOStepKeys<1,I> + END - WOStepRec = XLATE('WO_STEP',LockedWOStepKey,'','X') - ProcStep = FIELD(LockedWOStepKey,'*',2) - LOCATE ProcStep IN QuoteProcSteps USING @VM SETTING Pos THEN - StepPSN = QuoteProcStepPSNs<1,Pos> - WOStepRec = StepPSN - END + WOStepKeys = WORec - wsParms = FieldStore(wsParms, @RM, 2, 1, LockedWOStepKey) - wsParms = FieldStore(wsParms, @RM, 4, 1, WOStepRec) + LockedWOStepKeys = '' + wsParms = 'WO_STEP' + + FOR I = 1 TO COUNT(WOStepKeys,@VM) + (WOStepKeys NE '') + WOStepKey = WOStepKeys<1,I> + wsParms = FieldStore(wsParms, @RM, 2, 1, WOStepKey) + + obj_Tables('LockRec',wsParms) + + IF Get_Status(errCode) THEN + + FOR N = 1 TO COUNT(LockedWOStepKeys,@VM) + (LockedWOStepKeys NE '') + wsParms = FieldStore(wsParms, @RM, 2, 1, LockedWOStepKeys<1,N>) + obj_Tables('UnlockRec',wsParms) ;* Unlock everything locked up to here + NEXT N + + ErrorMsg = 'Unable to lock WO_STEP ':QUOTE(WOStepKey):' for Update.' + obj_Tables('UnlockRec',WTParms) + RETURN + END ELSE + LockedWOStepKeys<1,-1> = WOStepKey + END + NEXT I + + FOR I = 1 TO COUNT(LockedWOStepKeys,@VM) + (LockedWOStepKeys NE '') + LockedWOStepKey = LockedWOStepKeys<1,I> + + WOStepRec = XLATE('WO_STEP',LockedWOStepKey,'','X') + ProcStep = FIELD(LockedWOStepKey,'*',2) + LOCATE ProcStep IN QuoteProcSteps USING @VM SETTING Pos THEN + StepPSN = QuoteProcStepPSNs<1,Pos> + WOStepRec = StepPSN + END + + wsParms = FieldStore(wsParms, @RM, 2, 1, LockedWOStepKey) + wsParms = FieldStore(wsParms, @RM, 4, 1, WOStepRec) + + obj_Tables('WriteRec',wsParms) + + NEXT I + + WORec = QuoteNo + + WTParms = FieldStore(WTParms,@RM,4,1,WORec) + obj_Tables('WriteRec',WTParms) - obj_Tables('WriteRec',wsParms) - -NEXT I - -WORec = QuoteNo - -WTParms = FieldStore(WTParms,@RM,4,1,WORec) -obj_Tables('WriteRec',WTParms) - RETURN @@ -1941,86 +1941,86 @@ RETURN * * * * * * * NextWORun: * * * * * * * - -WONo = Parms[1,@RM] -WOStep = Parms[COL2()+1,@RM] - -IF WONo = '' THEN RETURN -IF WOStep = '' THEN WOStep = 1 - -errCode = 0 -Cancelled = 0 -LOOP - WTParms = 'WO_LOG':@RM:WONo - WORec = obj_Tables('ReadRec',WTParms) - dummy = Get_Status(errCode) - IF errCode THEN - Resp = Msg(@WINDOW,'','WO_NO_LOCKED') - IF Resp = CHAR(27) THEN Cancelled = 1 + WONo = Parms[1,@RM] + WOStep = Parms[COL2()+1,@RM] + + IF WONo = '' THEN RETURN + IF WOStep = '' THEN WOStep = 1 + + errCode = 0 + Cancelled = 0 + LOOP + WTParms = 'WO_LOG':@RM:WONo + WORec = obj_Tables('ReadRec',WTParms) + dummy = Get_Status(errCode) + + IF errCode THEN + Resp = Msg(@WINDOW,'','WO_NO_LOCKED') + IF Resp = CHAR(27) THEN Cancelled = 1 + END + UNTIL errCode = '' OR Cancelled = 1 + REPEAT + + IF Cancelled THEN RETURN ;* Bailed out + + + StepRDSNos = XLATE('WO_STEP',WONo:'*':WOStep,WO_STEP_RDS_KEY$,'X') + IF (WONo:'*':WOStep = '162988*1') THEN + CurrRuns = 3 + END ELSE + CurrRuns = 0 END -UNTIL errCode = '' OR Cancelled = 1 -REPEAT - -IF Cancelled THEN RETURN ;* Bailed out - - -StepRDSNos = XLATE('WO_STEP',WONo:'*':WOStep,WO_STEP_RDS_KEY$,'X') -IF (WONo:'*':WOStep = '162988*1') THEN - CurrRuns = 3 -END ELSE - CurrRuns = 0 -END -FOR I = 1 TO COUNT(StepRDSNos,@VM) + (StepRDSNos NE '') - IF RowExists('RDS',StepRDSNos<1,I>) THEN - CurrRuns += 1 - END -NEXT I - -NextRunNo = CurrRuns + 1 - - -Result = NextRunNo ;* Next Run No returned to calling program -*WORec = NextRunNo + 1 - - -WTParms = FieldStore(WTParms,@RM,4,1,WORec) -obj_Tables('WriteRec',WTParms) ;* Updates WO_LOG record and unlocks it. - + FOR I = 1 TO COUNT(StepRDSNos,@VM) + (StepRDSNos NE '') + IF RowExists('RDS',StepRDSNos<1,I>) THEN + CurrRuns += 1 + END + NEXT I + + NextRunNo = CurrRuns + 1 + + + Result = NextRunNo ;* Next Run No returned to calling program + *WORec = NextRunNo + 1 + + + WTParms = FieldStore(WTParms,@RM,4,1,WORec) + obj_Tables('WriteRec',WTParms) ;* Updates WO_LOG record and unlocks it. + RETURN * * * * * * * AddCassNo: * * * * * * * - - -WONo = Parms[1,@RM] -CassNo = Parms[COL2()+1,@RM] - -IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' -IF CassNo = '' THEN ErrorMsg = 'Null parameter "CassNo" passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN - -WTParms = 'WO_LOG':@RM:WONo -WORec = obj_Tables('ReadRec',WTParms) - -IF Get_Status(errCode) THEN - ErrMsg(errCode) -END ELSE - WOMatKey = WONo:'*':CassNo - LOCATE WOMatKey IN WORec BY 'AR' USING @VM SETTING CassPos THEN - obj_Tables('UnlockRec',WTParms) + + WONo = Parms[1,@RM] + CassNo = Parms[COL2()+1,@RM] + + IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' + IF CassNo = '' THEN ErrorMsg = 'Null parameter "CassNo" passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + WTParms = 'WO_LOG':@RM:WONo + WORec = obj_Tables('ReadRec',WTParms) + + IF Get_Status(errCode) THEN + ErrMsg(errCode) END ELSE - WORec = INSERT(WORec,WO_LOG_WO_MAT_KEY$,CassPos,0,WOMatKey) - WTParms = FieldStore(WTParms,@RM,4,1,WORec) + WOMatKey = WONo:'*':CassNo - obj_Tables('WriteRec',WTParms) ;* Updates WO_LOG record and unlocks it. + LOCATE WOMatKey IN WORec BY 'AR' USING @VM SETTING CassPos THEN + obj_Tables('UnlockRec',WTParms) + END ELSE + WORec = INSERT(WORec,WO_LOG_WO_MAT_KEY$,CassPos,0,WOMatKey) + WTParms = FieldStore(WTParms,@RM,4,1,WORec) + + obj_Tables('WriteRec',WTParms) ;* Updates WO_LOG record and unlocks it. + END END -END - + RETURN @@ -2030,207 +2030,207 @@ RETURN * * * * * * * RemoveCassettes: * * * * * * * - -ErrorMessage = '' -WONo = Parms[1,@RM] -CassNos = Parms[COL2()+1,@RM] - -IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' -IF CassNos = '' THEN ErrorMsg = 'Null parameter "CassNos" passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN - - -AllCassIDs = '' -CassCnt = COUNT(CassNos,@VM) + (CassNos NE '') -FOR I = 1 TO CassCnt - AllCassIDs<1,I> = WONo:'*':CassNos<1,I> -NEXT I - -AllRDSNos = XLATE('WO_MAT',AllCassIDs,WO_MAT_RDS_NO$,'X') - -! Deprecated code 01/04/2022 - DJS -* WTParms = 'WO_LOG':@RM:WONo -* WORec = obj_Tables('ReadRec',WTParms) - -WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo) -If Error_Services('NoError') then - - FOR I = 1 TO COUNT(CassNos,@VM) + (CassNos NE '') - CassNo = CassNos<1,I> - - Set_Status(0) - obj_WO_Mat('Delete',WONo:@RM:CassNo) - - IF Get_Status(errCode) THEN - ErrMsg(errCode) - END ELSE - WOMatKey = WONo:'*':CassNo - LOCATE WOMatKey IN WORec USING @VM SETTING CassPos THEN - WORec = DELETE(WORec,WO_LOG_WO_MAT_KEY$,CassPos,0) - END - END - - NEXT I - Database_Services('WriteDataRow', 'WO_LOG', WONo, WORec) - If Error_Services('HasError') then ErrorMessage = Error_Services('GetMessage') -end else - ErrorMessage = Error_Services('GetMessage') -end - -If ErrorMessage NE '' then - ErrMsg(ErrorMessage) - LogData = '' - LogData<1> = LoggingDTM - LogData<2> = @User4 - LogData<3> = WONo - LogData<4> = 'Error in obj_WO_Log("RemoveCassettes"). Error message: ':ErrorMessage - Logging_Services('AppendLog', objLog, LogData, @RM, @FM) -end - -! Deprecated code 01/04/2022 - DJS -* WTParms = FieldStore(WTParms,@RM,4,1,WORec) -* obj_Tables('WriteRec',WTParms) - + + ErrorMessage = '' + WONo = Parms[1,@RM] + CassNos = Parms[COL2()+1,@RM] + + IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' + IF CassNos = '' THEN ErrorMsg = 'Null parameter "CassNos" passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + + AllCassIDs = '' + CassCnt = COUNT(CassNos,@VM) + (CassNos NE '') + FOR I = 1 TO CassCnt + AllCassIDs<1,I> = WONo:'*':CassNos<1,I> + NEXT I + + AllRDSNos = XLATE('WO_MAT',AllCassIDs,WO_MAT_RDS_NO$,'X') + + ! Deprecated code 01/04/2022 - DJS + * WTParms = 'WO_LOG':@RM:WONo + * WORec = obj_Tables('ReadRec',WTParms) + + WORec = Database_Services('ReadDataRow', 'WO_LOG', WONo) + If Error_Services('NoError') then + + FOR I = 1 TO COUNT(CassNos,@VM) + (CassNos NE '') + CassNo = CassNos<1,I> + + Set_Status(0) + obj_WO_Mat('Delete',WONo:@RM:CassNo) + + IF Get_Status(errCode) THEN + ErrMsg(errCode) + END ELSE + WOMatKey = WONo:'*':CassNo + LOCATE WOMatKey IN WORec USING @VM SETTING CassPos THEN + WORec = DELETE(WORec,WO_LOG_WO_MAT_KEY$,CassPos,0) + END + END + + NEXT I + Database_Services('WriteDataRow', 'WO_LOG', WONo, WORec) + If Error_Services('HasError') then ErrorMessage = Error_Services('GetMessage') + end else + ErrorMessage = Error_Services('GetMessage') + end + + If ErrorMessage NE '' then + ErrMsg(ErrorMessage) + LogData = '' + LogData<1> = LoggingDTM + LogData<2> = @User4 + LogData<3> = WONo + LogData<4> = 'Error in obj_WO_Log("RemoveCassettes"). Error message: ':ErrorMessage + Logging_Services('AppendLog', objLog, LogData, @RM, @FM) + end + + ! Deprecated code 01/04/2022 - DJS + * WTParms = FieldStore(WTParms,@RM,4,1,WORec) + * obj_Tables('WriteRec',WTParms) + RETURN * * * * * * * SetPartNo: * * * * * * * - -WONo = Parms[1,@RM] -NewPartNo = Parms[COL2()+1,@RM] -OrgPartNo = Parms[COL2()+1,@RM] - - -IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' -IF NewPartNo = '' THEN ErrorMsg = 'Null parameter "NewPartNo" passed to routine. (':Method:')' -IF OrgPartNo = '' THEN ErrorMsg = 'Null parameter "OrgPartNo" passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN - -WORec = XLATE('WO_LOG',WONo,'','X') - -WOMatKeys = WORec - -obj_WO_Mat('SetPartNo',WOMatKeys:@RM:NewPartNo) - + + WONo = Parms[1,@RM] + NewPartNo = Parms[COL2()+1,@RM] + OrgPartNo = Parms[COL2()+1,@RM] + + + IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' + IF NewPartNo = '' THEN ErrorMsg = 'Null parameter "NewPartNo" passed to routine. (':Method:')' + IF OrgPartNo = '' THEN ErrorMsg = 'Null parameter "OrgPartNo" passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + WORec = XLATE('WO_LOG',WONo,'','X') + + WOMatKeys = WORec + + obj_WO_Mat('SetPartNo',WOMatKeys:@RM:NewPartNo) + RETURN * * * * * * * RefreshSigProfile: * * * * * * * - -WONo = Parms[1,@RM] - -IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN - -WOMatKeys = XLATE('WO_LOG',WONo,WO_LOG_WO_MAT_KEY$,'X') - -WOMatCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '') - -FOR I = 1 TO WOMatCnt - Set_Status(0) - WOMatKey = WOMatKeys<1,I> - obj_WO_Mat('RefreshSigProfile',WOMatKey) + WONo = Parms[1,@RM] + + IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + WOMatKeys = XLATE('WO_LOG',WONo,WO_LOG_WO_MAT_KEY$,'X') + + WOMatCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '') + + FOR I = 1 TO WOMatCnt + Set_Status(0) + + WOMatKey = WOMatKeys<1,I> + obj_WO_Mat('RefreshSigProfile',WOMatKey) + + IF Get_Status(errCode) THEN ErrMsg(errCode) + + NEXT I + - IF Get_Status(errCode) THEN ErrMsg(errCode) - -NEXT I - - RETURN * * * * * * * RelQty: * * * * * * * - -WONo = Parms[1,@RM] -WORec = Parms[COL2()+1,@RM] - -IF WONo = '' THEN RETURN - -IF WORec = '' THEN - WORec = XLATE('WO_LOG',WONo,'','X') -END - -IF WORec = '' THEN RETURN - -WOMatKeys = WORec - -LineCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '') - -FOR I = 1 TO LineCnt - WOMatRec = XLATE('WO_MAT',WOMatKeys<1,I>,'','X') -UNTIL WOMatRec = '' - Result += WOMatRec -NEXT I - + + WONo = Parms[1,@RM] + WORec = Parms[COL2()+1,@RM] + + IF WONo = '' THEN RETURN + + IF WORec = '' THEN + WORec = XLATE('WO_LOG',WONo,'','X') + END + + IF WORec = '' THEN RETURN + + WOMatKeys = WORec + + LineCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '') + + FOR I = 1 TO LineCnt + WOMatRec = XLATE('WO_MAT',WOMatKeys<1,I>,'','X') + UNTIL WOMatRec = '' + Result += WOMatRec + NEXT I + RETURN * * * * * * * RelDTMs: * * * * * * * - -WONo = Parms[1,@RM] -WORec = Parms[COL2()+1,@RM] -DtsOnly = Parms[COL2()+1,@RM] - -IF WONo = '' THEN RETURN - -IF WORec = '' THEN - WORec = XLATE('WO_LOG',WONo,'','X') -END - -IF WORec = '' THEN RETURN - - -WOMatKeys = WORec - -AllCassRelDTMs = XLATE('WO_MAT',WOMatKeys,WO_MAT_REL_DTM$,'X') -AllCassRelBys = XLATE('WO_MAT',WOMatKeys,WO_MAT_REL_BY$,'X') - - -WOMatCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '') - -RelDTMs = '' -RelDTs = '' -Result = '' - -FOR N = 1 TO WOMatCnt - - AllCassRelDTM = AllCassRelDTMs<1,N> - AllCassRelBy = OCONV(AllCassRelBys<1,N>,'[XLATE_CONV,LSL_USERS*FIRST_LAST]') + + WONo = Parms[1,@RM] + WORec = Parms[COL2()+1,@RM] + DtsOnly = Parms[COL2()+1,@RM] + + IF WONo = '' THEN RETURN + + IF WORec = '' THEN + WORec = XLATE('WO_LOG',WONo,'','X') + END + + IF WORec = '' THEN RETURN + + + WOMatKeys = WORec + + AllCassRelDTMs = XLATE('WO_MAT',WOMatKeys,WO_MAT_REL_DTM$,'X') + AllCassRelBys = XLATE('WO_MAT',WOMatKeys,WO_MAT_REL_BY$,'X') + + + WOMatCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '') + + RelDTMs = '' + RelDTs = '' + Result = '' + + FOR N = 1 TO WOMatCnt + + AllCassRelDTM = AllCassRelDTMs<1,N> + AllCassRelBy = OCONV(AllCassRelBys<1,N>,'[XLATE_CONV,LSL_USERS*FIRST_LAST]') + + IF DtsOnly = 1 THEN + RelDT = AllCassRelDTM[1,'.'] + + LOCATE RelDT IN RelDTs BY 'AR' USING @VM SETTING DtPos ELSE + RelDTs = INSERT(RelDTs,1,DtPos,0,RelDT) + END + END + + IF AllCassRelDTM NE '' THEN + LOCATE AllCassRelDTM IN RelDTMs USING @VM SETTING Pos THEN + NULL + END ELSE + RelDTMS = INSERT(RelDTMS,1,Pos,0,AllCassRelDTM) + Result = INSERT(Result,1,Pos,0,OCONV(AllCassRelDTM,'DT4/^HS'):' - ':AllCassRelBy) + END + END + NEXT N IF DtsOnly = 1 THEN - RelDT = AllCassRelDTM[1,'.'] - - LOCATE RelDT IN RelDTs BY 'AR' USING @VM SETTING DtPos ELSE - RelDTs = INSERT(RelDTs,1,DtPos,0,RelDT) - END + Result = RelDTs END - IF AllCassRelDTM NE '' THEN - LOCATE AllCassRelDTM IN RelDTMs USING @VM SETTING Pos THEN - NULL - END ELSE - RelDTMS = INSERT(RelDTMS,1,Pos,0,AllCassRelDTM) - Result = INSERT(Result,1,Pos,0,OCONV(AllCassRelDTM,'DT4/^HS'):' - ':AllCassRelBy) - END - END -NEXT N - -IF DtsOnly = 1 THEN - Result = RelDTs -END - RETURN @@ -2238,12 +2238,12 @@ CassRelUsers = XLATE('WO_MAT',@RECORD<31>,28,'X') TimeStamps = '' Tmp = '' FOR I = 1 TO COUNT(CassRelDTMs,@VM) + (CassRelDTMs NE '') - CassRelDTM = CassRelDTMs<1,I> - CassRelUser = CassRelUsers<1,I> - LOCATE CassRelDTM IN TimeStamps SETTING Pos ELSE - TimeStamps = INSERT(TimeStamps,1,Pos,0,CassRelDTM) - Tmp = INSERT(Tmp,1,Pos,0,OCONV(CassRelDTM,'DT2/^HS'):' ':OCONV(CassRelUser,'[XLATE_CONV,LSL_USERS*FIRST_LAST]')) - END + CassRelDTM = CassRelDTMs<1,I> + CassRelUser = CassRelUsers<1,I> + LOCATE CassRelDTM IN TimeStamps SETTING Pos ELSE + TimeStamps = INSERT(TimeStamps,1,Pos,0,CassRelDTM) + Tmp = INSERT(Tmp,1,Pos,0,OCONV(CassRelDTM,'DT2/^HS'):' ':OCONV(CassRelUser,'[XLATE_CONV,LSL_USERS*FIRST_LAST]')) + END NEXT I @ANS = Tmp @@ -2257,115 +2257,115 @@ RETURN * * * * * * * RxQty: * * * * * * * - -WONo = Parms[1,@RM] -WORec = Parms[COL2()+1,@RM] - -IF WONo = '' THEN RETURN - -IF WORec = '' THEN - WORec = XLATE('WO_LOG',WONo,'','X') -END - -IF WORec = '' THEN RETURN - -WOMatKeys = WORec - -LineCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '') - -FOR I = 1 TO LineCnt - WOMatRec = XLATE('WO_MAT',WOMatKeys<1,I>,'','X') -UNTIL WOMatRec = '' - Result += WOMatRec -NEXT I - + + WONo = Parms[1,@RM] + WORec = Parms[COL2()+1,@RM] + + IF WONo = '' THEN RETURN + + IF WORec = '' THEN + WORec = XLATE('WO_LOG',WONo,'','X') + END + + IF WORec = '' THEN RETURN + + WOMatKeys = WORec + + LineCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '') + + FOR I = 1 TO LineCnt + WOMatRec = XLATE('WO_MAT',WOMatKeys<1,I>,'','X') + UNTIL WOMatRec = '' + Result += WOMatRec + NEXT I + RETURN * * * * * * * ShipQty: * * * * * * * - -IF NOT(ASSIGNED(WONo)) THEN WONo = Parms[1,@RM] -IF NOT(ASSIGNED(WORec)) THEN WORec = Parms[COL2()+1,@RM] - -IF WONo = '' THEN RETURN - -IF WORec = '' THEN - WORec = XLATE('WO_LOG',WONo,'','X') -END - -IF WORec = '' THEN RETURN - -WOMatKeys = WORec - -LineCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '') - -FOR I = 1 TO LineCnt - WOMatKey = WOMatKeys<1,I> - WOMatRec = XLATE('WO_MAT',WOMatKey,'','X') - WMOKey = WOMatRec - IF WMOKey NE '' THEN - - WMOutRec = XLATE('WM_OUT',WMOKey,'','X') - ShipNo = WMOutRec - IF ShipNo NE '' THEN - CurrWfrCnt = XLATE('WM_OUT',WMOKey,'WAFER_CNT','X') - Result += CurrWfrCnt - END - END ELSE + IF NOT(ASSIGNED(WONo)) THEN WONo = Parms[1,@RM] + IF NOT(ASSIGNED(WORec)) THEN WORec = Parms[COL2()+1,@RM] - IF WOMatRec NE '' THEN - CurrWfrCnt = obj_WO_Mat('CurrWaferCnt',WOMatKey:@RM:WOMatRec) - Result += CurrWfrCnt - END + IF WONo = '' THEN RETURN + + IF WORec = '' THEN + WORec = XLATE('WO_LOG',WONo,'','X') END -NEXT I - + + IF WORec = '' THEN RETURN + + WOMatKeys = WORec + + LineCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '') + + FOR I = 1 TO LineCnt + WOMatKey = WOMatKeys<1,I> + WOMatRec = XLATE('WO_MAT',WOMatKey,'','X') + WMOKey = WOMatRec + + IF WMOKey NE '' THEN + + WMOutRec = XLATE('WM_OUT',WMOKey,'','X') + ShipNo = WMOutRec + IF ShipNo NE '' THEN + CurrWfrCnt = XLATE('WM_OUT',WMOKey,'WAFER_CNT','X') + Result += CurrWfrCnt + END + END ELSE + + IF WOMatRec NE '' THEN + CurrWfrCnt = obj_WO_Mat('CurrWaferCnt',WOMatKey:@RM:WOMatRec) + Result += CurrWfrCnt + END + END + NEXT I + RETURN * * * * * * * ShipPropTarg: * * * * * * * - -IF NOT(ASSIGNED(WONo)) THEN WONo = Parms[1,@RM] -IF NOT(ASSIGNED(WORec)) THEN WORec = Parms[COL2()+1,@RM] -IF NOT(ASSIGNED(PropCd)) THEN PropCd = Parms[COL2()+1,@RM] - -IF WONo = '' THEN RETURN - -IF WORec = '' THEN - WORec = XLATE('WO_LOG',WONo,'','X') -END - -IF WORec = '' THEN RETURN -IF PropCd = '' THEN RETURN - -LastWOStepKey = WORec[-1,'B':@VM] -StepPSN = XLATE('WO_STEP',LastWOStepKey,WO_STEP_PROD_SPEC_ID$,'X') -PRSLayerKeys = XLATE('PROD_SPEC',StepPSN,PROD_SPEC_PRS_LAYER_KEY$,'X') - -LastPRSLayerKey = PRSLayerKeys[-1,'B':@VM] - -LastLayerProps = XLATE('PRS_LAYER',LastPRSLayerKey,PRS_LAYER_PRS_PROP_KEY$,'X') - -PropCnt = COUNT(LastLayerProps,@VM) + (LastLayerProps NE '') - -FOR I = 1 TO PropCnt - PropKey = LastLayerProps<1,I> - SpecPropCd = FIELD(PropKey,'*',3) - - IF SpecPropCd[1,5] = PropCd THEN - PropRec = XLATE('PRS_PROP',PropKey,'','X') - MinVal = PropRec<2> - MaxVal = PropRec<3> - Target = MinVal + ((MaxVal - MinVal)/2) - Result = OCONV( Target,'[MET_PROP_CONV,':PropCd:']') - END -NEXT I - + + IF NOT(ASSIGNED(WONo)) THEN WONo = Parms[1,@RM] + IF NOT(ASSIGNED(WORec)) THEN WORec = Parms[COL2()+1,@RM] + IF NOT(ASSIGNED(PropCd)) THEN PropCd = Parms[COL2()+1,@RM] + + IF WONo = '' THEN RETURN + + IF WORec = '' THEN + WORec = XLATE('WO_LOG',WONo,'','X') + END + + IF WORec = '' THEN RETURN + IF PropCd = '' THEN RETURN + + LastWOStepKey = WORec[-1,'B':@VM] + StepPSN = XLATE('WO_STEP',LastWOStepKey,WO_STEP_PROD_SPEC_ID$,'X') + PRSLayerKeys = XLATE('PROD_SPEC',StepPSN,PROD_SPEC_PRS_LAYER_KEY$,'X') + + LastPRSLayerKey = PRSLayerKeys[-1,'B':@VM] + + LastLayerProps = XLATE('PRS_LAYER',LastPRSLayerKey,PRS_LAYER_PRS_PROP_KEY$,'X') + + PropCnt = COUNT(LastLayerProps,@VM) + (LastLayerProps NE '') + + FOR I = 1 TO PropCnt + PropKey = LastLayerProps<1,I> + SpecPropCd = FIELD(PropKey,'*',3) + + IF SpecPropCd[1,5] = PropCd THEN + PropRec = XLATE('PRS_PROP',PropKey,'','X') + MinVal = PropRec<2> + MaxVal = PropRec<3> + Target = MinVal + ((MaxVal - MinVal)/2) + Result = OCONV( Target,'[MET_PROP_CONV,':PropCd:']') + END + NEXT I + RETURN @@ -2373,170 +2373,170 @@ RETURN * * * * * * CloseComp: * * * * * * - -CompOrShipShort = Parms[1,@RM] - -IF CompOrShipShort = '' THEN RETURN - -MsgUp = Msg(@WINDOW,'','SELECT_OPEN_WO') - -IF Get_Status(errCode) THEN RETURN - -IF CompOrShipShort = 'Comp' THEN - SelectStatement = 'SELECT WO_LOG WITH CURR_STATUS = "COMP" AND WITHOUT CLOSE_DATE ' -END ELSE - SelectStatement = 'SELECT WO_LOG WITH CURR_STATUS = "INPR" "SHIP" AND WITHOUT CLOSE_DATE ' -END - -RList(SelectStatement, TARGET_ACTIVELIST$, '','','') - -IF Get_Status(errCode) THEN - ErrMsg(errCode) - Msg(@WINDOW,MsgUp) - RETURN -END - -Msg(@WINDOW,MsgUp) - -WONos = Popup(@WINDOW,'','OPEN_WORK_ORDERS') - -IF WONos = '' OR WONos = CHAR(27) THEN RETURN - -IF Get_Status(errCode) THEN - ErrMsg(errCode) - RETURN -END - -DelCnt = COUNT(WONos,@VM) + (WONos NE '') - -Proceed = Msg(@WINDOW,'','WO_CLOSE','',DelCnt) - -IF Proceed = 0 THEN RETURN ;* Bailed Out - -Today = Date() - -Def = "" -Def = "Closing Work Orders..." -Def = "GC" -Def = DelCnt -Def = 200 - -MsgUp = Msg(@window, Def) - -FOR I = 1 TO DelCnt - WONo = WONos<1,I> -WHILE Msg(@WINDOW,MsgUp,I,MSGINSTUPDATE$) + CompOrShipShort = Parms[1,@RM] - otParms = 'WO_LOG':@RM:WONo - WOLogRec = obj_Tables('ReadRec',otParms) ;* Reads and sets lock - - IF Get_Status(errCode) THEN - ErrMsg(errCode) + IF CompOrShipShort = '' THEN RETURN + + MsgUp = Msg(@WINDOW,'','SELECT_OPEN_WO') + + IF Get_Status(errCode) THEN RETURN + + IF CompOrShipShort = 'Comp' THEN + SelectStatement = 'SELECT WO_LOG WITH CURR_STATUS = "COMP" AND WITHOUT CLOSE_DATE ' END ELSE - WOLogRec = Today - otParms = FIELDSTORE(otParms,@RM,4,0,WOLogRec) - obj_Tables('WriteRec',otParms) + SelectStatement = 'SELECT WO_LOG WITH CURR_STATUS = "INPR" "SHIP" AND WITHOUT CLOSE_DATE ' END -NEXT I - -Msg(@WINDOW, MsgUp) ;* take down the gauge - + + RList(SelectStatement, TARGET_ACTIVELIST$, '','','') + + IF Get_Status(errCode) THEN + ErrMsg(errCode) + Msg(@WINDOW,MsgUp) + RETURN + END + + Msg(@WINDOW,MsgUp) + + WONos = Popup(@WINDOW,'','OPEN_WORK_ORDERS') + + IF WONos = '' OR WONos = CHAR(27) THEN RETURN + + IF Get_Status(errCode) THEN + ErrMsg(errCode) + RETURN + END + + DelCnt = COUNT(WONos,@VM) + (WONos NE '') + + Proceed = Msg(@WINDOW,'','WO_CLOSE','',DelCnt) + + IF Proceed = 0 THEN RETURN ;* Bailed Out + + Today = Date() + + Def = "" + Def = "Closing Work Orders..." + Def = "GC" + Def = DelCnt + Def = 200 + + MsgUp = Msg(@window, Def) + + FOR I = 1 TO DelCnt + WONo = WONos<1,I> + + WHILE Msg(@WINDOW,MsgUp,I,MSGINSTUPDATE$) + + otParms = 'WO_LOG':@RM:WONo + WOLogRec = obj_Tables('ReadRec',otParms) ;* Reads and sets lock + + IF Get_Status(errCode) THEN + ErrMsg(errCode) + END ELSE + WOLogRec = Today + otParms = FIELDSTORE(otParms,@RM,4,0,WOLogRec) + obj_Tables('WriteRec',otParms) + END + NEXT I + + Msg(@WINDOW, MsgUp) ;* take down the gauge + RETURN * * * * * * * Route: * * * * * * * - -WONo = Parms[1,@RM] -ProdVerNo = Parms[COL2()+1,@RM] - -IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' -IF ProdVerNo = '' THEN ErrorMsg = 'Null parameter "ProdVerNo" passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN - -otParms = 'WO_LOG':@RM:WONo -WOLogRec = obj_Tables('ReadRec',otParms) ;* Reads and sets lock - -IF Get_Status(errCode) THEN RETURN - - -WOStepKeys = WOLogRec - -IF WOStepKeys NE '' THEN - WOStepPSN = Xlate('WO_STEP', WOStepKeys, 'PROD_SPEC_ID', 'X') - If WOStepPSN NE '' then - ErrorMsg = 'WO has WO_STEPS already defined.' - obj_Tables('UnlockRec',otParms) - RETURN - END -END - -* Good lock and WO_LOG record * - -ProdVerRec = XLATE('PROD_VER',ProdVerNo,'','X') - -* Add WO_STEP records - -ProcSteps = ProdVerRec -ProcPSNs = ProdVerRec -ProcDescs = ProdVerRec - -ProcPSNStatuses = XLATE('PROD_SPEC',ProcPSNs,PROD_SPEC_STATUS$,'X') -ProcPSNReactTypes = Xlate('PROD_SPEC',ProcPSNs,PROD_SPEC_REACTOR_TYPE$,'X') - -FOR P = 1 TO COUNT(ProcPSNStatuses,@VM) + (ProcPSNStatuses NE '') - IF ProcPSNStatuses<1,P> NE 'A' THEN - ErrorMsg = 'Product Spec on Hold on Prod Ver No.' - obj_Tables('UnlockRec',otParms) - RETURN + + WONo = Parms[1,@RM] + ProdVerNo = Parms[COL2()+1,@RM] + + IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' + IF ProdVerNo = '' THEN ErrorMsg = 'Null parameter "ProdVerNo" passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + otParms = 'WO_LOG':@RM:WONo + WOLogRec = obj_Tables('ReadRec',otParms) ;* Reads and sets lock + + IF Get_Status(errCode) THEN RETURN + + + WOStepKeys = WOLogRec + + IF WOStepKeys NE '' THEN + WOStepPSN = Xlate('WO_STEP', WOStepKeys, 'PROD_SPEC_ID', 'X') + If WOStepPSN NE '' then + ErrorMsg = 'WO has WO_STEPS already defined.' + obj_Tables('UnlockRec',otParms) + RETURN + END END -NEXT P - -CustNo = WOLogRec -EpiPartNo = WOLogRec - -DefWMOCassQtys = XLATE('CUST_EPI_PART',CustNo:'*':EpiPartNo,CUST_EPI_PART_WMO_LOAD_CNT$,'X') - - -WOStepKeys = '' -DefWMOCassQty = '' - -FOR N = 1 TO COUNT(ProcSteps,@VM) + (ProcSteps NE '') - - ProcStep = ProcSteps<1,N> - ProcPSN = ProcPSNs<1,N> - ProcDesc = ProcDescs<1,N> - obj_WO_Step('Create',WONo:@RM:ProcStep:@RM:ProcPSN:@RM:ProcDesc) + * Good lock and WO_LOG record * - IF DefWMOCassQtys<1,N> NE '' THEN DefWMOCassQty = DefWMOCassQtys<1,N> + ProdVerRec = XLATE('PROD_VER',ProdVerNo,'','X') - WOStepKeys<1,N> = WONo:'*':ProcStep + * Add WO_STEP records -NEXT N - -WOLogRec = WOStepKeys ;* This is currently a relational target * 11/2/2011 jch, might change later -WOLogRec = DefWMOCassQty -WOLogRec = ProcPSNReactTypes<1,1> ;* Assumes both steps run on same reactor type - -* Add rest of WO fields -CustNo = ProdVerRec -EpiPN = ProdVerRec - -Captive = XLATE('COMPANY',CustNo,COMPANY_CAPTIVE$,'X') - -IF Captive = 1 THEN - WOLogRec = EpiPN -END - -WOLogRec = ProdVerNo -WOLogRec = CustNo - -otParms = FIELDSTORE(otParms,@RM,4,0,WOLogRec) -obj_Tables('WriteRec',otParms) + ProcSteps = ProdVerRec + ProcPSNs = ProdVerRec + ProcDescs = ProdVerRec + + ProcPSNStatuses = XLATE('PROD_SPEC',ProcPSNs,PROD_SPEC_STATUS$,'X') + ProcPSNReactTypes = Xlate('PROD_SPEC',ProcPSNs,PROD_SPEC_REACTOR_TYPE$,'X') + + FOR P = 1 TO COUNT(ProcPSNStatuses,@VM) + (ProcPSNStatuses NE '') + IF ProcPSNStatuses<1,P> NE 'A' THEN + ErrorMsg = 'Product Spec on Hold on Prod Ver No.' + obj_Tables('UnlockRec',otParms) + RETURN + END + NEXT P + + CustNo = WOLogRec + EpiPartNo = WOLogRec + + DefWMOCassQtys = XLATE('CUST_EPI_PART',CustNo:'*':EpiPartNo,CUST_EPI_PART_WMO_LOAD_CNT$,'X') + + + WOStepKeys = '' + DefWMOCassQty = '' + + FOR N = 1 TO COUNT(ProcSteps,@VM) + (ProcSteps NE '') + + ProcStep = ProcSteps<1,N> + ProcPSN = ProcPSNs<1,N> + ProcDesc = ProcDescs<1,N> + + obj_WO_Step('Create',WONo:@RM:ProcStep:@RM:ProcPSN:@RM:ProcDesc) + + IF DefWMOCassQtys<1,N> NE '' THEN DefWMOCassQty = DefWMOCassQtys<1,N> + + WOStepKeys<1,N> = WONo:'*':ProcStep + + NEXT N + + WOLogRec = WOStepKeys ;* This is currently a relational target * 11/2/2011 jch, might change later + WOLogRec = DefWMOCassQty + WOLogRec = ProcPSNReactTypes<1,1> ;* Assumes both steps run on same reactor type + + * Add rest of WO fields + CustNo = ProdVerRec + EpiPN = ProdVerRec + + Captive = XLATE('COMPANY',CustNo,COMPANY_CAPTIVE$,'X') + + IF Captive = 1 THEN + WOLogRec = EpiPN + END + + WOLogRec = ProdVerNo + WOLogRec = CustNo + + otParms = FIELDSTORE(otParms,@RM,4,0,WOLogRec) + obj_Tables('WriteRec',otParms) RETURN @@ -2545,477 +2545,431 @@ RETURN * * * * * * * Unroute: * * * * * * * - -WONo = Parms[1,@RM] - -IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' - -IF ErrorMsg NE '' THEN RETURN - -otParms = 'WO_LOG':@RM:WONo -WOLogRec = obj_Tables('ReadRec',otParms) ;* Reads and sets lock - - -IF Get_Status(errCode) THEN RETURN - -IF WOLogRec NE '' THEN - ErrorMsg = 'WO has been released and may not Unrouted.' - obj_Tables('UnlockRec',otParms) - RETURN -END - - -WOStepKeys = WOLogRec - -StepCnt = COUNT(WOStepKeys,@VM) + (WOStepKeys NE '') - -FOR I = 1 TO StepCnt - WOStepKey = WOStepKeys<1,I> - StepNo = FIELD(WOStepKey,'*',2) - obj_WO_Step('Delete',WONo:@RM:StepNo) - IF Get_Status(errCode) THEN + WONo = Parms[1,@RM] + + IF WONo = '' THEN ErrorMsg = 'Null parameter "WONo" passed to routine. (':Method:')' + + IF ErrorMsg NE '' THEN RETURN + + otParms = 'WO_LOG':@RM:WONo + WOLogRec = obj_Tables('ReadRec',otParms) ;* Reads and sets lock + + + IF Get_Status(errCode) THEN RETURN + + IF WOLogRec NE '' THEN + ErrorMsg = 'WO has been released and may not Unrouted.' obj_Tables('UnlockRec',otParms) RETURN END -NEXT I - -WOLogRec = '' -WOLogRec = '' -WOLogRec = '' -WOLogRec = '' -WOLogRec = '' - -otParms = FIELDSTORE(otParms,@RM,4,0,WOLogRec) -obj_Tables('WriteRec',otParms) - + + + WOStepKeys = WOLogRec + + StepCnt = COUNT(WOStepKeys,@VM) + (WOStepKeys NE '') + + FOR I = 1 TO StepCnt + WOStepKey = WOStepKeys<1,I> + StepNo = FIELD(WOStepKey,'*',2) + + obj_WO_Step('Delete',WONo:@RM:StepNo) + IF Get_Status(errCode) THEN + obj_Tables('UnlockRec',otParms) + RETURN + END + NEXT I + + WOLogRec = '' + WOLogRec = '' + WOLogRec = '' + WOLogRec = '' + WOLogRec = '' + + otParms = FIELDSTORE(otParms,@RM,4,0,WOLogRec) + obj_Tables('WriteRec',otParms) + RETURN * * * * * * * GetAvgCycleTimes: * * * * * * * - -IF NOT(Assigned(WONo)) THEN WONo = Parms[1,@RM] -IF NOT(Assigned(WOLogRec)) THEN WOLogRec = Parms[COL2()+1,@RM] - -IF WONo = '' THEN RETURN -IF WOLogRec = '' THEN - WOLogRec = XLATE('WO_LOG',WONo,'','X') - IF WOLogRec = '' THEN RETURN -END - -ProdVerNo = WOLogRec -ReactType = XLATE('PROD_VER', ProdVerNo,PROD_VER_REACT_TYPE$, 'X' ) - -IF ReactType = 'EPP' THEN - - * EpiPRO - RelToVerTime = '' + IF NOT(Assigned(WONo)) THEN WONo = Parms[1,@RM] + IF NOT(Assigned(WOLogRec)) THEN WOLogRec = Parms[COL2()+1,@RM] - FirstWOMatKey = WOLogRec - WOMatRec= XLATE('WO_MAT',FirstWOMatKey,'','X') - StartDTM = WOMatRec - - WOStepKey = WOLogRec - RDSNos = XLATE('WO_STEP',WOStepKey,WO_STEP_RDS_KEY$,'X') - StopDTM = XLATE('REACT_RUN',RDSNos<1,1>,REACT_RUN_VER_SIG_DTM$,'X') - - IF StartDTM NE '' AND StopDTM NE '' THEN - RelToVerTime = ICONV((StopDTM - StartDTM)*24,'MD1') + IF WONo = '' THEN RETURN + IF WOLogRec = '' THEN + WOLogRec = XLATE('WO_LOG',WONo,'','X') + IF WOLogRec = '' THEN RETURN END - * Average Cycle Time + ProdVerNo = WOLogRec + ReactType = XLATE('PROD_VER', ProdVerNo,PROD_VER_REACT_TYPE$, 'X' ) - TotCycleTime = 0 - TotCycleCnt = 0 - - RDSCnt = COUNT(RDSNos,@VM) + (RDSNos NE '') - - FOR I = 1 TO RDSCnt - StartDTM = '' - StopDTM = '' - ReactRunRec = XLATE('REACT_RUN',RDSNos<1,I>,'','X') - StartDTM = ReactRunRec - StopDTM = ReactRunRec + IF ReactType = 'EPP' THEN + + * EpiPRO + + RelToVerTime = '' + + FirstWOMatKey = WOLogRec + WOMatRec= XLATE('WO_MAT',FirstWOMatKey,'','X') + StartDTM = WOMatRec + + WOStepKey = WOLogRec + RDSNos = XLATE('WO_STEP',WOStepKey,WO_STEP_RDS_KEY$,'X') + StopDTM = XLATE('REACT_RUN',RDSNos<1,1>,REACT_RUN_VER_SIG_DTM$,'X') IF StartDTM NE '' AND StopDTM NE '' THEN - CycleTime = (StopDTM - StartDTM)*24 ;* DTM's in decimal days - TotCycleTime += CycleTime - TotCycleCnt += 1 + RelToVerTime = ICONV((StopDTM - StartDTM)*24,'MD1') END - NEXT I - - IF TotCycleCnt > 0 THEN - AvgCycleTime = ICONV(TotCycleTime/TotCycleCnt,'MD1') + + * Average Cycle Time + + TotCycleTime = 0 + TotCycleCnt = 0 + + RDSCnt = COUNT(RDSNos,@VM) + (RDSNos NE '') + + FOR I = 1 TO RDSCnt + StartDTM = '' + StopDTM = '' + ReactRunRec = XLATE('REACT_RUN',RDSNos<1,I>,'','X') + StartDTM = ReactRunRec + StopDTM = ReactRunRec + + IF StartDTM NE '' AND StopDTM NE '' THEN + CycleTime = (StopDTM - StartDTM)*24 ;* DTM's in decimal days + TotCycleTime += CycleTime + TotCycleCnt += 1 + END + NEXT I + + IF TotCycleCnt > 0 THEN + AvgCycleTime = ICONV(TotCycleTime/TotCycleCnt,'MD1') + END ELSE + AvgCycleTime = '' + END + END ELSE - AvgCycleTime = '' - END + + * ASM + + WOMatKeys = WOLogRec + + WOMatCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '') + + * RelToVerTime Calculation + + RelToVerTime = '' + + FirstWOMatKey = WOLogRec + WOMatRec= XLATE('WO_MAT',FirstWOMatKey,'','X') + StartDTM = WOMatRec + + RDSNos = WOMatRec + StopDTM = XLATE('REACT_RUN',RDSNos<1,1>,REACT_RUN_VER_SIG_DTM$,'X') + + IF StartDTM NE '' AND StopDTM NE '' THEN + RelToVerTime = ICONV((StopDTM - StartDTM)*24,'MD1') + END + + TotCycleTime = 0 + TotCycleCnt = 0 + + FOR I = 1 TO WOMatCnt + + CycleTime = obj_WO_Mat('GetCycleTime',WOMatKeys<1,I>:@RM:'':@RM:'VER':@RM:'QA') + + IF CycleTime NE '' THEN + TotCycleTime += OCONV(CycleTime,'MD1') + TotCycleCnt += 1 + END + + NEXT I + + IF TotCycleCnt > 0 THEN + AvgCycleTime = ICONV(TotCycleTime/TotCycleCnt,'MD1') + END ELSE + AvgCycleTime = '' + END + + + END ;* End of check for EpiPRO (EPP) reactor type -END ELSE - - * ASM + * QA To Ship Time WOMatKeys = WOLogRec WOMatCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '') - * RelToVerTime Calculation + TotQAShipTime = 0 + TotQAShipCnt = 0 - RelToVerTime = '' - - FirstWOMatKey = WOLogRec - WOMatRec= XLATE('WO_MAT',FirstWOMatKey,'','X') - StartDTM = WOMatRec - - RDSNos = WOMatRec - StopDTM = XLATE('REACT_RUN',RDSNos<1,1>,REACT_RUN_VER_SIG_DTM$,'X') - - IF StartDTM NE '' AND StopDTM NE '' THEN - RelToVerTime = ICONV((StopDTM - StartDTM)*24,'MD1') - END - - TotCycleTime = 0 - TotCycleCnt = 0 FOR I = 1 TO WOMatCnt - - CycleTime = obj_WO_Mat('GetCycleTime',WOMatKeys<1,I>:@RM:'':@RM:'VER':@RM:'QA') - - IF CycleTime NE '' THEN - TotCycleTime += OCONV(CycleTime,'MD1') - TotCycleCnt += 1 + WOMatKey = WOMatKeys<1,I> + QAShipTime = obj_WO_Mat('GetCycleTime',WOMatKey:@RM:'':@RM:'QA':@RM:'SB') + IF QAShipTime NE '' THEN + TotQAShipTime += OCONV(QAShipTime,'MD1') + TotQAShipCnt += 1 END - NEXT I - IF TotCycleCnt > 0 THEN - AvgCycleTime = ICONV(TotCycleTime/TotCycleCnt,'MD1') + IF TotQAShipCnt > 0 THEN + AvgQAShipTime = ICONV(TotQAShipTime/TotQAShipCnt,'MD1') END ELSE - AvgCycleTime = '' + AvgQAShipTime = '' END + Result = RelToVerTime:@FM:AvgCycleTime:@FM:AvgQAShipTime -END ;* End of check for EpiPRO (EPP) reactor type - -* QA To Ship Time - -WOMatKeys = WOLogRec - -WOMatCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '') - -TotQAShipTime = 0 -TotQAShipCnt = 0 - - -FOR I = 1 TO WOMatCnt - WOMatKey = WOMatKeys<1,I> - QAShipTime = obj_WO_Mat('GetCycleTime',WOMatKey:@RM:'':@RM:'QA':@RM:'SB') - IF QAShipTime NE '' THEN - TotQAShipTime += OCONV(QAShipTime,'MD1') - TotQAShipCnt += 1 - END -NEXT I - -IF TotQAShipCnt > 0 THEN - AvgQAShipTime = ICONV(TotQAShipTime/TotQAShipCnt,'MD1') -END ELSE - AvgQAShipTime = '' -END - -Result = RelToVerTime:@FM:AvgCycleTime:@FM:AvgQAShipTime - RETURN * * * * * * * TimeTarget: * * * * * * * - -WONo = Parms[1,@RM] -WOLogRec = Parms[COL2()+1,@RM] - -IF WONo = '' THEN RETURN -IF WOLogRec = '' THEN - WOLogRec = XLATE('WO_LOG',WONo,'','X') - IF WOLogRec = '' THEN RETURN -END - - -GOSUB GetAvgCycleTimes - -WOAvgCycleTime = OCONV(Result<2>,'MD1') - -Result = '' ;* Clear result set by GetAvgCycleTimes method - -ProdVerNo = WOLogRec -ReactType = OCONV(XLATE('PROD_VER', ProdVerNo,PROD_VER_REACT_TYPE$, 'X' ),'[REACT_TYPE_CONV,OPSREF]') - - - -IF ReactType = '' THEN RETURN -IF WOAvgCycleTime = '' THEN RETURN - -EpiPartNo = WOLogRec -AllTargThick = SUM(XLATE('EPI_PART',EpiPartNo,'EPI_THICK_TARG','X')) -ThickOconv = XLATE('DICT.EPI_PART','EPI_THICK_TARG',DICT_CONV$,'X') -TargThick = OCONV(AllTargThick,ThickOconv) - -BaseLine = 5.5 ;* 1st Wafer + Cleans + Tencor + QA + Bag (from Chad) -XFactor = 0 ;* Calculated periodically by Manufacturing Manager - - - -BEGIN CASE - CASE ReactType = 'ASM' - t1 = 157.95 - t2 = 3.673*TargThick - t3 = 0.1294*((TargThick - 17.5)*(TargThick - 17.5)) - - CASE ReactType = 'ASM+' - t1 = 185.81 - t2 = 4.276*TargThick - t3 = 0.1485*((TargThick - 17.5)*(TargThick - 17.5)) - CASE ReactType = 'HTR' - t1 = 263.274 - t2 = 2.7118*TargThick - t3 = 0.04015*((TargThick - 35.0)*(TargThick - 35.0)) + WONo = Parms[1,@RM] + WOLogRec = Parms[COL2()+1,@RM] + + IF WONo = '' THEN RETURN + IF WOLogRec = '' THEN + WOLogRec = XLATE('WO_LOG',WONo,'','X') + IF WOLogRec = '' THEN RETURN + END - CASE ReactType = 'EpiPro' - t1 = 268.985 - t2 = 1.0867*TargThick - t3 = 0.0059595*((TargThick - 67.5)*(TargThick - 67.5)) - - CASE 1 - RETURN - -END CASE - -WfrsPerDay = t1 - t2 + t3 -HrsPerBox = 24/(WfrsPerDay/25) - -OutHrsPerBox = OCONV(ICONV(HrsPerBox,'MD1'),'MD1') - -CalcCycleTime = Baseline + OutHrsPerBox + XFactor - -CycleTimeDelta = WOAvgCycleTime - CalcCycleTime - -Result = CycleTimeDelta - + GOSUB GetAvgCycleTimes + + WOAvgCycleTime = OCONV(Result<2>,'MD1') + + Result = '' ;* Clear result set by GetAvgCycleTimes method + + ProdVerNo = WOLogRec + ReactType = OCONV(XLATE('PROD_VER', ProdVerNo,PROD_VER_REACT_TYPE$, 'X' ),'[REACT_TYPE_CONV,OPSREF]') + + + + IF ReactType = '' THEN RETURN + IF WOAvgCycleTime = '' THEN RETURN + + EpiPartNo = WOLogRec + AllTargThick = SUM(XLATE('EPI_PART',EpiPartNo,'EPI_THICK_TARG','X')) + ThickOconv = XLATE('DICT.EPI_PART','EPI_THICK_TARG',DICT_CONV$,'X') + TargThick = OCONV(AllTargThick,ThickOconv) + + BaseLine = 5.5 ;* 1st Wafer + Cleans + Tencor + QA + Bag (from Chad) + XFactor = 0 ;* Calculated periodically by Manufacturing Manager + + + + BEGIN CASE + CASE ReactType = 'ASM' + t1 = 157.95 + t2 = 3.673*TargThick + t3 = 0.1294*((TargThick - 17.5)*(TargThick - 17.5)) + + CASE ReactType = 'ASM+' + t1 = 185.81 + t2 = 4.276*TargThick + t3 = 0.1485*((TargThick - 17.5)*(TargThick - 17.5)) + + CASE ReactType = 'HTR' + t1 = 263.274 + t2 = 2.7118*TargThick + t3 = 0.04015*((TargThick - 35.0)*(TargThick - 35.0)) + + + CASE ReactType = 'EpiPro' + t1 = 268.985 + t2 = 1.0867*TargThick + t3 = 0.0059595*((TargThick - 67.5)*(TargThick - 67.5)) + + CASE 1 + RETURN + + END CASE + + WfrsPerDay = t1 - t2 + t3 + HrsPerBox = 24/(WfrsPerDay/25) + + OutHrsPerBox = OCONV(ICONV(HrsPerBox,'MD1'),'MD1') + + CalcCycleTime = Baseline + OutHrsPerBox + XFactor + + CycleTimeDelta = WOAvgCycleTime - CalcCycleTime + + Result = CycleTimeDelta + RETURN * * * * * * * PcntComp: * * * * * * * - -WONo = Parms[1,@RM] -WOLogRec = Parms[COL2()+1,@RM] - -IF WONo = '' THEN RETURN - -IF WOLogRec = '' THEN - WOLogRec = XLATE('WO_LOG',WONo,'','X') -END - -IF WOLogRec = '' THEN RETURN - -StepNo = WOLogRec[-1,'B*'] ;* This is the shipping step for multi step WO's - -WOMatKeys = WOLogRec - -WOMatCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '') - -WOWfrQty = SUM(XLATE('WO_MAT',WOMatKeys,WO_MAT_WAFER_QTY$,'X')) -WOOrderQty = WOLogRec - -* Split for reactor types here - -ProdVerNo = WOLogRec - -ReactType = XLATE('PROD_VER',ProdVerNo,PROD_VER_REACT_TYPE$,'X') - - -IF ReactType = 'EPP' THEN - * EpiPRO reactor - WOLoadCnt = SUM(XLATE('WO_MAT',WOMatKeys,'WMI_RDS_LOAD_CNT','X')) - WOPreEpiRej = SUM(XLATE('WO_MAT',WOMatKeys,'WM_IN_REJ_WFRS','X')) - - RRunNos = XLATE('WO_STEP',WONo:'*':StepNo,6,'X') - WOUnloadCnt = SUM(XLATE('REACT_RUN',RRunNos,'EPI_PRO_UNLD_CNT','X')) - WOPTCnt = SUM(XLATE('REACT_RUN',RRunNos,'EPI_PRO_PT_CNT','X')) - - IF WOLoadCnt > 0 AND WOOrderQty > 0 THEN - OrdPcntComp = ICONV(((WOPreEpiRej + WOUnloadCnt + WOPTCnt)/WOOrderQty)*100,'MD0') - END ELSE - OrdPcntComp = 0 - END - - Result = OCONV(OrdPcntComp,'MD0S%') - -END ELSE - - SAPBatchNos = XLATE('WO_MAT',WOMatKeys,'SAP_BATCH_NO','X') - CompBoxCnt = 0 - - BoxCnt = COUNT(SAPBatchNos,@VM) + (SAPBatchNos NE '') - - FOR I = 1 TO BoxCnt - IF SAPBatchNos<1,I> NE '' THEN CompBoxCnt += 1 - NEXT I - IF CompBoxCnt = 0 THEN - Result = OCONV(0,'MD0S%') - END ELSE - - Result = OCONV(ICONV((CompBoxCnt/BoxCnt)*100,'MD0'),'MD0S%') + WONo = Parms[1,@RM] + WOLogRec = Parms[COL2()+1,@RM] + + IF WONo = '' THEN RETURN + + IF WOLogRec = '' THEN + WOLogRec = XLATE('WO_LOG',WONo,'','X') END - -END - + + IF WOLogRec = '' THEN RETURN + + StepNo = WOLogRec[-1,'B*'] ;* This is the shipping step for multi step WO's + + WOMatKeys = WOLogRec + + WOMatCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '') + + WOWfrQty = SUM(XLATE('WO_MAT',WOMatKeys,WO_MAT_WAFER_QTY$,'X')) + WOOrderQty = WOLogRec + + * Split for reactor types here + + ProdVerNo = WOLogRec + + ReactType = XLATE('PROD_VER',ProdVerNo,PROD_VER_REACT_TYPE$,'X') + + + IF ReactType = 'EPP' THEN + * EpiPRO reactor + WOLoadCnt = SUM(XLATE('WO_MAT',WOMatKeys,'WMI_RDS_LOAD_CNT','X')) + WOPreEpiRej = SUM(XLATE('WO_MAT',WOMatKeys,'WM_IN_REJ_WFRS','X')) + + RRunNos = XLATE('WO_STEP',WONo:'*':StepNo,6,'X') + WOUnloadCnt = SUM(XLATE('REACT_RUN',RRunNos,'EPI_PRO_UNLD_CNT','X')) + WOPTCnt = SUM(XLATE('REACT_RUN',RRunNos,'EPI_PRO_PT_CNT','X')) + + IF WOLoadCnt > 0 AND WOOrderQty > 0 THEN + OrdPcntComp = ICONV(((WOPreEpiRej + WOUnloadCnt + WOPTCnt)/WOOrderQty)*100,'MD0') + END ELSE + OrdPcntComp = 0 + END + + Result = OCONV(OrdPcntComp,'MD0S%') + + END ELSE + + SAPBatchNos = XLATE('WO_MAT',WOMatKeys,'SAP_BATCH_NO','X') + CompBoxCnt = 0 + + BoxCnt = COUNT(SAPBatchNos,@VM) + (SAPBatchNos NE '') + + FOR I = 1 TO BoxCnt + IF SAPBatchNos<1,I> NE '' THEN CompBoxCnt += 1 + NEXT I + + IF CompBoxCnt = 0 THEN + Result = OCONV(0,'MD0S%') + END ELSE + + Result = OCONV(ICONV((CompBoxCnt/BoxCnt)*100,'MD0'),'MD0S%') + END + + END + RETURN * * * * * * * EstComp: * * * * * * * - -WONo = Parms[1,@RM] -WOLogRec = Parms[COL2()+1,@RM] - -IF WONo = '' THEN RETURN - -IF WOLogRec = '' THEN - WOLogRec = XLATE('WO_LOG',WONo,'','X') -END - -IF WOLogRec = '' THEN RETURN - -WOMatKeys = WOLogRec - -SAPBatchNos = XLATE('WO_MAT',WOMatKeys,'SAP_BATCH_NO','X') - -CompBoxCnt = 0 - -BoxCnt = COUNT(SAPBatchNos,@VM) + (SAPBatchNos NE '') - -FOR I = 1 TO BoxCnt - IF SAPBatchNos<1,I> NE '' THEN CompBoxCnt += 1 -NEXT I - -OpenBoxCnt = BoxCnt - CompBoxCnt - -IF Method = 'EstComp' THEN - GOSUB GetAvgCycleTimes - AvgCycleTime = Result<2> ;* This is hours per box in internal MD1 format. + WONo = Parms[1,@RM] + WOLogRec = Parms[COL2()+1,@RM] - Result = OCONV( (OpenBoxCnt * AvgCycleTime),'MD1') + IF WONo = '' THEN RETURN + + IF WOLogRec = '' THEN + WOLogRec = XLATE('WO_LOG',WONo,'','X') + END + + IF WOLogRec = '' THEN RETURN + + WOMatKeys = WOLogRec + + SAPBatchNos = XLATE('WO_MAT',WOMatKeys,'SAP_BATCH_NO','X') + + CompBoxCnt = 0 + + BoxCnt = COUNT(SAPBatchNos,@VM) + (SAPBatchNos NE '') + + FOR I = 1 TO BoxCnt + IF SAPBatchNos<1,I> NE '' THEN CompBoxCnt += 1 + NEXT I + + OpenBoxCnt = BoxCnt - CompBoxCnt + + IF Method = 'EstComp' THEN + GOSUB GetAvgCycleTimes + + AvgCycleTime = Result<2> ;* This is hours per box in internal MD1 format. + + Result = OCONV( (OpenBoxCnt * AvgCycleTime),'MD1') + + END -END - RETURN * * * * * * * SchedReacts: * * * * * * * - - WONo = Parms[1,@RM] - - IF WONo = '' THEN RETURN - - OPEN 'DICT.SCHED_DET' TO DictVar THEN - - SearchString = 'WO_NO':@VM:WONo:@FM - SchedDetKeys = '' - Btree.Extract(SearchString, 'SCHED_DET_NG', DictVar, SchedDetKeys, '' , '') - IF Get_Status(errCode) THEN - RETURN - END - - IF SchedDetKeys NE '' THEN - Reactors = '' - StartDts = '' - EndDts = '' - - sdkCnt = COUNT(SchedDetKeys,@VM) + (SchedDetKeys NE '') - - FOR I = 1 TO sdkCnt - SchedDetKey = SchedDetKeys<1,I> - Reactor = Xlate('SCHED_DET_NG', SchedDetKey, 'REACT_NO', 'X') - SchedDt = Xlate('SCHED_DET_NG', SchedDetKey, 'START_DTM', 'X') - SchedDt = SchedDt[1, 'F.'] - - LOCATE Reactor IN Reactors BY 'AR' SETTING Pos THEN - IF SchedDt < StartDts<1,I> THEN - StartDts<1,Pos> = SchedDt - END - - IF SchedDt > EndDts<1,I> THEN - EndDts<1,Pos> = SchedDt - END - END ELSE - - Reactors = INSERT(Reactors,1,Pos,0,Reactor) - StartDts = INSERT(StartDts,1,Pos,0,SchedDt) - EndDts = INSERT(EndDts,1,Pos,0,SchedDt) - - END - - NEXT I - - Result = Reactors:@FM:StartDts:@FM:EndDts - END - END - -* OPEN 'DICT.SCHED_DET' TO DictVar THEN -* SearchString = 'WO_NO':@VM:WONo:@FM -* SchedDetKeys = '' -* Btree.Extract(SearchString,'SCHED_DET',DictVar,SchedDetKeys,'' ,'') -* IF Get_Status(errCode) THEN -* RETURN -* END -* -* IF SchedDetKeys NE '' THEN -* Reactors = '' -* StartDts = '' -* EndDts = '' -* -* sdkCnt = COUNT(SchedDetKeys,@VM) + (SchedDetKeys NE '') -* -* FOR I = 1 TO sdkCnt -* SchedDetKey = SchedDetKeys<1,I> -* Reactor = SchedDetKey[1,'*'] -* SchedDt = SchedDetKey[COL2()+1,'*'] -* -* LOCATE Reactor IN Reactors BY 'AR' SETTING Pos THEN -* IF SchedDt < StartDts<1,I> THEN -* StartDts<1,Pos> = SchedDt -* END -* -* IF SchedDt > EndDts<1,I> THEN -* EndDts<1,Pos> = SchedDt -* END -* END ELSE -* -* Reactors = INSERT(Reactors,1,Pos,0,Reactor) -* StartDts = INSERT(StartDts,1,Pos,0,SchedDt) -* EndDts = INSERT(EndDts,1,Pos,0,SchedDt) -* -* END -* -* NEXT I -* -* Result = Reactors:@FM:StartDts:@FM:EndDts -* END -* END - + + WONo = Parms[1,@RM] + + IF WONo = '' THEN RETURN + + OPEN 'DICT.SCHED_DET' TO DictVar THEN + + SearchString = 'WO_NO':@VM:WONo:@FM + SchedDetKeys = '' + Btree.Extract(SearchString, 'SCHED_DET_NG', DictVar, SchedDetKeys, '' , '') + IF Get_Status(errCode) THEN + RETURN + END + + IF SchedDetKeys NE '' THEN + Reactors = '' + StartDts = '' + EndDts = '' + + sdkCnt = COUNT(SchedDetKeys,@VM) + (SchedDetKeys NE '') + + FOR I = 1 TO sdkCnt + SchedDetKey = SchedDetKeys<1,I> + Reactor = Xlate('SCHED_DET_NG', SchedDetKey, 'REACT_NO', 'X') + SchedDt = Xlate('SCHED_DET_NG', SchedDetKey, 'START_DTM', 'X') + SchedDt = SchedDt[1, 'F.'] + + LOCATE Reactor IN Reactors BY 'AR' SETTING Pos THEN + IF SchedDt < StartDts<1,I> THEN + StartDts<1,Pos> = SchedDt + END + + IF SchedDt > EndDts<1,I> THEN + EndDts<1,Pos> = SchedDt + END + END ELSE + + Reactors = INSERT(Reactors,1,Pos,0,Reactor) + StartDts = INSERT(StartDts,1,Pos,0,SchedDt) + EndDts = INSERT(EndDts,1,Pos,0,SchedDt) + + END + + NEXT I + + Result = Reactors:@FM:StartDts:@FM:EndDts + END + END + RETURN - - - - diff --git a/LSL2/STPROC/OBJ_WO_MAT.txt b/LSL2/STPROC/OBJ_WO_MAT.txt index f5d8d54..fe49a6e 100644 --- a/LSL2/STPROC/OBJ_WO_MAT.txt +++ b/LSL2/STPROC/OBJ_WO_MAT.txt @@ -4266,6 +4266,9 @@ SetWfrQty: CurrWfrQty = WOMatRec CurrSlots = WOMatRec + ReactorType = Xlate('WO_MAT', WOMatKey, 'REACTOR_TYPE', 'X') + EpiPro = ( (ReactorType EQ 'EPP') or (ReactorType EQ 'EpiPro') ) + BEGIN CASE CASE WfrQty > CurrWfrQty @@ -4282,6 +4285,7 @@ SetWfrQty: NEXT I CASE WfrQty < CurrWfrQty + // Removing wafers EligibleWfrList = '' @@ -4295,7 +4299,10 @@ SetWfrQty: NEXT I NumEligibleWfrs = DCount(EligibleWfrList, @FM) - If NumEligibleWfrs GE WfrQty then + + DiffQty = CurrWfrQty - WfrQty + + If NumEligibleWfrs GE DiffQty then // We have enough wafers, so remove enough to make cassette quantity equal the desired quantity Loop @@ -4306,17 +4313,33 @@ SetWfrQty: CurrWfrQty -= 1 NumEligibleWfrs -= 1 Repeat + WOMatRec = WfrQty ;* Update Wafer Qty + end else + ErrorMsg = 'This cassette cannot be reduced to ':WfrQty:' wafers because only ':NumEligibleWfrs:' are eligible to be removed. ' end - - WOMatRec = WfrQty ;* Update Wafer Qty END CASE - otParms = FIELDSTORE(otParms,@RM,4,0,WOMatRec) - obj_Tables('WriteRec',otParms) - - Result = CurrWfrQty + If ErrorMsg EQ '' then + If EpiPro then + WMIKey = WOMatRec + If WMIKey NE '' then + WMIRec = Database_Services('ReadDataRow', 'WM_IN', WMIKey) + If Error_Services('NoError') then + WMIRec = WOMatRec + Database_Services('WriteDataRow', 'WM_IN', WMIKey, WMIRec, True$, False$, True$) + end + end + end + otParms = FIELDSTORE(otParms,@RM,4,0,WOMatRec) + obj_Tables('WriteRec',otParms) ; // This will release the lock + Result = CurrWfrQty + end else + RecordLocked = Database_Services('IsKeyIDLocked', 'WO_MAT', WOMatKey, False$) + If RecordLocked then Database_Services('ReleaseKeyIDLock', 'WO_MAT', WOMatKey) + end + RETURN diff --git a/LSL2/STPROC/RDS_ACTIONS.txt b/LSL2/STPROC/RDS_ACTIONS.txt index be8a596..2e8df68 100644 --- a/LSL2/STPROC/RDS_ACTIONS.txt +++ b/LSL2/STPROC/RDS_ACTIONS.txt @@ -950,7 +950,8 @@ WRITE_RECORD: OrigDateOut = OrigRecord NewDateOut = Record - If ( (OrigDateOut EQ '') and (NewDateOut NE '') ) then + + If ( ( (OrigDateOut EQ '') and (NewDateOut NE '') ) ) then // Mark this cassette as processed in the schedule event record DatetimeOut = {DATETIME_OUT} If EpiPro then diff --git a/LSL2/STPROC/SCHEDULE_SERVICES.txt b/LSL2/STPROC/SCHEDULE_SERVICES.txt index 1dac599..3976ae1 100644 --- a/LSL2/STPROC/SCHEDULE_SERVICES.txt +++ b/LSL2/STPROC/SCHEDULE_SERVICES.txt @@ -3002,6 +3002,9 @@ Service MarkCassProcessed(WONo, CassNo, ProcessedDTM) CassComp = False$ ReactType = Xlate('WO_LOG', WONo, 'REACT_TYPE', 'X') If ReactType EQ 'EPP' then + // Since EpiPro splits WM_IN cassettes out into RDS runs, we need to determine if the + // cassette has been emptied out or if enough wafers have been consumed such that + // the wafer count equals the split work order event quantity. StopDtm = SchedDetNGRec SchedWfrQty = Schedule_Services('GetScheduledWfrQty', WONo, StopDtm) // Determine the cassette and slot this event should end on. This will be used to identify @@ -3025,7 +3028,10 @@ Service MarkCassProcessed(WONo, CassNo, ProcessedDTM) NumUnloadedWfrs += (UnloadDtm NE '') Next UnloadDtm end - If ( (NumUnloadedWfrs EQ 25) or ( (CassNo EQ EndCassNo) and (NumUnloadedWfrs GE EndSlotNo) ) ) then CassComp = True$ + CassRemWfrs = Xlate('WM_IN', WMIKey, 'REM_WFRS', 'X') + If ( (NumUnloadedWfrs EQ 25) or ( (CassNo EQ EndCassNo) and (NumUnloadedWfrs GE EndSlotNo) ) or (CassRemWfrs EQ 0) ) then + CassComp = True$ + end end else CassComp = True$ end @@ -3041,17 +3047,6 @@ Service MarkCassProcessed(WONo, CassNo, ProcessedDTM) Done = True$ end end - // Mark previous cassette processed if it isn't already. This covers situations where users fail to - // sign the unload stage for a cassette. - PrevCassNo = CassNo - 1 - Locate PrevCassNo in UnprocessedCassettes using @VM setting vPos then - UnprocessedCassettes = Delete(UnprocessedCassettes, 0, vPos, 0) - ProcessedCassettes = SchedDetNGRec - ProcessedCassettes<0, -1> = PrevCassNo - SchedDetNGRec = UnprocessedCassettes - SchedDetNGRec = ProcessedCassettes - Database_Services('WriteDataRow', 'SCHED_DET_NG', SchedDetNGKey, SchedDetNGRec, True$, False$, True$) - end Until Done EQ True$ Repeat end @@ -3424,4 +3419,3 @@ CreateScheduleChangeNotification: return - diff --git a/LSL2/STPROC/WM_IN_ACTIONS.txt b/LSL2/STPROC/WM_IN_ACTIONS.txt index c4ba2fc..395db72 100644 --- a/LSL2/STPROC/WM_IN_ACTIONS.txt +++ b/LSL2/STPROC/WM_IN_ACTIONS.txt @@ -59,7 +59,7 @@ Equ Comma$ to ',' Declare function Database_Services, obj_NCR, obj_SAP, Environment_Services, Logging_Services, Datetime Declare subroutine Error_Services, Database_Services, obj_NCR, obj_SAP, Material_Services, Work_Order_Services -Declare subroutine Logging_Services, obj_Notes +Declare subroutine Logging_Services, obj_Notes, Schedule_Services LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WM_IN' LogDate = Oconv(Date(), 'D4/') @@ -160,48 +160,8 @@ WRITE_RECORD: WONo = Field(Name, '*', 1) CassNo = Field(Name, '*', 3) ProcessedDTM = Datetime() - // Find the SCHED_DET_NG event record that contains the cassette number. - Query = 'SELECT SCHED_DET_NG WITH WO_NO EQ ':WONo:' AND WITH UNPROCESSED_CASS CONTAINING ':CassNo - GoSub ClearCursors - RList(Query, TARGET_ACTIVELIST$, '', '', '') - EOF = False$ - Done = False$ - Loop - Readnext SchedDetNGKey else EOF = True$ - Until EOF = True$ - SchedDetNGRec = Database_Services('ReadDataRow', 'SCHED_DET_NG', SchedDetNGKey) - ProcessedCassettes = SchedDetNGRec - ProcessedWfrQty = DCount(ProcessedCassettes, @VM) * 25 - TotalWfrs = SchedDetNGRec - CassRemWfrs = Xlate('WM_IN', Name, 'REM_WFRS', 'X') - ProcessedCassQty = 25 - CassRemWfrs - If (ProcessedWfrQty + ProcessedCassQty ) EQ TotalWfrs then - // Mark cassette complete. - UnprocessedCassettes = SchedDetNGRec - Locate CassNo in UnprocessedCassettes using @VM setting vPos then - UnprocessedCassettes = Delete(UnprocessedCassettes, 0, vPos, 0) - ProcessedCassettes = SchedDetNGRec - ProcessedCassettes<0, -1> = CassNo - SchedDetNGRec = UnprocessedCassettes - SchedDetNGRec = ProcessedCassettes - Database_Services('WriteDataRow', 'SCHED_DET_NG', SchedDetNGKey, SchedDetNGRec, True$, False$, True$) - Done = True$ - end - // Mark previous cassette processed if it isn't already. This covers situations where users fail to - // sign the unload stage for a cassette. - PrevCassNo = CassNo - 1 - Locate PrevCassNo in UnprocessedCassettes using @VM setting vPos then - UnprocessedCassettes = Delete(UnprocessedCassettes, 0, vPos, 0) - ProcessedCassettes = SchedDetNGRec - ProcessedCassettes<0, -1> = PrevCassNo - SchedDetNGRec = UnprocessedCassettes - SchedDetNGRec = ProcessedCassettes - Database_Services('WriteDataRow', 'SCHED_DET_NG', SchedDetNGKey, SchedDetNGRec, True$, False$, True$) - end - end - - Until Done EQ True$ - Repeat + // This service will determine if the cassette needs to be marked as complete. + Schedule_Services('MarkCassProcessed', WONo, CassNo, ProcessedDtm) WfrCount = DCount(Record, @VM) If WfrCount LT 25 then @@ -301,4 +261,3 @@ Restore_System_Variables: @FILE.ERROR = OrigFileError return - diff --git a/LSL2/STPROC/WORK_ORDER_SERVICES.txt b/LSL2/STPROC/WORK_ORDER_SERVICES.txt index 44db323..8956860 100644 --- a/LSL2/STPROC/WORK_ORDER_SERVICES.txt +++ b/LSL2/STPROC/WORK_ORDER_SERVICES.txt @@ -1055,7 +1055,3 @@ ClearCursors: Next counter return - - - - diff --git a/LSL2/STPROC/WO_MAT_ACTIONS.txt b/LSL2/STPROC/WO_MAT_ACTIONS.txt index 217a66d..b27d88d 100644 --- a/LSL2/STPROC/WO_MAT_ACTIONS.txt +++ b/LSL2/STPROC/WO_MAT_ACTIONS.txt @@ -56,9 +56,9 @@ $insert RLIST_EQUATES Equ Comma$ to ',' Declare function Error_Services, Database_Services, Environment_Services, Logging_Services, obj_WO_Mat, Max -Declare function GaN_Services, Signature_Services, obj_WO_LOG, SRP_Array, MemberOf +Declare function GaN_Services, Signature_Services, obj_WO_LOG, SRP_Array, MemberOf, Datetime Declare subroutine Error_Services, Database_Services, Environment_Services, Logging_Services, Obj_SAP, obj_Notes -Declare subroutine SAP_Services, Work_Order_Services, Material_Services, RList +Declare subroutine SAP_Services, Work_Order_Services, Material_Services, RList, Schedule_Services LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_Mat' LogDate = Oconv(Date(), 'D4/') @@ -690,7 +690,7 @@ WRITE_RECORD: end end - //Original MU wafer transaction + // Original MU wafer transaction IF OrigSAPBatchNo EQ '' AND NewSAPBatchNo NE '' then MULotFlag = False$ If {REACTOR_TYPE} NE 'EPP' then @@ -825,6 +825,12 @@ WRITE_RECORD: Work_Order_Services('UpdateReleasedQty', WONo) end + CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKeyID) + If CurrWaferCount EQ 0 then + // This should catch cases where the entire cassette is "peeled off", NCR'ed, or used for destructive testing. + Schedule_Services('MarkCassProcessed', WONo, CassNo, Datetime()) + end + return DELETE_RECORD_PRE: