When MES cancels check-out, call this API to notify ERP to cancel the corresponding production report, restoring reported data. ERP will void or reverse the report record upon receipt.
PRODUCTION_REPORTID has a value.
If ERP has not yet returned the report number during check-out (TIMEOUT or failure), cancel will not be able to notify ERP to reverse.
User clicks "Cancel Check-out" in MES, system queries report number then calls ERP to cancel that report.
Batch cancel multiple check-out records, system calls ERP to cancel corresponding reports one by one.
Cancel check-out at rework station also triggers production report cancel flow.
| Field | ERP Field Name | Type | Required | Description |
|---|---|---|---|---|
| Company Code | enterprise_no |
String | Required | Enterprise code |
| Site Code | site_no |
String | Required | Factory/site code |
| Report Number | report_no |
String | Required | Report number to cancel (type-number) |
PDTYPE-PDNO, e.g.: 10-20260319001.
This value comes from SFT_OP_REALRUN.PRODUCTION_REPORTID or SFT_WS_RUN.WR024.
{
"enterprise_no": "COMP01",
"site_no": "SITE01",
"report_no": "10-20260319001"
}
<parameters> <parameter key="enterprise_no" type="string">COMP01</parameter> <parameter key="site_no" type="string">SITE01</parameter> <parameter key="report_no" type="string">10-20260319001</parameter> </parameters>
{
"code": 200,
"msg": "Production report cancelled successfully",
"ERPMessage": {
"description": "Process successful",
"report_no": "10-20260319001"
}
}
{
"code": 500,
"msg": "Production report cancel failed",
"ERPMessage": {
"description": "Report already confirmed, cannot cancel"
}
}
| Field | Type | Description |
|---|---|---|
code |
Integer | 200=Success, 500=Failure |
msg |
String | Processing message |
ERPMessage.description |
String | Detailed message from ERP |
After successful production report cancellation, MES will clear report number from related records:
-- Clear SFT_OP_REALRUN report number
UPDATE SFT_OP_REALRUN
SET PRODUCTION_REPORTID = '',
PRODUCTION_REPORTSN = ''
WHERE ID = :KEYID
AND ERP_OPSEQ = :ERP_OPSEQ
AND SEQUENCE = :SEQUENCE
-- Clear SFT_WS_RUN report number
UPDATE SFT_WS_RUN
SET WR024 = '',
WR025 = ''
WHERE (corresponding check-in/out record conditions)
-- Delete report header/detail (depends on system settings)
DELETE FROM SFT_SFCTE WHERE TE001 = :PDTYPE AND TE002 = :PDNO
DELETE FROM SFT_SFCTD WHERE TD001 = :PDTYPE AND TD002 = :PDNO
| API Name | Task Name | Applicable Scenario | Document Type Cancelled |
|---|---|---|---|
wo.work.report.data.process |
cancelProductionForm | General production report cancel | Production Report |
outsourcing.process |
outsourcingProcess | Outsourcing stock-in cancel (TRANSORDERTYPE=59) | Outsourcing Receipt |
stockin.data.process |
cancelStockIn | Stock-in cancel | Stock-In Document |
wo.scrap.data.process |
woScrapDataProcess | Scrap stock-in cancel (TRANSORDERTYPE=58) | Scrap Document |
SFT_TRANSORDER_LINE.TRANSORDERTYPE:
| Table | Description | Affected Fields |
|---|---|---|
SFT_OP_REALRUN |
Process execution records | PRODUCTION_REPORTID, PRODUCTION_REPORTSN (cleared) |
SFT_WS_RUN |
Workstation execution records | WR024, WR025 (cleared) |
SFT_SFCTD |
Report header | Entire record deleted or marked cancelled |
SFT_SFCTE |
Report detail | Entire record deleted or marked cancelled |
| Function | File Path | Line Number |
|---|---|---|
| Cancel check-out entry | SFT_core/src/com/dci/sft/update/GeneralUpdater.java | 1571-1605 |
| Cancel API call | SFT_ERPIntegrate/src/com/dci/sft/erp/XmlToERP_handler.java | 159-237 |
| Clear report number | SFT_core/src/com/dci/sft/jsonMappingHibernate/TransOrderDataToJson.java | 1530-1580 |
| Error Scenario | ERP Response | MES Handling |
|---|---|---|
| Report already confirmed | code=500, Report confirmed | Display error message, requires manual handling |
| Report does not exist | code=500, Report not found | Clear MES report number, continue cancel flow |
| Connection timeout | SocketTimeoutException | Log error, requires manual supplementary cancel |
// Log file: logs/ERPReturnErrorRec.log
[ERP_SEND_ERROR] taskName=cancelProductionForm, errorType=SocketTimeoutException, errorMsg=Read timed out
[ERP_SEND_ERROR] Content sent={"report_no":"10-20260319001"}
PRODUCTION_REPORTID is empty, cannot call ERP cancel