---
# API: Product Substitution (A2X)
# File: CE_PRODUCTSUBSTITUTION_0003.md
# Version: 3.0.0
# Status: ACTIVE
# Protocol: OData V4
# Source Service: /sap/opu/odata4/sap/ce_productsubstitution/srvd_a2x/sap/productsubstitution/0001/
# Generated: 2026-07-23 14:17:02
---

# Product Substitution / 产品替代 API

> **API 版本:** 3.0.0 | **状态:** ACTIVE | **协议:** OData V4  
> **技术名称:** `CE_PRODUCTSUBSTITUTION_0003`  
> **服务根路径:** `/sap/opu/odata4/sap/ce_productsubstitution/srvd_a2x/sap/productsubstitution/0001/`  
> **SAP 通信场景:** `SAP_COM_0009`

## 概述 / Overview

该服务用于管理 SAP S/4HANA 高级可用性承诺（aATP）中的产品替代物料。支持对产品替代主数据进行创建、读取、删除。当主要产品库存不足时，系统将根据定义的替代规则自动推荐替代产品。

This synchronous inbound OData V4 service enables CRUD operations on product substitution master data for SAP S/4HANA Advanced Available-to-Promise (aATP). It defines alternative products to be used when the primary product is unavailable due to stock-out, discontinuation, or regional restrictions.

**SAP 加速器中心:** `https://api.sap.com/api/CE_PRODUCTSUBSTITUTION_0003/overview`

---

## 实体列表 / Entity List

| # | 实体名称 | 描述 (EN) | 描述 (CN) | 主键 |
|---|----------|-----------|-----------|------|
| 1 | `A_ProductSubstitution` | Product Substitution | 产品替代 | `Product`, `Plant`, `SubstituteProduct` |

---

## 1. A_ProductSubstitution — 产品替代

**实体集合路径:** `A_ProductSubstitution`  
**主键 (Key):** `Product` (CHAR 40) + `Plant` (CHAR 4) + `SubstituteProduct` (CHAR 40)  
**ETag:** 支持

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `Product` | String | 40 | Original Product (Material Number) | 原始产品编号 (主键) |
| `Plant` | String | 4 | Plant | 工厂 (主键) |
| `SubstituteProduct` | String | 40 | Substitute Product | 替代产品编号 (主键) |
| `SubstitutionReason` | String | 2 | Reason for Substitution | 替代原因 |
| `SubstitutionReasonText` | String | 40 | Description of Substitution Reason | 替代原因描述 |
| `SequenceNumber` | Integer | - | Sequence of Substitution | 替代顺序编号 |
| `LeadIndicator` | Boolean | - | Lead Substitute Indicator | 首要替代标识 |
| `ExitIndicator` | Boolean | - | Exit Substitute Indicator | 终止替代标识 |
| `ValidFrom` | DateTimeOffset | - | Validity Start Date | 有效期起始日期 |
| `ValidTo` | DateTimeOffset | - | Validity End Date | 有效期截止日期 |
| `ValidityStartDate` | DateTime | - | Validity Start Date (Date only) | 有效期起始日 |
| `ValidityEndDate` | DateTime | - | Validity End Date (Date only) | 有效期截止日 |
| `IsActive` | Boolean | - | Active Status | 激活状态 |
| `CreationDate` | DateTime | - | Record Created On | 创建日期 |
| `CreatedByUser` | String | 12 | Created By | 创建人 |
| `LastChangeDate` | DateTime | - | Last Changed On | 最后更改日期 |
| `LastChangedByUser` | String | 12 | Last Changed By | 最后更改人 |

### 导航属性 / Navigation Properties

| 导航属性 | 关联实体 | 描述 (EN) | 描述 (CN) |
|----------|----------|-----------|-----------|
| `to_Product` | A_Product | Original Product master data | 原始产品主数据 |
| `to_SubstituteProduct` | A_Product | Substitute product master data | 替代产品主数据 |

---

## 使用示例 / Usage Examples

### 读取产品替代 GET

```
GET /sap/opu/odata4/sap/ce_productsubstitution/srvd_a2x/sap/productsubstitution/0001/A_ProductSubstitution
  ?$filter=Product eq '\''M-100'\'' and Plant eq '\''PL01'\''
  &$format=json
```

### 创建产品替代 POST

```json
{
  "Product": "M-100",
  "Plant": "PL01",
  "SubstituteProduct": "M-200",
  "SubstitutionReason": "01",
  "SequenceNumber": 1,
  "LeadIndicator": true,
  "ValidFrom": "2026-01-01T00:00:00Z",
  "ValidTo": "2026-12-31T00:00:00Z",
  "IsActive": true
}
```
