Related API
Cancel Outsourcing Receipt (outsourcingProcess) is used in pair with Create Outsourcing Receipt (outsourcingPurchaseStockinCreate).
When cancelling, the TB001/TB002 returned by ERP after successful creation (stored in TL011/TL012) is required.
3. Request Specification
Transport Format: JSON Content-Type: application/json (HttpClient.java:25)
TL011/TL012 is written from TB001/TB002 returned by ERP after successful outsourcingPurchaseStockinCreate.
4. Response Specification
Field
Type
Description
code
int
200=Success, others=Failure
msg
string
Processing result message
Success Behavior
ERP outsourcing receipt voided/reversed
Inventory quantity reversed
MES checkout record cancelled
5. Validation Rules
#
Check Item
Rule
Code Location
1
TL011 not empty
Must have ERP doc type
GeneralUpdater.java:1571
2
TL012 not empty
Must have ERP doc number
GeneralUpdater.java:1571
3
TRANSORDERTYPE = "59"
Outsourcing type check
GeneralUpdater.java:1577
4
Original document exists
ERP document must exist
ERP validation
5
Document status allows cancel
Can only reverse if not posted
ERP validation
Important: ERP will NOT be called when TL011/TL012 is empty
In the program logic, outsourcingProcess is only called when both TL011 and TL012 are not empty.
If empty, the cancel checkout action only executes in MES, ERP is not affected.
Known Issue: TL011/TL012 is empty when cancelling checkout
When the user cancels checkout before ERP responds, since TL011/TL012 has not been written back yet, outsourcingProcess will not be called.
This leads to data inconsistency between MES and ERP.
Timeline Example
Root Cause
// GeneralUpdater.java:1571if(!SftTransorderLine.getTl011().equals("") && !SftTransorderLine.getTl012().equals("")){
// outsourcingProcess is only called when TL011/TL012 are not empty// If cancelled before ERP response, this if is false, ERP call is skipped
}
Recommended Solutions
Solution
Description
Impact
Immediate Action
Manually void the outsourcing receipt in ERP
Manual intervention required
Wait Mechanism
Wait for ERP response before allowing cancel checkout
Code modification required
Lock Mechanism
Disable cancel operation during checkout in progress
Code modification required
Periodic Comparison
Scheduled job to compare MES and ERP document status