---
# API: Sales Order (A2X) / 销售订单 API
# File: CE_SALESORDER_0001.md
# Version: 1.9.2
# Status: ACTIVE
# Protocol: OData V4
# Source URL: https://api.sap.com/api/CE_SALESORDER_0001/overview
# Generated: 2026-07-23 14:17:02
---

# Sales Order (A2X) / 销售订单 API

> **API 版本:** 1.9.2 | **状态:** ACTIVE | **协议:** OData V4  
> **技术名称:** `CE_SALESORDER_0001`  
> **服务根路径:** `/sap/opu/odata4/sap/ce_salesorder/srvd_a2x/sap/salesorder/0001/`  
> **SAP 通信场景:** `SAP_COM_0109`

## 概述 / Overview

该服务允许外部系统对销售订单执行创建、读取、更新和删除（CRUD）操作。支持深插入（Deep Insert），可一次性创建销售订单及其行项目、合作伙伴、定价要素和文本。

This synchronous inbound OData V4 service enables you to create, read, update, and delete sales orders from external systems. It supports deep insert requests, allowing you to create a sales order header together with items, partners, pricing elements, and texts in a single POST.

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

---

## 实体列表 / Entity List

| # | 实体名称 | 描述 (EN) | 描述 (CN) | 主键 |
|---|----------|-----------|-----------|------|
| 1 | `A_SalesOrder` | Sales Order Header | 销售订单抬头 | `SalesOrder` |
| 2 | `A_SalesOrderItem` | Sales Order Item | 销售订单行项目 | `SalesOrder`, `SalesOrderItem` |
| 3 | `A_SalesOrderPartner` | Sales Order Header Partner | 销售订单抬头合作伙伴 | `SalesOrder`, `PartnerFunction` |
| 4 | `A_SalesOrderPricingElement` | Sales Order Header Pricing | 销售订单抬头定价要素 | `SalesOrder`, `PricingProcedureStep`, `PricingProcedureCounter`, `ConditionType` |
| 5 | `A_SalesOrderText` | Sales Order Header Text | 销售订单抬头文本 | `SalesOrder`, `Language`, `LongTextID` |
| 6 | `A_SalesOrderScheduleLine` | Sales Order Schedule Line | 销售订单计划行 | `SalesOrder`, `SalesOrderItem`, `ScheduleLine` |
| 7 | `A_SalesOrderItemPartner` | Sales Order Item Partner | 销售订单行项目合作伙伴 | `SalesOrder`, `SalesOrderItem`, `PartnerFunction` |
| 8 | `A_SalesOrderItemPricingElement` | Sales Order Item Pricing | 销售订单行项目定价要素 | `SalesOrder`, `SalesOrderItem`, `PricingProcedureStep`, `PricingProcedureCounter`, `ConditionType` |
| 9 | `A_SalesOrderItemText` | Sales Order Item Text | 销售订单行项目文本 | `SalesOrder`, `SalesOrderItem`, `Language`, `LongTextID` |

---

## 1. A_SalesOrder — 销售订单抬头

**实体集合路径:** `A_SalesOrder`  
**主键 (Key):** `SalesOrder` (STRING 10)  
**ETag:** 支持 (`LastChangeDateTime`)

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `SalesOrder` | String | 10 | Sales Order | 销售订单编号 (主键) |
| `SalesOrderType` | String | 4 | Sales Document Type | 销售凭证类型 |
| `SalesOrderProcessingType` | String | 1 | Processing Type | 处理类型 |
| `SoldToParty` | String | 10 | Sold-to Party | 售达方 |
| `SalesOrganization` | String | 4 | Sales Organization | 销售组织 |
| `DistributionChannel` | String | 2 | Distribution Channel | 分销渠道 |
| `OrganizationDivision` | String | 2 | Division | 产品组 |
| `ReferenceDistributionChannel` | String | 2 | Reference Distribution Channel | 参考分销渠道 |
| `SalesOffice` | String | 4 | Sales Office | 销售办公室 |
| `SalesGroup` | String | 3 | Sales Group | 销售组 |
| `SalesDistrict` | String | 6 | Sales District | 销售地区 |
| `CreatedByUser` | String | 12 | Created By | 创建人 |
| `CreationDate` | DateTimeOffset | - | Created On | 创建日期 |
| `CreationTime` | Time | - | Created At | 创建时间 |
| `LastChangeDateTime` | DateTimeOffset | - | Last Changed On | 最后更改日期 |
| `LastChangedByUser` | String | 12 | Last Changed By | 最后更改人 |
| `PurchaseOrderByCustomer` | String | 35 | Customer Purchase Order Number | 客户采购订单号 |
| `PurchaseOrderByShipToParty` | String | 35 | Ship-to Party's Customer Reference | 收货方客户参考 |
| `CustomerPurchaseOrderType` | String | 4 | Customer Purchase Order Type | 客户采购订单类型 |
| `CustomerPurchaseOrderDate` | DateTimeOffset | - | Customer Purchase Order Date | 客户采购订单日期 |
| `BusinessSolutionOrder` | String | 10 | Business Solution Order | 业务解决方案订单 |
| `ReferenceSDDocument` | String | 10 | Reference Sales Order | 参考销售凭证 |
| `SDDocumentReason` | String | 3 | Order Reason | 订单原因 |
| `SalesOrderDate` | Date | - | Document Date | 凭证日期 |
| `RequestedDeliveryDate` | Date | - | Requested Delivery Date | 请求交货日期 |
| `PricingDate` | Date | - | Pricing Date | 定价日期 |
| `ServicesRenderedDate` | Date | - | Services Rendered Date | 服务提供日期 |
| `BillingDocumentDate` | Date | - | Billing Date | 开票日期 |
| `TotalNetAmount` | Decimal | - | Total Net Amount | 总净额 |
| `TaxAmount` | Decimal | - | Tax Amount | 税额 |
| `GrossAmount` | Decimal | - | Gross Amount | 总金额 |
| `TransactionCurrency` | String | 5 | SD Document Currency | 凭证货币 |
| `DeliveryDateTypeRule` | String | 1 | Delivery Date Rule | 交货日期规则 |
| `ShippingCondition` | String | 2 | Shipping Condition | 发运条件 |
| `CompleteDeliveryIsDefined` | Boolean | - | Complete Delivery Defined | 完整交货标识 |
| `SlsDocIsRlvtForProofOfDeliv` | Boolean | - | Relevant for POD | 交货证明相关标识 |
| `ShippingType` | String | 2 | Shipping Type | 发运类型 |
| `ReceivingPoint` | String | 2 | Receiving Point | 收货点 |
| `IncotermsClassification` | String | 3 | Incoterms (Part 1) | 国际贸易条款 |
| `IncotermsVersion` | String | 4 | Incoterms Version | 国际贸易条款版本 |
| `IncotermsLocation1` | String | 70 | Incoterms Location 1 | 国际贸易条款地点1 |
| `IncotermsLocation2` | String | 70 | Incoterms Location 2 | 国际贸易条款地点2 |
| `SDPricingProcedure` | String | 6 | Pricing Procedure | 定价过程 |
| `CustomerPriceGroup` | String | 2 | Customer Price Group | 客户价格组 |
| `PriceListType` | String | 2 | Price List Type | 价格清单类型 |
| `FixedValueDate` | Date | - | Fixed Value Date | 固定价值日期 |
| `TaxDepartureCountry` | String | 3 | Tax Departure Country | 税务出发国 |
| `VATRegistrationCountry` | String | 3 | VAT Registration Country | 增值税注册国 |
| `IsEUTriangularDeal` | Boolean | - | EU Triangular Deal | 欧盟三角交易标识 |
| `CustomerPaymentTerms` | String | 4 | Payment Terms | 客户付款条件 |
| `PaymentMethod` | String | 1 | Payment Method | 付款方式 |
| `BillingCompanyCode` | String | 4 | Billing Company Code | 开票公司代码 |
| `ControllingArea` | String | 4 | Controlling Area | 控制范围 |
| `CustomerAccountAssignmentGroup` | String | 2 | Account Assignment Group | 客户科目分配组 |
| `AssignmentReference` | String | 18 | Assignment Number | 分配编号 |
| `AccountingDocExternalReference` | String | 50 | External Reference | 会计凭证外部参考 |
| `CustomerCreditAccount` | String | 10 | Credit Account | 客户信用账户 |
| `HeaderBillingBlockReason` | String | 2 | Billing Block (Header) | 抬头开票冻结原因 |
| `DeliveryBlockReason` | String | 2 | Delivery Block (Header) | 抬头交货冻结原因 |
| `SalesOrderApprovalReason` | String | 4 | Approval Reason | 审批原因 |
| `CustomerGroup` | String | 2 | Customer Group | 客户组 |
| `AdditionalCustomerGroup1` | String | 3 | Additional Customer Group 1 | 附加客户组1 |
| `AdditionalCustomerGroup2` | String | 3 | Additional Customer Group 2 | 附加客户组2 |
| `AdditionalCustomerGroup3` | String | 3 | Additional Customer Group 3 | 附加客户组3 |
| `AdditionalCustomerGroup4` | String | 3 | Additional Customer Group 4 | 附加客户组4 |
| `AdditionalCustomerGroup5` | String | 3 | Additional Customer Group 5 | 附加客户组5 |
| `OverallSDProcessStatus` | String | 2 | Overall Processing Status | 总体处理状态 |
| `OverallDeliveryBlockStatus` | String | 1 | Delivery Block Status | 总体交货冻结状态 |
| `OverallBillingBlockStatus` | String | 1 | Billing Block Status | 总体开票冻结状态 |
| `OverallDeliveryStatus` | String | 1 | Overall Delivery Status | 总体交货状态 |
| `TotalCreditCheckStatus` | String | 1 | Credit Check Status | 信用检查状态 |
| `OverallSDDocumentRejectionSts` | String | 1 | Rejection Status | 总体拒绝状态 |
| `TotalBlockStatus` | String | 1 | Overall Block Status | 总体冻结状态 |
| `HdrGeneralIncompletionStatus` | String | 1 | Header Incompletion Status | 抬头不完整状态 |
| `OvrlItmGeneralIncompletionSts` | String | 1 | Item Incompletion Status | 行项目不完整状态 |
| `OverallSDDocReferenceStatus` | String | 1 | Reference Status | 参考状态 |
| `SalesDocApprovalStatus` | String | 1 | Approval Status | 审批状态 |
| `OverallChmlCmplncStatus` | String | 1 | Chemical Compliance Status | 化学品合规状态 |
| `OverallDangerousGoodsStatus` | String | 1 | Dangerous Goods Status | 危险品状态 |
| `OverallSafetyDataSheetStatus` | String | 1 | Safety Data Sheet Status | 安全数据表状态 |
| `OverallTrdCmplncEmbargoSts` | String | 1 | Embargo Status | 禁运状态 |
| `OvrlTrdCmplncSnctndListChkSts` | String | 1 | Sanctioned List Check | 制裁名单检查状态 |
| `OvrlTrdCmplncLegalCtrlChkSts` | String | 1 | Legal Control Status | 法律管制状态 |
| `SalesOrderDownPaymentStatus` | String | 1 | Down Payment Status | 预付款状态 |
| `OverallOrdReltdBillgStatus` | String | 1 | Order-Related Billing Status | 订单相关开票状态 |

### 导航属性 / Navigation Properties

| 属性名 | 目标实体 | 基数 | 描述 |
|--------|----------|------|------|
| `_Item` | A_SalesOrderItem | 0..* | 销售订单行项目 |
| `_Partner` | A_SalesOrderPartner | 0..* | 销售订单合作伙伴 |
| `_PricingElement` | A_SalesOrderPricingElement | 0..* | 销售订单定价要素 |
| `_Text` | A_SalesOrderText | 0..* | 销售订单文本 |

---

## 2. A_SalesOrderItem — 销售订单行项目

**实体集合路径:** `A_SalesOrderItem`  
**主键 (Key):** `SalesOrder` (STRING 10), `SalesOrderItem` (STRING 6)

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `SalesOrder` | String | 10 | Sales Order | 销售订单编号 |
| `SalesOrderItem` | String | 6 | Sales Order Item | 行项目编号 |
| `HigherLevelItem` | String | 6 | Higher-Level Item | 上层项目(BOM中) |
| `SalesOrderItemCategory` | String | 4 | Item Category | 项目类别 |
| `SalesOrderItemText` | String | 40 | Short Text | 行项目短文本 |
| `Product` | String | 40 | Product Number | 产品编号 |
| `ProductGroup` | String | 9 | Product Group | 产品组 |
| `MaterialByCustomer` | String | 35 | Customer Material Number | 客户物料编号 |
| `InternationalArticleNumber` | String | 18 | EAN/UPC | 国际商品编码 |
| `PurchaseOrderByCustomer` | String | 35 | Customer PO Number | 客户采购订单号 |
| `ConfdDelivQtyInOrderQtyUnit` | Decimal | - | Confirmed Quantity | 已确认数量(销售单位) |
| `OrderQuantitySAPUnit` | String | 3 | Order Quantity Unit | 订单数量单位 |
| `OrderQuantityISOUnit` | String | 3 | ISO Unit for Order Qty | 订单数量ISO单位 |
| `RequestedQuantity` | Decimal | - | Requested Quantity | 请求数量 |
| `RequestedQuantitySAPUnit` | String | 3 | Requested Qty Unit | 请求数量单位 |
| `RequestedQuantityISOUnit` | String | 3 | ISO Unit for Req. Qty | 请求数量ISO单位 |
| `ItemGrossWeight` | Decimal | - | Gross Weight | 毛重 |
| `ItemNetWeight` | Decimal | - | Net Weight | 净重 |
| `ItemWeightSAPUnit` | String | 3 | Weight Unit | 重量单位 |
| `ItemWeightISOUnit` | String | 3 | ISO Unit for Weight | 重量ISO单位 |
| `ItemVolume` | Decimal | - | Volume | 体积 |
| `ItemVolumeSAPUnit` | String | 3 | Volume Unit | 体积单位 |
| `ItemVolumeISOUnit` | String | 3 | ISO Unit for Volume | 体积ISO单位 |
| `RequestedDeliveryDate` | Date | - | Requested Delivery Date | 请求交货日期 |
| `ConfirmedDeliveryDate` | Date | - | Confirmed Delivery Date | 确认交货日期 |
| `PricingDate` | Date | - | Pricing Date | 定价日期 |
| `ServicesRenderedDate` | Date | - | Services Rendered Date | 服务提供日期 |
| `BillingDocumentDate` | Date | - | Billing Date | 开票日期 |
| `NetAmount` | Decimal | - | Net Value | 净额 |
| `TaxAmount` | Decimal | - | Tax Amount | 税额 |
| `TransactionCurrency` | String | 5 | Currency | 凭证货币 |
| `CustomerGroup` | String | 2 | Customer Group | 客户组 |
| `Batch` | String | 10 | Batch Number | 批次号 |
| `Plant` | String | 4 | Plant | 工厂 |
| `StorageLocation` | String | 4 | Storage Location | 库存地点 |
| `ShippingPoint` | String | 4 | Shipping Point | 发运点 |
| `ShippingType` | String | 2 | Shipping Type | 发运类型 |
| `Route` | String | 6 | Route | 路线 |
| `DeliveryPriority` | String | 2 | Delivery Priority | 交货优先级 |
| `PartialDeliveryIsAllowed` | String | 1 | Partial Delivery | 允许部分交货 |
| `MaxNmbrOfPartialDelivery` | Decimal | - | Max Partial Deliveries | 最大部分交货次数 |
| `DeliveryDateTypeRule` | String | 1 | Delivery Date Rule | 交货日期规则 |
| `ReceivingPoint` | String | 2 | Receiving Point | 收货点 |
| `DeliveryGroup` | String | 6 | Delivery Group | 交货组 |
| `IncotermsClassification` | String | 3 | Incoterms | 国际贸易条款 |
| `IncotermsLocation1` | String | 70 | Incoterms Location 1 | 国际贸易条款地点1 |
| `IncotermsLocation2` | String | 70 | Incoterms Location 2 | 国际贸易条款地点2 |
| `IncotermsVersion` | String | 4 | Incoterms Version | 国际贸易条款版本 |
| `CustomerPaymentTerms` | String | 4 | Payment Terms | 客户付款条件 |
| `FixedValueDate` | Date | - | Fixed Value Date | 固定价值日期 |
| `CustomerPriceGroup` | String | 2 | Customer Price Group | 客户价格组 |
| `MaterialPricingGroup` | String | 2 | Material Pricing Group | 物料定价组 |
| `BusinessArea` | String | 4 | Business Area | 业务范围 |
| `ProfitCenter` | String | 10 | Profit Center | 利润中心 |
| `MatlAccountAssignmentGroup` | String | 2 | Account Assignment Group | 物料科目分配组 |
| `ItemBillingBlockReason` | String | 2 | Billing Block (Item) | 行项目开票冻结原因 |
| `SalesDocumentRjcnReason` | String | 2 | Rejection Reason | 拒绝原因 |
| `ProductConfiguration` | String | 1 | Product Configuration | 产品配置 |
| `SDProcessStatus` | String | 2 | Item Processing Status | 行项目处理状态 |
| `SDDocumentRejectionStatus` | String | 1 | Item Rejection Status | 行项目拒绝状态 |
| `DeliveryStatus` | String | 1 | Delivery Status | 交货状态 |
| `BillingBlockStatus` | String | 1 | Billing Block Status | 开票冻结状态 |
| `ItemGeneralIncompletionStatus` | String | 1 | Incompletion Status | 不完整状态 |
| `DeliveryBlockStatus` | String | 1 | Delivery Block Status | 交货冻结状态 |
| `SlsOrderItemDownPaymentStatus` | String | 1 | Down Payment Status | 预付款状态 |
| `OrderRelatedBillingStatus` | String | 1 | Order-Related Billing Status | 订单相关开票状态 |
| `ChmlCmplncStatus` | String | 1 | Chemical Compliance Status | 化学品合规状态 |
| `DangerousGoodsStatus` | String | 1 | Dangerous Goods Status | 危险品状态 |
| `SafetyDataSheetStatus` | String | 1 | Safety Data Sheet Status | 安全数据表状态 |
| `TrdCmplncEmbargoSts` | String | 1 | Embargo Status | 禁运状态 |
| `TrdCmplncSnctndListChkSts` | String | 1 | Sanctioned List Check | 制裁名单检查状态 |
| `OvrlTrdCmplncLegalCtrlChkSts` | String | 1 | Legal Control Status | 法律管制状态 |

### 导航属性 / Navigation Properties

| 属性名 | 目标实体 | 基数 | 描述 |
|--------|----------|------|------|
| `_ItemPartner` | A_SalesOrderItemPartner | 0..* | 行项目合作伙伴 |
| `_ItemPricingElement` | A_SalesOrderItemPricingElement | 0..* | 行项目定价要素 |
| `_ItemText` | A_SalesOrderItemText | 0..* | 行项目文本 |
| `_ScheduleLine` | A_SalesOrderScheduleLine | 0..* | 计划行 |
| `_SalesOrder` | A_SalesOrder | 0..1 | 销售订单抬头 |

---

## 3. A_SalesOrderPartner — 销售订单抬头合作伙伴

**实体集合路径:** `A_SalesOrderPartner`  
**主键 (Key):** `SalesOrder` (STRING 10), `PartnerFunction` (STRING 2)

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `SalesOrder` | String | 10 | Sales Order | 销售订单编号 |
| `PartnerFunction` | String | 2 | Partner Function | 合作伙伴功能 |
| `Customer` | String | 10 | Customer Number | 客户编号 |
| `Supplier` | String | 10 | Supplier Number | 供应商编号 |
| `Personnel` | String | 8 | Personnel Number | 员工编号 |
| `ContactPerson` | String | 10 | Contact Person | 联系人编号 |

### 常见合作伙伴功能 / Common Partner Functions

| 功能值 | 描述 (EN) | 描述 (CN) |
|--------|-----------|-----------|
| `AG` | Sold-to Party | 售达方 |
| `RE` | Bill-to Party | 收票方 |
| `WE` | Ship-to Party | 收货方 |
| `RG` | Payer | 付款方 |
| `SP` | Supplier | 供应商 |
| `BP` | Contact Person | 联系人 |
| `VW` | Sales Employee | 销售员工 |

---

## 4. A_SalesOrderPricingElement — 销售订单抬头定价要素

**实体集合路径:** `A_SalesOrderPricingElement`  
**主键 (Key):** `SalesOrder`, `PricingProcedureStep`, `PricingProcedureCounter`, `ConditionType`

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `SalesOrder` | String | 10 | Sales Order | 销售订单编号 |
| `PricingProcedureStep` | String | 3 | Step Number | 定价过程步骤 |
| `PricingProcedureCounter` | String | 3 | Counter | 定价过程计数器 |
| `ConditionType` | String | 4 | Condition Type | 条件类型 |
| `ConditionCalculationType` | String | 3 | Calculation Type | 计算类型 |
| `ConditionRateAmount` | Decimal | - | Rate (Amount) | 费率 |
| `ConditionCurrency` | String | 5 | Condition Currency | 条件货币 |
| `ConditionQuantity` | Decimal | - | Condition Quantity | 条件数量 |
| `ConditionBaseQuantity` | Decimal | - | Base Quantity | 条件基础数量 |
| `ConditionQuantitySAPUnit` | String | 3 | Condition Quantity Unit | 条件数量单位 |
| `ConditionQuantityISOUnit` | String | 3 | ISO Unit | 条件数量ISO单位 |
| `ConditionRateRatio` | Decimal | - | Rate (Ratio) | 比率 |
| `ConditionRateRatioSAPUnit` | String | 3 | Ratio Unit | 比率单位 |
| `ConditionRateRatioISOUnit` | String | 3 | Ratio ISO Unit | 比率ISO单位 |
| `ConditionAmount` | Decimal | - | Condition Amount | 条件金额 |
| `ConditionBaseAmount` | Decimal | - | Base Amount | 条件基础金额 |
| `TransactionCurrency` | String | 5 | Document Currency | 凭证货币 |

---

## 5. A_SalesOrderText — 销售订单抬头文本

**实体集合路径:** `A_SalesOrderText`  
**主键 (Key):** `SalesOrder` (STRING 10), `Language` (STRING 2), `LongTextID` (STRING 4)

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `SalesOrder` | String | 10 | Sales Order | 销售订单编号 |
| `Language` | String | 2 | Language Key | 语言代码 |
| `LongTextID` | String | 4 | Text ID | 文本ID |
| `LongText` | String | - | Long Text | 长文本内容 |

### 常见文本ID / Common Text IDs

| 文本ID | 描述 (EN) | 描述 (CN) |
|--------|-----------|-----------|
| `TX01` | General Note | 一般备注 |
| `TX02` | Customer Reference | 客户参考 |
| `ZK01` | Internal Note | 内部备注 |
| `Z001` | Sales Note | 销售备注 |

---

## 6. A_SalesOrderItemPartner — 行项目合作伙伴

**实体集合路径:** `A_SalesOrderItemPartner`  
**主键 (Key):** `SalesOrder`, `SalesOrderItem`, `PartnerFunction`

字段同 A_SalesOrderPartner，额外包含 `PartnerIsSpecificForSDDocItem` (Boolean) 标识该合作伙伴是否为行项目特有。

---

## 7. A_SalesOrderItemPricingElement — 行项目定价要素

**实体集合路径:** `A_SalesOrderItemPricingElement`  
**主键 (Key):** `SalesOrder`, `SalesOrderItem`, `PricingProcedureStep`, `PricingProcedureCounter`, `ConditionType`

字段同 A_SalesOrderPricingElement。

---

## 8. A_SalesOrderItemText — 行项目文本

**实体集合路径:** `A_SalesOrderItemText`  
**主键 (Key):** `SalesOrder`, `SalesOrderItem`, `Language`, `LongTextID`

字段同 A_SalesOrderText。

---

## 9. A_SalesOrderScheduleLine — 计划行

**实体集合路径:** `A_SalesOrderScheduleLine`  
**主键 (Key):** `SalesOrder`, `SalesOrderItem`, `ScheduleLine`

### 字段列表 / Field List

| 字段名 | 类型 | 长度 | 描述 (EN) | 描述 (CN) |
|--------|------|------|-----------|-----------|
| `SalesOrder` | String | 10 | Sales Order | 销售订单编号 |
| `SalesOrderItem` | String | 6 | Sales Order Item | 行项目编号 |
| `ScheduleLine` | String | 4 | Schedule Line | 计划行编号 |
| `ScheduleLineCategory` | String | 2 | Schedule Line Category | 计划行类别 |
| `ScheduleLineOrderQuantity` | Decimal | - | Order Quantity | 计划行数量 |
| `OrderQuantitySAPUnit` | String | 3 | Order Quantity Unit | 订单单位 |
| `OrderQuantityISOUnit` | String | 3 | ISO Unit | ISO单位 |
| `RequestedDeliveryDate` | Date | - | Requested Delivery Date | 请求交货日期 |
| `ConfirmedDeliveryDate` | Date | - | Confirmed Delivery Date | 确认交货日期 |
| `ConfdOrderQtyByMatlAvailCheck` | Decimal | - | ATP Confirmed Qty | ATP确认数量 |
| `DeliveredQtyInOrderQtyUnit` | Decimal | - | Delivered Quantity | 已交货数量 |
| `OpenConfdDelivQtyInOrdQtyUnit` | Decimal | - | Open Confirmed Qty | 未清确认数量 |
| `CorrectedQtyInOrderQtyUnit` | Decimal | - | Corrected Qty | 修正数量 |
| `DelivBlockReasonForSchedLine` | String | 2 | Schedule Line Block | 计划行交货冻结原因 |
| `PurchaseRequisition` | String | 10 | Purchase Requisition | 采购申请编号 |
| `PurchaseRequisitionItem` | String | 5 | Purchase Requisition Item | 采购申请行项目 |
| `GoodsMovementType` | String | 3 | Movement Type | 移动类型 |

---

## CRUD 端点 / CRUD Endpoints

所有实体遵循 OData V4 CRUD 约定。以下以 `A_SalesOrder` 为例：

### 创建 (Create) — POST

```
POST /sap/opu/odata4/sap/ce_salesorder/srvd_a2x/sap/salesorder/0001/A_SalesOrder
Content-Type: application/json
```

### 读取 (Read) — GET

```
GET /sap/opu/odata4/sap/ce_salesorder/srvd_a2x/sap/salesorder/0001/A_SalesOrder(SalesOrder='12345')
GET /sap/opu/odata4/sap/ce_salesorder/srvd_a2x/sap/salesorder/0001/A_SalesOrder?$filter=...&$expand=...
```

### 更新 (Update) — PATCH

```
PATCH /sap/opu/odata4/sap/ce_salesorder/srvd_a2x/sap/salesorder/0001/A_SalesOrder(SalesOrder='12345')
Content-Type: application/json
```

### 替换 (Replace) — PUT

```
PUT /sap/opu/odata4/sap/ce_salesorder/srvd_a2x/sap/salesorder/0001/A_SalesOrder(SalesOrder='12345')
Content-Type: application/json
```

### 删除 (Delete) — DELETE

```
DELETE /sap/opu/odata4/sap/ce_salesorder/srvd_a2x/sap/salesorder/0001/A_SalesOrder(SalesOrder='12345')
```

### 各实体端点路径速查表

| 实体 | 端点路径 |
|------|---------|
| A_SalesOrder | `A_SalesOrder` |
| A_SalesOrderItem | `A_SalesOrderItem` |
| A_SalesOrderPartner | `A_SalesOrderPartner` |
| A_SalesOrderPricingElement | `A_SalesOrderPricingElement` |
| A_SalesOrderText | `A_SalesOrderText` |
| A_SalesOrderScheduleLine | `A_SalesOrderScheduleLine` |
| A_SalesOrderItemPartner | `A_SalesOrderItemPartner` |
| A_SalesOrderItemPricingElement | `A_SalesOrderItemPricingElement` |
| A_SalesOrderItemText | `A_SalesOrderItemText` |

---

## 深插入 (Deep Insert) — 一次性创建销售订单

CE_SALESORDER_0001 支持通过单次 POST 创建销售订单抬头及其子对象。

### 深插入示例

```json
POST /sap/opu/odata4/sap/ce_salesorder/srvd_a2x/sap/salesorder/0001/A_SalesOrder
Content-Type: application/json

{
  "SalesOrderType": "OR",
  "SalesOrganization": "1000",
  "DistributionChannel": "10",
  "OrganizationDivision": "00",
  "SoldToParty": "10100001",
  "PurchaseOrderByCustomer": "PO-12345",
  "RequestedDeliveryDate": "2026-08-15",
  "_Item": [
    {
      "Product": "TG11",
      "RequestedQuantity": 10,
      "RequestedQuantitySAPUnit": "PCE",
      "Plant": "1000"
    }
  ],
  "_Text": [
    {
      "Language": "EN",
      "LongTextID": "TX02",
      "LongText": "Sales order from external system"
    }
  ],
  "_Partner": [
    {
      "PartnerFunction": "AG",
      "Customer": "10100001"
    },
    {
      "PartnerFunction": "WE",
      "Customer": "10100002"
    },
    {
      "PartnerFunction": "RE",
      "Customer": "10100001"
    },
    {
      "PartnerFunction": "RG",
      "Customer": "10100003"
    }
  ]
}
```

---

## OData V4 查询选项 / Query Options (V4)

| 参数 | 示例 | 说明 |
|------|------|------|
| `$filter` | `$filter=SalesOrder eq '12345'` | 过滤 |
| `$select` | `$select=SalesOrder,TotalNetAmount` | 选择字段 |
| `$expand` | `$expand=_Item,_Partner` | 展开导航属性 |
| `$top` | `$top=100` | 返回前 N 条 |
| `$skip` | `$skip=50` | 跳过前 N 条 |
| `$orderby` | `$orderby=SalesOrder desc` | 排序 |
| `$count` | `$count=true` | 返回计数 |

### 多层展开 (V4 Syntax)

```
GET A_SalesOrder?$expand=_Item($_expand=_ScheduleLine,$select=Product,RequestedQuantity)
```

---

## 导航属性关系总表 / Navigation Property Matrix

| 源实体 | 导航属性 | 目标实体 | 基数 |
|--------|----------|----------|------|
| A_SalesOrder | `_Item` | A_SalesOrderItem | 0..* |
| A_SalesOrder | `_Partner` | A_SalesOrderPartner | 0..* |
| A_SalesOrder | `_PricingElement` | A_SalesOrderPricingElement | 0..* |
| A_SalesOrder | `_Text` | A_SalesOrderText | 0..* |
| A_SalesOrderItem | `_ItemPartner` | A_SalesOrderItemPartner | 0..* |
| A_SalesOrderItem | `_ItemPricingElement` | A_SalesOrderItemPricingElement | 0..* |
| A_SalesOrderItem | `_ItemText` | A_SalesOrderItemText | 0..* |
| A_SalesOrderItem | `_ScheduleLine` | A_SalesOrderScheduleLine | 0..* |
| A_SalesOrderItem | `_SalesOrder` | A_SalesOrder | 0..1 |
| A_SalesOrderPartner | `_SalesOrder` | A_SalesOrder | 0..1 |
| A_SalesOrderPricingElement | `_SalesOrder` | A_SalesOrder | 0..1 |
| A_SalesOrderText | `_SalesOrder` | A_SalesOrder | 0..1 |
| A_SalesOrderItemPartner | `_Item` | A_SalesOrderItem | 0..1 |
| A_SalesOrderItemPartner | `_SalesOrder` | A_SalesOrder | 0..1 |
| A_SalesOrderItemPricingElement | `_Item` | A_SalesOrderItem | 0..1 |
| A_SalesOrderItemPricingElement | `_SalesOrder` | A_SalesOrder | 0..1 |
| A_SalesOrderItemText | `_Item` | A_SalesOrderItem | 0..1 |
| A_SalesOrderItemText | `_SalesOrder` | A_SalesOrder | 0..1 |
| A_SalesOrderScheduleLine | `_Item` | A_SalesOrderItem | 0..1 |
| A_SalesOrderScheduleLine | `_SalesOrder` | A_SalesOrder | 0..1 |

---

## 相关资源 / References

| 资源 | 链接 |
|------|------|
| SAP API Business Hub | [https://api.sap.com/api/CE_SALESORDER_0001/overview](https://api.sap.com/api/CE_SALESORDER_0001/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) |
| Ballerina SDK | [https://central.ballerina.io/ballerinax/sap.s4hana.ce_salesorder_0001](https://central.ballerina.io/ballerinax/sap.s4hana.ce_salesorder_0001) |
| 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) |
| SAP Cloud SDK JS | [https://sap.github.io/cloud-sdk/docs/js/features/odata/v4-client](https://sap.github.io/cloud-sdk/docs/js/features/odata/v4-client) |
