552 lines
22 KiB
Plaintext
552 lines
22 KiB
Plaintext
Function WM_OUT_Actions(Action, CalcColName, FSList, Handle, Name, FMC, Record, Status, OrigRecord, Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10)
|
|
/***********************************************************************************************************************
|
|
|
|
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
|
|
permission from Infineon.
|
|
|
|
Name : WM_OUT_Actions
|
|
|
|
Description : Handles calculated columns and MFS calls for the current table.
|
|
|
|
Notes : This function uses @ID, @RECORD, and @DICT to make sure {ColumnName} references work correctly.
|
|
If called from outside of a calculated column these will need to be set and restored.
|
|
|
|
Parameters :
|
|
Action [in] -- Name of the action to be taken
|
|
CalcColName [in] -- Name of the calculated column that needs to be processed. Normally this should only be
|
|
populated when the CalcField action is being used.
|
|
FSList [in] -- The list of MFSs and the BFS name for the current file or volume. This is an @SVM
|
|
delimited array, with the current MFS name as the first value in the array, and the BFS
|
|
name as the last value. Normally set by a calling MFS.
|
|
Handle [in] -- The file handle of the file or media map being accessed. Note, this does contain the
|
|
entire handle structure that the Basic+ Open statement would provide. Normally set by a
|
|
calling MFS.
|
|
Name [in] -- The name (key) of the record or file being accessed. Normally set by a calling MFS.
|
|
FMC [in] -- Various functions. Normally set by a calling MFS.
|
|
Record [in] -- The entire record (for record-oriented functions) or a newly-created handle (for
|
|
"get handle" functions). Normally set by a calling MFS.
|
|
Status [in/out] -- Indicator of the success or failure of an action. Normally set by the calling MFS but
|
|
for some actions can be set by the action handler to indicate failure.
|
|
OrigRecord [in] -- Original content of the record being processed by the current action. This is
|
|
automatically being assigned by the WRITE_RECORD and DELETE_RECORD actions within
|
|
BASE_MFS.
|
|
Param1-10 [in/out] -- Additional request parameter holders
|
|
ActionFlow [out] -- Used to control the action chain (see the ACTION_SETUP insert for more information.)
|
|
Can also be used to return a special value, such as the results of the CalcField
|
|
method.
|
|
|
|
History : (Date, Initials, Notes)
|
|
06/05/18 djs Original programmer.
|
|
03/07/19 djs Updated WRITE_RECORD and DELETE_RECORD actions such that calls to obj_NCR('RejQty') are
|
|
now wrapped in a Sum() function call because EpiPro wafers return @VM delimited reject
|
|
quantity values for each distinct RDS in the NCR record. This Sum() function call will not
|
|
affect Non-EpiPro NCR records or EpiPro NCRs with only a single reject quanitity (i.e. the
|
|
NCR only contains one distinct RDS).
|
|
05/10/21 djs Added WFR_STATUS calculated column to return an array of statuses per wafer per zone.
|
|
This is an improvement over the RDS_CURR_STATUS calculated column that does not
|
|
differentiate between zones.
|
|
|
|
|
|
***********************************************************************************************************************/
|
|
|
|
#pragma precomp SRP_PreCompiler
|
|
|
|
$insert LOGICAL
|
|
$insert FILE.SYSTEM.EQUATES
|
|
$insert ACTION_SETUP
|
|
$insert RDS_TEST_EQUATES
|
|
$insert RDS_EQUATES
|
|
$insert WO_LOG_EQUATES
|
|
$insert WM_OUT_EQUATES
|
|
$insert WM_IN_EQUATES
|
|
$insert WO_MAT_EQUATES
|
|
$insert REACT_RUN_EQUATES
|
|
$insert REACTOR_EQUATES
|
|
$insert MAKEUP_WAFERS_EQUATES
|
|
|
|
EQU CRLF$ TO \0D0A\
|
|
Equ Comma$ to ','
|
|
|
|
Declare function Database_Services, obj_NCR, obj_SAP, EpiPro_Services, obj_WO_Log, obj_WO_Mat, SRP_Array
|
|
Declare function Environment_Services, Logging_Services, MemberOf
|
|
Declare subroutine Error_Services, Database_Services, obj_NCR, obj_SAP, SAP_Services, Work_Order_Services
|
|
Declare subroutine Material_Services, Logging_Services, obj_Notes
|
|
|
|
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WM_OUT'
|
|
LogDate = Oconv(Date(), 'D4/')
|
|
LogTime = Oconv(Time(), 'MTS')
|
|
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Delete Attempt Log.csv'
|
|
Headers = 'Logging DTM' : @FM : 'WM_OUT Key' : @FM : 'Notes'
|
|
objDeleteLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
|
|
|
|
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' CassComp Log.csv'
|
|
Headers = 'Logging DTM' : @FM : 'WM_OUT Key' : @FM : 'User' : @FM : 'MakeupFlag' : @FM : 'WOMatKey'
|
|
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
|
|
|
|
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
|
|
|
If KeyID then GoSub Initialize_System_Variables
|
|
|
|
Begin Case
|
|
|
|
Case Action _EQC 'CalculateColumn' ; GoSub CalculateColumn
|
|
Case Action _EQC 'READ_RECORD_PRE' ; GoSub READ_RECORD_PRE
|
|
Case Action _EQC 'READ_RECORD' ; GoSub READ_RECORD
|
|
Case Action _EQC 'READONLY_RECORD_PRE' ; GoSub READONLY_RECORD_PRE
|
|
Case Action _EQC 'READONLY_RECORD' ; GoSub READONLY_RECORD
|
|
Case Action _EQC 'WRITE_RECORD_PRE' ; GoSub WRITE_RECORD_PRE
|
|
Case Action _EQC 'WRITE_RECORD' ; GoSub WRITE_RECORD
|
|
Case Action _EQC 'DELETE_RECORD_PRE' ; GoSub DELETE_RECORD_PRE
|
|
Case Action _EQC 'DELETE_RECORD' ; GoSub DELETE_RECORD
|
|
Case Otherwise$ ; Status = 'Invalid Action'
|
|
|
|
End Case
|
|
|
|
If KeyID then GoSub Restore_System_Variables
|
|
|
|
If Assigned(ActionFlow) else ActionFlow = ACTION_CONTINUE$
|
|
|
|
Return ActionFlow
|
|
|
|
|
|
// ----- Calculated Columns --------------------------------------------------------------------------------------------
|
|
//
|
|
// The typical structure of a calculated column will look like this:
|
|
//
|
|
// Declare function TableName_Actions
|
|
//
|
|
// A = {COL1} ; * Reference as many data columns in this way to ensure the dictionary dependency is generated.
|
|
//
|
|
// @ANS = TableName_Actions('CalcField', 'CalcColName')
|
|
//
|
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
|
|
CalculateColumn:
|
|
// Make sure the ActionFlow return variable is cleared in case nothing is calculated.
|
|
ActionFlow = ''
|
|
|
|
Begin Case
|
|
Case CalcColName EQ 'WFR_STATUS' ; GoSub WFR_STATUS
|
|
End Case
|
|
|
|
return
|
|
|
|
|
|
WFR_STATUS:
|
|
|
|
WMOKey = @ID
|
|
WfrStatus = ''
|
|
WMOSlots = Xlate('WM_OUT', WMOKey, 'RDS', 'X')
|
|
WMOZoneProfile = Xlate('WM_OUT', WMOKey, WM_OUT_ZONE$, 'X')
|
|
WMORDSTestKeys = XLATE('WM_OUT', WMOKey, 'CASS_RDS_MET_KEYS', 'X')
|
|
For each RDSNo in WMOSlots using @VM setting sPos
|
|
|
|
Result = ''
|
|
IF RDSNo NE '' then
|
|
ReactRunRec = Database_Services('ReadDataRow', 'REACT_RUN', RDSNo)
|
|
SlotZone = Xlate('WM_OUT', WMOKey, WM_OUT_ZONE$, 'X')<1, sPos>
|
|
//Get the RDS_Test for this slot.
|
|
//Find the right RDS Test Key
|
|
ThisSlotRDSTestKeys = ''
|
|
For each RDSTestKey in WMORDSTestKeys using @VM
|
|
RDSTestRec = Database_Services('ReadDataRow', 'RDS_TEST', RDSTestKey)
|
|
If RDSTestRec<RDS_TEST_ZONE$> EQ SlotZone AND RDSTestRec<RDS_TEST_RDS_NO$> EQ RDSNo then
|
|
ThisSlotRDSTestKeys<1, -1> = RDSTestKey
|
|
end
|
|
Next RDSTestKey
|
|
IF ThisSlotRDSTestKeys NE '' then
|
|
RDSTestDataEntered = XLATE('RDS_TEST', ThisSlotRDSTestKeys, 'MET_ENTERED', 'X')
|
|
If RDSTestDataEntered NE '' then
|
|
Locate False$ in RDSTestDataEntered using @VM setting iPos then
|
|
Result = 'ULMET'
|
|
end else
|
|
MetOutOfSpec = Sum(Xlate('RDS_TEST', ThisSlotRDSTestKeys, 'OUT_OF_SPEC', 'X'))
|
|
If MetOutOfSpec then
|
|
//Check for an NCR
|
|
SlotNcr = Xlate('WM_OUT', WMOKey, 'WM_OUT_SLOT_NCR', 'X')<1, sPos>
|
|
If SlotNcr NE '' then
|
|
MetOutOfSpec = False$
|
|
end
|
|
end
|
|
If MetOutOfSpec then
|
|
Result = 'SPEC'
|
|
end else
|
|
Result = 'ULOAD'
|
|
end
|
|
end
|
|
end else
|
|
Result = 'ULMET'
|
|
end
|
|
end else
|
|
Result = 'ULOAD'
|
|
end
|
|
end
|
|
WfrStatus<1, sPos> = Result
|
|
Next RDSNo
|
|
ActionFlow = WfrStatus
|
|
|
|
Return
|
|
|
|
// ----- MFS calls -----------------------------------------------------------------------------------------------------
|
|
|
|
READ_RECORD_PRE:
|
|
// In order to stop a record from being read in this action these lines of code must be used:
|
|
//
|
|
// OrigFileError = 100 : @FM : KeyID
|
|
// Status = 0
|
|
// Record = ''
|
|
// ActionFlow = ACTION_STOP$
|
|
return
|
|
|
|
READ_RECORD:
|
|
// In order to stop a record from being read in this action these lines of code must be used:
|
|
//
|
|
// OrigFileError = 100 : @FM : KeyID
|
|
// Status = 0
|
|
// Record = ''
|
|
return
|
|
|
|
READONLY_RECORD_PRE:
|
|
// In order to stop a record from being read in this action these lines of code must be used:
|
|
//
|
|
// OrigFileError = 100 : @FM : KeyID
|
|
// Status = 0
|
|
// Record = ''
|
|
// ActionFlow = ACTION_STOP$
|
|
return
|
|
|
|
READONLY_RECORD:
|
|
// In order to stop a record from being read in this action these lines of code must be used:
|
|
//
|
|
// OrigFileError = 100 : @FM : KeyID
|
|
// Status = 0
|
|
// Record = ''
|
|
return
|
|
|
|
WRITE_RECORD_PRE:
|
|
|
|
WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', {WO_MAT_KEY})
|
|
If WOMatRec NE '' then
|
|
WOMatNCRs = WOMatRec<WO_MAT_NCR_KEYS$>
|
|
WOMatSlotNCRs = ''
|
|
For each NCRKey in WOMatNCRs using @VM setting vPos
|
|
OutSlotNos = Xlate('NCR', NCRKey, 'OUT_SLOT_NO', 'X')
|
|
If OutSlotNos NE '' then
|
|
For each SlotNo in OutSlotNos using @VM setting sPos
|
|
WOMatSlotNCRs<0, SlotNo> = NCRKey
|
|
Next SlotNo
|
|
end
|
|
Next NCRKey
|
|
Record<WM_OUT_SLOT_NCR$> = WOMatSlotNCRs
|
|
SaveRecord = Record
|
|
// Pad value marks if necessary
|
|
NumSlots = DCount(WOMatSlotNCRs, @VM)
|
|
If NumSlots LT 25 then WOMatSlotNCRs<0, 25> = ''
|
|
WOMatRec<WO_MAT_EPOS_NCR$> = WOMatSlotNCRs
|
|
Database_Services('WriteDataRow', 'WO_MAT', {WO_MAT_KEY}, WOMatRec)
|
|
end
|
|
|
|
WMOSlotNCRs = {SLOT_NCR}
|
|
// WO_MAT column pads @VMs while WM_OUT column does not, so trim trailing @VMs from WO_MAT column.
|
|
WOMatSlotNCRs = Xlate('WO_MAT', {WO_MAT_KEY}, 'EPOS_NCR', 'X')
|
|
Done = False$
|
|
For Slot = 25 to 1 Step -1
|
|
If WOMatSlotNCRs<0, Slot> EQ '' then
|
|
WOMatSlotNCRs = Delete(WOMatSlotNCRs, 0, Slot, 0)
|
|
end else
|
|
Done = True$
|
|
end
|
|
Until Done
|
|
Next Slot
|
|
NCRMismatch = (WMOSlotNCRs NE WOMatSlotNCRs)
|
|
If NCRMismatch then
|
|
Record<WM_OUT_SLOT_NCR$> = WOMatSlotNCRs
|
|
SaveRecord = Record
|
|
end
|
|
|
|
NewMUFlag = Record<WM_OUT_MAKEUP_BOX$>
|
|
OrigMUFlag = OrigRecord<WM_OUT_MAKEUP_BOX$>
|
|
If NewMUFlag NE OrigMUFlag then
|
|
SAPBatchNo = WOMatRec<WO_MAT_SAP_BATCH_NO$>
|
|
SAPTXDtm = WOMatRec<WO_MAT_SAP_TX_DTM$>
|
|
AwaitingBatchNo = ( (SAPTXDtm NE '') and (SAPBatchNo EQ '') )
|
|
FullBoxReject = (SAPBatchNo[-1, 1] = 'R')
|
|
Begin Case
|
|
Case AwaitingBatchNo
|
|
Error_Services('Add', 'Cassette ineligible to be converted as it is awaiting a batch number from SAP.')
|
|
OrigFileError = 104:': Cassette ineligible to be converted as it is awaiting a batch number from SAP.'
|
|
Status = 0
|
|
Record = ''
|
|
ActionFlow = ACTION_STOP$
|
|
Case FullBoxReject
|
|
Error_Services('Add', 'Cassette ineligible to be converted as it is a full box reject.')
|
|
OrigFileError = 104:': Cassette ineligible to be converted as it is a full box reject.'
|
|
Status = 0
|
|
Record = ''
|
|
ActionFlow = ACTION_STOP$
|
|
Case Otherwise$
|
|
Null
|
|
End Case
|
|
end
|
|
|
|
return
|
|
|
|
WRITE_RECORD:
|
|
|
|
WONo = {WO_NO}
|
|
SAPBatchNo = {SAP_BATCH_NO}
|
|
WMOKey = Name
|
|
CassNo = Field(WMOKey, '*', 3)
|
|
|
|
// Check for RDS No changes and update WO_LOG ship qty if needed.
|
|
OrigRDSNos = OrigRecord<WM_OUT_RDS$>
|
|
NewRDSNos = Record<WM_OUT_RDS$>
|
|
ShipNo = Record<WM_OUT_SHIP_NO$>
|
|
If ( (ShipNo NE '') and (OrigRDSNos NE NewRDSNos) ) then
|
|
WOLogRec = Database_Services('ReadDataRow', 'WO_LOG', WONo)
|
|
OrigShipQty = WOLogRec<WO_LOG_STATIC_SHIP_QTY$>
|
|
NewShipQty = obj_WO_Log('ShipQty',WONo:@RM:WOLogRec)
|
|
If OrigShipQty NE NewShipQty then
|
|
WOLogRec<WO_LOG_STATIC_SHIP_QTY$> = NewShipQty
|
|
Database_Services('WriteDataRow', 'WO_LOG', WONo, WOLogRec, True$, False$, True$)
|
|
end
|
|
end
|
|
|
|
// Check MAKEUP_BOX flag. If False$ -> True$, then send CASS_COMP SAP transaction
|
|
MakeupBox = Record<WM_OUT_MAKEUP_BOX$>
|
|
MakeupBoxOrig = OrigRecord<WM_OUT_MAKEUP_BOX$>
|
|
|
|
Begin Case
|
|
Case ( (MakeupBox EQ True$) and ( (MakeupBoxOrig EQ False$) or (MakeupBoxOrig EQ '') ) and (SAPBatchNo EQ '') )
|
|
// Intial WIP to MU conversion -> Send CASS_COMP SAP transaction to get a batch number.
|
|
// Log this event
|
|
LogData = ''
|
|
LogData<1> = LoggingDTM
|
|
LogData<2> = Name
|
|
LogData<3> = @User4
|
|
LogData<4> = MakeupBox
|
|
LogData<5> = {WO_MAT_KEY}
|
|
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
|
SAP_Services('AddCassCompTransaction', {WO_MAT_KEY})
|
|
Case ( (MakeupBox EQ True$) and ( (MakeupBoxOrig EQ False$) or (MakeupBoxOrig EQ '') ) and (SAPBatchNo NE '') )
|
|
// Converting finished goods cassette into MU cassette -> Send BATCH_CONV transaction to SAP.
|
|
SAP_Services('AddBatchConvTransaction', {WO_MAT_KEY})
|
|
Case ( ( (MakeupBox EQ False$) or (MakeupBox EQ '') ) and (MakeupBoxOrig EQ True$) and (SAPBatchNo NE '') )
|
|
// 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:@RM:'':@RM:True$)
|
|
If CurrWaferCount GT 0 then
|
|
// Populate MAKEUP_WAFERS table
|
|
// Add/update cassette data to the MAKEUP_WAFERS table
|
|
WOMatKey = {WO_MAT_KEY}
|
|
If RowExists('MAKEUP_WAFERS', WOMatKey) then
|
|
MUWfrRec = Database_Services('ReadDataRow', 'MAKEUP_WAFERS', WOMatKey)
|
|
end else
|
|
MUWfrRec = ''
|
|
end
|
|
MUWfrRec<MAKEUP_WAFERS.SAP_BATCH_NO$> = {SAP_BATCH_NO}
|
|
MUWfrRec<MAKEUP_WAFERS.PS_NO$> = {PS_NO}
|
|
MUWfrRec<MAKEUP_WAFERS.CUST_NO$> = Xlate('WO_LOG', WONo, 'CUST_NO', 'X')
|
|
MUWfrRec<MAKEUP_WAFERS.PROD_ORD_NO$> = Xlate('WO_LOG', WONo, 'PROD_ORD_NO', 'X')
|
|
MUWfrRec<MAKEUP_WAFERS.WAFER_SIZE$> = Xlate('WO_MAT', WOMatKey, 'WAFER_SIZE', 'X')
|
|
MUWfrRec<MAKEUP_WAFERS.EPI_PART_NO$> = {PART_NO}
|
|
MUWfrRec<MAKEUP_WAFERS.RDS_NO$> = '' ; // {RDS}
|
|
MUWfrRec<MAKEUP_WAFERS.WM_OUT_NO$> = WMOKey
|
|
MUWfrRec<MAKEUP_WAFERS.PROD_VER_NO$> = Xlate('WO_MAT', WOMatKey, 'PROD_VER_NO', 'X')
|
|
MUWfrRec<MAKEUP_WAFERS.CUST_PART_NO$> = Xlate('WO_MAT', WOMatKey, 'CUST_PART_NO', 'X')
|
|
MUWfrRec<MAKEUP_WAFERS.REACT_TYPE$> = Xlate('WO_LOG', WONo, 'REACT_TYPE', 'X')
|
|
MUWfrRec<MAKEUP_WAFERS.CURR_STATUS_STATIC$> = {CURR_STATUS}
|
|
MUWfrRec<MAKEUP_WAFERS.WFR_QTY$> = CurrWaferCount
|
|
RDSNos = {RDS}
|
|
RDSNos = SRP_Array('Clean', RDSNos, 'TrimAndMakeUnique', @VM)
|
|
UnloadDTMs = ''
|
|
For each RDSNo in RDSNos using @VM
|
|
DateOut = Xlate('RDS', RDSNo, 'DATE_OUT', 'X')
|
|
TimeOut = Xlate('RDS', RDSNo, 'TIME_OUT', 'X') / 86400
|
|
TimeOut[1, 2] = ''
|
|
TimeOut = TimeOut[1, 5]
|
|
UnloadDTMs<0, -1> = DateOut:'.':TimeOut
|
|
Next RDSNo
|
|
UnloadDTMs = SRP_Array('Clean', UnloadDTMs, 'TrimAndMakeUnique', @VM)
|
|
UnloadDTMs = SRP_Array('SortSimpleList', UnloadDTMs, 'AscendingNumbers', @VM)
|
|
MUWfrRec<MAKEUP_WAFERS.UNLOAD_DTM$> = UnloadDTMs<0, 1>
|
|
Database_Services('WriteDataRow', 'MAKEUP_WAFERS', WOMatKey, MUWfrRec, True$, False$, True$)
|
|
end else
|
|
// Remove cassette data from MAKEUP_WAFERS table if it is present
|
|
If RowExists('MAKEUP_WAFERS', WOMatKey) then
|
|
Database_Services('DeleteDataRow', 'MAKEUP_WAFERS', WOMatKey, True$, False$)
|
|
end
|
|
end
|
|
end else
|
|
// Remove cassette data from MAKEUP_WAFERS table if it is present
|
|
If RowExists('MAKEUP_WAFERS', WOMatKey) then
|
|
Database_Services('DeleteDataRow', 'MAKEUP_WAFERS', WOMatKey, True$, False$)
|
|
end
|
|
end
|
|
|
|
// Copy FQA date and datetime to the WO_MAT record.
|
|
ReactType = Xlate('WO_LOG', WONo, 'REACT_TYPE', 'X')
|
|
EpiPro = (ReactType EQ 'EPP')
|
|
If EpiPro then
|
|
|
|
OrigFQASig = OrigRecord<WM_OUT_SUP_VER_SIG$>
|
|
OrigFQASigDTM = OrigRecord<WM_OUT_SUP_VER_SIG_DTM$>
|
|
FQASig = Record<WM_OUT_SUP_VER_SIG$>
|
|
FQASigDTM = Record<WM_OUT_SUP_VER_SIG_DTM$>
|
|
|
|
If ( (OrigFQASig NE FQASig) or (OrigFQASigDTM NE FQASigDTM) ) then
|
|
WOMatStage = '1MO_QA'
|
|
WOMatKey = {WO_MAT_KEY}
|
|
WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
|
|
SigProf = WOMatRec<WO_MAT_SIG_PROFILE$>
|
|
Sigs = WOMatRec<WO_MAT_SIGNATURE$>
|
|
SigDTMs = WOMatRec<WO_MAT_SIG_DTM$>
|
|
Locate WOMatStage in SigProf using @VM setting vPos then
|
|
Sigs<0, vPos> = FQASig
|
|
SigDTMs<0, vPos> = FQASigDTM
|
|
WOMatRec<WO_MAT_SIGNATURE$> = Sigs
|
|
WOMatRec<WO_MAT_SIG_DTM$> = SigDTMs
|
|
Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRec, True$, False$, True$)
|
|
end
|
|
end
|
|
|
|
end
|
|
|
|
**** SAP BATCHMOVE_IN ****
|
|
|
|
WorkOrderNo = {WO_NO}
|
|
// If makeup wafers added/removed after FQA and if not shipped -> send to SAP
|
|
SAPOrderNo = XLATE('WO_LOG', WorkOrderNo, WO_LOG_PROD_ORD_NO$, 'X')
|
|
IF ( (SAPOrderNo NE '') and {SAP_BATCH_NO} ) THEN
|
|
MakeupBox = {MAKEUP_BOX}
|
|
OrigMUWONos = OrigRecord<WM_OUT_MU_WO_NO$>
|
|
NewMUWONos = Record<WM_OUT_MU_WO_NO$>
|
|
OrigMUCassNos = OrigRecord<WM_OUT_MU_CASS_NO$>
|
|
NewMUCassNos = Record<WM_OUT_MU_CASS_NO$>
|
|
SAPSLocFrom = ''
|
|
SAPSLocTo = ''
|
|
|
|
If ( (OrigMUWONos NE NewMUWONos) or (OrigMUCassNos NE NewMUCassNos) ) then
|
|
Material = Xlate('WO_LOG', WorkOrderNo, 'EPI_PART_NO', 'X')
|
|
For WfrIndex = 1 to 25
|
|
|
|
OrigMUCassID = ''
|
|
OrigMUWONo = OrigMUWONos<0, WfrIndex>
|
|
OrigMUCassNo = OrigMUCassNos<0, WfrIndex>
|
|
If OrigMUWONo NE '' and OrigMUCassNo NE '' then OrigMUCassID = OrigMUWONo:'*':OrigMUCassNo
|
|
|
|
NewMUCassID = ''
|
|
NewMUWONo = NewMUWONos<0, WfrIndex>
|
|
NewMUCassNo = NewMUCassNos<0, WfrIndex>
|
|
If NewMUWONo NE '' and NewMUCassNo NE '' then NewMUCassID = NewMUWONo:'*':NewMUCassNo
|
|
|
|
Begin Case
|
|
Case ( (OrigMUCassID EQ '') and (NewMUCassID NE '') )
|
|
// MU wafer added
|
|
If MakeupBox EQ True$ then
|
|
// Current box is a makeup box and new box is a makeup box. We want to update
|
|
// the batch number in SAP.
|
|
SAPSLocFrom = '0400'
|
|
SAPSLocTo = '0400'
|
|
end else
|
|
SAPSLocFrom = '0400'
|
|
SAPSLocTo = '0500'
|
|
end
|
|
|
|
BatchFrom = Xlate('WO_MAT', NewMUCassID, 'SAP_BATCH_NO', 'X')
|
|
BatchTo = {SAP_BATCH_NO}
|
|
If ( (BatchTo NE '') and (BatchFrom NE '') ) then
|
|
TransQty = 1
|
|
obj_SAP('AddTransaction','BATCHMOVE_IN':@RM:Material:@RM:BatchFrom:@RM:BatchTo:@RM:SAPSLocFrom:@RM:SAPSLocTo:@RM:TransQty)
|
|
end
|
|
|
|
Case ( (OrigMUCassID NE '') and (NewMUCassID EQ '') )
|
|
// MU wafer removed
|
|
If MakeupBox EQ True$ then
|
|
// Current box is a makeup box and new box is a makeup box. We want to update
|
|
// the batch number in SAP.
|
|
SAPSLocFrom = '0400'
|
|
SAPSLocTo = '0400'
|
|
end else
|
|
SAPSLocFrom = '0500'
|
|
SAPSLocTo = '0400'
|
|
end
|
|
|
|
BatchFrom = {SAP_BATCH_NO}
|
|
BatchTo = Xlate('WO_MAT', OrigMUCassID, 'SAP_BATCH_NO', 'X')
|
|
If ( (BatchTo NE '') and (BatchFrom NE '') ) then
|
|
TransQty = 1
|
|
obj_SAP('AddTransaction','BATCHMOVE_IN':@RM:Material:@RM:BatchFrom:@RM:BatchTo:@RM:SAPSLocFrom:@RM:SAPSLocTo:@RM:TransQty)
|
|
end
|
|
|
|
Case Otherwise$
|
|
// No change
|
|
Null
|
|
End Case
|
|
|
|
Next WfrIndex
|
|
|
|
end
|
|
end
|
|
|
|
return
|
|
|
|
DELETE_RECORD_PRE:
|
|
|
|
return
|
|
|
|
DELETE_RECORD:
|
|
|
|
return
|
|
|
|
|
|
// ----- Internal Methods ----------------------------------------------------------------------------------------------
|
|
|
|
Initialize_System_Variables:
|
|
// Save these for restoration later
|
|
SaveDict = @DICT
|
|
SaveID = @ID
|
|
SaveRecord = @RECORD
|
|
OrigFileError = @FILE.ERROR
|
|
|
|
// Now make sure @DICT, ID, and @RECORD are populated
|
|
CurrentDictName = ''
|
|
If @DICT then
|
|
DictHandle = @DICT<1, 2>
|
|
Locate DictHandle in @TABLES(5) Using @FM Setting fPos then
|
|
CurrentDictName = Field(@TABLES(0), @FM, fPos, 1)
|
|
end
|
|
end
|
|
|
|
If CurrentDictName NE DictName then
|
|
Open DictName to @DICT else Status = 'Unable to initialize @DICT'
|
|
end
|
|
|
|
@ID = KeyID
|
|
If Record else
|
|
// Record might not have been passed in. Read the record from the database table just to make sure.
|
|
@FILE.ERROR = ''
|
|
Open TableName to hTable then
|
|
FullFSList = hTable[1, 'F' : @VM]
|
|
BFS = FullFSList[-1, 'B' : @SVM]
|
|
LastHandle = hTable[-1, 'B' : \0D\]
|
|
FileHandle = \0D\ : LastHandle[1, @VM]
|
|
|
|
Call @BFS(READO.RECORD, BFS, FileHandle, KeyID, FMC, Record, ReadOStatus)
|
|
end
|
|
end
|
|
@RECORD = Record
|
|
return
|
|
|
|
Restore_System_Variables:
|
|
Transfer SaveDict to @DICT
|
|
Transfer SaveID to @ID
|
|
Transfer SaveRecord to @RECORD
|
|
@FILE.ERROR = OrigFileError
|
|
return
|
|
|