# CO_SDCM_ESR_SALES_PRICING_COND

**SOAP v1.1.0 — ACTIVE**

## Title / 标题
**Condition Record for Pricing in Sales - Replicate / 销售定价条件记录 - 复制**

## Operation / 操作
`SalesPricingConditionReplicate`

---

## Description / 描述
This asynchronous outbound service replicates condition records for pricing used in Sales 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_SDCM_ESR_SALES_PRICING_COND` |
| Test | `https://sap-test.example.com/sap/bc/srt/rfc/sap/CO_SDCM_ESR_SALES_PRICING_COND` |

## Message Structure / 消息结构

### Request / 请求
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `ConditionRecord` | `PRICING_COND` | Pricing condition record header | 定价条件记录抬头 |
| `?ConditionType` | `CHAR(4)` | Condition type (e.g. PR00, K004) | 条件类型（如 PR00、K004） |
| `?ConditionTable` | `CHAR(3)` | Condition table number | 条件表编号 |
| `?ConditionNumber` | `CHAR(10)` | Condition record number | 条件记录编号 |
| `?ValidFrom` | `DATE` | Validity start date | 有效起始日期 |
| `?ValidTo` | `DATE` | Validity end date | 有效截止日期 |
| `?Amount` | `DECIMAL(16,2)` | Condition amount | 条件金额 |
| `?Currency` | `CUKY(5)` | Condition currency | 条件货币 |
| `?UnitPrice` | `DECIMAL(11,2)` | Condition unit price | 条件单价 |
| `?PricingUnit` | `NUMC(3)` | Pricing unit (e.g. 1, 1000) | 定价单位（如 1、1000） |
| `ConditionKeys` | Table | Condition table key fields | 条件表关键字段 |
| `?FieldName` | `CHAR(30)` | Key field name | 关键字段名称 |
| `?FieldValue` | `CHAR(40)` | Key field value | 关键字段值 |
| `?Description` | `CHAR(60)` | Field description | 字段描述 |
| `ScaleValues` | Table | Condition scale values (if applicable) | 条件阶梯值（如适用） |
| `?ScaleQuantity` | `QUAN(13)` | Scale basis quantity | 阶梯基准数量 |
| `?ScaleAmount` | `DECIMAL(16,2)` | Scale amount or rate | 阶梯金额或比率 |
| `?Unit` | `UNIT(3)` | Scale unit | 阶梯单位 |

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

---

## Example Payload / 示例负载

### Request
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <SalesPricingConditionReplicate>
      <ConditionRecord>
        <ConditionType>PR00</ConditionType>
        <ConditionTable>005</ConditionTable>
        <ConditionNumber>0000001234</ConditionNumber>
        <ValidFrom>2026-07-01</ValidFrom>
        <ValidTo>2026-12-31</ValidTo>
        <Amount>250.00</Amount>
        <Currency>CNY</Currency>
        <UnitPrice>250.00</UnitPrice>
        <PricingUnit>1</PricingUnit>
      </ConditionRecord>
      <ConditionKeys>
        <item>
          <FieldName>SALES_ORG</FieldName>
          <FieldValue>1000</FieldValue>
          <Description>Sales Organization / 销售组织</Description>
        </item>
        <item>
          <FieldName>DISTR_CHAN</FieldName>
          <FieldValue>10</FieldValue>
          <Description>Distribution Channel / 分销渠道</Description>
        </item>
        <item>
          <FieldName>MATERIAL</FieldName>
          <FieldValue>MAT-40001</FieldValue>
          <Description>Material Number / 物料编号</Description>
        </item>
      </ConditionKeys>
      <ScaleValues>
        <item>
          <ScaleQuantity>100.000</ScaleQuantity>
          <ScaleAmount>250.00</ScaleAmount>
          <Unit>PC</Unit>
        </item>
        <item>
          <ScaleQuantity>500.000</ScaleQuantity>
          <ScaleAmount>230.00</ScaleAmount>
          <Unit>PC</Unit>
        </item>
        <item>
          <ScaleQuantity>1000.000</ScaleQuantity>
          <ScaleAmount>200.00</ScaleAmount>
          <Unit>PC</Unit>
        </item>
      </ScaleValues>
    </SalesPricingConditionReplicate>
  </soap:Body>
</soap:Envelope>
```

### Response
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <SalesPricingConditionReplicateResponse>
      <Return>
        <Type>S</Type>
        <Message>Condition record replicated successfully / 条件记录已成功复制</Message>
        <LogNumber>LOG-PRCOND-20260723-001</LogNumber>
      </Return>
    </SalesPricingConditionReplicateResponse>
  </soap:Body>
</soap:Envelope>
```

---

## Error Codes / 错误代码
| Code | Description (EN) | Description (CN) |
|------|------------------|------------------|
| `SPC_001` | Invalid condition type | 无效的条件类型 |
| `SPC_002` | Condition record not found | 未找到条件记录 |
| `SPC_003` | Invalid condition table key combination | 无效的条件表键组合 |
| `SPC_004` | Scale values inconsistent with condition type | 阶梯值与条件类型不一致 |

---

## Notes / 备注
- Condition records are replicated asynchronously / 条件记录以异步方式复制
- Supported condition tables include material, customer, and combination tables / 支持的条件表包括物料、客户和组合表
- Scale values are only applicable for condition types supporting scale-based pricing / 阶梯值仅适用于支持阶梯定价的条件类型