Modified WM_IN ZPL label generation to include a 2D datamatrix

barcode. Implemented 2D barcode verification in PTI and FQA Label Check
Operations.

Bug fixes

Changed WMI 2D barcode to have 8 fields to keep code base simpler

minor changes to error message verbiage

Refactored code to use post log. Refactored code to not use multiple returns. Modfield input form fields to force upper case only.

changed LSL password verification to be case insensitive to avoid barcode scanning issues when caps lock is on

temporary change to allow 1D WMI scans at PTI while we exhaust current supply
This commit is contained in:
Infineon\Mitchem
2025-05-28 12:58:56 -07:00
committed by Stieber Daniel (CSC FI SPS MESLEO)
parent 2f6b376ece
commit b2c9e500f8
16 changed files with 5621 additions and 2639 deletions

View File

@ -62,117 +62,161 @@ Options SCAN_TYPES_PTO = 'LABEL1', 'LABEL2'
//----------------------------------------------------------------------------------------------------------------------
Service ProcessFQAScanData(ScanData, ScanType = SCAN_TYPES, Param1, Param2, Param3)
ErrorMsg = ''
If (ScanData NE '') then
// Code 3of9 encodes the asterisk and underscore characters. These need to be decoded.
//ScanData = Scan_Services('DecodeScanData', ScanData)
If Error_Services('NoError') then
ColumnIndex = ''
ColumnValue = ''
// Identify the scan data based on the data identifier prefix (if any). Otherwise, assume this is a
// type of cassette ID (i.e., RDS or WMO).
Begin Case
Case ScanType EQ 'SUPPLIER'
ValidLot = False$
If ScanData[1, 2] EQ '2T' OR ScanData[1,2] EQ '1T' then ScanData[1, 2] = ''
ScanSubLot = ScanData
CassetteID = Param1
If INDEX(CassetteID,'.',2) then
RDSType = 'EPP'
end else
RDSType = 'SIC'
end
ValidLot = Rds_Services('IsValidSubLot', CassetteID, RDSType, ScanSubLot)
If ValidLot NE True$ then
// Add error to error stack
ErrorMessage = 'Invalid Supplier Lot: ':ScanData
Error_Services('Add', ErrorMessage)
end
If Error_Services('NoError') then
Response = ScanSubLot
end
Case ScanType EQ 'CASSETTE1'
// Assume this is intended to be a Cassette ID scan (either WMO or RDS). Only if this is a
// non-existent carrier will the scan data be considered invalid.
// Strip '1T', 'I', and 'O' prefixes.
If ScanData[1, 2] EQ '1T' then
ScanData[1, 2] = ''
end else If ScanData[1,1] EQ 'I' OR ScanData[1,1] EQ 'O' then
ScanData[1,1] = ''
end
CassetteID = ScanData
If INDEX(CassetteID,'.',2) then
RDSType = 'EPP'
WOMatKey = Field(CassetteID, '.', 1):'*':Field(CassetteID, '.', 3)
end else
RDSType = 'SIC'
WOMatKey = Xlate('RDS', CassetteID, 'WO_MAT_KEY', 'X')
end
ValidCassetteID = False$ ; // Assume Cassette ID is not valid for now.
ValidCassetteID = Rds_Services('IsValidRDS', CassetteID, RDSType )
If RDSType EQ 'EPP' then
LotDesc = 'EPP Lot '
end else
LotDesc = 'RDS Number '
ColumnIndex = ''
ColumnValue = ''
// Identify the scan data based on the data identifier prefix (if any). Otherwise, assume this is a
// type of cassette ID (i.e., RDS or WMO).
Begin Case
Case ScanType EQ 'SUPPLIER'
ValidLot = False$
If ScanData[1, 2] EQ '2T' OR ScanData[1,2] EQ '1T' then ScanData[1, 2] = ''
ScanSubLot = ScanData
CassetteID = Param1
If INDEX(CassetteID,'.',2) then
RDSType = 'EPP'
end else
RDSType = 'SIC'
end
ValidLot = Rds_Services('IsValidSubLot', CassetteID, RDSType, ScanSubLot)
If ValidLot NE True$ then
// Add error to error stack
ErrorMsg = 'Invalid Supplier Lot: ':ScanData
end
If ErrorMsg EQ '' then Response = ScanSubLot
Case ScanType EQ 'CASSETTE1'
DelimCount = DCount(ScanData, '|')
Begin Case
Case ( (ScanData[1, 2] EQ '1T') or (ScanData[1, 1] EQ 'O') )
ErrorMsg = '1D Lot Label Scanned. 2D Lot Label Required.'
Case (DelimCount NE 8)
ErrorMsg = 'Invalid Lot Label Scan.'
Case Otherwise$
CassetteID = Field(ScanData, '|', 3)
SeqNo = Field(ScanData, '|', 8)
End Case
If ErrorMsg EQ '' then
If CassetteID[1, 2] EQ '1T' then
CassetteID[1, 2] = ''
end else If CassetteID[1,1] EQ 'I' OR CassetteID[1,1] EQ 'O' then
CassetteID[1,1] = ''
end
If INDEX(CassetteID,'.',2) then
RDSType = 'EPP'
WOMatKey = Field(CassetteID, '.', 1):'*':Field(CassetteID, '.', 3)
end else
RDSType = 'SIC'
WOMatKey = Xlate('RDS', CassetteID, 'WO_MAT_KEY', 'X')
end
ValidCassetteID = Rds_Services('IsValidRDS', CassetteID, RDSType )
If ValidCassetteID EQ True$ then
If Param1 NE '' AND ScanData NE Param1 then ;*Cassette2 Scan
Error_Services('Add', LotDesc:'Mismatch: ':CassetteID: ' does not match ': Param1)
end
// Check if FQA is signed
FQASigned = ''
WorkOrdNo = Field(WOMatKey, '*', 1)
ReactorType = XLATE('WO_LOG', WorkOrdNo, 'REACT_TYPE', 'X')
QAStage = ''
Begin Case
Case RDSType EQ 'EPP'
QAStage = 'MO_QA'
Case Otherwise$
QAStage = 'QA'
End Case
If Param1 NE '' AND ScanData NE Param1 then ;*Cassette2 Scan
ErrorMsg = 'Lot Label Mismatch: ':CassetteID: ' does not match ': Param1
end
If ErrorMsg EQ '' then
// Check if FQA is signed
FQASigned = ''
WorkOrdNo = Field(WOMatKey, '*', 1)
ReactorType = XLATE('WO_LOG', WorkOrdNo, 'REACT_TYPE', 'X')
QAStage = ''
Begin Case
Case RDSType EQ 'EPP'
QAStage = 'MO_QA'
Case Otherwise$
QAStage = 'QA'
End Case
FQASigned = Signature_Services('CheckSignature', WOMatKey, QAStage)
IF NOT(FQASigned) THEN
Error_Services('Add', 'FQA not signed for ':LotDesc:CassetteID: '!')
END
end else
Error_Services('Add', 'Invalid ':LotDesc:CassetteID)
end
If Error_Services('NoError') then
Response = CassetteID
end
Case ScanType EQ 'CASSETTE2'
Response = Material_Movement_Services('ProcessPTIScanData', ScanData, 'CASSETTE1', Param1)
Response = ScanData
End Case
end
FQASigned = Signature_Services('CheckSignature', WOMatKey, QAStage)
If NOT(FQASigned) then ErrorMsg = 'FQA not signed for ':CassetteID:'!'
end
end else
ErrorMsg = 'Invalid Lot ID ':CassetteID
end
If ErrorMsg EQ '' then
Response = ''
Response<1> = CassetteID
Response<2> = SeqNo
end
end
Case ScanType EQ 'CASSETTE2'
// Assume this is intended to be a Cassette ID scan (either WMO or RDS). Only if this is a
// non-existent carrier will the scan data be considered invalid.
// Strip '1T', 'I', and 'O' prefixes.
ValidCassetteID = False$ ; // Assume Cassette ID is not valid for now.
Cassette1ID = Param1
Seq1No = Param2
DelimCount = DCount(ScanData, '|')
Begin Case
Case ( (ScanData[1, 2] EQ '1T') or (ScanData[1, 1] EQ 'O') )
ErrorMsg = '1D Lot Label Scanned. 2D Lot Label Required.'
Case (DelimCount NE 8)
ErrorMsg = 'Invalid Lot Label Scan.'
Case Otherwise$
CassetteID = Field(ScanData, '|', 3)
Seq2No = Field(ScanData, '|', 8)
End Case
If ErrorMsg EQ '' then
If CassetteID[1, 2] EQ '1T' then
CassetteID[1, 2] = ''
end else If CassetteID[1,1] EQ 'I' OR CassetteID[1,1] EQ 'O' then
CassetteID[1,1] = ''
end
If INDEX(CassetteID,'.',2) then
RDSType = 'EPP'
end else
RDSType = 'SIC'
end
ValidCassetteID = Rds_Services('IsValidRDS', CassetteID, RDSType )
If ValidCassetteID EQ True$ then
If Cassette1ID NE '' AND (CassetteID NE Cassette1ID) then ;*Cassette2 Scan
ErrorMsg = 'Lot Label Mismatch: ':CassetteID: ' does not match ': Cassette1ID
end
If Seq1No EQ Seq2No then
ErrorMsg = 'FQA Label verification failed due':CRLF$:'to operator double-scanning barcode.'
end
end else
ErrorMsg = 'Invalid RDS Number: ':CassetteID
end
If ErrorMsg EQ '' then Response = CassetteID
end
End Case
end else
Error_Services('Add', 'ScanData argument was missing in the ' : Service : ' service.')
ErrorMsg = 'ScanData argument was missing in the ' : Service : ' service.'
end
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service
//----------------------------------------------------------------------------------------------------------------------
// ProcessPTIScanData
//
@ -183,92 +227,148 @@ end service
//----------------------------------------------------------------------------------------------------------------------
Service ProcessPTIScanData(ScanData, ScanType = SCAN_TYPES, Param1, Param2, Param3)
ErrorMsg = ''
If (ScanData NE '') then
// Code 3of9 encodes the asterisk and underscore characters. These need to be decoded.
//ScanData = Scan_Services('DecodeScanData', ScanData)
If Error_Services('NoError') then
ColumnIndex = ''
ColumnValue = ''
// Identify the scan data based on the data identifier prefix (if any). Otherwise, assume this is a
// type of cassette ID (i.e., RDS or WMO).
Begin Case
Case ScanType EQ 'SUPPLIER'
ValidLot = False$
If ScanData[1, 2] EQ '2T' OR ScanData[1,2] EQ '1T' then ScanData[1, 2] = ''
ScanSubLot = ScanData
CassetteID = Param1
If INDEX(CassetteID,'.',2) then
RDSType = 'EPP'
end else
RDSType = 'SIC'
end
ValidLot = Rds_Services('IsValidSubLot', CassetteID, RDSType, ScanSubLot)
If ValidLot NE True$ then ErrorMsg = 'Invalid Supplier Lot: ':ScanData
If ErrorMsg EQ '' then Response = ScanSubLot
Case ScanType EQ 'CASSETTE1'
debug
// Assume this is intended to be a Cassette ID scan (either WMO or RDS). Only if this is a
// non-existent carrier will the scan data be considered invalid.
// Strip '1T', 'I', and 'O' prefixes.
ValidCassetteID = False$ ; // Assume Cassette ID is not valid for now.
DelimCount = DCount(ScanData, '|')
Begin Case
Case (ScanData[1, 1] EQ 'I')
! Temporary exception while we exhaust current WMI inventory on KIT racks that
! do not have a 2D barcode.
CassetteID = ScanData
SeqNo = 'SEQ1'
Case ( (ScanData[1, 2] EQ '1T') or (ScanData[1, 1] EQ 'O') )
ErrorMsg = '1D Lot Label Scanned. 2D Lot Label Required.'
Case (DelimCount NE 8)
ErrorMsg = 'Invalid Lot Label Scan.'
Case Otherwise$
CassetteID = Field(ScanData, '|', 3)
SeqNo = Field(ScanData, '|', 8)
End Case
If ErrorMsg EQ '' then
If CassetteID[1, 2] EQ '1T' then
CassetteID[1, 2] = ''
end else If CassetteID[1,1] EQ 'I' OR CassetteID[1,1] EQ 'O' then
CassetteID[1,1] = ''
end
If INDEX(CassetteID,'.',2) then
RDSType = 'EPP'
end else
RDSType = 'SIC'
end
ValidCassetteID = Rds_Services('IsValidRDS', CassetteID, RDSType)
If ValidCassetteID EQ True$ then
If Param1 NE '' AND (ScanData NE Param1) then ;*Cassette2 Scan
ErrorMsg = 'Lot Label Mismatch: ':CassetteID: ' does not match ': Param1
end
end else
ErrorMsg = 'Invalid Cassette Number: ':CassetteID
end
If ErrorMsg EQ '' then
Response = ''
Response<1> = CassetteID
Response<2> = SeqNo
end
end
Case ScanType EQ 'CASSETTE2'
// Assume this is intended to be a Cassette ID scan (either WMO or RDS). Only if this is a
// non-existent carrier will the scan data be considered invalid.
// Strip '1T', 'I', and 'O' prefixes.
ValidCassetteID = False$ ; // Assume Cassette ID is not valid for now.
Cassette1ID = Param1
Seq1No = Param2
DelimCount = DCount(ScanData, '|')
Begin Case
Case (ScanData[1, 1] EQ 'I')
! Temporary exception while we exhaust current WMI inventory on KIT racks that
! do not have a 2D barcode.
CassetteID = ScanData
Seq2No = 'SEQ2'
Case ( (ScanData[1, 2] EQ '1T') or (ScanData[1, 1] EQ 'O') )
ErrorMsg = '1D Lot Label Scanned. 2D Lot Label Required.'
Case (DelimCount NE 8)
ErrorMsg = 'Invalid Lot Label Scan.'
Case Otherwise$
CassetteID = Field(ScanData, '|', 3)
Seq2No = Field(ScanData, '|', 8)
End Case
If ErrorMsg EQ '' then
If CassetteID[1, 2] EQ '1T' then
CassetteID[1, 2] = ''
end else If CassetteID[1,1] EQ 'I' OR CassetteID[1,1] EQ 'O' then
CassetteID[1,1] = ''
end
If INDEX(CassetteID,'.',2) then
RDSType = 'EPP'
end else
RDSType = 'SIC'
end
ValidCassetteID = Rds_Services('IsValidRDS', CassetteID, RDSType)
If ValidCassetteID EQ True$ then
If Cassette1ID NE '' AND (CassetteID NE Cassette1ID) then ;*Cassette2 Scan
ErrorMsg = 'Lot Label Mismatch: ':CassetteID: ' does not match ': Cassette1ID
end
If Seq1No EQ Seq2No then
ErrorMsg = 'PTI Label verification failed due':CRLF$:'to operator double-scanning barcode.'
end
end else
ErrorMsg = 'Invalid Cassette Number: ':CassetteID
end
If ErrorMsg EQ '' then Response = CassetteID
end
End Case
ColumnIndex = ''
ColumnValue = ''
// Identify the scan data based on the data identifier prefix (if any). Otherwise, assume this is a
// type of cassette ID (i.e., RDS or WMO).
Begin Case
Case ScanType EQ 'SUPPLIER'
ValidLot = False$
If ScanData[1, 2] EQ '2T' OR ScanData[1,2] EQ '1T' then ScanData[1, 2] = ''
ScanSubLot = ScanData
CassetteID = Param1
If INDEX(CassetteID,'.',2) then
RDSType = 'EPP'
end else
RDSType = 'SIC'
end
ValidLot = Rds_Services('IsValidSubLot', CassetteID, RDSType, ScanSubLot)
If ValidLot NE True$ then
// Add error to error stack
ErrorMessage = 'Invalid Supplier Lot: ':ScanData
Error_Services('Add', ErrorMessage)
end
If Error_Services('NoError') then
Response = ScanSubLot
end
Case ScanType EQ 'CASSETTE1'
// Assume this is intended to be a Cassette ID scan (either WMO or RDS). Only if this is a
// non-existent carrier will the scan data be considered invalid.
// Strip '1T', 'I', and 'O' prefixes.
If ScanData[1, 2] EQ '1T' then
ScanData[1, 2] = ''
end else If ScanData[1,1] EQ 'I' OR ScanData[1,1] EQ 'O' then
ScanData[1,1] = ''
end
CassetteID = ScanData
If INDEX(CassetteID,'.',2) then
RDSType = 'EPP'
end else
RDSType = 'SIC'
end
ValidCassetteID = False$ ; // Assume Cassette ID is not valid for now.
ValidCassetteID = Rds_Services('IsValidRDS', CassetteID, RDSType )
If ValidCassetteID EQ True$ then
If Param1 NE '' AND ScanData NE Param1 then ;*Cassette2 Scan
Error_Services('Add', 'RDS Mismatch: ':CassetteID: ' does not match ': Param1)
end
end else
Error_Services('Add', 'Invalid RDS Number: ':CassetteID)
end
If Error_Services('NoError') then
Response = CassetteID
end
Case ScanType EQ 'CASSETTE2'
Response = Material_Movement_Services('ProcessPTIScanData', ScanData, 'CASSETTE1', Param1)
Response = ScanData
End Case
end
end else
Error_Services('Add', 'ScanData argument was missing in the ' : Service : ' service.')
ErrorMsg = 'ScanData argument was missing in the ' : Service : ' service.'
end
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service
//to do before release of ProcessPTOScanData
//1. prerequisite - waiting on newly printed (on/after 10/18/21) labels to make their way through warehouse, though not critical
//2. showstopper - need barcode scanners to be able to scan 2D barcodes - currently only 1 such scanner (purchased for shipping but not deployed, given to Cheryl)
//3. fix prod print routine to use SRP GetPrinter methods similar to what the Test_Print_SAP_Cass_Ship_Label does
//----------------------------------------------------------------------------------------------------------------------
// ProcessPTOScanData
//
@ -282,174 +382,165 @@ end service
//----------------------------------------------------------------------------------------------------------------------
Service ProcessPTOScanData(ScanData, ScanType = SCAN_TYPES_PTO, Param1, Param2)
ErrorMsg = ''
Location = 'PTO Mat'
If (ScanData NE '') then
If Error_Services('NoError') then
ColumnIndex = ''
ColumnValue = ''
Cassette1 = ''
Cassette2 = ''
Begin Case
Case ScanType EQ 'LABEL1'
//determine whether regular NEPP or EPP label scan
//NEPP should be data matrix scan and have 7 parts, RDS_No is the 3rd
//EPP is 1D scan and will have the WMO number (e.g. 170369*1*48)
// This should be a multi-part 2D datamatrix scan, so there should be a long string separated by pipe symbols.
// Validate the 1. it is multi-part string and 2. that the RDS number from the string is a) valid RDS number
// and b) is currently is the proper state to do PTO transaction.
// Strip any standardized prefixes (e.g. '1T', '2T', etc.) as necessary
// data from Label1 should have 8 parts (no matter type - Si or EPP), we're looking for the 3rd
cnt = DCount(ScanData, '|')
if cnt NE 8 then
Cassette1 = 0
Error_Services('Add', 'Invalid Lot Label Scan.')
return
end else
//RDS should be 3rd position
Cassette1 = Field(ScanData, '|', 3)
end
//strip the prefix encoding
If Cassette1[1, 2] EQ '1T' OR Cassette1[1, 2] EQ '2T' then
Cassette1[1, 2] = ''
end else If Cassette1[1,1] EQ 'I' OR ScanData[1,1] EQ 'O' then
Cassette1[1,1] = ''
end
WOMatKey = ''
RdsRec = ''
WONo = ''
CassNo = ''
ColumnIndex = ''
ColumnValue = ''
Cassette1 = ''
Cassette2 = ''
Begin Case
Case ScanType EQ 'LABEL1'
// Determine whether regular NEPP or EPP label scan
// NEPP should be data matrix scan and have 7 parts, RDS_No is the 3rd
// EPP is 1D scan and will have the WMO number (e.g. 170369*1*48)
// This should be a multi-part 2D datamatrix scan, so there should be a long string separated by pipe symbols.
// Validate the 1. it is multi-part string and 2. that the RDS number from the string is a) valid RDS number
// and b) is currently is the proper state to do PTO transaction.
// Strip any standardized prefixes (e.g. '1T', '2T', etc.) as necessary
// Data from Label1 should have 8 parts (no matter type - Si or EPP), we're looking for the 3rd
cnt = DCount(ScanData, '|')
if cnt NE 8 then
ErrorMsg = 'Invalid Lot Label Scan.'
end else
Cassette1 = Field(ScanData, '|', 3)
end
If ErrorMsg EQ '' then
// Strip the prefix encoding
If Cassette1[1, 2] EQ '1T' OR Cassette1[1, 2] EQ '2T' then
Cassette1[1, 2] = ''
end else If Cassette1[1,1] EQ 'I' OR ScanData[1,1] EQ 'O' then
Cassette1[1,1] = ''
end
WOMatKey = ''
RdsRec = ''
WONo = ''
CassNo = ''
If INDEX(Cassette1,'.',2) then
RDSType = 'EPP'
WMOKey = Cassette1
If INDEX(Cassette1,'.',2) then
RDSType = 'EPP'
WMOKey = Cassette1
Convert '.' to '*' in WMOKey
If RowExists('WM_OUT', WMOKey) then
If RowExists('WM_OUT', WMOKey) then
WONo = Field(WMOKey, '*', 1, 1)
CassNo = Field(WMOKey, '*', 3, 1)
WOMatKey = WONo:'*':CassNo
end
end else
RDSType = 'SIC'
WOMatKey = XLATE('RDS', Cassette1, 'WO_MAT_KEY', 'X')
RdsRec = Database_Services('ReadDataRow','RDS', Cassette1)
WONo = RdsRec<RDS_WO$>
CassNo = RdsRec<RDS_CASS_NO$>
end
end else
RDSType = 'SIC'
WOMatKey = XLATE('RDS', Cassette1, 'WO_MAT_KEY', 'X')
RdsRec = Database_Services('ReadDataRow','RDS', Cassette1)
WONo = RdsRec<RDS_WO$>
CassNo = RdsRec<RDS_CASS_NO$>
end
ValidCassette1 = False$ ; // Assume Cassette ID is not valid for now.
testCass1 = Cassette1
ValidCassette1 = False$ ; // Assume Cassette ID is not valid for now.
testCass1 = Cassette1
Convert '*' to '.' in testCass1
If Rds_Services('IsValidRDS', Cassette1, RDSType) then
If Rds_Services('GetHoldStatus', Cassette1, RDSType) EQ False$ then
If Rds_Services('IsPackaged', Cassette1, RDSType) EQ True$ then
ValidCassette1 = True$
end else
Error_Services('Add', RDSType: ' RDS ':testCass1: ' has not completed packaging.')
return
end
end else
Error_Services('Add', RDSType: ' RDS ':testCass1: ' is currently on hold.')
return
end
end else
Error_Services('Add', RDSType: ' RDS ' : testCass1 : ' is an invalid RDS number.')
return
end
Convert '*' to '.' in testCass1
If Rds_Services('IsValidRDS', Cassette1, RDSType) then
If Rds_Services('GetHoldStatus', Cassette1, RDSType) EQ False$ then
If Rds_Services('IsPackaged', Cassette1, RDSType) EQ True$ then
ValidCassette1 = True$
end else
ErrorMsg = RDSType: ' RDS ':testCass1: ' has not completed packaging.'
end
end else
ErrorMsg = RDSType: ' RDS ':testCass1: ' is currently on hold.'
end
end else
ErrorMsg = RDSType: ' RDS ' : testCass1 : ' is an invalid RDS number.'
end
LastPTO = obj_WO_Mat('OutofPTO',WOMatKey)
StepNo = 1
IF LastPTO THEN
MsgHead = 'Cassette previously scanned through PTO'
MsgText = 'Scanned at ':LastPTO<2>:' by ':LastPTO<1>:CRLF$
MsgText := 'Are you sure you wish to rescan and reprint the shipping label?'
If ErrorMsg EQ '' then
LastPTO = obj_WO_Mat('OutofPTO',WOMatKey)
StepNo = 1
IF LastPTO THEN
MsgHead = 'Cassette previously scanned through PTO'
MsgText = 'Scanned at ':LastPTO<2>:' by ':LastPTO<1>:CRLF$
MsgText := 'Are you sure you wish to rescan and reprint the shipping label?'
OK = Msg(@WINDOW, '','YESNO','',MsgHead:@FM:MsgText)
OK = Msg(@WINDOW, '','YESNO','',MsgHead:@FM:MsgText)
IF NOT(OK) THEN
Error_Services('Add', 'Scan Cancelled')
RETURN
END else
Print_SAP_Cass_Ship_Label(WONo,StepNo,CassNo,Cassette1, RDSType)
end
end else
Print_SAP_Cass_Ship_Label(WONo,StepNo,CassNo,Cassette1, RDSType)
END
If ValidCassette1 EQ True$ then
If Param1 NE '' AND ScanData NE Param1 then ;*Cassette2 Scan
Error_Services('Add', 'RDS Mismatch: ':Cassette1: ' does not match ': Param1)
return
end
end else
Error_Services('Add', 'Invalid RDS Number: ':Cassette1)
return
end
If Error_Services('NoError') then
Response = Cassette1
end
Case ScanType EQ 'LABEL2'
cnt = DCount(ScanData, ';')
if cnt EQ 9 then
//Tower is customer and RDS should be 2nd position
Cassette2 = Field(ScanData, ';', 2)
end else if cnt EQ 10 then
//all other customers and RDS should be 3rd position
Cassette2 = Field(ScanData, ';', 3)
end else
Error_Services('Add', 'Invalid Shipping Label Scan.')
return
end
//strip the prefix encoding
If Cassette2[1, 2] EQ '1T' OR Cassette2[1, 2] EQ '2T' then
Cassette2[1, 2] = ''
end else If Cassette2[1,1] EQ 'I' OR ScanData[1,1] EQ 'O' then
Cassette2[1,1] = ''
end
testCass1 = Param3
testCass2 = Cassette2
convert '*' to '.' in testCass1
convert '*' to '.' in testCass2
If testCass1 NE testCass2 then
ErrorMsg = 'Scan Mismatch - RDS values do not match. Both cassettes placed on hold - Supervisor, Lead, or Engineering disposition required.':CRLF$ |
IF NOT(OK) THEN
ErrorMsg = 'Scan Cancelled'
END else
Print_SAP_Cass_Ship_Label(WONo,StepNo,CassNo,Cassette1, RDSType)
end
end else
Print_SAP_Cass_Ship_Label(WONo,StepNo,CassNo,Cassette1, RDSType)
end
If ErrorMsg EQ '' then
If ValidCassette1 EQ True$ then
If Param1 NE '' AND ScanData NE Param1 then ;*Cassette2 Scan
ErrorMsg = 'RDS Mismatch: ':Cassette1: ' does not match ': Param1
end
end else
ErrorMsg = 'Invalid RDS Number: ':Cassette1
end
If ErrorMsg EQ '' then Response = Cassette1
end
end
end
Case ScanType EQ 'LABEL2'
cnt = DCount(ScanData, ';')
if cnt EQ 9 then
// Tower is customer and RDS should be 2nd position
Cassette2 = Field(ScanData, ';', 2)
end else if cnt EQ 10 then
// All other customers and RDS should be 3rd position
Cassette2 = Field(ScanData, ';', 3)
end else
ErrorMsg = 'Invalid Shipping Label Scan.'
end
If ErrorMsg EQ '' then
// Strip the prefix encoding
If Cassette2[1, 2] EQ '1T' OR Cassette2[1, 2] EQ '2T' then
Cassette2[1, 2] = ''
end else If Cassette2[1,1] EQ 'I' OR ScanData[1,1] EQ 'O' then
Cassette2[1,1] = ''
end
testCass1 = Param3
testCass2 = Cassette2
convert '*' to '.' in testCass1
convert '*' to '.' in testCass2
If testCass1 NE testCass2 then
ErrorMsg = 'Scan Mismatch - RDS values do not match. Both cassettes placed on hold - Supervisor, Lead, or Engineering disposition required.':CRLF$ |
: 'RDS Label #1: ':testCass1:CRLF$ |
: 'RDS Label #2: ':testCass2:CRLF$
ScanMismatch = True$
gosub ToggleLotHold
Error_Services('Add', ErrorMsg)
return
end
If Error_Services('NoError') then
Response = Cassette2
end
End Case
end
ScanMismatch = True$
GoSub ToggleLotHold
end
If ErrorMsg EQ '' then Response = Cassette2
end
End Case
end else
Error_Services('Add', 'ScanData argument was missing in the ' : Service : ' service.')
ErrorMsg = 'ScanData argument was missing in the ' : Service : ' service.'
end
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service
Service SaveRecord(CassetteID, Warehouse, Location, OperatorID)
* Write success record in Material Log
// Write success record in Material Log
RDSKey = CassetteID
WMOKey = CassetteID
Convert '.' to '*' in WMOKey
@ -504,20 +595,12 @@ Service SaveRecord(CassetteID, Warehouse, Location, OperatorID)
errCode = ''
obj_WO_Mat_Log('Create',WOMLParms)
* aiParms = 'WO_MAT':@RM:WONo:@RM:CassNo:@RM:WhCd:'*':LocCd:@RM:Action:@RM:InvDTM:@RM:UserID:@RM:Tag:@RM:ToolID
* obj_WO_Mat('AddInvTrans', aiParms)
IF Get_Status(errCode) THEN
swap @SVM with CRLF$ in errCode
ErrorMsg = 'Errors calling obj_WO_Mat_Log("Create"). Error code: ':errCode:', Len(errCode)=':Len(errCode):'. FI has been notified.'
If Get_Status(errCode) then
Swap @SVM with CRLF$ in errCode
ErrorMsg = 'Errors calling obj_WO_Mat_Log("Create"). Error code: ':errCode
Error_Services('Add', ErrorMsg)
if LEN(errCode) > 5 then
Gosub SendErrorNotification
end
Gosub SendErrorNotification
end
end
end service
@ -525,19 +608,20 @@ end service
SendErrorNotification:
Recipients = XLATE('NOTIFICATION','FI_SUPPORT',NOTIFICATION_USER_ID$,'X')
SentFrom = 'MATERIAL_MOVEMENT_SERVICES'
Subject = 'ERROR CALLING OBJ_WO_MAT '
Message = 'Error occured while attempting to write WO_MAT_LOG at ':Location:' Scan':CRLF$:ErrorMsg
AttachKey = WoMatKey
AttachWindow = ''
SendToGroup = ''
Recipients = ''
SentFrom = 'MATERIAL_MOVEMENT_SERVICES'
Subject = 'ERROR CALLING OBJ_WO_MAT '
Message = 'Error occured while attempting to write WO_MAT_LOG at ':Location:' Scan':CRLF$:ErrorMsg
AttachKey = WoMatKey
AttachWindow = ''
SendToGroup = 'FI_SUPPORT'
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
obj_Notes('Create',Parms)
return
ToggleLotHold:
If ScanMismatch EQ True$ then
@ -578,22 +662,26 @@ ToggleLotHold:
// To do: Throw Error
End Case
Convert '*' to '.' in Cassette1
HoldEntityID = Cassette1
// Manually add work order material log entry
WOMatKey = WONo:'*':CassNo
WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
NumTimestamps = Dcount(WOMatRec<WO_MAT_INV_WH$>, @VM)
NewEntryPos = NumTimestamps + 1
WOMatRec = INSERT(WOMatRec, WO_MAT_INV_WH$, NewEntryPos, 0, WhCd)
WOMatRec = INSERT(WOMatRec, WO_MAT_INV_LOCATION$, NewEntryPos, 0, LocCd)
WOMatRec = INSERT(WOMatRec, WO_MAT_INV_ACTION$, NewEntryPos, 0, Action)
WOMatRec = INSERT(WOMatRec, WO_MAT_INV_DTM$, NewEntryPos, 0, LogDTM)
WOMatRec = INSERT(WOMatRec, WO_MAT_INV_USER$, NewEntryPos, 0, UserID)
WOMatRec = INSERT(WOMatRec, WO_MAT_INV_TAG$, NewEntryPos, 0, Tags)
WOMatRec = INSERT(WOMatRec, WO_MAT_INV_TOOL_ID$, NewEntryPos, 0, ToolID)
Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRec, True$, False$, True$)
WOMLParms = LogFile:@RM
WOMLParms := LogDTM:@RM
WOMLParms := Action:@RM
WOMLParms := WhCd:@RM
WOMLParms := LocCd:@RM
WOMLParms := WONo:@RM
WOMLParms := CassNo:@RM
WOMLParms := UserID:@RM
WOMLParms := Tags:@RM
WOMLParms := ToolID
Set_Status(0)
errCode = ''
obj_WO_Mat_Log('Create',WOMLParms)
If Get_Status(errCode) then
Swap @SVM with CRLF$ in errCode
ErrorMsg = 'Error calling obj_WO_Mat_Log("Create"). Error code: ':errCode
Gosub SendErrorNotification
end
// Place first cassette on hold
WOMatKey = WONo:'*':CassNo
@ -637,24 +725,26 @@ ToggleLotHold:
ToolID = ''
HoldEntityID = Cassette2
// Manually add work order material log entry
WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
NumTimestamps = Dcount(WOMatRec<WO_MAT_INV_WH$>, @VM)
NewEntryPos = NumTimestamps + 1
WOMatRec = INSERT(WOMatRec, WO_MAT_INV_WH$, NewEntryPos, 0, WhCd)
WOMatRec = INSERT(WOMatRec, WO_MAT_INV_LOCATION$, NewEntryPos, 0, LocCd)
WOMatRec = INSERT(WOMatRec, WO_MAT_INV_ACTION$, NewEntryPos, 0, Action)
WOMatRec = INSERT(WOMatRec, WO_MAT_INV_DTM$, NewEntryPos, 0, LogDTM)
WOMatRec = INSERT(WOMatRec, WO_MAT_INV_USER$, NewEntryPos, 0, UserID)
WOMatRec = INSERT(WOMatRec, WO_MAT_INV_TAG$, NewEntryPos, 0, Tags)
WOMatRec = INSERT(WOMatRec, WO_MAT_INV_TOOL_ID$, NewEntryPos, 0, ToolID)
Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRec, True$, False$, True$)
WOMLParms = LogFile:@RM
WOMLParms := LogDTM:@RM
WOMLParms := Action:@RM
WOMLParms := WhCd:@RM
WOMLParms := LocCd:@RM
WOMLParms := WONo:@RM
WOMLParms := CassNo:@RM
WOMLParms := UserID:@RM
WOMLParms := Tags:@RM
WOMLParms := ToolID
Set_Status(0)
errCode = ''
obj_WO_Mat_Log('Create',WOMLParms)
If Get_Status(errCode) then
Swap @SVM with CRLF$ in errCode
ErrorMsg = 'Error calling obj_WO_Mat_Log("Create"). Error code: ':errCode
Gosub SendErrorNotification
end
//pause before putting second cassette on hold
// Place second cassette on hold
WOMatKey = WONo:'*':CassNo
CtrlEntID = False$ ;* Control checked/unchecked
OriginFlag = 'PTO' ;* Flag to indicate a hold initiated from the packaging form
@ -662,7 +752,8 @@ ToggleLotHold:
Hold_Services('ToggleHold', WOMatKey, HoldEntity, HoldEntityID, CtrlEntID, OriginFlag, '', OperatorID)
end
gosub SendPTOMismatchNotification
GoSub SendPTOMismatchNotification
errCode = ''
IF Get_Status(errCode) THEN Error_Services('Add', 'Error code ':errCode:' in ':Service:' service.')
Error_Services('Add', 'Cassette scans did not match! Both cassettes placed on hold - Supervisor, Lead, or Engineering disposition required.')
@ -671,6 +762,7 @@ ToggleLotHold:
return
SendPTOMismatchNotification:
// Send scan mismatch notification