# CO_SDMD_ESR_DISTR_CHANNEL

**SOAP v1.0.0 — ACTIVE**

## Title / 标题
**Distribution Channel - Replicate / 分销渠道 - 复制**

## Operation / 操作
`DistributionChannelReplicate`

---

## Description / 描述
This service replicates distribution channels from SAP S/4HANA Cloud to external systems, enabling synchronization of distribution channel master data across integrated landscapes.

该服务将分销渠道从 SAP S/4HANA Cloud 复制到外部系统，实现集成环境中分销渠道主数据的同步。

---

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

## Message Structure / 消息结构

### Request / 请求
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `DistributionChannel` | `MDISTRBCHANNEL` | Distribution channel master data | 分销渠道主数据 |
| `?SalesOrganization` | `CHAR(4)` | Sales organization | 销售组织 |
| `?DistributionChannel` | `CHAR(2)` | Distribution channel code | 分销渠道代码 |
| `?ValidityStartDate` | `DATE` | Validity start date | 有效期起始日期 |
| `?ValidityEndDate` | `DATE` | Validity end date | 有效期结束日期 |
| `?Description` | `CHAR(40)` | Distribution channel description | 分销渠道描述 |
| `?Language` | `LANG(1)` | Language key | 语言键 |

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

---

## Example Payload / 示例负载

### Request
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <DistributionChannelReplicate>
      <DistributionChannel>
        <SalesOrganization>1000</SalesOrganization>
        <DistributionChannel>01</DistributionChannel>
        <ValidityStartDate>2026-01-01</ValidityStartDate>
        <ValidityEndDate>9999-12-31</ValidityEndDate>
        <Description>Wholesale Channel</Description>
        <Language>E</Language>
      </DistributionChannel>
    </DistributionChannelReplicate>
  </soap:Body>
</soap:Envelope>
```

### Response
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <DistributionChannelReplicateResponse>
      <Return>
        <Type>S</Type>
        <Message>Distribution channel replicated successfully / 分销渠道复制成功</Message>
      </Return>
    </DistributionChannelReplicateResponse>
  </soap:Body>
</soap:Envelope>
```

---

## Error Codes / 错误代码
| Code | Description (EN) | Description (CN) |
|------|------------------|------------------|
| `DCHN_001` | Invalid sales organization | 无效的销售组织 |
| `DCHN_002` | Distribution channel not found | 未找到分销渠道 |
| `DCHN_003` | Invalid date range | 无效的日期范围 |
| `DCHN_004` | Duplicate distribution channel | 重复的分销渠道 |

---

## Notes / 备注
- Distribution channels are replicated as outbound synchronization / 分销渠道以出站同步方式复制
- Validity dates define the active period of the distribution channel / 有效期定义了分销渠道的激活期间
- Changes are replicated in near real-time / 变更以近实时方式复制