# CO_PUR_ORDER_STATUS_NOTIF_OUT

**SOAP v1.0.0 — ACTIVE**

## Title / 标题
**Purchase Order - Send Status Update Notification / 采购订单 - 发送状态更新通知**

## Operation / 操作
`PurchaseOrderStatusNotification`

---

## Description / 描述
This asynchronous outbound service sends purchase order status update notifications from SAP S/4HANA Cloud Public Edition to external systems.

该异步出站服务将采购订单状态更新通知从 SAP S/4HANA Cloud 公共版发送至外部系统。

---

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

## Message Structure / 消息结构

### Request / 请求
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `PurchaseOrderStatus` | `PUR_ORDER_STATUS` | Purchase order status header | 采购订单状态抬头 |
| `?PurchaseOrder` | `CHAR(10)` | Purchase order number | 采购订单编号 |
| `?CompanyCode` | `CHAR(4)` | Company code | 公司代码 |
| `?Status` | `CHAR(2)` | Current status of the purchase order | 采购订单当前状态 |
| `?StatusDescription` | `CHAR(60)` | Status description text | 状态描述文本 |
| `?ChangedAt` | `TIMESTAMP` | Timestamp of last status change | 最后状态更改的时间戳 |
| `?ChangedBy` | `CHAR(12)` | User who changed the status | 更改状态的用户 |
| `Items` | Table | Purchase order items status | 采购订单行项目状态 |
| `?ItemNumber` | `NUMC(5)` | Item number | 行项目编号 |
| `?Material` | `CHAR(40)` | Material number | 物料编号 |
| `?Quantity` | `QUAN(13)` | Ordered quantity | 已订购数量 |
| `?Unit` | `UNIT(3)` | Order unit | 订单单位 |
| `?DeliveryDate` | `DATE` | Delivery date | 交货日期 |
| `?ItemStatus` | `CHAR(2)` | Item status | 项目状态 |

### 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 | 消息文本 |
| `?LogNumber` | `CHAR(20)` | Application log number | 应用程序日志编号 |

---

## Example Payload / 示例负载

### Request
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <PurchaseOrderStatusNotification>
      <PurchaseOrderStatus>
        <PurchaseOrder>4500000010</PurchaseOrder>
        <CompanyCode>1000</CompanyCode>
        <Status>AP</Status>
        <StatusDescription>Approved / 已批准</StatusDescription>
        <ChangedAt>2026-07-23T14:30:00Z</ChangedAt>
        <ChangedBy>USER01</ChangedBy>
      </PurchaseOrderStatus>
      <Items>
        <item>
          <ItemNumber>00010</ItemNumber>
          <Material>MAT-10001</Material>
          <Quantity>100.000</Quantity>
          <Unit>PC</Unit>
          <DeliveryDate>2026-08-15</DeliveryDate>
          <ItemStatus>AP</ItemStatus>
        </item>
        <item>
          <ItemNumber>00020</ItemNumber>
          <Material>MAT-10002</Material>
          <Quantity>50.000</Quantity>
          <Unit>KG</Unit>
          <DeliveryDate>2026-08-20</DeliveryDate>
          <ItemStatus>DL</ItemStatus>
        </item>
      </Items>
    </PurchaseOrderStatusNotification>
  </soap:Body>
</soap:Envelope>
```

### Response
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <PurchaseOrderStatusNotificationResponse>
      <Return>
        <Type>S</Type>
        <Message>Notification sent successfully / 通知已成功发送</Message>
        <LogNumber>LOG-20260723-001</LogNumber>
      </Return>
    </PurchaseOrderStatusNotificationResponse>
  </soap:Body>
</soap:Envelope>
```

---

## Error Codes / 错误代码
| Code | Description (EN) | Description (CN) |
|------|------------------|------------------|
| `PON_001` | Invalid purchase order number | 无效的采购订单编号 |
| `PON_002` | Purchase order not found | 未找到采购订单 |
| `PON_003` | Status transition not allowed | 不允许的状态转换 |
| `PON_004` | External system communication error | 外部系统通信错误 |

---

## Notes / 备注
- Status updates are sent asynchronously / 状态更新以异步方式发送
- Supported statuses: New, Approved, Rejected, In Process, Completed, Closed / 支持的状态：新建、已批准、已拒绝、处理中、已完成、已关闭
- Only status changes are transmitted, not full order details / 仅传输状态变更，不传输完整订单详情