---
# API: Bills of Material (Version 2) (A2X)
# File: API_BILL_OF_MATERIAL_SRV_0002.md
# Version: 2.1.0
# Status: ACTIVE
# Protocol: OData V2
# Source URL: https://api.sap.com/api/API_BILL_OF_MATERIAL_SRV_0002/overview
# Generated: 2026-07-23 14:17:02
---

# Bills of Material (Version 2) / 物料清单 (版本 2) API

> **API 版本:** 2.1.0 | **状态:** ACTIVE | **协议:** OData V2 (异步)  
> **技术名称:** `API_BILL_OF_MATERIAL_SRV_0002`  
> **服务根路径:** `/sap/opu/odata/sap/API_BILL_OF_MATERIAL_SRV_0002`  
> **SAP 通信场景:** `SAP_COM_0110`

## 概述 / Overview

该服务支持读取、创建、更新和删除物料清单（BOM）抬头和行项目数据，支持有版本和无版本 BOM。服务使用异步处理模式。

This synchronous inbound OData V2 service enables you to read, create, update, or delete bill of material (BOM) headers and items with and without version. The service uses asynchronous processing for long-running operations.

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

---

## 实体列表 / Entity List

| # | 实体名称 | 描述 (EN) | 描述 (CN) | 主键 |
|---|----------|-----------|-----------|------|
| 1 | `A_BillOfMaterial` | Bill of Material Header | BOM 抬头 | `BillOfMaterial`, `BillOfMaterialCategory`, `BillOfMaterialVariant`, `BillOfMaterialUsage`, `BillOfMaterialVersion` |
| 2 | `A_BillOfMaterialItem` | Bill of Material Item | BOM 行项目 | `BillOfMaterial`, `BillOfMaterialCategory`, `BillOfMaterialVariant`, `BillOfMaterialUsage`, `BillOfMaterialVersion`, `BillOfMaterialItemNodeNumber` |
| 3 | `A_BillOfMaterialUsage` | BOM Usage | BOM 用途 | `BillOfMaterialVariantUsage` |
| 4 | `A_BillOfMaterialUsageText` | BOM Usage Text | BOM 用途文本 | `BillOfMaterialVariantUsage`, `Language` |
| 5 | `A_BOMItemCategory` | BOM Item Category | BOM 行项目类别 | `BillOfMaterialItemCategory` |
| 6 | `A_BOMItemCategoryText` | BOM Item Category Text | BOM 行项目类别文本 | `BillOfMaterialItemCategory`, `Language` |

---

## 1. A_BillOfMaterial — BOM 抬头

**实体集合路径:** `A_BillOfMaterial`  
**主键 (Key):** `BillOfMaterial` (CHAR 8), `BillOfMaterialCategory` (CHAR 1), `BillOfMaterialVariant` (CHAR 2), `BillOfMaterialUsage` (CHAR 1), `BillOfMaterialVersion` (CHAR 4)  
**ETag:** 支持

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `BillOfMaterial` | String | 8 | Bill of Material | 物料清单编号 (主键) |
| `BillOfMaterialCategory` | String | 1 | BOM Category (M=Material BOM, S=Sales BOM, E=Equipment BOM) | BOM 类别 (主键) |
| `BillOfMaterialVariant` | String | 2 | Alternative BOM | BOM 备选标识 (主键) |
| `BillOfMaterialUsage` | String | 1 | BOM Usage (1=Production, 2=Engineering, 5=Costing) | BOM 用途 (主键) |
| `BillOfMaterialVersion` | String | 4 | BOM Version | BOM 版本 (主键) |
| `EngineeringChangeDoc` | String | 12 | Change Number | 工程变更编号 |
| `Material` | String | 40 | Material Number | 物料编号 |
| `Plant` | String | 4 | Plant | 工厂 |
| `BOMText` | String | 40 | BOM Text | BOM 描述文本 |
| `BaseQuantity` | Decimal | 13,3 | Base Quantity | 基准数量 |
| `BaseMeasureUnit` | String | 3 | Base Unit of Measure | 基准计量单位 |
| `ValidityStartDate` | DateTime | - | Validity Start Date | 有效起始日期 |
| `ValidityEndDate` | DateTime | - | Validity End Date | 有效截止日期 |
| `Responsible` | String | 12 | Person Responsible | 负责人 |
| `AuthorizationGroup` | String | 4 | Authorization Group | 授权组 |
| `CreatedByUser` | String | 12 | Created By | 创建人 |
| `CreationDate` | DateTime | - | Created On | 创建日期 |
| `LastChangedByUser` | String | 12 | Last Changed By | 最后更改人 |
| `LastChangeDate` | DateTime | - | Last Changed On | 最后更改日期 |
| `BillOfMaterialHeaderUUID` | GUID | - | UUID of BOM Header | BOM 抬头 UUID |
| `IsDeleted` | Boolean | - | Deletion Indicator | 删除标识 |
| `LaboratoryOrDesignOffice` | String | 3 | Laboratory/Design Office | 实验室/设计室 |
| `BOMStatus` | String | 3 | BOM Status | BOM 状态 |
| `DocumentNumber` | String | 25 | Document Number | 文档编号 |
| `DocumentType` | String | 3 | Document Type | 文档类型 |
| `DocumentVersion` | String | 2 | Document Version | 文档版本 |
| `DocumentPart` | String | 3 | Document Part | 文档部件 |
| `EngineeringChangeDocForRevision` | String | 12 | Revision Level | 修订等级 |
| `Function` | String | 3 | Function | 功能 |
| `TechnicalType` | String | 10 | Technical Type | 技术类型 |

### 导航属性 / Navigation Properties

| 属性名 | 目标实体 | 基数 | 描述 |
|--------|----------|------|------|
| `to_Item` | A_BillOfMaterialItem | 0..* | BOM 行项目 |
| `to_BillOfMaterialUsage` | A_BillOfMaterialUsage | 0..1 | BOM 用途 |

---

## 2. A_BillOfMaterialItem — BOM 行项目

**实体集合路径:** `A_BillOfMaterialItem`  
**主键 (Key):** `BillOfMaterial`, `BillOfMaterialCategory`, `BillOfMaterialVariant`, `BillOfMaterialUsage`, `BillOfMaterialVersion`, `BillOfMaterialItemNodeNumber` (CHAR 8)

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `BillOfMaterial` | String | 8 | Bill of Material | 物料清单编号 (主键) |
| `BillOfMaterialCategory` | String | 1 | BOM Category | BOM 类别 (主键) |
| `BillOfMaterialVariant` | String | 2 | Alternative BOM | BOM 备选标识 (主键) |
| `BillOfMaterialUsage` | String | 1 | BOM Usage | BOM 用途 (主键) |
| `BillOfMaterialVersion` | String | 4 | BOM Version | BOM 版本 (主键) |
| `BillOfMaterialItemNodeNumber` | String | 8 | BOM Item Node Number | BOM 项目节点编号 (主键) |
| `HeaderChangeDocument` | String | 12 | Change Number | 变更编号 |
| `Material` | String | 40 | Material Number | 物料编号 |
| `Plant` | String | 4 | Plant | 工厂 |
| `ItemCategory` | String | 1 | Item Category (L=Stock Item, N=Non-stock Item, R=Variable-size Item) | 行项目类别 |
| `ItemNumber` | String | 4 | Item Number | 行项目编号 |
| `ComponentDescription` | String | 40 | Component Description | 组件描述 |
| `ComponentQuantity` | Decimal | 13,3 | Quantity | 组件数量 |
| `ComponentMeasureUnit` | String | 3 | Unit of Measure | 组件计量单位 |
| `QuantityIsVariable` | Boolean | - | Quantity is Variable | 数量可变标识 |
| `SortOrder` | String | 2 | Sort String | 排序字符串 |
| `ValidityStartDate` | DateTime | - | Validity Start Date | 有效起始日期 |
| `ValidityEndDate` | DateTime | - | Validity End Date | 有效截止日期 |
| `ScrapPercentage` | Decimal | 5,2 | Scrap Percentage | 废品率 |
| `IsDeleted` | Boolean | - | Deletion Indicator | 删除标识 |

### 导航属性 / Navigation Properties

无

---

## 异步处理 / Asynchronous Processing

此 API 支持异步处理长时间运行的操作。创建或更新 BOM 时，可同步获取请求接受确认，然后异步查询操作状态。

### 异步请求模式
1. 发送创建/更新请求 -> 接受确认 (202 Accepted)
2. 监控 `Monitor` 实体中的处理状态
3. 准备就绪后读取结果

---

## CRUD 端点 / CRUD Endpoints

| 操作 | HTTP 方法 | 端点路径 |
|------|-----------|---------|
| 读取集合 | GET | `/{EntityCollection}` |
| 读取单个 | GET | `/{EntityCollection}(...key...)` |
| 创建 | POST | `/{EntityCollection}` |
| 更新 | PATCH | `/{EntityCollection}(...key...)` |
| 删除 | DELETE | `/{EntityCollection}(...key...)` |

各实体集合路径与实体名称一致。

---

## 认证 / Authentication

### OAuth 2.0 (推荐)
```
Authorization: Bearer <access_token>
```

### 基本认证 (Basic Auth)
```
Authorization: Basic <base64(username:password)>
```

### CSRF Token 处理
```http
GET /sap/opu/odata/sap/API_BILL_OF_MATERIAL_SRV_0002/A_BillOfMaterial
X-CSRF-Token: Fetch
```

---

## 错误码 / Error Codes

| HTTP 状态码 | 描述 (EN) | 描述 (CN) |
|-------------|-----------|-----------|
| 200 | OK | 请求成功 |
| 201 | Created | 创建成功 |
| 202 | Accepted | 异步请求已接受 |
| 204 | No Content | 无返回内容 |
| 400 | Bad Request | 请求参数错误 |
| 401 | Unauthorized | 未授权 |
| 403 | Forbidden | 禁止访问 |
| 404 | Not Found | 资源不存在 |
| 500 | Internal Server Error | 服务器内部错误 |

---

## 相关资源 / References

| 资源 | 链接 |
|------|------|
| SAP API Business Hub | [https://api.sap.com/api/API_BILL_OF_MATERIAL_SRV_0002/overview](https://api.sap.com/api/API_BILL_OF_MATERIAL_SRV_0002/overview) |
| SAP Help Portal | [https://help.sap.com/docs/SAP_S4HANA_CLOUD/a0f1af8fb2ac4f84bb623fcca9eca646/8a8b08aab6cd47f4a3e35e8bd8d86ca2.html](https://help.sap.com/docs/SAP_S4HANA_CLOUD/a0f1af8fb2ac4f84bb623fcca9eca646/8a8b08aab6cd47f4a3e35e8bd8d86ca2.html) |
| SAP Cloud SDK Java VDM | [https://javadoc.io/static/com.sap.cloud.sdk.s4hana/s4hana-api-odata-onpremise/4.9.0/com/sap/cloud/sdk/s4hana/onpremise/datamodel/odata/services/BillOfMaterialsService.html](https://javadoc.io/static/com.sap.cloud.sdk.s4hana/s4hana-api-odata-onpremise/4.9.0/com/sap/cloud/sdk/s4hana/onpremise/datamodel/odata/services/BillOfMaterialsService.html) |
