# CO_SDBIL_ESR_BD_PRCG_CONF_OUT

**SOAP v1.0.0 — ACTIVE**

## Title / 标题
**Billing Document - Send Confirmation of Simulated Pricing / 开票凭证 - 发送模拟定价确认**

## Operation / 操作
`BillingDocumentPricingConfirmation`

---

## Description / 描述
This asynchronous outbound service sends confirmations of simulated prices for billing document items 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_SDBIL_ESR_BD_PRCG_CONF_OUT` |
| Test | `https://sap-test.example.com/sap/bc/srt/rfc/sap/CO_SDBIL_ESR_BD_PRCG_CONF_OUT` |

## Message Structure / 消息结构

### Request / 请求
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `BillingDocumentPricing` | `BD_PRCG` | Billing document pricing header | 开票凭证定价抬头 |
| `?BillingDocument` | `CHAR(10)` | Billing document number | 开票凭证编号 |
| `?CompanyCode` | `CHAR(4)` | Company code | 公司代码 |
| `?Customer` | `CHAR(10)` | Customer account number | 客户账户编号 |
| `?DocumentDate` | `DATE` | Document date | 凭证日期 |
| `?NetAmount` | `DECIMAL(16,2)` | Net amount before pricing | 定价前净金额 |
| `?GrossAmount` | `DECIMAL(16,2)` | Gross amount after pricing | 定价后总金额 |
| `?Currency` | `CUKY(5)` | Currency | 货币 |
| `PricingItems` | Table | Pricing item details | 定价行项目明细 |
| `?ItemNumber` | `NUMC(6)` | Item number | 行项目编号 |
| `?Material` | `CHAR(40)` | Material number | 物料编号 |
| `?Quantity` | `QUAN(13)` | Billed quantity | 开票数量 |
| `?Unit` | `UNIT(3)` | Unit of measure | 计量单位 |
| `?NetPrice` | `DECIMAL(16,2)` | Net price | 净价 |
| `?GrossPrice` | `DECIMAL(16,2)` | Gross price (calculated) | 总价（计算得出） |
| `ConditionValues` | Table | Pricing condition values | 定价条件值 |
| `?ConditionType` | `CHAR(4)` | Condition type (e.g. PR00, K004) | 条件类型（如 PR00、K004） |
| `?ConditionAmount` | `DECIMAL(16,2)` | Condition amount | 条件金额 |
| `?ConditionRate` | `DECIMAL(11,2)` | Condition rate/percentage | 条件比率/百分比 |
| `?ConditionCurrency` | `CUKY(5)` | Condition currency | 条件货币 |

### 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>
    <BillingDocumentPricingConfirmation>
      <BillingDocumentPricing>
        <BillingDocument>0090000002</BillingDocument>
        <CompanyCode>1000</CompanyCode>
        <Customer>CUSTOMER01</Customer>
        <DocumentDate>2026-07-23</DocumentDate>
        <NetAmount>20000.00</NetAmount>
        <GrossAmount>23600.00</GrossAmount>
        <Currency>CNY</Currency>
      </BillingDocumentPricing>
      <PricingItems>
        <item>
          <ItemNumber>000010</ItemNumber>
          <Material>MAT-30001</Material>
          <Quantity>100.000</Quantity>
          <Unit>PC</Unit>
          <NetPrice>200.00</NetPrice>
          <GrossPrice>236.00</GrossPrice>
        </item>
      </PricingItems>
      <ConditionValues>
        <item>
          <ConditionType>PR00</ConditionType>
          <ConditionAmount>20000.00</ConditionAmount>
          <ConditionRate>200.00</ConditionRate>
          <ConditionCurrency>CNY</ConditionCurrency>
        </item>
        <item>
          <ConditionType>MWST</ConditionType>
          <ConditionAmount>3600.00</ConditionAmount>
          <ConditionRate>18.00</ConditionRate>
          <ConditionCurrency>CNY</ConditionCurrency>
        </item>
      </ConditionValues>
    </BillingDocumentPricingConfirmation>
  </soap:Body>
</soap:Envelope>
```

### Response
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <BillingDocumentPricingConfirmationResponse>
      <Return>
        <Type>S</Type>
        <Message>Pricing confirmation sent successfully / 定价确认已成功发送</Message>
        <LogNumber>LOG-PRCG-20260723-001</LogNumber>
      </Return>
    </BillingDocumentPricingConfirmationResponse>
  </soap:Body>
</soap:Envelope>
```

---

## Error Codes / 错误代码
| Code | Description (EN) | Description (CN) |
|------|------------------|------------------|
| `PRC_001` | Billing document not found | 未找到开票凭证 |
| `PRC_002` | Pricing simulation not completed | 定价模拟未完成 |
| `PRC_003` | Invalid condition type | 无效的条件类型 |
| `PRC_004` | Amount calculation mismatch | 金额计算不匹配 |

---

## Notes / 备注
- Pricing confirmation is based on simulated pricing results / 定价确认基于模拟定价结果
- Condition values reflect all applicable pricing elements / 条件值反映所有适用的定价元素
- Gross amount includes taxes and surcharges / 总金额包含税费和附加费