# FKCMANAGECONTRACTACCOUNT

**SOAP v1.0.0 — ACTIVE**

## Title / 标题
**Contract Account – Manage / 合同账户 – 管理**

## Operation / 操作
`ContractAccountManage`

---

## Description / 描述
Transfer Contract Account data from an external system to Contract Accounting (FI-CA) with this synchronous inbound service.

使用此同步入站服务将合同账户数据从外部系统传输到合同会计（FI-CA）。

---

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

## Message Structure / 消息结构

### Request / 请求
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `ContractAccount` | `CHAR(12)` | Contract account number | 合同账户号码 |
| `BusinessPartner` | `CHAR(10)` | Business partner number | 业务合作伙伴号 |
| `?ContractAccountType` | `CHAR(2)` | Contract account type | 合同账户类型 |
| `?CompanyCode` | `CHAR(4)` | Company code | 公司代码 |
| `?HouseBank` | `CHAR(5)` | House bank | 开户行 |
| `?BankAccount` | `CHAR(18)` | Bank account number | 银行账号 |
| `?PaymentMethod` | `CHAR(1)` | Payment method | 付款方式 |
| `?PaymentTerms` | `CHAR(4)` | Payment terms | 付款条件 |
| `?DunningProcedure` | `CHAR(2)` | Dunning procedure | 催款程序 |
| `?DunningLevel` | `NUMC(2)` | Current dunning level | 当前催款级别 |
| `?InterestCalculation` | `CHAR(1)` | Interest calculation indicator | 利息计算标识 |
| `Status` | `CHAR(1)` | Status (A=Active, L=Locked) | 状态（A=活跃，L=锁定） |

### 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 | 消息文本 |
| `ContractAccount` | `CHAR(12)` | Managed contract account number | 已管理的合同账户号码 |

---

## Example Payload / 示例负载

### Request
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ContractAccountManage>
      <ContractAccount>9000000001</ContractAccount>
      <BusinessPartner>BP100001</BusinessPartner>
      <ContractAccountType>01</ContractAccountType>
      <CompanyCode>1000</CompanyCode>
      <HouseBank>CNBANK</HouseBank>
      <PaymentMethod>C</PaymentMethod>
      <PaymentTerms>0001</PaymentTerms>
      <DunningProcedure>DP01</DunningProcedure>
      <Status>A</Status>
    </ContractAccountManage>
  </soap:Body>
</soap:Envelope>
```

### Response
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ContractAccountManageResponse>
      <Return>
        <Type>S</Type>
        <Message>Contract account created successfully / 合同账户创建成功</Message>
      </Return>
      <ContractAccount>9000000001</ContractAccount>
    </ContractAccountManageResponse>
  </soap:Body>
</soap:Envelope>
```

---

## Error Codes / 错误代码
| Code | Description (EN) | Description (CN) |
|------|------------------|------------------|
| `FKC_001` | Business partner not found | 未找到业务合作伙伴 |
| `FKC_002` | Contract account already exists | 合同账户已存在 |
| `FKC_003` | Invalid company code | 无效的公司代码 |
| `FKC_004` | Payment method not allowed | 不允许的付款方式 |
| `FKC_005` | Dunning procedure not configured | 未配置催款程序 |

---

## Notes / 备注
- The business partner must already exist in the system / 业务合作伙伴必须已存在于系统中
- Contract account type 01 = Customer, 02 = Vendor / 合同账户类型01=客户，02=供应商
- Changes to dunning level are only possible via dedicated BAPI / 催款级别的更改只能通过专用BAPI进行
