# CO_PSWBSELEMENT_MASTER_DATA_RE

**SOAP v1.0.0 — ACTIVE**

## Title / 标题
**PS WBS Element Master Data / PS工作分解结构元素主数据**

## Operation / 操作
`WBSBulkReplicationRequest`

---

## Description / 描述
This service enables the creation, update, and retrieval of Work Breakdown Structure (WBS) element master data for Project Systems (PS), supporting project planning and execution.

该服务支持创建、更新和检索项目系统（PS）的工作分解结构（WBS）元素主数据，支持项目规划和执行。

---

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

## Message Structure / 消息结构

### Request / 请求
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `WBSMasterData` | `BAPIWBSMD` | WBS element master data header | WBS元素主数据抬头 |
| `?ProjectDefinition` | `CHAR(24)` | Project definition | 项目定义 |
| `?WBSElement` | `CHAR(24)` | WBS element | WBS元素 |
| `?Description` | `CHAR(40)` | WBS element description | WBS元素描述 |
| `?ResponsiblePerson` | `CHAR(12)` | Person responsible | 负责人 |
| `?StartDate` | `DATE` | Planned start date | 计划开始日期 |
| `?FinishDate` | `DATE` | Planned finish date | 计划完成日期 |
| `?Priority` | `CHAR(1)` | Priority (1=high, 2=medium, 3=low) | 优先级（1=高，2=中，3=低） |
| `?WBSCategory` | `CHAR(1)` | WBS category (E=header, I=element) | WBS类别（E=抬头，I=元素） |
| `?StatusProfile` | `CHAR(8)` | Status profile | 状态配置文件 |
| `?CompanyCode` | `CHAR(4)` | Company code | 公司代码 |
| `?ProfitCentre` | `CHAR(10)` | Profit centre | 利润中心 |
| `?CostCentre` | `CHAR(10)` | Cost centre | 成本中心 |
| `CWBSElements` | Table | Child WBS elements | 子WBS元素 |
| `?ChildWBSElement` | `CHAR(24)` | Child WBS element | 子WBS元素 |
| `?ChildDescription` | `CHAR(40)` | Child element description | 子元素描述 |
| `?ChildStartDate` | `DATE` | Child start date | 子元素开始日期 |
| `?ChildFinishDate` | `DATE` | Child finish date | 子元素完成日期 |

### Response / 响应
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `Return` | `BAPIRETURN` | Application log message | 应用程序日志消息 |
| `?Type` | `CHAR(1)` | Message type (S/E/W/I) | 消息类型（成功/错误/警告/信息） |
| `?Code` | `CHAR(20)` | Message code | 消息代码 |
| `?Message` | `CHAR(220)` | Message text | 消息文本 |
| `?LogNo` | `CHAR(20)` | Application log number | 应用程序日志编号 |
| `ProjectNumber` | `CHAR(24)` | Generated project number | 生成的项目编号 |

---

## Example Payload / 示例负载

### Request
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <WBSBulkReplicationRequest>
      <WBSMasterData>
        <ProjectDefinition>PRJ-2026-001</ProjectDefinition>
        <WBSElement>WBS-ROOT</WBSElement>
        <Description>New Product Development / 新产品开发</Description>
        <ResponsiblePerson>PM-001</ResponsiblePerson>
        <StartDate>2026-08-01</StartDate>
        <FinishDate>2027-07-31</FinishDate>
        <Priority>1</Priority>
        <WBSCategory>E</WBSCategory>
        <StatusProfile>PS-STD</StatusProfile>
        <CompanyCode>1000</CompanyCode>
        <ProfitCentre>PC-1000</ProfitCentre>
      </WBSMasterData>
      <CWBSElements>
        <item>
          <ChildWBSElement>WBS-DESIGN</ChildWBSElement>
          <ChildDescription>Design Phase / 设计阶段</ChildDescription>
          <ChildStartDate>2026-08-01</ChildStartDate>
          <ChildFinishDate>2026-11-30</ChildFinishDate>
        </item>
        <item>
          <ChildWBSElement>WBS-PROTO</ChildWBSElement>
          <ChildDescription>Prototyping / 原型制作</ChildDescription>
          <ChildStartDate>2026-12-01</ChildStartDate>
          <ChildFinishDate>2027-03-31</ChildFinishDate>
        </item>
      </CWBSElements>
    </WBSBulkReplicationRequest>
  </soap:Body>
</soap:Envelope>
```

### Response
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <WBSBulkReplicationRequestResponse>
      <Return>
        <Type>S</Type>
        <Code>WBS_001</Code>
        <Message>WBS element created successfully / WBS元素已成功创建</Message>
      </Return>
      <ProjectNumber>PRJ-2026-001-01</ProjectNumber>
    </WBSBulkReplicationRequestResponse>
  </soap:Body>
</soap:Envelope>
```

---

## Error Codes / 错误代码
| Code | Description (EN) | Description (CN) |
|------|------------------|------------------|
| `WBS_001` | Project definition not found | 项目定义未找到 |
| `WBS_002` | WBS element already exists | WBS元素已存在 |
| `WBS_003` | Invalid date range (start > finish) | 无效的日期范围（开始>完成） |
| `WBS_004` | Responsible person not found | 负责人未找到 |
| `WBS_005` | Profit centre not valid for company code | 利润中心对公司代码无效 |

---

## Notes / 备注
- WBS category E = header (top-level) element, I = intermediate/leaf element / WBS类别 E=抬头（顶层）元素，I=中间/叶元素
- Dates must be within the project definition timeframe / 日期必须在项目定义的时间范围内
- Maximum 999 child WBS elements per parent / 每个父WBS元素最多 999 个子WBS元素
- Status profile determines allowed user status transitions / 状态配置文件决定允许的用户状态转换