---
# API: Enterprise Project (A2X)
# File: API_ENTERPRISE_PROJECT_SRV_0002.md
# Version: 2.0.0
# Status: ACTIVE
# Protocol: OData V2
# Source URL: https://api.sap.com/api/API_ENTERPRISE_PROJECT_SRV_0002/overview
# Generated: 2026-07-23 15:00:00
---

# Enterprise Project / 企业项目 API

> **API 版本:** 2.0.0 | **状态:** ACTIVE | **协议:** OData V2  
> **技术名称:** `API_ENTERPRISE_PROJECT_SRV;v=0002`  
> **服务根路径:** `/sap/opu/odata/sap/API_ENTERPRISE_PROJECT_SRV_0002`  
> **SAP 通信场景:** `SAP_COM_0308` (Enterprise Project Integration)

## 概述 / Overview

该服务支持对企业项目定义、项目要素（WBS 元素、网络活动）、项目文本和项目合作伙伴进行创建、读取、更新和删除操作。支持企业项目（投资型、间接费用型、统计型、收入型）和专业服务项目（客户型、内部型）。

This synchronous OData V2 service enables create, read, update, and delete operations on enterprise project definitions, project elements (WBS elements, activities), project texts, and project partners. Supports both enterprise projects (investment, overhead, statistical, revenue) and professional services projects (customer, internal).

**API 业务加速器中心:** [https://api.sap.com/api/API_ENTERPRISE_PROJECT_SRV_0002/overview](https://api.sap.com/api/API_ENTERPRISE_PROJECT_SRV_0002/overview)

---

## 实体列表 / Entity List

| # | 实体名称 | 描述 (EN) | 描述 (CN) | 主键 |
|---|----------|-----------|-----------|------|
| 1 | `A_EnterpriseProject` | Enterprise Project Definition | 企业项目定义 | `ProjectUUID` |
| 2 | `A_EnterpriseProjectElement` | Enterprise Project Element | 企业项目要素 | `ProjectUUID`, `ElementUUID` |
| 3 | `A_EnterpriseProjectText` | Enterprise Project Text | 企业项目文本 | `ProjectUUID`, `Language` |
| 4 | `A_EnterpriseProjectElementText` | Enterprise Project Element Text | 企业项目要素文本 | `ProjectUUID`, `ElementUUID`, `Language` |
| 5 | `A_EnterpriseProjectPartner` | Enterprise Project Partner | 企业项目合作伙伴 | `ProjectUUID`, `PartnerFunction` |

---

## 1. A_EnterpriseProject — 企业项目定义

**实体集合路径:** `A_EnterpriseProject`  
**主键 (Key):** `ProjectUUID` (GUID)  
**ETag:** 支持

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `ProjectUUID` | GUID | - | Internal Key for Project Definition (UUID) | 项目定义内部编号 (UUID, 主键) |
| `Project` | String | 24 | Project Definition | 项目定义编号 |
| `ProjectName` | String | 40 | Project Name | 项目名称 |
| `ProjectDescription` | String | 80 | Project Description | 项目描述 |
| `ProjectType` | String | 15 | Project Type | 项目类型 |
| `ProjectProfile` | String | 6 | Project Profile | 项目参数文件 |
| `ResponsiblePerson` | String | 20 | Person Responsible | 负责人 |
| `CalenderID` | String | 2 | Factory Calendar ID | 工厂日历标识 |
| `ProjectCurrency` | String | 5 | Project Currency | 项目货币 |
| `TotalPlannedCosts` | Decimal | 23 | Total Planned Costs | 总计划成本 |
| `TotalCosts` | Decimal | 23 | Total Costs Actually Incurred | 实际总成本 |
| `TotalPayments` | Decimal | 23 | Total Payments Made | 付款总额 |
| `ActualStartDate` | DateTime | - | Actual Start Date | 实际开始日期 |
| `ActualFinishDate` | DateTime | - | Actual Finish Date | 实际完成日期 |
| `BasicStartDate` | DateTime | - | Basic Start Date | 基本开始日期 |
| `BasicFinishDate` | DateTime | - | Basic Finish Date | 基本完成日期 |
| `PlannedStartDate` | DateTime | - | Planned Start Date | 计划开始日期 |
| `PlannedFinishDate` | DateTime | - | Planned Finish Date | 计划完成日期 |
| `ProjectStatusCode` | String | 2 | Project Status Code | 项目状态编码 |
| `ProjectStatusText` | String | 40 | Project Status Text | 项目状态文本 |
| `CompanyCode` | String | 4 | Company Code | 公司代码 |
| `BusinessArea` | String | 4 | Business Area | 业务范围 |
| `ProfitCenter` | String | 10 | Profit Center | 利润中心 |
| `ControllingArea` | String | 4 | Controlling Area | 控制范围 |
| `Plant` | String | 4 | Plant | 工厂 |
| `WBSAccountingIndicator` | Boolean | - | WBS Account Assignment Indicator | WBS 核算标识 |
| `CreatedByUser` | String | 12 | Created By | 创建人 |
| `CreationDate` | DateTime | - | Created On | 创建日期 |
| `LastChangedByUser` | String | 12 | Last Changed By | 最后更改人 |
| `LastChangeDate` | DateTime | - | Last Changed On | 最后更改日期 |

### 导航属性 / Navigation Properties

| 属性名 | 目标实体 | 基数 | 描述 |
|--------|----------|------|------|
| `to_EnterpriseProjectElement` | A_EnterpriseProjectElement | 0..* | 项目要素 |
| `to_EnterpriseProjectText` | A_EnterpriseProjectText | 0..* | 项目文本 |
| `to_EnterpriseProjectPartner` | A_EnterpriseProjectPartner | 0..* | 项目合作伙伴 |
| `to_EnterpriseProjectRole` | A_EnterpriseProjectRole | 0..* | 项目角色 |

---

## 2. A_EnterpriseProjectElement — 企业项目要素

**实体集合路径:** `A_EnterpriseProjectElement`  
**主键 (Key):** `ProjectUUID` (GUID), `ElementUUID` (GUID)  
**ETag:** 支持

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `ProjectUUID` | GUID | - | Internal Key for Project Definition | 项目定义内部编号 |
| `ElementUUID` | GUID | - | Internal Key for Project Element (UUID) | 项目要素内部编号 (UUID, 主键) |
| `ElementNumber` | String | 24 | Project Element Number (WBS/Network) | 项目要素编号 (WBS/网络) |
| `ElementName` | String | 40 | Project Element Name | 项目要素名称 |
| `ElementType` | String | 4 | Element Type | 要素类型 |
| `WBSAccountAssignment` | String | 10 | WBS Account Assignment Element | WBS 核算要素 |
| `WBSElement` | String | 24 | WBS Element | WBS 元素 |
| `Network` | String | 12 | Network Number | 网络编号 |
| `Activity` | String | 12 | Activity Number | 活动编号 |
| `ControlProfile` | String | 6 | Control Profile | 控制参数文件 |
| `ResponsiblePerson` | String | 20 | Person Responsible | 负责人 |
| `PlannedStartDate` | DateTime | - | Planned Start Date | 计划开始日期 |
| `PlannedFinishDate` | DateTime | - | Planned Finish Date | 计划完成日期 |
| `ActualStartDate` | DateTime | - | Actual Start Date | 实际开始日期 |
| `ActualFinishDate` | DateTime | - | Actual Finish Date | 实际完成日期 |
| `TotalPlannedCosts` | Decimal | 23 | Total Planned Costs | 总计划成本 |
| `TotalCosts` | Decimal | 23 | Total Costs Actually Incurred | 实际总成本 |
| `ProjectCurrency` | String | 5 | Project Currency | 项目货币 |
| `ElementStatus` | String | 2 | Element Status | 要素状态 |
| `CompanyCode` | String | 4 | Company Code | 公司代码 |
| `ProfitCenter` | String | 10 | Profit Center | 利润中心 |
| `Plant` | String | 4 | Plant | 工厂 |
| `CreatedByUser` | String | 12 | Created By | 创建人 |
| `CreationDate` | DateTime | - | Created On | 创建日期 |
| `LastChangedByUser` | String | 12 | Last Changed By | 最后更改人 |
| `LastChangeDate` | DateTime | - | Last Changed On | 最后更改日期 |

### 导航属性 / Navigation Properties

| 属性名 | 目标实体 | 基数 | 描述 |
|--------|----------|------|------|
| `to_EnterpriseProjectElementText` | A_EnterpriseProjectElementText | 0..* | 项目要素文本 |

---

## 3. A_EnterpriseProjectText — 企业项目文本

**实体集合路径:** `A_EnterpriseProjectText`  
**主键 (Key):** `ProjectUUID` (GUID), `Language` (CHAR 2)

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `ProjectUUID` | GUID | - | Internal Key for Project Definition | 项目定义内部编号 |
| `Language` | String | 2 | Language Key | 语言代码 |
| `ProjectText` | String | 40 | Project Text | 项目文本内容 |
| `TextType` | String | 4 | Text Type | 文本类型 |

---

## 4. A_EnterpriseProjectElementText — 企业项目要素文本

**实体集合路径:** `A_EnterpriseProjectElementText`  
**主键 (Key):** `ProjectUUID` (GUID), `ElementUUID` (GUID), `Language` (CHAR 2)

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `ProjectUUID` | GUID | - | Internal Key for Project Definition | 项目定义内部编号 |
| `ElementUUID` | GUID | - | Internal Key for Project Element | 项目要素内部编号 |
| `Language` | String | 2 | Language Key | 语言代码 |
| `ElementText` | String | 40 | Element Text | 要素文本内容 |
| `TextType` | String | 4 | Text Type | 文本类型 |

---

## 5. A_EnterpriseProjectPartner — 企业项目合作伙伴

**实体集合路径:** `A_EnterpriseProjectPartner`  
**主键 (Key):** `ProjectUUID` (GUID), `PartnerFunction` (CHAR 2)

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `ProjectUUID` | GUID | - | Internal Key for Project Definition | 项目定义内部编号 |
| `PartnerFunction` | String | 2 | Partner Function | 合作伙伴功能 |
| `BusinessPartner` | String | 10 | Business Partner Number | 业务伙伴编号 |
| `Customer` | String | 10 | Customer Number | 客户编号 |
| `Supplier` | String | 10 | Supplier Number | 供应商编号 |
| `PersonnelNumber` | String | 8 | Personnel Number | 人事编号 |
| `ValidityStartDate` | DateTime | - | Validity Start Date | 有效起始日期 |
| `ValidityEndDate` | DateTime | - | Validity End Date | 有效截止日期 |
| `CreationDate` | DateTime | - | Created On | 创建日期 |
| `CreatedByUser` | String | 12 | Created By | 创建人 |

---

## CRUD 端点 / CRUD Endpoints

| 实体 | 创建 (POST) | 读取 (GET) | 更新 (PATCH) | 删除 (DELETE) |
|------|-------------|------------|-------------|---------------|
| A_EnterpriseProject | ✓ | ✓ | ✓ | ✓ |
| A_EnterpriseProjectElement | ✓ | ✓ | ✓ | ✓ |
| A_EnterpriseProjectText | ✓ | ✓ | ✓ | ✓ |
| A_EnterpriseProjectElementText | ✓ | ✓ | ✓ | ✓ |
| A_EnterpriseProjectPartner | ✓ | ✓ | ✓ | ✓ |

### 创建项目 (示例)

```
POST /sap/opu/odata/sap/API_ENTERPRISE_PROJECT_SRV_0002/A_EnterpriseProject
Content-Type: application/json

{
  "Project": "P-2026-001",
  "ProjectName": "New Product Development",
  "ProjectType": "INVEST",
  "ResponsiblePerson": "JSMITH",
  "CompanyCode": "1010",
  "PlannedStartDate": "/Date(1767225600000)/",
  "PlannedFinishDate": "/Date(1808870400000)/",
  "ProjectCurrency": "USD",
  "TotalPlannedCosts": 500000.00
}
```

### 深插入 (Deep Insert) — 项目 + WBS 要素

```
POST /sap/opu/odata/sap/API_ENTERPRISE_PROJECT_SRV_0002/A_EnterpriseProject
Content-Type: application/json

{
  "Project": "P-2026-002",
  "ProjectName": "Infrastructure Upgrade",
  "ProjectType": "OVERHEAD",
  "CompanyCode": "1010",
  "to_EnterpriseProjectElement": [
    {
      "ElementNumber": "P-2026-002.01",
      "ElementName": "Planning Phase",
      "ElementType": "WBS1",
      "PlannedStartDate": "/Date(1767225600000)/",
      "PlannedFinishDate": "/Date(1777852800000)/"
    },
    {
      "ElementNumber": "P-2026-002.02",
      "ElementName": "Execution Phase",
      "ElementType": "WBS2",
      "PlannedStartDate": "/Date(1777852800000)/",
      "PlannedFinishDate": "/Date(1808870400000)/"
    }
  ]
}
```

---

## OData 查询选项 / Query Options

| 参数 | 示例 | 说明 |
|------|------|------|
| `$filter` | `$filter=ProjectType eq 'INVEST'` | 过滤 |
| `$select` | `$select=Project,ProjectName,ProjectType` | 选择字段 |
| `$expand` | `$expand=to_EnterpriseProjectElement` | 展开导航属性 |
| `$top` | `$top=100` | 返回前 N 条 |
| `$skip` | `$skip=50` | 跳过前 N 条 |
| `$orderby` | `$orderby=Project asc` | 排序 |
| `$count` | `$count=true` | 返回计数 |

### 展开示例: 项目 + 要素 + 文本

```http
GET /sap/opu/odata/sap/API_ENTERPRISE_PROJECT_SRV_0002/A_EnterpriseProject('uuid')?$expand=to_EnterpriseProjectElement/to_EnterpriseProjectElementText
```

---

## ETag 处理 / ETag Handling

API_ENTERPRISE_PROJECT_SRV_0002 通过 ETag 支持乐观锁并发控制。

### 更新时携带 ETag

```http
PATCH /sap/opu/odata/sap/API_ENTERPRISE_PROJECT_SRV_0002/A_EnterpriseProject('uuid')
If-Match: W/"datetime'2026-07-23T15%3A00%3A00'"
Content-Type: application/json

{ "ProjectName": "Updated Project Name" }
```

### 强制更新 (忽略 ETag)

```http
PATCH /sap/opu/odata/sap/API_ENTERPRISE_PROJECT_SRV_0002/A_EnterpriseProject('uuid')
If-Match: *
Content-Type: application/json

{ "ProjectName": "Updated Project Name" }
```

---

## 批处理 / Batch Processing

```
POST /sap/opu/odata/sap/API_ENTERPRISE_PROJECT_SRV_0002/$batch
Content-Type: multipart/mixed; boundary=batch_001

--batch_001
Content-Type: application/http
Content-Transfer-Encoding: binary

GET A_EnterpriseProject?$top=5 HTTP/1.1

--batch_001
Content-Type: application/http
Content-Transfer-Encoding: binary

GET A_EnterpriseProjectElement?$top=5 HTTP/1.1

--batch_001--
```

---

## 认证 / Authentication

### OAuth 2.0 (推荐)

```
Authorization: Bearer <access_token>
Content-Type: application/json
```

### 基本认证 (Basic Auth)

```
Authorization: Basic <base64(username:password)>
```

### CSRF Token 处理

```http
# 获取 Token
GET /sap/opu/odata/sap/API_ENTERPRISE_PROJECT_SRV_0002/A_EnterpriseProject
X-CSRF-Token: Fetch

# 使用 Token
POST /sap/opu/odata/sap/API_ENTERPRISE_PROJECT_SRV_0002/A_EnterpriseProject
X-CSRF-Token: <token_value>
Content-Type: application/json

{ "Project": "P-2026-003", "ProjectName": "New Project" }
```

---

## 错误码 / Error Codes

| HTTP 状态码 | 描述 (EN) | 描述 (CN) |
|-------------|-----------|-----------|
| 200 | OK | 请求成功 |
| 201 | Created | 创建成功 |
| 204 | No Content | 无返回内容 |
| 400 | Bad Request | 请求参数错误 |
| 401 | Unauthorized | 未授权 |
| 403 | Forbidden | 禁止访问 |
| 404 | Not Found | 资源不存在 |
| 405 | Method Not Allowed | 方法不允许 |
| 412 | Precondition Failed | ETag 不匹配 |
| 500 | Internal Server Error | 服务器内部错误 |

---

## 可扩展性 / Extensibility

通过 SAP Fiori "Custom Fields and Logic" 应用添加自定义字段：

| 实体 | 业务上下文 |
|------|-----------|
| A_EnterpriseProject | Enterprise Project Core View |
| A_EnterpriseProjectElement | Enterprise Project Element Core View |

自定义字段以 `YY1_<FieldName>_<Context>` 格式返回。

---

## 服务限制 / Constraints

通过此 API **无法** 执行以下操作：

1. 维护项目版本（Project Versions）
2. 维护网络活动之间的关系
3. 维护项目的详细预算和可用性控制
4. 执行项目的结构同步操作

---

## 相关资源 / References

| 资源 | 链接 |
|------|------|
| SAP API Business Hub | [https://api.sap.com/api/API_ENTERPRISE_PROJECT_SRV_0002/overview](https://api.sap.com/api/API_ENTERPRISE_PROJECT_SRV_0002/overview) |
| SAP Help Portal (Cloud) | [https://help.sap.com/docs/SAP_S4HANA_CLOUD](https://help.sap.com/docs/SAP_S4HANA_CLOUD) |
| SAP Help Portal (On-Prem) | [https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE](https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE) |
| SAP Cloud SDK Java VDM | [https://javadoc.io/static/com.sap.cloud.sdk.s4hana/s4hana-api-odata](https://javadoc.io/static/com.sap.cloud.sdk.s4hana/s4hana-api-odata) |
| SAP Cloud SDK JavaScript | [https://sap.github.io/cloud-sdk/docs/js/features/odata/v2-client](https://sap.github.io/cloud-sdk/docs/js/features/odata/v2-client) |
| SAP Cloud SDK Java | [https://sap.github.io/cloud-sdk/docs/java/features/odata/v4-vdm-client](https://sap.github.io/cloud-sdk/docs/java/features/odata/v4-vdm-client) |