# ECC_OUTBOUNDDELIVERYCNCRC

**SOAP v1.0.0 — ACTIVE**

## Title / 标题
**Outbound Delivery – Cancel (A2X) / 外向交货 – 取消**

## Operation / 操作
`OutboundDeliveryCancel`

---

## Description / 描述
Cancel an outbound delivery with this synchronous inbound service.

使用此同步入站服务取消外向交货单。

---

## Endpoint / 端点
| Environment | URL |
|-------------|-----|
| Production | `https://sap.example.com/sap/bc/srt/rfc/sap/ECC_OUTBOUNDDELIVERYCNCRC` |
| Test | `https://sap-test.example.com/sap/bc/srt/rfc/sap/ECC_OUTBOUNDDELIVERYCNCRC` |

## Message Structure / 消息结构

### Request / 请求
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `DeliveryOrder` | `CHAR(10)` | Outbound delivery document number | 外向交货单号 |
| `?Material` | `CHAR(18)` | Material number | 物料号 |
| `?Batch` | `CHAR(10)` | Batch number | 批次号 |
| `?Plant` | `CHAR(4)` | Plant | 工厂 |
| `?StorageLocation` | `CHAR(4)` | Storage location | 存储地点 |
| `GoodsMovementDate` | `DATE` | Posting date of goods movement | 货物移动过账日期 |
| `CancellationReason` | `CHAR(2)` | Reason for cancellation | 取消原因 |
| `IsFinalCancel` | `BOOLEAN` | Final cancellation flag | 最终取消标识 |

### Response / 响应
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `Return` | `BAPIRETURN` | Application log message | 应用程序日志消息 |
| `?Type` | `CHAR(1)` | Message type (S/E/W/I) | 消息类型（成功/错误/警告/信息） |
| `?Message` | `CHAR(220)` | Message text | 消息文本 |
| `DeliveryOrder` | `CHAR(10)` | Cancelled delivery document number | 已取消的交货单号 |

---

## Example Payload / 示例负载

### Request
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <OutboundDeliveryCancel>
      <DeliveryOrder>0080001001</DeliveryOrder>
      <GoodsMovementDate>2026-07-23</GoodsMovementDate>
      <CancellationReason>02</CancellationReason>
      <IsFinalCancel>true</IsFinalCancel>
    </OutboundDeliveryCancel>
  </soap:Body>
</soap:Envelope>
```

### Response
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <OutboundDeliveryCancelResponse>
      <Return>
        <Type>S</Type>
        <Message>Delivery cancelled successfully / 交货单已成功取消</Message>
      </Return>
      <DeliveryOrder>0080001001</DeliveryOrder>
    </OutboundDeliveryCancelResponse>
  </soap:Body>
</soap:Envelope>
```

---

## Error Codes / 错误代码
| Code | Description (EN) | Description (CN) |
|------|------------------|------------------|
| `DEL_001` | Delivery not found | 未找到交货单 |
| `DEL_002` | Delivery cannot be cancelled in current status | 当前状态无法取消交货单 |
| `DEL_003` | Goods movement already posted | 货物移动已过账 |
| `DEL_004` | Cancellation reason is mandatory | 取消原因必填 |

---

## Notes / 备注
- Only deliveries with status "A" (Open) can be cancelled / 只有状态为"A"（未处理）的交货单可以取消
- Final cancellation removes the delivery completely from the system / 最终取消将完全从系统中删除交货单
