# CO_FKK_MDG_CONTRACT_ACCOUNT_B1

**SOAP v1.0.0 — ACTIVE**

## Title / 标题
**Contract Account - Return Status of Bulk Replication to Client System / 合同账户 - 向客户端系统返回批量复制状态**

## Operation / 操作
`ContractAccountBulkReplicationStatusNotification`

---

## Description / 描述
This asynchronous outbound service sends a replication confirmation message from Contract Accounting (FI-CA) to an external system. It provides the return status of bulk replication for contract account master data, indicating whether the replication was successful or if errors occurred.

该异步出站服务从合同账户（FI-CA）向外部系统发送复制确认消息，提供合同账户主数据批量复制的返回状态，指示复制是否成功或是否发生错误。

**通信场景:** `SAP_COM_0278`

---

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

---

## Message Structure / 消息结构

### Request (ContractAccountBulkReplicationStatusNotification) / 请求
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `ContractAccountBulkReplicationStatusNotification` | - | Root element for replication status | 复制状态根元素 |
| `?SourceSystem` | `CHAR(10)` | Source system ID | 源系统ID |
| `?TargetSystem` | `CHAR(10)` | Target system ID | 目标系统ID |
| `?ReplicationID` | `CHAR(32)` | Unique replication run identifier | 唯一复制运行标识符 |
| `?ReplicationDate` | `DATE` | Replication run date | 复制运行日期 |
| `?ReplicationTime` | `TIME` | Replication run time | 复制运行时间 |
| `?OverallStatus` | `CHAR(1)` | Overall status (S=Success, E=Error, P=Partial) | 总体状态（S=成功，E=错误，P=部分成功） |
| `?TotalRecords` | `INT4` | Total records processed | 处理的总记录数 |
| `?SuccessRecords` | `INT4` | Successfully replicated records | 成功复制的记录数 |
| `?ErrorRecords` | `INT4` | Records with errors | 有错误的记录数 |
| `ContractAccountStatus` | Table | Per-account replication status | 每个账户的复制状态 |
| `?BusinessPartner` | `CHAR(10)` | Business partner number | 业务伙伴编号 |
| `?ContractAccount` | `CHAR(12)` | Contract account number | 合同账户编号 |
| `?AccountStatus` | `CHAR(1)` | Replication status per account | 各账户的复制状态 |
| `?StatusCode` | `CHAR(4)` | Detailed status code | 详细状态码 |
| `?StatusMessage` | `CHAR(220)` | Status description | 状态描述 |
| `?ProcessedAt` | `TIMESTAMP` | Processing timestamp | 处理时间戳 |
| `?ExternalReference` | `CHAR(40)` | External system reference ID | 外部系统参考ID |

### Response (ReplicationAcknowledgment) / 响应
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `ReplicationAcknowledgment` | - | Acknowledgment from client system | 客户端系统确认 |
| `?AckStatus` | `CHAR(1)` | Acknowledgment status (S=Success, E=Error) | 确认状态（S=成功，E=错误） |
| `?AckMessage` | `CHAR(220)` | Acknowledgment message | 确认消息 |
| `?AcknowledgedAt` | `TIMESTAMP` | Acknowledgment timestamp | 确认时间戳 |

---

## Example Payload / 示例负载

### Request
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ContractAccountBulkReplicationStatusNotification>
      <SourceSystem>S4H_001</SourceSystem>
      <TargetSystem>EXT_CRM</TargetSystem>
      <ReplicationID>REPL-20260724-001</ReplicationID>
      <ReplicationDate>2026-07-24</ReplicationDate>
      <ReplicationTime>14:30:00</ReplicationTime>
      <OverallStatus>P</OverallStatus>
      <TotalRecords>10</TotalRecords>
      <SuccessRecords>8</SuccessRecords>
      <ErrorRecords>2</ErrorRecords>
      <ContractAccountStatus>
        <item>
          <BusinessPartner>0000123456</BusinessPartner>
          <ContractAccount>3000000001</ContractAccount>
          <AccountStatus>S</AccountStatus>
          <StatusCode>SC01</StatusCode>
          <StatusMessage>Replicated successfully / 复制成功</StatusMessage>
          <ExternalReference>EXT-REF-001</ExternalReference>
        </item>
        <item>
          <BusinessPartner>0000123457</BusinessPartner>
          <ContractAccount>3000000002</ContractAccount>
          <AccountStatus>E</AccountStatus>
          <StatusCode>ER01</StatusCode>
          <StatusMessage>Invalid business partner / 无效的业务伙伴</StatusMessage>
          <ExternalReference>EXT-REF-002</ExternalReference>
        </item>
        <item>
          <BusinessPartner>0000123458</BusinessPartner>
          <ContractAccount>3000000003</ContractAccount>
          <AccountStatus>S</AccountStatus>
          <StatusCode>SC01</StatusCode>
          <StatusMessage>Replicated successfully / 复制成功</StatusMessage>
          <ExternalReference>EXT-REF-003</ExternalReference>
        </item>
      </ContractAccountStatus>
    </ContractAccountBulkReplicationStatusNotification>
  </soap:Body>
</soap:Envelope>
```

### Response
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ReplicationAcknowledgment>
      <AckStatus>S</AckStatus>
      <AckMessage>Replication status received / 复制状态已接收</AckMessage>
      <AcknowledgedAt>2026-07-24T14:30:15Z</AcknowledgedAt>
    </ReplicationAcknowledgment>
  </soap:Body>
</soap:Envelope>
```

---

## Error Codes / 错误代码
| Code | Description (EN) | Description (CN) |
|------|------------------|------------------|
| `SC01` | Replicated successfully | 复制成功 |
| `SC02` | Replicated with warnings | 复制成功但有警告 |
| `ER01` | Invalid business partner | 无效的业务伙伴 |
| `ER02` | Invalid contract account | 无效的合同账户 |
| `ER03` | Missing mandatory data | 缺少必填数据 |
| `ER04` | Duplicate contract account in target | 目标系统中存在重复的合同账户 |
| `ER05` | Target system communication error | 目标系统通信错误 |
| `ER99` | Unknown error | 未知错误 |

---

## Status Codes / 状态码说明
| AccountStatus | Description (EN) | Description (CN) |
|---------------|------------------|------------------|
| `S` | Success - Account replicated successfully | 成功 - 账户复制成功 |
| `E` | Error - Account replication failed | 错误 - 账户复制失败 |
| `W` | Warning - Replicated with warnings | 警告 - 复制成功但有警告 |
| `N` | Not Processed | 未处理 |

---

## Notes / 备注
- 此服务为异步出站服务，用于返回MDG（主数据治理）批量复制至客户端系统的状态 / This is an asynchronous outbound service for returning MDG (Master Data Governance) bulk replication status to a client system
- 总体状态为"P"（部分成功）时，需要检查各账户的详细状态 / When OverallStatus is "P" (Partial), check per-account status details
- 外部系统应据此消息决定是否重试失败的复制 / The external system should use this message to decide whether to retry failed replications
- 确认响应仅表示消息已接收，不表示复制数据已处理 / The acknowledgment only confirms message receipt, not that the replicated data has been processed

---