# CO_SDSLS_ESR_CUST_RETURN_CONF

**SOAP v1.0.0 —ACTIVE**

## Title / 标题
**Customer Return - Confirm Processing (A2A) / 客户退货 - 确认处理**

## Operation / 操作
`CustomerReturnConfirmation`

---

## Description / 描述
Confirm creation of customer returns using this asynchronous outbound service. Sends processing confirmation messages for customer returns from SAP S/4HANA Cloud to external systems.

通过此异步出站服务确认客户退货的创建。将客户退货的处理确认消息从 SAP S/4HANA Cloud 发送到外部系统。

---

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

## Message Structure / 消息结构

### Request / 请求
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `ReturnConfirmation` | `RETURN_CONF` | Customer return confirmation header | 客户退货确认抬头 |
| `?ReturnOrderID` | `CHAR(10)` | Customer return order ID | 客户退货单号 |
| `?ReturnType` | `CHAR(4)` | Return order type | 退货单类型 |
| `?CreationDate` | `DATE` | Creation date of return | 退货创建日期 |
| `?CreationTime` | `TIME` | Creation time of return | 退货创建时间 |
| `?SoldToParty` | `CHAR(10)` | Sold-to party | 售达方 |
| `?ShipToParty` | `CHAR(10)` | Ship-to party | 收货方 |
| `?DocumentCurrency` | `CUKY(5)` | Document currency | 凭证货币 |
| `?OverallStatus` | `CHAR(1)` | Overall processing status | 总体处理状态 |
| `ReturnItems` | Table | Return order items | 退货单行项目 |
| `?ItemNumber` | `NUM(6)` | Item number | 行项目号 |
| `?Material` | `CHAR(40)` | Material number | 物料编码 |
| `?Quantity` | `QUAN` | Return quantity | 退货数量 |
| `?BaseUnit` | `UNIT(3)` | Base unit of measure | 基本计量单位 |
| `?ItemStatus` | `CHAR(1)` | Item processing status | 行项目处理状态 |
| `?ReasonForReturn` | `CHAR(3)` | Reason for return | 退货原因 |

### 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>
    <CustomerReturnConfirmation>
      <ReturnConfirmation>
        <ReturnOrderID>0080000100</ReturnOrderID>
        <ReturnType>RE</ReturnType>
        <CreationDate>2026-07-23</CreationDate>
        <SoldToParty>0001001000</SoldToParty>
        <ShipToParty>0001001001</ShipToParty>
        <DocumentCurrency>CNY</DocumentCurrency>
        <OverallStatus>C</OverallStatus>
      </ReturnConfirmation>
      <ReturnItems>
        <item>
          <ItemNumber>10</ItemNumber>
          <Material>MAT-001</Material>
          <Quantity>5.000</Quantity>
          <BaseUnit>PC</BaseUnit>
          <ItemStatus>C</ItemStatus>
          <ReasonForReturn>DEF</ReasonForReturn>
        </item>
        <item>
          <ItemNumber>20</ItemNumber>
          <Material>MAT-002</Material>
          <Quantity>2.000</Quantity>
          <BaseUnit>PC</BaseUnit>
          <ItemStatus>C</ItemStatus>
          <ReasonForReturn>DMG</ReasonForReturn>
        </item>
      </ReturnItems>
    </CustomerReturnConfirmation>
  </soap:Body>
</soap:Envelope>
```

### Response
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <CustomerReturnConfirmationResponse>
      <Return>
        <Type>S</Type>
        <Message>Customer return confirmation processed / 客户退货确认已处理</Message>
      </Return>
    </CustomerReturnConfirmationResponse>
  </soap:Body>
</soap:Envelope>
```

---

## Error Codes / 错误代码
| Code | Description (EN) | Description (CN) |
|------|------------------|------------------|
| `CR_001` | Invalid return order ID | 无效的退货单号 |
| `CR_002` | Return order not found | 未找到退货单 |
| `CR_003` | Invalid item number | 无效的行项目号 |
| `CR_004` | Confirmation already sent | 确认消息已发送 |

---

## Notes / 备注
- This is an asynchronous outbound service / 此为异步出站服务
- The confirmation is triggered after successful creation of customer return in S/4HANA / 确认在 S/4HANA 中成功创建客户退货后触发
- Only fully processed returns with status "C" (Completed) are confirmed / 仅确认状态为"C"（已完成）的已完全处理的退货