Added troubleshooting logs to find cause of LBLCHK transactions going missing

This commit is contained in:
Infineon\Ouellette
2025-07-29 14:06:51 -07:00
committed by Ouellette Jonathan (CSC FI SPS MESLEO)
parent 03f42dedea
commit 6934799e92
2 changed files with 167 additions and 2 deletions

View File

@ -121,6 +121,11 @@ SAPFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' SetS
SAPHeaders = 'Logging DTM' : @FM : 'WOMatKey' : @FM : 'SAPBatchNo'
objSAPLog = Logging_Services('NewLog', SAPLogPath, SAPFileName, CRLF$, Comma$, SAPHeaders, '', False$, False$)
WOMatLogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_Mat'
WOMatLogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' WO_MAT_LOG - Inv Transaction Error.csv'
WOMatHeaders = 'Logging DTM' : @FM : 'WONo' : @FM : 'CassNo' : @FM : 'User' : @FM : 'Log Pos' : @FM : 'Tag' : @FM : 'Warehouse' : @FM : 'Loc' : @FM : 'InvAction' : @FM : 'ToolID'
objLogInvTransError = Logging_Services('NewLog', WOMatLogPath, WOMatLogFileName, CRLF$, Comma$, WOMatHeaders, '', False$, False$)
IsProd = Environment_Services('IsProd')
If IsProd EQ True$ then
MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_OBJWOMAT'
@ -1040,6 +1045,20 @@ AddInvTrans:
IF ErrorMsg NE '' THEN
ErrorMsg := CRLF$:Parms
SWAP @RM WITH CRLF$ IN ErrorMsg
LogData = ''
LogData<1> = LogFile
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = InvLocation
LogData<5> = InvAction
LogData<6> = InvDTM
LogData<7> = ScanUserID
LogData<8> = Tag
LogData<9> = ToolID
LogData<10> = ScanEntry
LogData<11> = ''
LogData<12> = 'Unable to add inv. transaction. Missing Parameter detected. ' : ErrorMsg
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
RETURN
END
@ -1065,6 +1084,20 @@ AddInvTrans:
IF Get_Status(errCode) THEN
obj_Tables('UnlockRec',OtParms)
LogData = ''
LogData<1> = LogFile
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = InvLocation
LogData<5> = InvAction
LogData<6> = InvDTM
LogData<7> = ScanUserID
LogData<8> = Tag
LogData<9> = ToolID
LogData<10> = ScanEntry
LogData<11> = ''
LogData<12> = 'Unable to add inv. transaction. Unable to read OR get a lock on the WO_MAT record. Line 1099'
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
RETURN
END
@ -1080,6 +1113,20 @@ AddInvTrans:
IF Get_Status(errCode) THEN
obj_Tables('UnlockRec',WOtParms)
obj_Tables('UnlockRec',OtParms)
LogData = ''
LogData<1> = LogFile
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = InvLocation
LogData<5> = InvAction
LogData<6> = InvDTM
LogData<7> = ScanUserID
LogData<8> = Tag
LogData<9> = ToolID
LogData<10> = ScanEntry
LogData<11> = ''
LogData<12> = 'Unable to add inv. transaction. Unable to read WM_OUT record.'
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
RETURN
END
@ -1095,7 +1142,20 @@ AddInvTrans:
obj_Tables('WriteRec',WOtParms)
IF Get_Status(errCode) THEN
NULL
LogData = ''
LogData<1> = LogFile
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = InvLocation
LogData<5> = InvAction
LogData<6> = InvDTM
LogData<7> = ScanUserID
LogData<8> = Tag
LogData<9> = ToolID
LogData<10> = ScanEntry
LogData<11> = ''
LogData<12> = 'Unable to add inv. transaction. Unable to write WM_OUT record.'
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
END
END ;* End of check for PTO or PKO location
@ -1108,6 +1168,20 @@ AddInvTrans:
IF Get_Status(errCode) THEN
obj_Tables('UnlockRec',WOtParms)
obj_Tables('UnlockRec',OtParms)
LogData = ''
LogData<1> = LogFile
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = InvLocation
LogData<5> = InvAction
LogData<6> = InvDTM
LogData<7> = ScanUserID
LogData<8> = Tag
LogData<9> = ToolID
LogData<10> = ScanEntry
LogData<11> = ''
LogData<12> = 'Unable to add inv. transaction. Unable to read WM_OUT record.'
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
RETURN
END
@ -1125,6 +1199,20 @@ AddInvTrans:
IF @WINDOW NE 'WO_MAT_INV' THEN
IF WOMatRec<WO_MAT_LOT_NO$> = '' OR WOMatRec<WO_MAT_CUST_PART_NO$> = '' THEN
obj_Tables('UnlockRec',OtParms)
LogData = ''
LogData<1> = LogFile
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = InvLocation
LogData<5> = InvAction
LogData<6> = InvDTM
LogData<7> = ScanUserID
LogData<8> = Tag
LogData<9> = ToolID
LogData<10> = ScanEntry
LogData<11> = ''
LogData<12> = 'Unable to add inv. transaction. null LOT_NO or CUST_PART_NO values.'
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
RETURN
END
END
@ -1163,6 +1251,50 @@ AddInvTrans:
Loop
NumAttempts += 1
Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRec, True$, False$, True$)
if Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
LogData = ''
LogData<1> = LogFile
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = InvLocation
LogData<5> = InvAction
LogData<6> = InvDTM
LogData<7> = ScanUserID
LogData<8> = Tag
LogData<9> = ToolID
LogData<10> = ScanEntry
LogData<11> = ''
LogData<12> = 'Unable to add inv. transaction. ' : ErrorMessage : ' Next line is the expected INV Actions.'
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
LogData = ''
LogData<1> = WONo
LogData<2> = CassNo
LogData<3> = WOMatRec<WO_MAT_INV_ACTION$>
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
end else
LogData = ''
LogData<1> = LogFile
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = InvLocation
LogData<5> = InvAction
LogData<6> = InvDTM
LogData<7> = ScanUserID
LogData<8> = Tag
LogData<9> = ToolID
LogData<10> = ScanEntry
LogData<11> = ''
LogData<12> = 'Successfully wrote inv transaction to WO_MAT record. Next line is the resultant INV Actions.'
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
LogData = ''
LogData<1> = WONo
LogData<2> = CassNo
LogData<3> = WOMatRec<WO_MAT_INV_ACTION$>
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
end
WOMatRecVerify = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
LastEntryIndex = DCount(WOMatRecVerify<WO_MAT_INV_WH$>, @VM)
LastEntryAction = WOMatRecVerify<WO_MAT_INV_ACTION$, LastEntryIndex>
@ -5581,3 +5713,4 @@ ExpCOA:
RETURN