fixed bug in GetAvailableMakeupWafers which was using the CustPartNo instead of the EpiPartNo to find available makeup wafers

This commit is contained in:
Infineon\StieberD
2025-07-10 09:16:00 -07:00
parent af6cd757de
commit d4ce96337b
2 changed files with 111 additions and 123 deletions

View File

@ -619,133 +619,127 @@ end service
Service GetAvailableMakeupWafers(WorkOrderNo, KeysOnly=BOOLEAN)
AvailableMakeupWafers = ''
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<WO_LOG_WO_STEP_KEY$>
WOMatKeys = WOLogRow<WO_LOG_WO_MAT_KEY$>
FirstWOMatKey = WOMatKeys<0, 1>
WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', FirstWOMatKey)
WOStepKeys = WOLogRow<WO_LOG_WO_STEP_KEY$>
LastWOStepKey = WOStepKeys[-1, 'B' : @VM]
PartNo = WOLogRow<WO_LOG_EPI_PART_NO$>
WOStepRow = Database_Services('ReadDataRow', 'WO_STEP', LastWOStepKey)
If Error_Services('NoError') then
PartNo = WOMatRow<WO_MAT_CUST_PART_NO$>
LastWOStepKey = WOStepKeys[-1, 'B' : @VM]
WOStepRow = Database_Services('ReadDataRow', 'WO_STEP', LastWOStepKey)
WOStepPSN = WOStepRow<WO_STEP_PROD_SPEC_ID$>
WOStepRDSNos = WOStepRow<WO_STEP_RDS_KEY$>
WOStepWMOutNos = WOStepRow<WO_STEP_WM_OUT_KEYS$>
ProdSpecRow = Database_Services('ReadDataRow', 'PROD_SPEC', WOStepPSN)
If Error_Services('NoError') then
WOStepPSN = WOStepRow<WO_STEP_PROD_SPEC_ID$>
WOStepRDSNos = WOStepRow<WO_STEP_RDS_KEY$>
WOStepWMOutNos = WOStepRow<WO_STEP_WM_OUT_KEYS$>
ProdSpecRow = Database_Services('ReadDataRow', 'PROD_SPEC', WOStepPSN)
ReactorType = ProdSpecRow<PROD_SPEC_REACTOR_TYPE$>
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<PROD_SPEC_REACTOR_TYPE$>
SearchString = ''
SearchTable = 'MAKEUP_WAFERS'
If ReactorType EQ 'EPP' then
SearchString := 'EPI_PART_NO' : @VM : PartNo : @FM : 'REACT_TYPE' : @VM : 'EPP' : @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
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
If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then
CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKeyID:@RM:'':@RM:True$)
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
CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKeyID:@RM:'':@RM:True$)
end else
CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKeyID)
end
If CurrWaferCount GT 0 then
WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', WOMatKeyID)
RDSKeyIDs = WOMatRow<WO_MAT_RDS_NO$>
SAPBatchNo = WOMatRow<WO_MAT_SAP_BATCH_NO$>
FirstRDSKeyID = RDSKeyIDs[1, @VM]
RDSRow = Database_Services('ReadDataRow', 'RDS', FirstRDSKeyID)
WMOKey = WOMatRow<WO_MAT_WMO_KEY$>
If WMOKey NE '' then
WMOFQASig = Xlate('WM_OUT', WMOKey, 'SUP_VER_SIG', 'X')
end else
CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKeyID)
WMOFQASig = ''
end
If CurrWaferCount GT 0 then
WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', WOMatKeyID)
RDSKeyIDs = WOMatRow<WO_MAT_RDS_NO$>
SAPBatchNo = WOMatRow<WO_MAT_SAP_BATCH_NO$>
FirstRDSKeyID = RDSKeyIDs[1, @VM]
RDSRow = Database_Services('ReadDataRow', 'RDS', FirstRDSKeyID)
WMOKey = WOMatRow<WO_MAT_WMO_KEY$>
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<WO_LOG_WO_STEP_KEY$>[-1, 'B' : @VM]
ThisWOStepRow = Database_Services('ReadDataRow', 'WO_STEP', ThisWOStepKeyID)
WOStepRDSNos = ThisWoStepRow<WO_STEP_RDS_KEY$>
MakeupBoxDet = ThisWorkOrderNo : @SVM
MakeupBoxDet := ThisCassetteNo : @SVM
MakeupBoxDet := WOMatRow<WO_MAT_SAP_BATCH_NO$> : @SVM
MakeupBoxDet := ThisWOStepRow<WO_STEP_PROD_SPEC_ID$> : @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')
LabelCheck = Count(WOMatRow<WO_MAT_INV_ACTION$>, 'LBLCHK')
// 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<WO_LOG_WO_STEP_KEY$>[-1, 'B' : @VM]
ThisWOStepRow = Database_Services('ReadDataRow', 'WO_STEP', ThisWOStepKeyID)
WOStepRDSNos = ThisWoStepRow<WO_STEP_RDS_KEY$>
MakeupBoxDet = ThisWorkOrderNo : @SVM
MakeupBoxDet := ThisCassetteNo : @SVM
MakeupBoxDet := WOMatRow<WO_MAT_SAP_BATCH_NO$> : @SVM
MakeupBoxDet := ThisWOStepRow<WO_STEP_PROD_SPEC_ID$> : @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')
LabelCheck = Count(WOMatRow<WO_MAT_INV_ACTION$>, 'LBLCHK')
// 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<RDS_SUP_VER_SIG$> NE '') and (LabelCheck NE FALSE$) ) OR ( (ReactorType EQ 'EPP') and (WMOFQASig NE '') and (LabelCheck NE FALSE$) )
// Cassette has a final signature, so it is eligible to be used.
FieldPos = 1
Case ( (ReactorType NE 'EPP') and (RDSRow<RDS_SUP_VER_SIG$> 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 ( (ReactorType NE 'EPP') and (RDSRow<RDS_SUP_VER_SIG$> NE '') and (LabelCheck EQ False$)) OR ( (ReactorType EQ 'EPP') and (WMOFQASig NE '') and (LabelCheck EQ False$))
// Cassette does not yet have a packing label check, so it is not yet eligible to be used.
FieldPos = 4
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<RDS_SUP_VER_SIG$> NE '') and (LabelCheck NE FALSE$) ) OR ( (ReactorType EQ 'EPP') and (WMOFQASig NE '') and (LabelCheck NE FALSE$) )
// Cassette has a final signature, so it is eligible to be used.
FieldPos = 1
Case ( (ReactorType NE 'EPP') and (RDSRow<RDS_SUP_VER_SIG$> 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 ( (ReactorType NE 'EPP') and (RDSRow<RDS_SUP_VER_SIG$> NE '') and (LabelCheck EQ False$)) OR ( (ReactorType EQ 'EPP') and (WMOFQASig NE '') and (LabelCheck EQ False$))
// Cassette does not yet have a packing label check, so it is not yet eligible to be used.
FieldPos = 4
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
@ -1482,5 +1476,3 @@ ClearCursors:
return

View File

@ -29,7 +29,6 @@ Function NDW_Makeup_Wafers_Events(CtrlEntId, Event, @PARAMS)
04/13/18 dmb Created initial commuter module.
***********************************************************************************************************************/
#pragma precomp SRP_PreCompiler
#Window NDW_MAKEUP_WAFERS
@ -50,11 +49,11 @@ If Event EQ 'OLE' then
Transfer Param1 to Event
Transfer Param2 to Param1
Transfer Param3 to Param2
* Transfer Param4 to Param3
* Transfer Param5 to Param4
* Transfer Param6 to Param5
* Transfer Param7 to Param6
* Transfer Param8 to Param7
Transfer Param4 to Param3
Transfer Param5 to Param4
Transfer Param6 to Param5
Transfer Param7 to Param6
Transfer Param8 to Param7
end
GoToEvent Event for CtrlEntID
@ -67,7 +66,7 @@ Return EventFlow else EVENT_CONTINUE$
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Event WINDOW.CREATE(CreateParam)
ThisWOMatKey = CreateParam
ThisWorkOrderNo = ThisWOMatKey[1, '*']
ThisCassetteNo = ThisWOMatKey[Col2() + 1, '*']
@ -445,6 +444,3 @@ Setup_OLE_Controls:
return