implemented support for BatchConv SAP interface
This commit is contained in:
@ -48,21 +48,29 @@ Declare function SRP_Array, SAP_Services, Memory_Services, Database_Services,
|
||||
Declare function SRP_Math, SRP_Hash, Obj_WO_Mat, Obj_Tables, GaN_Services, Environment_Services, Logging_Services
|
||||
Declare function Date_Services, SRP_Datetime
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Packaging\AddCassComp'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Cass Comp Call Log.csv'
|
||||
Headers = 'Logging DTM' : @FM : 'WOMatKey' : @FM : 'SAPBatchNo' : @FM : 'SAPTxDTM' : @FM : 'RejectCassFlag' : @FM : 'Message'
|
||||
objLogAddCassComp = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\SAP'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' BatchConv Call Log.csv'
|
||||
Headers = 'Logging DTM' : @FM : 'WOMatKey' : @FM : 'SAPBatchNo' : @FM : 'StorLocFrom' : @FM : 'StorLocTo' : @FM : 'BatchQty'
|
||||
objLogBatchConv = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Shipping\PrintSpectrumLabel'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Spectrum Label Printing.csv'
|
||||
Headers = 'Logging DTM' : @FM : 'WOMatKey' : @FM : 'Message'
|
||||
objLogPrintSpectrumLabel = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Packaging\AddCassComp'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Cass Comp Call Log.csv'
|
||||
Headers = 'Logging DTM' : @FM : 'WOMatKey' : @FM : 'SAPBatchNo' : @FM : 'SAPTxDTM' : @FM : 'RejectCassFlag' : @FM : 'Message'
|
||||
objLogAddCassComp = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Shipping\PrintSpectrumLabel'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Spectrum Label Printing.csv'
|
||||
Headers = 'Logging DTM' : @FM : 'WOMatKey' : @FM : 'Message'
|
||||
objLogPrintSpectrumLabel = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
GoToService else
|
||||
Error_Services('Set', Service : ' is not a valid service request within the ' : ServiceModule : ' services module.')
|
||||
@ -76,6 +84,66 @@ Return Response else ''
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
// AddBatchConvTransaction
|
||||
//
|
||||
// Adds BatchConv transaction to the outbound SAP queue.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service AddBatchConvTransaction(WOMatKey)
|
||||
|
||||
ErrorMsg = ''
|
||||
If WOMatKey NE '' then
|
||||
WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
|
||||
If Error_Services('NoError') then
|
||||
SAPBatchNo = WOMatRec<WO_MAT_SAP_BATCH_NO$>
|
||||
ReactorType = Xlate('WO_MAT', WOMatKey, 'REACTOR_TYPE', 'X')
|
||||
If ReactorType EQ 'EPP' then
|
||||
WMOKey = WOMatRec<WO_MAT_WMO_KEY$>
|
||||
MakeupBox = Xlate('WM_OUT', WMOKey, WM_OUT_MAKEUP_BOX$, 'X')
|
||||
end else
|
||||
MakeupBox = WOMatRec<WO_MAT_MAKEUP_BOX$>
|
||||
end
|
||||
If MakeupBox then
|
||||
// Moving batch from 0500 to 0400
|
||||
StorLocFrom = '0500'
|
||||
StorLocTo = '0400'
|
||||
end else
|
||||
// Moving batch from 0400 to 0500
|
||||
StorLocFrom = '0400'
|
||||
StorLocTo = '0500'
|
||||
end
|
||||
WONo = Field(WOMatKey, '*', 1)
|
||||
Material = Xlate('WO_LOG', WONo, 'EPI_PART_NO', 'X')
|
||||
BatchQty = Xlate('WO_MAT', WOMatKey, 'CURR_WFR_CNT', 'X')
|
||||
obj_SAP('AddTransaction', 'BATCH_CONV':@RM:Material:@RM:SAPBatchNo:@RM:StorLocFrom:@RM:StorLocTo:@RM:BatchQty)
|
||||
|
||||
LogMessage = ''
|
||||
ErrCode = ''
|
||||
If Get_Status(ErrCode) then
|
||||
LogMessage = 'Error in ':Service:' service. obj_SAP("AddTransaction") call failed. Error code: ':ErrCode
|
||||
ErrorMsg = LogMessage
|
||||
end else
|
||||
LogMessage = 'BatchConv transaction added to outbound SAP queue.'
|
||||
end
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
LogData<2> = WOMatKey
|
||||
LogData<3> = SAPBatchNo
|
||||
LogData<4> = StorLocFrom
|
||||
LogData<5> = StorLocTo
|
||||
LogData<6> = BatchQty
|
||||
LogData<7> = LogMessage
|
||||
Logging_Services('AppendLog', objLogBatchConv, LogData, @RM, @FM)
|
||||
|
||||
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
|
||||
end
|
||||
end else
|
||||
Error_Services('Add', 'Error in ':Service:' service. Null WOMatKey passed in!')
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
// AddCassCompTransaction
|
||||
//
|
||||
@ -182,8 +250,6 @@ Service AddCassCompTransaction(WOMatKey)
|
||||
atParms := SubSuppCd:@RM
|
||||
atParms := CustPartRev:@RM
|
||||
atParms := MakeupFlag
|
||||
//atParms := MUBatchNo:@RM
|
||||
//atParms := MUCassQty
|
||||
|
||||
Copy = atParms
|
||||
Swap @RM with @FM in Copy
|
||||
@ -212,13 +278,14 @@ Service AddCassCompTransaction(WOMatKey)
|
||||
|
||||
end service
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
// SetInboundPending
|
||||
//
|
||||
// Calculates and stores the current inbound pending count for SAP.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service SetInboundPending()
|
||||
|
||||
|
||||
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
|
||||
Lock hSysLists, ServiceKeyID then
|
||||
|
||||
@ -387,7 +454,7 @@ end service
|
||||
// Gets the incoming SAP transactions and processes them.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetInboundTransactions()
|
||||
|
||||
|
||||
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
|
||||
Lock hSysLists, ServiceKeyID then
|
||||
SAPHoldStartDateTime = SAP_Services('GetSAPHoldStartDateTime')
|
||||
|
Reference in New Issue
Block a user