diff --git a/LSL2/STPROC/MATERIAL_SERVICES.txt b/LSL2/STPROC/MATERIAL_SERVICES.txt index 9580955..4a52364 100644 --- a/LSL2/STPROC/MATERIAL_SERVICES.txt +++ b/LSL2/STPROC/MATERIAL_SERVICES.txt @@ -65,9 +65,6 @@ Declare subroutine Material_Services, Memory_Services, Database_Services, SRP_A Declare subroutine SRP_Stopwatch, Set_Status, RList, Work_Order_Services, SQL_Services, obj_WO_Mat, obj_Notes Declare subroutine SRP_Rotate_Array, SRP_DateTime, obj_WO_Log, Hold_Services -UseMakeupWafersTable = Database_Services('ReadDataRow', 'APP_INFO', 'USE_MAKEUP_WAFERS_TABLE') -If UseMakeupWafersTable EQ '' then UseMakeupWafersTable = False$ - LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\MUBox' LogDate = Oconv(Date(), 'D4/') LogTime = Oconv(Time(), 'MTS') @@ -615,252 +612,136 @@ end service Service GetAvailableMakeupWafers(WorkOrderNo, KeysOnly=BOOLEAN) AvailableMakeupWafers = '' - - If UseMakeupWafersTable EQ False$ then - If WorkOrderNo NE '' then - WorkOrderNo = WorkOrderNo[1, '*'] ; // This might be formatted as a WO_MAT Key ID, so strip off the Cassette No. - WOLogRow = Database_Services('ReadDataRow', 'WO_LOG', WorkOrderNo) + + If WorkOrderNo NE '' then + WorkOrderNo = WorkOrderNo[1, '*'] ; // This might be formatted as a WO_MAT Key ID, so strip off the Cassette No. + WOLogRow = Database_Services('ReadDataRow', 'WO_LOG', WorkOrderNo) + If Error_Services('NoError') then + WOStepKeys = WOLogRow + WOMatKeys = WOLogRow + FirstWOMatKey = WOMatKeys<0, 1> + WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', FirstWOMatKey) If Error_Services('NoError') then - WOStepKeys = WOLogRow - WOMatKeys = WOLogRow - FirstWOMatKey = WOMatKeys<0, 1> - WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', FirstWOMatKey) + PartNo = WOMatRow + LastWOStepKey = WOStepKeys[-1, 'B' : @VM] + WOStepRow = Database_Services('ReadDataRow', 'WO_STEP', LastWOStepKey) If Error_Services('NoError') then - PartNo = WOMatRow - LastWOStepKey = WOStepKeys[-1, 'B' : @VM] - WOStepRow = Database_Services('ReadDataRow', 'WO_STEP', LastWOStepKey) + WOStepPSN = WOStepRow + WOStepRDSNos = WOStepRow + WOStepWMOutNos = WOStepRow + ProdSpecRow = Database_Services('ReadDataRow', 'PROD_SPEC', WOStepPSN) If Error_Services('NoError') then - WOStepPSN = WOStepRow - WOStepRDSNos = WOStepRow - WOStepWMOutNos = WOStepRow - ProdSpecRow = Database_Services('ReadDataRow', 'PROD_SPEC', WOStepPSN) + ReactorType = ProdSpecRow + SearchString = '' + SearchTable = 'MAKEUP_WAFERS' + If ReactorType EQ 'EPP' then + SearchString := 'EPI_PART_NO' : @VM : PartNo : @FM : 'REACT_TYPE' : @VM : 'EPP' : @FM + end else + SearchString := 'EPI_PART_NO' : @VM : PartNo : @FM : 'REACT_TYPE' : @VM : '#EPP' : @FM + end + + hDictSearchTable = Database_Services('GetTableHandle', 'DICT.' : SearchTable) If Error_Services('NoError') then - ReactorType = ProdSpecRow - SearchString = '' - If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then - SearchTable = 'WM_OUT' - SearchString := 'MU_PART_NO' : @VM : PartNo : @FM + rv = Set_Status(0) + MakeupBoxes = '' + Flag = '' + StatusCode = '' + Btree.Extract(SearchString, SearchTable, hDictSearchTable, MakeupBoxes, '', Flag) + If Get_Status(StatusCode) then + Error_Services('Add', 'Error calling Btree.Extract in the ' : Service : ' service. StatusCode: ' : StatusCode) end else - SearchTable = 'WO_MAT' - SearchString := 'MAKEUP_BOX' : @VM : 1 : @FM - SearchString := 'CUST_PART_NO' : @VM : PartNo : @FM - end - hDictSearchTable = Database_Services('GetTableHandle', 'DICT.' : SearchTable) - If Error_Services('NoError') then - rv = Set_Status(0) - MakeupBoxes = '' - Flag = '' - StatusCode = '' - Btree.Extract(SearchString, SearchTable, hDictSearchTable, MakeupBoxes, '', Flag) - If Get_Status(StatusCode) then - Error_Services('Add', 'Error calling Btree.Extract in the ' : Service : ' service. StatusCode: ' : StatusCode) - end else - If MakeupBoxes NE '' then - // One or more makeup was found that matches the customer's part and has the status of 'Ready to Use'. - // Now loop through to find out which ones have the RDS final signature or not. - NumMakeupBoxes = DCount(MakeupBoxes, @VM) - For Each MakeupBoxID in MakeupBoxes using @VM - SRP_Stopwatch('Start', 'CurrStatus') + If MakeupBoxes NE '' then + // One or more makeup was found that matches the customer's part and has the status of 'Ready to Use'. + // Now loop through to find out which ones have the RDS final signature or not. + NumMakeupBoxes = DCount(MakeupBoxes, @VM) + For Each MakeupBoxID in MakeupBoxes using @VM + WOMatKeyID = MakeupBoxID + CurrStatus = Xlate('MAKEUP_WAFERS', MakeupBoxID, 'CURR_STATUS_STATIC', 'X') + // DPC 7/21/20 added HOLD as excluded status type + Locate CurrStatus in 'MT,VOID,SHIP,REJ,HOLD' using ',' setting cPos else If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then - WOMatKeyID = Field(MakeupBoxID, '*', 1) : '*' : Field(MakeupBoxID, '*', 3) - CurrStatus = obj_WM_Out('CurrStatus', MakeupBoxID) + CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKeyID:@RM:'':@RM:True$) end else - WOMatKeyID = MakeupBoxID - CurrStatus = obj_WO_Mat('CurrStatus', WOMatKeyID) - end - // DPC 7/21/20 added HOLD as excluded status type - Locate CurrStatus in 'MT,VOID,SHIP,REJ,HOLD' using ',' setting cPos else CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKeyID) - If CurrWaferCount GT 0 then - WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', WOMatKeyID) - RDSKeyIDs = WOMatRow - SAPBatchNo = WOMatRow - FirstRDSKeyID = RDSKeyIDs[1, @VM] - RDSRow = Database_Services('ReadDataRow', 'RDS', FirstRDSKeyID) - ThisWorkOrderNo = WOMatKeyID[1, '*'] - ThisCassetteNo = WOMatKeyID[Col2() + 1, '*'] - ThisWOLogRow = Database_Services('ReadDataRow', 'WO_LOG', ThisWorkOrderNo) - ThisWOStepKeyID = ThisWOLogRow[-1, 'B' : @VM] - ThisWOStepRow = Database_Services('ReadDataRow', 'WO_STEP', ThisWOStepKeyID) - WOStepRDSNos = ThisWoStepRow - MakeupBoxDet = ThisWorkOrderNo : @SVM - MakeupBoxDet := ThisCassetteNo : @SVM - MakeupBoxDet := WOMatRow : @SVM - MakeupBoxDet := ThisWOStepRow : @SVM - MakeupBoxDet := PartNo : @SVM - MakeupBoxDet := CurrWaferCount : @SVM - MakeupBoxDet := FirstRDSKeyID - // JRO Added PROD_SPEC PARAMETERS 5/8/2020 - If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then - ProdSpecID = Xlate('RDS', WOStepRDSNos<1, 1>, 114, 'X') - end else - ProdSpecID = Xlate('RDS', RDSKeyIDs, 114, 'X') - end - ActiveStatus = XLATE('PROD_SPEC', ProdSpecID, 9, 'X') - // JRO Added the extra condition for Active Status 5/8/2020 - If ActiveStatus EQ 'A' then - If (RDSRow NE '') OR ((ReactorType EQ 'EPP') OR (ReactorType EQ 'P')) then - // Has a RDS final signature. - If KeysOnly EQ True$ then - If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then - AvailableMakeupWafers = Insert(AvailableMakeupWafers, 1, -1, 0, MakeupBoxID) - end else - AvailableMakeupWafers = Insert(AvailableMakeupWafers, 1, -1, 0, WOMatKeyID) - end - end else - AvailableMakeupWafers = Insert(AvailableMakeupWafers, 1, -1, 0, MakeupBoxDet) - end - end else - // Does not have a RDS final signature. - If KeysOnly EQ True$ then - AvailableMakeupWafers = Insert(AvailableMakeupWafers, 2, -1, 0, WOMatKeyID) - end else - AvailableMakeupWafers = Insert(AvailableMakeupWafers, 2, -1, 0, MakeupBoxDet) - end - end - end + end + If CurrWaferCount GT 0 then + WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', WOMatKeyID) + RDSKeyIDs = WOMatRow + SAPBatchNo = WOMatRow + FirstRDSKeyID = RDSKeyIDs[1, @VM] + RDSRow = Database_Services('ReadDataRow', 'RDS', FirstRDSKeyID) + WMOKey = WOMatRow + If WMOKey NE '' then + WMOFQASig = Xlate('WM_OUT', WMOKey, 'SUP_VER_SIG', 'X') + end else + WMOFQASig = '' end - end - Next MakeupBoxID - end - end - end - end - end - end - end - end else - Error_Services('Add', 'WorkOrderNo argument was missing from the ' : Service : ' service.') - end - - end else - - If WorkOrderNo NE '' then - WorkOrderNo = WorkOrderNo[1, '*'] ; // This might be formatted as a WO_MAT Key ID, so strip off the Cassette No. - WOLogRow = Database_Services('ReadDataRow', 'WO_LOG', WorkOrderNo) - If Error_Services('NoError') then - WOStepKeys = WOLogRow - WOMatKeys = WOLogRow - FirstWOMatKey = WOMatKeys<0, 1> - WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', FirstWOMatKey) - If Error_Services('NoError') then - PartNo = WOMatRow - LastWOStepKey = WOStepKeys[-1, 'B' : @VM] - WOStepRow = Database_Services('ReadDataRow', 'WO_STEP', LastWOStepKey) - If Error_Services('NoError') then - WOStepPSN = WOStepRow - WOStepRDSNos = WOStepRow - WOStepWMOutNos = WOStepRow - ProdSpecRow = Database_Services('ReadDataRow', 'PROD_SPEC', WOStepPSN) - If Error_Services('NoError') then - ReactorType = ProdSpecRow - SearchString = '' - SearchTable = 'MAKEUP_WAFERS' - If ReactorType EQ 'EPP' then - SearchString := 'EPI_PART_NO' : @VM : PartNo : @FM : 'REACT_TYPE' : @VM : 'EPP' : @FM - end else - SearchString := 'EPI_PART_NO' : @VM : PartNo : @FM : 'REACT_TYPE' : @VM : '#EPP' : @FM - end - - hDictSearchTable = Database_Services('GetTableHandle', 'DICT.' : SearchTable) - If Error_Services('NoError') then - rv = Set_Status(0) - MakeupBoxes = '' - Flag = '' - StatusCode = '' - Btree.Extract(SearchString, SearchTable, hDictSearchTable, MakeupBoxes, '', Flag) - If Get_Status(StatusCode) then - Error_Services('Add', 'Error calling Btree.Extract in the ' : Service : ' service. StatusCode: ' : StatusCode) - end else - If MakeupBoxes NE '' then - // One or more makeup was found that matches the customer's part and has the status of 'Ready to Use'. - // Now loop through to find out which ones have the RDS final signature or not. - NumMakeupBoxes = DCount(MakeupBoxes, @VM) - For Each MakeupBoxID in MakeupBoxes using @VM - WOMatKeyID = MakeupBoxID - CurrStatus = Xlate('MAKEUP_WAFERS', MakeupBoxID, 'CURR_STATUS_STATIC', 'X') - // DPC 7/21/20 added HOLD as excluded status type - Locate CurrStatus in 'MT,VOID,SHIP,REJ,HOLD' using ',' setting cPos else - CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKeyID) - If CurrWaferCount GT 0 then - WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', WOMatKeyID) - RDSKeyIDs = WOMatRow - SAPBatchNo = WOMatRow - FirstRDSKeyID = RDSKeyIDs[1, @VM] - RDSRow = Database_Services('ReadDataRow', 'RDS', FirstRDSKeyID) - WMOKey = WOMatRow - If WMOKey NE '' then - WMOFQASig = Xlate('WM_OUT', WMOKey, 'SUP_VER_SIG', 'X') - end else - WMOFQASig = '' - end - ThisWorkOrderNo = WOMatKeyID[1, '*'] - ThisCassetteNo = WOMatKeyID[Col2() + 1, '*'] - ThisWOLogRow = Database_Services('ReadDataRow', 'WO_LOG', ThisWorkOrderNo) - ThisWOStepKeyID = ThisWOLogRow[-1, 'B' : @VM] - ThisWOStepRow = Database_Services('ReadDataRow', 'WO_STEP', ThisWOStepKeyID) - WOStepRDSNos = ThisWoStepRow - MakeupBoxDet = ThisWorkOrderNo : @SVM - MakeupBoxDet := ThisCassetteNo : @SVM - MakeupBoxDet := WOMatRow : @SVM - MakeupBoxDet := ThisWOStepRow : @SVM - MakeupBoxDet := PartNo : @SVM - MakeupBoxDet := CurrWaferCount : @SVM - MakeupBoxDet := FirstRDSKeyID - // JRO Added PROD_SPEC PARAMETERS 5/8/2020 - If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then - ProdSpecID = Xlate('RDS', WOStepRDSNos<1, 1>, RDS_PROD_SPEC_ID$, 'X') - end else - ProdSpecID = Xlate('RDS', RDSKeyIDs, RDS_PROD_SPEC_ID$, 'X') - end - ActiveStatus = XLATE('PROD_SPEC', ProdSpecID, PROD_SPEC_STATUS$, 'X') - // JRO Added the extra condition for Active Status 5/8/2020 - If ActiveStatus EQ 'A' then - Begin Case + ThisWorkOrderNo = WOMatKeyID[1, '*'] + ThisCassetteNo = WOMatKeyID[Col2() + 1, '*'] + ThisWOLogRow = Database_Services('ReadDataRow', 'WO_LOG', ThisWorkOrderNo) + ThisWOStepKeyID = ThisWOLogRow[-1, 'B' : @VM] + ThisWOStepRow = Database_Services('ReadDataRow', 'WO_STEP', ThisWOStepKeyID) + WOStepRDSNos = ThisWoStepRow + MakeupBoxDet = ThisWorkOrderNo : @SVM + MakeupBoxDet := ThisCassetteNo : @SVM + MakeupBoxDet := WOMatRow : @SVM + MakeupBoxDet := ThisWOStepRow : @SVM + MakeupBoxDet := PartNo : @SVM + MakeupBoxDet := CurrWaferCount : @SVM + MakeupBoxDet := FirstRDSKeyID + // JRO Added PROD_SPEC PARAMETERS 5/8/2020 + If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then + ProdSpecID = Xlate('RDS', WOStepRDSNos<1, 1>, RDS_PROD_SPEC_ID$, 'X') + end else + ProdSpecID = Xlate('RDS', RDSKeyIDs, RDS_PROD_SPEC_ID$, 'X') + end + ActiveStatus = XLATE('PROD_SPEC', ProdSpecID, PROD_SPEC_STATUS$, 'X') + // JRO Added the extra condition for Active Status 5/8/2020 + If ActiveStatus EQ 'A' then + Begin Case + + Case SAPBatchNo EQ '' + // Cassette has not received a batch number from SAP, so it is not yet eligible to be used. + FieldPos = 3 - Case SAPBatchNo EQ '' - // Cassette has not received a batch number from SAP, so it is not yet eligible to be used. - FieldPos = 3 - - Case ( (ReactorType NE 'EPP') and (RDSRow NE '') ) OR ( (ReactorType EQ 'EPP') and (WMOFQASig NE '') ) - // Cassette has a final signature, so it is eligible to be used. - FieldPos = 1 - - Case ( (ReactorType NE 'EPP') and (RDSRow EQ '') ) OR ( (ReactorType EQ 'EPP') and (WMOFQASig EQ '') ) - // Cassette does not yet have a final signature, so it is not yet eligible to be used. - FieldPos = 2 - - Case Otherwise$ - // Log these cassettes as we should never end up here. - Null - - End Case - - If KeysOnly EQ True$ then - If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then - WMOFormat = Field(MakeupBoxID, '*', 1):'*1*':Field(MakeupBoxID, '*', 2) - AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, WMOFormat) - end else - AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, WOMatKeyID) - end + Case ( (ReactorType NE 'EPP') and (RDSRow NE '') ) OR ( (ReactorType EQ 'EPP') and (WMOFQASig NE '') ) + // Cassette has a final signature, so it is eligible to be used. + FieldPos = 1 + + Case ( (ReactorType NE 'EPP') and (RDSRow EQ '') ) OR ( (ReactorType EQ 'EPP') and (WMOFQASig EQ '') ) + // Cassette does not yet have a final signature, so it is not yet eligible to be used. + FieldPos = 2 + + Case Otherwise$ + // Log these cassettes as we should never end up here. + Null + + End Case + + If KeysOnly EQ True$ then + If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then + WMOFormat = Field(MakeupBoxID, '*', 1):'*1*':Field(MakeupBoxID, '*', 2) + AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, WMOFormat) end else - AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, MakeupBoxDet) + AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, WOMatKeyID) end - + end else + AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, MakeupBoxDet) end + end end - Next MakeupBoxID - end + end + Next MakeupBoxID end end end end end end - end else - Error_Services('Add', 'WorkOrderNo argument was missing from the ' : Service : ' service.') end + end else + Error_Services('Add', 'WorkOrderNo argument was missing from the ' : Service : ' service.') end Response = AvailableMakeupWafers @@ -1589,5 +1470,3 @@ ClearCursors: return - - diff --git a/LSL2/STPROC/WM_OUT_ACTIONS.txt b/LSL2/STPROC/WM_OUT_ACTIONS.txt index 321b99a..5403ec2 100644 --- a/LSL2/STPROC/WM_OUT_ACTIONS.txt +++ b/LSL2/STPROC/WM_OUT_ACTIONS.txt @@ -335,10 +335,10 @@ WRITE_RECORD: // Converting MU cassette into finished goods cassette -> Send BATCH_CONV transaction to SAP. SAP_Services('AddBatchConvTransaction', {WO_MAT_KEY}) End Case - + WOMatKey = {WO_MAT_KEY} If MakeupBox then - CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKey) + CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKey:@RM:'':@RM:True$) If CurrWaferCount GT 0 then // Populate MAKEUP_WAFERS table // Add/update cassette data to the MAKEUP_WAFERS table