---
# API: Storage Location Substitution / 库位替代
# File: CE_STORLOCSUBSTITUTION_0002.md
# Version: 2.0.0
# Status: ACTIVE
# Protocol: OData V4
# Source Service: /sap/opu/odata4/sap/ce_storlocsubstitution/srvd_a2x/sap/storagelocationsubstitution/0001/
# Generated: 2026-07-23 14:17:02
---

# Storage Location Substitution / 库位替代 API

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

## 概述 / Overview

该服务用于管理工厂下存储库位之间的替代规则，属于 aATP 位置替代框架。当指定库位无法满足需求时，系统将根据规则自动替代到其他库位。支持定义不确定库位（Unspecified）替代。

This synchronous inbound OData V4 service manages storage location substitution master data within the aATP Location Substitution framework. It defines which storage location can be substituted by another when demand cannot be fulfilled from the original location. Unspecified storage location substitution is also supported.

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

---

## 实体列表 / Entity List

| # | 实体名称 | 描述 (EN) | 描述 (CN) | 主键 |
|---|----------|-----------|-----------|------|
| 1 | `A_StorageLocSubstitution` | Storage Location Substitution | 库位替代 | `Plant`, `StorageLocation`, `Material`, `SubstituteStorageLoc` |

---

## 1. A_StorageLocSubstitution — 库位替代

**实体集合路径:** `A_StorageLocSubstitution`  
**主键 (Key):** `Plant` (CHAR 4) + `StorageLocation` (CHAR 4) + `Material` (CHAR 40) + `SubstituteStorageLoc` (CHAR 4)  
**ETag:** 支持

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `Plant` | String | 4 | Plant | 工厂 (主键) |
| `StorageLocation` | String | 4 | Original Storage Location | 原始存储库位 (主键) |
| `SubstituteStorageLoc` | String | 4 | Substitute Storage Location | 替代库位 (主键) |
| `Material` | String | 40 | Material Number | 物料编号 (主键) |
| `SubstitutionReason` | String | 2 | Reason for Substitution | 替代原因 |
| `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 | 有效期截止日期 |
| `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_Material` | A_Product | Material master data | 物料主数据 |
| `to_Plant` | A_Plant | Plant master data | 工厂主数据 |

---

## 使用示例 / Usage Examples

### 读取库位替代 GET

```
GET /sap/opu/odata4/sap/ce_storlocsubstitution/srvd_a2x/sap/storagelocationsubstitution/0001/A_StorageLocSubstitution
  ?$filter=Plant eq '\''PL01'\'' and StorageLocation eq '\''L001'\''
  &$format=json
```

### 创建库位替代 POST

```json
{
  "Plant": "PL01",
  "StorageLocation": "L001",
  "SubstituteStorageLoc": "L002",
  "Material": "M-100",
  "SubstitutionReason": "01",
  "SequenceNumber": 1,
  "LeadIndicator": false,
  "ValidFrom": "2026-01-01T00:00:00Z",
  "ValidTo": "2026-12-31T00:00:00Z",
  "IsActive": true
}
```
