# CO_MMPUR_PO_ITEM_HIST_NOTIF

**SOAP v1.0.0 — ACTIVE**

## Title / 标题
**Purchase Order – Notify about Update of Item History / 采购订单 - 通知项目历史更新**

## Operation / 操作
`POItemHistoryNotificationOut`

---

## Description / 描述
Send notifications from an SAP S/4HANA Cloud Public Edition system to an external system using this outbound asynchronous service.

使用此出站异步服务从 SAP S/4HANA Cloud Public Edition 系统向外部系统发送通知。

---

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

## Message Structure / 消息结构

### Request / 请求
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `POItemHistoryNotification` | `PO_ITEM_HIST` | PO item history notification header | 采购订单项目历史通知抬头 |
| `?PurchaseOrder` | `CHAR(10)` | Purchase order number | 采购订单编号 |
| `?ItemNumber` | `CHAR(5)` | Item number of the PO | 采购订单行项目号 |
| `?Material` | `CHAR(40)` | Material number | 物料编号 |
| `?Plant` | `CHAR(4)` | Plant | 工厂 |
| `?Quantity` | `DECIMAL` | Movement quantity | 移动数量 |
| `?QuantityUnit` | `CHAR(3)` | Unit of measure | 计量单位 |
| `?MovementType` | `CHAR(3)` | Goods movement type | 货物移动类型 |
| `?PostingDate` | `DATE` | Posting date | 过账日期 |
| `?DocumentYear` | `CHAR(4)` | Material document year | 物料凭证年度 |
| `?MaterialDocument` | `CHAR(10)` | Material document number | 物料凭证编号 |
| `?VendorBatch` | `CHAR(15)` | Vendor batch number | 供应商批次号 |
| `HistoryItems` | Table | Additional history entries | 附加历史条目 |
| `?ItemQuantity` | `DECIMAL` | Item quantity | 项目数量 |
| `?ItemAmount` | `DECIMAL` | Item amount in local currency | 项目本币金额 |

### 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 | 消息文本 |

---

## Example Payload / 示例负载

### Request
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <POItemHistoryNotificationOut>
      <POItemHistoryNotification>
        <PurchaseOrder>4500010001</PurchaseOrder>
        <ItemNumber>00010</ItemNumber>
        <Material>M-10001</Material>
        <Plant>1000</Plant>
        <Quantity>150.000</Quantity>
        <QuantityUnit>PC</QuantityUnit>
        <MovementType>101</MovementType>
        <PostingDate>2026-07-23</PostingDate>
        <DocumentYear>2026</DocumentYear>
        <MaterialDocument>5000000123</MaterialDocument>
      </POItemHistoryNotification>
      <HistoryItems>
        <item>
          <ItemQuantity>50.000</ItemQuantity>
          <ItemAmount>7500.00</ItemAmount>
        </item>
        <item>
          <ItemQuantity>100.000</ItemQuantity>
          <ItemAmount>15000.00</ItemAmount>
        </item>
      </HistoryItems>
    </POItemHistoryNotificationOut>
  </soap:Body>
</soap:Envelope>
```

### Response
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <POItemHistoryNotificationOutResponse>
      <Return>
        <Type>S</Type>
        <Message>Notification acknowledged / 通知已确认</Message>
      </Return>
    </POItemHistoryNotificationOutResponse>
  </soap:Body>
</soap:Envelope>
```

---

## Error Codes / 错误代码
| Code | Description (EN) | Description (CN) |
|------|------------------|------------------|
| `POI_001` | Purchase order not found | 采购订单未找到 |
| `POI_002` | Invalid item number | 无效的项目编号 |
| `POI_003` | Material document not posted | 物料凭证未过账 |
| `POI_004` | Missing movement type | 缺少移动类型 |

---

## Notes / 备注
- Notifications are triggered by goods movements against PO items / 通知由针对采购订单项目的货物移动触发
- Movement type 101 = goods receipt, 102 = reversal, 201 = issue to cost center / 移动类型 101=收货，102=冲销，201=发料到成本中心
- The history items table captures multiple delivery splits for the same PO item / 历史项目表捕获同一采购订单项目的多个交货批次