# SAP Outbound Delivery (A2X) API 详细文档

## API 版本 / API Version

| 项目 / Item | 值 / Value |
|---|---|
| API 名称 / Name | `API_OUTBOUND_DELIVERY_SRV` |
| 版本 / Version | **2.1.0** (v0002) |
| 状态 / Status | **ACTIVE** |
| 协议 / Protocol | **OData V2** (XML/JSON) |
| 接口类型 / Type | **A2X** (Application-to-Anything) |
| 所属模块 / Module | **SAP S/4HANA Logistics – Outbound Delivery Processing** |
| 服务根 URL | `/sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/` |

## API 概述 / API Overview

本 API 提供对 SAP S/4HANA 外向交货单（Outbound Delivery）的 **CRUD** 操作，包括抬头、行项目、合作伙伴、文本、地址、序列号、处理单元等实体。支持深层插入（Deep Insert）、ETag 并发控制、分页查询和自定义 OData Action。

This API provides CRUD operations for SAP S/4HANA Outbound Deliveries, including header, item, partner, text, address, serial number, and handling unit entities. It supports deep insert, ETag concurrency control, pagination, and custom OData Actions.

- **API 业务用途**: 创建、读取、更新、删除外向交货单，拣货确认，分配处理单元，添加序列号等。
- **SAP 官方 API Business Hub URL**: [https://api.sap.com/api/API_OUTBOUND_DELIVERY_SRV_0002/overview](https://api.sap.com/api/API_OUTBOUND_DELIVERY_SRV_0002/overview)

---

## 实体关系图 / Entity Relationship Diagram (Text)

```
┌─────────────────────────────────────┐
│      A_OutbDeliveryHeader           │  ← 顶层实体 / Root Entity
│─────────────────────────────────────│
│ PK: DeliveryDocument (string)       │
│ ~120 属性 / Properties              │
├─────────────────────────────────────┤
│ 导航 / Navigation:                  │
│ 1:N  → to_Item                     │
│ 1:N  → to_Partner                  │
│ 1:N  → to_Text                     │
│ 1:1  → to_Address                  │
│ 1:N  → to_HandlingUnit             │
│ 1:N  → to_SerialNumber             │
└──────────┬──────────────────────────┘
           │
           │ 1:N (DeliveryDocument)
           │
┌──────────▼──────────────────────────┐
│      A_OutbDeliveryItem             │
│─────────────────────────────────────│
│ PK: DeliveryDocument (string)       │
│ PK: DeliveryDocumentItem (string)   │
│ ~130 属性 / Properties              │
├─────────────────────────────────────┤
│ 导航 / Navigation:                  │
│ 1:1  → to_Header                   │
│ 1:N  → to_Partner                  │
│ 1:N  → to_Text                     │
│ 1:1  → to_Address                  │
│ 1:N  → to_SerialNumber             │
│ 1:N  → to_HandlingUnit             │
└─────────────────────────────────────┘
           │
           │ 1:N (DeliveryDocument + Item)
           │
┌──────────▼──────────────────────────┐
│   A_OutbDeliveryPartner             │
│─────────────────────────────────────│
│ PK: DeliveryDocument (string)       │
│ PK: PartnerFunction (string)        │
│ PK: PartnerNumber (string)          │
│ ~10 属性 / Properties               │
└─────────────────────────────────────┘

┌─────────────────────────────────────┐
│   A_OutbDeliveryHeaderText          │
│─────────────────────────────────────│
│ PK: DeliveryDocument (string)       │
│ PK: Language (string)               │
│ PK: LongTextID (string)             │
│ ~5 属性 / Properties                │
└─────────────────────────────────────┘

┌─────────────────────────────────────┐
│   A_OutbDeliveryItemText            │
│─────────────────────────────────────│
│ PK: DeliveryDocument (string)       │
│ PK: DeliveryDocumentItem (string)   │
│ PK: Language (string)               │
│ PK: LongTextID (string)             │
│ ~5 属性 / Properties                │
└─────────────────────────────────────┘

┌─────────────────────────────────────┐
│ A_OutbDeliveryHeaderAddress         │
│─────────────────────────────────────│
│ PK: DeliveryDocument (string)       │
│ PK: AddressID (string)              │
│ ~30 属性 / Properties               │
└─────────────────────────────────────┘

┌─────────────────────────────────────┐
│ A_OutbDeliveryItemAddress           │
│─────────────────────────────────────│
│ PK: DeliveryDocument (string)       │
│ PK: DeliveryDocumentItem (string)   │
│ PK: AddressID (string)              │
│ ~30 属性 / Properties               │
└─────────────────────────────────────┘

┌─────────────────────────────────────┐
│ A_OutbDeliverySerialNumber          │
│─────────────────────────────────────│
│ PK: DeliveryDocument (string)       │
│ PK: DeliveryDocumentItem (string)   │
│ PK: SerialNumber (string)           │
│ ~15 属性 / Properties               │
└─────────────────────────────────────┘

┌─────────────────────────────────────┐
│ A_OutbDeliveryHandlingUnit          │
│─────────────────────────────────────│
│ PK: HandlingUnitExternalID (string) │
│ PK: DeliveryDocument (string)       │
│ ~30 属性 / Properties               │
└─────────────────────────────────────┘

┌─────────────────────────────────────┐
│ A_OutbDeliveryItemHandlingUnit      │
│─────────────────────────────────────│
│ PK: DeliveryDocument (string)       │
│ PK: DeliveryDocumentItem (string)   │
│ PK: HandlingUnitExternalID (string) │
│ ~20 属性 / Properties               │
└─────────────────────────────────────┘
```

---

## 导航属性关系 / Navigation Property Relationships

| 源实体 / Source | 导航属性 / Nav Property | 目标实体 / Target | 基数 / Cardinality |
|---|---|---|---|
| `A_OutbDeliveryHeader` | `to_Item` | `A_OutbDeliveryItem` | **1:N** (集合) |
| `A_OutbDeliveryHeader` | `to_Partner` | `A_OutbDeliveryPartner` | **1:N** (集合) |
| `A_OutbDeliveryHeader` | `to_Text` | `A_OutbDeliveryHeaderText` | **1:N** (集合) |
| `A_OutbDeliveryHeader` | `to_Address` | `A_OutbDeliveryHeaderAddress` | **1:1** (单例) |
| `A_OutbDeliveryHeader` | `to_HandlingUnit` | `A_OutbDeliveryHandlingUnit` | **1:N** (集合) |
| `A_OutbDeliveryHeader` | `to_SerialNumber` | `A_OutbDeliverySerialNumber` | **1:N** (集合) |
| `A_OutbDeliveryItem` | `to_Header` | `A_OutbDeliveryHeader` | **1:1** (单例) |
| `A_OutbDeliveryItem` | `to_Partner` | `A_OutbDeliveryPartner` | **1:N** (集合) |
| `A_OutbDeliveryItem` | `to_Text` | `A_OutbDeliveryItemText` | **1:N** (集合) |
| `A_OutbDeliveryItem` | `to_Address` | `A_OutbDeliveryItemAddress` | **1:1** (单例) |
| `A_OutbDeliveryItem` | `to_SerialNumber` | `A_OutbDeliverySerialNumber` | **1:N** (集合) |
| `A_OutbDeliveryItem` | `to_HandlingUnit` | `A_OutbDeliveryItemHandlingUnit` | **1:N** (集合) |
| `A_OutbDeliveryPartner` | `to_Header` | `A_OutbDeliveryHeader` | **1:1** (单例) |
| `A_OutbDeliveryPartner` | `to_Item` | `A_OutbDeliveryItem` | **1:1** (单例) |
| `A_OutbDeliveryHeaderText` | `to_Header` | `A_OutbDeliveryHeader` | **1:1** (单例) |
| `A_OutbDeliveryItemText` | `to_Item` | `A_OutbDeliveryItem` | **1:1** (单例) |
| `A_OutbDeliveryHeaderAddress` | `to_Header` | `A_OutbDeliveryHeader` | **1:1** (单例) |
| `A_OutbDeliveryItemAddress` | `to_Item` | `A_OutbDeliveryItem` | **1:1** (单例) |
| `A_OutbDeliverySerialNumber` | `to_Header` | `A_OutbDeliveryHeader` | **1:1** (单例) |
| `A_OutbDeliverySerialNumber` | `to_Item` | `A_OutbDeliveryItem` | **1:1** (单例) |
| `A_OutbDeliveryHandlingUnit` | `to_Header` | `A_OutbDeliveryHeader` | **1:1** (单例) |
| `A_OutbDeliveryHandlingUnit` | `to_ItemHandlingUnit` | `A_OutbDeliveryItemHandlingUnit` | **1:N** (集合) |
| `A_OutbDeliveryItemHandlingUnit` | `to_HandlingUnit` | `A_OutbDeliveryHandlingUnit` | **1:1** (单例) |
| `A_OutbDeliveryItemHandlingUnit` | `to_Item` | `A_OutbDeliveryItem` | **1:1** (单例) |

---

## 实体与属性 / Entities & Properties

### 1. A_OutbDeliveryHeader — 抬头实体 / Header Entity

**关键字段 / Key**: `DeliveryDocument` (Edm.String) — 交货单号 / Delivery Document Number

**属性列表 / Properties** (≈120):

| # | 属性名 / Property Name | SAP 字段 | 类型 / Type | 描述 / Description |
|---|---|---|---|---|
| 1 | `DeliveryDocument` | VBELN | Edm.String (10) | 交货单号 / Delivery Document |
| 2 | `DeliveryDocumentBySupplier` | LIFEX | Edm.String (35) | 供应商交货单号 / Delivery Document by Supplier |
| 3 | `CreationDate` | ERDAT | Edm.DateTime (DateTimeOffset) | 创建日期 / Created On |
| 4 | `CreationTime` | ERZET | Edm.Time | 创建时间 / Created At |
| 5 | `LastChangeDate` | AEDAT | Edm.DateTime (DateTimeOffset) | 最后更改日期 / Last Changed On |
| 6 | `LastChangeTime` | AEZET | Edm.Time | 最后更改时间 / Last Changed At |
| 7 | `IsDeleted` | LOEVO | Edm.Boolean | 删除标识 / Deletion Indicator |
| 8 | `BillingDocumentDate` | FKDAT | Edm.DateTime (DateTimeOffset) | 开票日期 / Billing Document Date |
| 9 | `ActualGoodsMovementDate` | WADAT | Edm.DateTime (DateTimeOffset) | 实际货物移动日期 / Actual Goods Movement Date |
| 10 | `ActualGoodsMovementTime` | WADAT_Time | Edm.Time | 实际货物移动时间 / Actual Goods Movement Time |
| 11 | `BillOfLading` | BOLNR | Edm.String (35) | 提单号 / Bill of Lading |
| 12 | `BusinessArea` | GSBER | Edm.String (4) | 业务范围 / Business Area |
| 13 | `CompleteDeliveryIsDefined` | LGPBE | Edm.Boolean | 完整交货已定义 / Complete Delivery Defined |
| 14 | `ConfirmationTime` | BSTZK | Edm.Time | 确认时间 / Confirmation Time |
| 15 | `ConfirmedDeliveryQuantityBySU` | BSTMG | Edm.Decimal (17,3) | 以库存单位确认的已确认交货数量 |
| 16 | `ControllingArea` | KOKRS | Edm.String (4) | 控制范围 / Controlling Area |
| 17 | `CreatedByUser` | ERNAM | Edm.String (12) | 创建者 / Created By |
| 18 | `DeliveryBlockReason` | LIFSP | Edm.String (2) | 交货冻结原因 / Delivery Block Reason |
| 19 | `DeliveryDate` | LFDAT | Edm.DateTime (DateTimeOffset) | 交货日期 / Delivery Date |
| 20 | `DeliveryIsInPlant` | WAKBOX | Edm.Boolean | 交货是否在工厂内 |
| 21 | `DeliveryPriority` | LPRIO | Edm.String (2) | 交货优先级 / Delivery Priority |
| 22 | `DeliveryTime` | LFAZT | Edm.Time | 交货时间 / Delivery Time |
| 23 | `DeliveryVersion` | VERSION | Edm.String (4) | 交货版本 / Delivery Version |
| 24 | `DistributionChannel` | VTWEG | Edm.String (2) | 分销渠道 / Distribution Channel |
| 25 | `Division` | SPART | Edm.String (2) | 产品组 / Division |
| 26 | `DocumentDate` | BSTDK | Edm.DateTime (DateTimeOffset) | 单据日期 / Document Date |
| 27 | `EmptiesBillingDocumentDate` | LEFKD | Edm.DateTime (DateTimeOffset) | 空瓶开票单据日期 |
| 28 | `EmptiesBillingDocumentInPr` | LEFKB | Edm.String (1) | 空瓶开票单据内部处理 |
| 29 | `ExchangeRateToDelivery` | KURST | Edm.Decimal (11,5) | 汇率 / Exchange Rate |
| 30 | `FiscalYear` | GJAHR | Edm.String (4) | 会计年度 / Fiscal Year |
| 31 | `GoodsIssueDate` | WADAT_IST | Edm.DateTime (DateTimeOffset) | 实际发货日期 / Goods Issue Date |
| 32 | `GoodsIssueOrReceiptSlipNumb` | VBELN_VL | Edm.String (10) | 货物移动凭证号 |
| 33 | `GoodsIssueTime` | WAZET_IST | Edm.Time | 实际发货时间 / Goods Issue Time |
| 34 | `HandlingUnitInStock` | HU_EXIST | Edm.Boolean | 处理单元在库存 |
| 35 | `HeaderBillOfLading` | BOLNR | Edm.String (35) | 抬头提单号 / Header Bill of Lading |
| 36 | `HeaderGrossWeight` | BRGEW_HD | Edm.Decimal (19,3) | 抬头毛重 / Header Gross Weight |
| 37 | `HeaderNetWeight` | NTGEW_HD | Edm.Decimal (19,3) | 抬头净重 / Header Net Weight |
| 38 | `HeaderVolume` | VOLUM_HD | Edm.Decimal (19,3) | 抬头体积 / Header Volume |
| 39 | `HeaderVolumeUnit` | VOLEH_HD | Edm.String (3) | 抬头体积单位 / Header Volume Unit |
| 40 | `HeaderWeightUnit` | GEWEI_HD | Edm.String (3) | 抬头重量单位 / Header Weight Unit |
| 41 | `IncotermsClassification` | INCO1 | Edm.String (3) | 国际贸易条款分类 / Incoterms |
| 42 | `IncotermsLocation1` | INCO2_L | Edm.String (70) | 国际贸易条款地点1 |
| 43 | `IncotermsLocation2` | INCO2_U | Edm.String (70) | 国际贸易条款地点2 |
| 44 | `InspectionHolidayIndicator` | INSP_HOL_FLG | Edm.String (1) | 检查假期指示符 |
| 45 | `InspectionHolidayInDay` | INSP_HOL_DAY | Edm.String (2) | 检查假期 — 日 |
| 46 | `InspectionHolidayInHour` | INSP_HOL_HOUR | Edm.String (2) | 检查假期 — 时 |
| 47 | `InspectionHolidayInMinute` | INSP_HOL_MIN | Edm.String (2) | 检查假期 — 分 |
| 48 | `InspectionHolidayInMonth` | INSP_HOL_MONTH | Edm.String (2) | 检查假期 — 月 |
| 49 | `InspectionHolidayInSecond` | INSP_HOL_SEC | Edm.String (2) | 检查假期 — 秒 |
| 50 | `InspectionHolidayInYear` | INSP_HOL_YEAR | Edm.String (4) | 检查假期 — 年 |
| 51 | `IsExportDelivery` | EXPVL | Edm.Boolean | 是否为出口交货 |
| 52 | `LoadingGroup` | LADEG | Edm.String (4) | 装运组 / Loading Group |
| 53 | `MeansOfTransport` | VSART | Edm.String (2) | 运输方式 / Means of Transport |
| 54 | `MeansOfTransportID` | VSBED | Edm.String (2) | 运输方式标识 |
| 55 | `MileageIndicator` | ENTFERN | Edm.Decimal (5,1) | 里程指示符 |
| 56 | `MultipleDeliveryIsDefined` | SAMMG | Edm.Boolean | 是否定义多交货 |
| 57 | `NextInspectionDate` | N_INSP_AT | Edm.DateTime (DateTimeOffset) | 下次检查日期 |
| 58 | `OverallDelivConfdRltdProcgSts` | UEKTP | Edm.String (1) | 整体交货确认相关处理状态 |
| 59 | `OverallDeliveryReqdRltdPrcgSts` | UEKTA | Edm.String (1) | 整体交货要求相关处理状态 |
| 60 | `OverallGoodsMovementStatus` | UEKAV | Edm.String (1) | 整体货物移动状态 |
| 61 | `OverallPackingStatus` | UEKPK | Edm.String (1) | 整体包装状态 |
| 62 | `OverallPickingDate` | KOMPI_DAT | Edm.DateTime (DateTimeOffset) | 整体拣货日期 |
| 63 | `OverallPickingStatus` | UEKPI | Edm.String (1) | 整体拣货状态 |
| 64 | `OverallProofOfDeliveryStatus` | UEPOD | Edm.String (1) | 整体交货证明状态 |
| 65 | `OverallWarehouseActivityStatus` | UELAG | Edm.String (1) | 整体仓库活动状态 |
| 66 | `PaymentTerms` | ZTERM | Edm.String (4) | 付款条件 / Payment Terms |
| 67 | `PickingDate` | KODAT | Edm.DateTime (DateTimeOffset) | 拣货日期 / Picking Date |
| 68 | `PickingTime` | KOZET | Edm.Time | 拣货时间 / Picking Time |
| 69 | `PlannedGoodsIssueDate` | WADAT_PL | Edm.DateTime (DateTimeOffset) | 计划发货日期 |
| 70 | `PlannedGoodsIssueTime` | WAZET_PL | Edm.Time | 计划发货时间 |
| 71 | `ProofOfDeliveryDate` | PODAT | Edm.DateTime (DateTimeOffset) | 交货证明日期 |
| 72 | `ProofOfDeliveryTime` | POTIM | Edm.Time | 交货证明时间 |
| 73 | `ProposeDeliveryRoute` | ROUTE | Edm.String (6) | 建议交货路线 |
| 74 | `ReceivingPlant` | EMPST | Edm.String (4) | 收货工厂 / Receiving Plant |
| 75 | `ReturnsDelivery` | RETPO | Edm.Boolean | 退货交货 / Returns Delivery |
| 76 | `Route` | ROUTE | Edm.String (6) | 路线 / Route |
| 77 | `RouteSchedule` | FAHRT | Edm.String (4) | 路线日程 / Route Schedule |
| 78 | `SalesDistrict` | BZIRK | Edm.String (6) | 销售地区 / Sales District |
| 79 | `SalesOffice` | VKBUR | Edm.String (4) | 销售办公室 / Sales Office |
| 80 | `SalesOrganization` | VKORG | Edm.String (4) | 销售组织 / Sales Organization |
| 81 | `SDDocumentCategory` | VBTYP | Edm.String (1) | SD 单据类别 / SD Document Category |
| 82 | `SDDocumentCategoryText` | VTEXT_VBTYP | Edm.String (20) | SD 单据类别文本 |
| 83 | `SDDocumentType` | LFART | Edm.String (4) | 交货单据类型 / Delivery Type |
| 84 | `SDDocumentTypeText` | BEZEI_LFART | Edm.String (20) | 交货单据类型文本 |
| 85 | `Season` | SAISO | Edm.String (4) | 季节 / Season |
| 86 | `SeasonYear` | SAISJ | Edm.String (4) | 季节年份 / Season Year |
| 87 | `SelectionDate` | PLDAT | Edm.DateTime (DateTimeOffset) | 选择日期 / Selection Date |
| 88 | `ShipmentNumber` | TKNUM | Edm.String (10) | 装运编号 / Shipment Number |
| 89 | `ShippingCondition` | VSBED | Edm.String (2) | 运输条件 / Shipping Condition |
| 90 | `ShippingLocation` | ABLAD | Edm.String (25) | 发运地点 / Shipping Location |
| 91 | `ShippingPoint` | VSTEL | Edm.String (4) | 发货点 / Shipping Point |
| 92 | `ShippingType` | VSART | Edm.String (2) | 运输类型 / Shipping Type |
| 93 | `SoldToParty` | KUNAG | Edm.String (10) | 售达方 / Sold-To Party |
| 94 | `SoldToPartyName` | KUNNA | Edm.String (35) | 售达方名称 |
| 95 | `StatisticsDate` | STADT | Edm.DateTime (DateTimeOffset) | 统计日期 / Statistics Date |
| 96 | `StatisticsTime` | STATZ | Edm.Time | 统计时间 / Statistics Time |
| 97 | `TaxJurisdiction` | TXJCD | Edm.String (15) | 税务管辖 / Tax Jurisdiction |
| 98 | `TotalBlockStatus` | LIFSK | Edm.String (2) | 整体冻结状态 / Total Block Status |
| 99 | `TotalCreditCheckStatus` | KLFAC | Edm.String (1) | 整体信用检查状态 |
| 100 | `TransportationGroup` | TRAGR | Edm.String (4) | 运输组 / Transportation Group |
| 101 | `TransportationPlanningDate` | TPLDAT | Edm.DateTime (DateTimeOffset) | 运输计划日期 |
| 102 | `TransportationPlanningTime` | TPLZET | Edm.Time | 运输计划时间 |
| 103 | `UnloadingPointName` | ABLAD | Edm.String (25) | 卸货点名称 / Unloading Point |
| 104 | `VendorGoodsReceiptReference` | LIFNR | Edm.String (10) | 供应商收货参考 |
| 105 | `Warehouse` | LGNUM | Edm.String (3) | 仓库 / Warehouse |
| 106 | `WarehouseDoor` | LGTOR | Edm.String (3) | 仓库门 / Warehouse Door |
| 107 | `WarehouseGate` | LGBZO | Edm.String (3) | 仓库通道 / Warehouse Gate |
| 108 | `WarehouseStagingArea` | LGBZO | Edm.String (10) | 仓库待运区 |
| 109 | `WarehouseStagingAreaText` | LGBZOT | Edm.String (25) | 仓库待运区文本 |
| 110 | `ZeroStockIndicator` | NIFLG | Edm.Boolean | 零库存标识 |
---

### 2. A_OutbDeliveryItem — 行项目实体 / Item Entity

**关键字段 / Key**: `DeliveryDocument` (Edm.String), `DeliveryDocumentItem` (Edm.String) — 交货单号+项目号复合主键

**属性列表 / Properties** (≈130):

| # | 属性名 / Property Name | SAP 字段 | 类型 / Type | 描述 / Description |
|---|---|---|---|---|
| 1 | `DeliveryDocument` | VBELN | Edm.String (10) | 交货单号 / Delivery Document |
| 2 | `DeliveryDocumentItem` | POSNR | Edm.String (6) | 交货项目号 / Delivery Item |
| 3 | `ActualDeliveryQuantity` | LFIMG | Edm.Decimal (17,3) | 实际交货数量 |
| 4 | `Batch` | CHARG | Edm.String (10) | 批次 / Batch |
| 5 | `BatchBySupplier` | LIFNR_CHAR | Edm.String (10) | 供应商批次 |
| 6 | `BatchExpirationDate` | VFDAT | Edm.DateTime (DateTimeOffset) | 批次有效期 |
| 7 | `BatchGoodsMovementDate` | WADAT_CH | Edm.DateTime (DateTimeOffset) | 批次货物移动日期 |
| 8 | `BatchInStock` | BESTQ | Edm.String (1) | 批次库存标识 |
| 9 | `BillOfLading` | BOLNR | Edm.String (35) | 提单号 / Bill of Lading |
| 10 | `BusinessArea` | GSBER | Edm.String (4) | 业务范围 / Business Area |
| 11 | `BusinessAreaText` | GTEXT_GSBER | Edm.String (30) | 业务范围文本 |
| 12 | `CashDiscountPercentage1` | SKTPR1 | Edm.Decimal (4,3) | 现金折扣率1 |
| 13 | `CashDiscountPercentage2` | SKTPR2 | Edm.Decimal (4,3) | 现金折扣率2 |
| 14 | `CashDiscountPercentage3` | SKTPR3 | Edm.Decimal (4,3) | 现金折扣率3 |
| 15 | `CashDiscountDays1` | SKTDT1 | Edm.Decimal (3) | 现金折扣天数1 |
| 16 | `CashDiscountDays2` | SKTDT2 | Edm.Decimal (3) | 现金折扣天数2 |
| 17 | `CashDiscountDays3` | SKTDT3 | Edm.Decimal (3) | 现金折扣天数3 |
| 18 | `ConditionRateValue` | KBETR | Edm.Decimal (13,3) | 条件价格 / Condition Rate |
| 19 | `ConditionUnit` | KMEIN | Edm.String (3) | 条件单位 / Condition Unit |
| 20 | `ControllingArea` | KOKRS | Edm.String (4) | 控制范围 / Controlling Area |
| 21 | `CostCenter` | KOSTL | Edm.String (10) | 成本中心 / Cost Center |
| 22 | `CountryOfOrigin` | HERKL | Edm.String (3) | 原产国 / Country of Origin |
| 23 | `CreatedByUser` | ERNAM | Edm.String (12) | 创建者 / Created By |
| 24 | `CreationDate` | ERDAT | Edm.DateTime (DateTimeOffset) | 创建日期 / Created On |
| 25 | `CreationTime` | ERZET | Edm.Time | 创建时间 / Created At |
| 26 | `CustInventoryShortageInd` | FEHRS | Edm.String (1) | 客户库存短缺标识 |
| 27 | `CustomerGroup` | KDGRP | Edm.String (2) | 客户组 / Customer Group |
| 28 | `CustomerPaymentTerms` | KUNNR_ZTERM | Edm.String (4) | 客户付款条件 |
| 29 | `DelivConfdQtyInBaseUnit` | BSTMG | Edm.Decimal (17,3) | 基本单位已确认数量 |
| 30 | `DelivConfdQtyInDlvryUnit` | BSTME | Edm.Decimal (17,3) | 交货单位已确认数量 |
| 31 | `DelivConfdQtyInSalesUnit` | BSTMS | Edm.Decimal (17,3) | 销售单位已确认数量 |
| 32 | `DeliveryDocumentItemText` | POSEX | Edm.String (6) | 交货项目文本 |
| 33 | `DeliveryDocumentItemType` | PSTYV | Edm.String (4) | 交货项目类别 / Item Type |
| 34 | `DeliveryGroup` | GRKOR | Edm.String (3) | 交货组 / Delivery Group |
| 35 | `DeliveryNotesLanguage` | SPRAS | Edm.String (1) | 交货备注语言 |
| 36 | `DeliveryNotesLanguageIso` | SPRAS_ISO | Edm.String (2) | 交货备注语言(ISO) |
| 37 | `DeliveryNotesText` | LFNUM | Edm.String (50) | 交货备注文本 |
| 38 | `DeliveryPriority` | LPRIO | Edm.String (2) | 交货优先级 / Delivery Priority |
| 39 | `DeliveryQuantityUnit` | VRKME | Edm.String (3) | 交货数量单位 |
| 40 | `DeliveryQuantityUnitIso` | VRKME_ISO | Edm.String (3) | 交货数量单位(ISO) |
| 41 | `DeliveryVersion` | VERSION | Edm.String (4) | 交货版本 / Delivery Version |
| 42 | `DistributionChannel` | VTWEG | Edm.String (2) | 分销渠道 / Distribution Channel |
| 43 | `Division` | SPART | Edm.String (2) | 产品组 / Division |
| 44 | `DockAppointmentScheduledWindow` | ANKER | Edm.String (10) | 码头预约时间窗口 |
| 45 | `DockingLocation` | ANDCK | Edm.String (10) | 对接位置 / Docking Location |
| 46 | `DockingLocationType` | ANDCKTYP | Edm.String (2) | 对接位置类型 |
| 47 | `DocumentDate` | BSTDK | Edm.DateTime (DateTimeOffset) | 单据日期 / Document Date |
| 48 | `EmptiesBillingDocumentDate` | LEFKD | Edm.DateTime (DateTimeOffset) | 空瓶开票日期 |
| 49 | `EmptiesBillingDocumentInPr` | LEFKB | Edm.String (1) | 空瓶开票内部处理 |
| 50 | `ExchangeRateToDelivery` | KURST | Edm.Decimal (11,5) | 汇率 / Exchange Rate |
| 51 | `FiscalYear` | GJAHR | Edm.String (4) | 会计年度 / Fiscal Year |
| 52 | `ForeignReceivingPlant` | WEMPF | Edm.String (12) | 国外收货工厂 |
| 53 | `ForeignReceivingPlantName` | WEMPFT | Edm.String (35) | 国外收货工厂名称 |
| 54 | `GoodsIssueDate` | WADAT_IST | Edm.DateTime (DateTimeOffset) | 实际发货日期 |
| 55 | `GoodsIssueOrReceiptSlipNumb` | VBELN_VL | Edm.String (10) | 货物移动凭证号 |
| 56 | `GoodsIssueTime` | WAZET_IST | Edm.Time | 实际发货时间 |
| 57 | `GrossWeight` | BRGEW | Edm.Decimal (19,3) | 毛重 / Gross Weight |
| 58 | `HandlingUnitInStock` | HU_EXIST | Edm.Boolean | 处理单元在库存 |
| 59 | `HigherLevelItem` | UEPOS | Edm.String (6) | 上级项目 / Higher-Level Item |
| 60 | `IncotermsClassification` | INCO1 | Edm.String (3) | 国际贸易条款 |
| 61 | `IncotermsLocation1` | INCO2_L | Edm.String (70) | 条款地点1 |
| 62 | `IncotermsLocation2` | INCO2_U | Edm.String (70) | 条款地点2 |
| 63 | `InspectionHolidayIndicator` | INSP_HOL_FLG | Edm.String (1) | 检查假期标识 |
| 64 | `InspectionHolidayInDay` | INSP_HOL_DAY | Edm.String (2) | 检查假期日 |
| 65 | `InspectionHolidayInHour` | INSP_HOL_HOUR | Edm.String (2) | 检查假期时 |
| 66 | `InspectionHolidayInMinute` | INSP_HOL_MIN | Edm.String (2) | 检查假期分 |
| 67 | `InspectionHolidayInMonth` | INSP_HOL_MONTH | Edm.String (2) | 检查假期月 |
| 68 | `InspectionHolidayInSecond` | INSP_HOL_SEC | Edm.String (2) | 检查假期秒 |
| 69 | `InspectionHolidayInYear` | INSP_HOL_YEAR | Edm.String (4) | 检查假期年 |
| 70 | `InspectionLot` | INSP_LOT | Edm.String (12) | 检验批 / Inspection Lot |
| 71 | `InspectionLotText` | INSP_LOT_TXT | Edm.String (40) | 检验批文本 |
| 72 | `InternationalArticleNumber` | EANNR | Edm.String (18) | 国际商品编码 |
| 73 | `IsCompletelyDelivered` | COMPL_DEL | Edm.Boolean | 是否完全交货 |
| 74 | `IsDeleted` | LOEVO | Edm.Boolean | 删除标识 |
| 75 | `IsDeliveryConfdByExecSystem` | BSTAE | Edm.Boolean | 是否由执行系统交货确认 |
| 76 | `IsExportDelivery` | EXPVL | Edm.Boolean | 是否为出口交货 |
| 77 | `IsNotGoodsMovementsRelevant` | KZUMB | Edm.Boolean | 是否与货物移动无关 |
| 78 | `IsSplitted` | SPLIT | Edm.Boolean | 是否已拆分 |
| 79 | `IssuingPlant` | WERKS_AUS | Edm.String (4) | 发货工厂 / Issuing Plant |
| 80 | `IssuingPlantName` | WERKS_AUS_TXT | Edm.String (30) | 发货工厂名称 |
| 81 | `IssuingStorageBin` | LGPLA_AUS | Edm.String (10) | 发货仓储位 |
| 82 | `IssuingStorageLocation` | LGORT_AUS | Edm.String (4) | 发货库存地点 |
| 83 | `IssuingStorageLocationName` | LGORT_AUS_TXT | Edm.String (30) | 发货库存地点名称 |
| 84 | `ItemBillingIncoterms` | INCO1_ITEM | Edm.String (3) | 项目开票国际贸易条款 |
| 85 | `ItemBillingIncotermsLoc1` | INCO2_L_ITEM | Edm.String (70) | 项目开票条款地点1 |
| 86 | `ItemBillingIncotermsLoc2` | INCO2_U_ITEM | Edm.String (70) | 项目开票条款地点2 |
| 87 | `ItemBillingReference` | REFER | Edm.String (35) | 项目开票参考 |
| 88 | `ItemGrossWeight` | BRGEW_IT | Edm.Decimal (19,3) | 项目毛重 |
| 89 | `ItemNetWeight` | NTGEW_IT | Edm.Decimal (19,3) | 项目净重 |
| 90 | `ItemVolume` | VOLUM_IT | Edm.Decimal (19,3) | 项目体积 |
| 91 | `ItemVolumeUnit` | VOLEH_IT | Edm.String (3) | 项目体积单位 |
| 92 | `ItemWeightUnit` | GEWEI_IT | Edm.String (3) | 项目重量单位 |
| 93 | `LastChangeDate` | AEDAT | Edm.DateTime (DateTimeOffset) | 最后更改日期 |
| 94 | `LastChangeTime` | AEZET | Edm.Time | 最后更改时间 |
| 95 | `LoadingGroup` | LADEG | Edm.String (4) | 装运组 / Loading Group |
| 96 | `ManufacturingDate` | HERST_DAT | Edm.DateTime (DateTimeOffset) | 生产日期 |
| 97 | `ManufacturingPlant` | WERKS_HER | Edm.String (4) | 生产工厂 |
| 98 | `ManufacturingPlantName` | WERKS_HER_TXT | Edm.String (30) | 生产工厂名称 |
| 99 | `Material` | MATNR | Edm.String (40) | 物料号 / Material |
| 100 | `MaterialAccountAssignmentGroup` | KONGS | Edm.String (2) | 物料科目分配组 |
| 101 | `MaterialAccountAssignmentGroupText` | KONGST | Edm.String (20) | 物料科目分配组文本 |
| 102 | `MaterialByCustomer` | KDMAT | Edm.String (35) | 客户物料号 |
| 103 | `MaterialExternalID` | MATNRE | Edm.String (18) | 物料外部标识 |
| 104 | `MaterialFiscalYear` | MATNR_GJAHR | Edm.String (4) | 物料会计年度 |
| 105 | `MaterialGoodsReceiptGroup` | WGMG | Edm.String (2) | 物料收货组 |
| 106 | `MaterialGoodsReceiptGroupText` | WGMGT | Edm.String (20) | 物料收货组文本 |
| 107 | `MaterialGroup` | MATKL | Edm.String (9) | 物料组 / Material Group |
| 108 | `MaterialGroupText` | MATKLT | Edm.String (20) | 物料组文本 |
| 109 | `MaterialID` | MATNR_INT | Edm.String (40) | 物料内部标识 |
| 110 | `MaterialInternationalArticleNumber` | EANNR | Edm.String (18) | 物料国际商品编码 |
| 111 | `MaterialIsLocked` | MAT_LOCK | Edm.Boolean | 物料已锁定 |
| 112 | `MaterialIsLockedText` | MAT_LOCK_T | Edm.String (40) | 物料锁定文本 |
| 113 | `MaterialPricingGroup` | KONDM | Edm.String (2) | 物料定价组 |
| 114 | `MaterialPricingGroupText` | KONDMT | Edm.String (20) | 物料定价组文本 |
| 115 | `MaterialRevisionLevel` | REVLV | Edm.String (2) | 物料版本级别 |
| 116 | `MaterialVolume` | VOLUM_MAT | Edm.Decimal (19,3) | 物料体积 |
| 117 | `MaterialVolumeUnit` | VOLEH_MAT | Edm.String (3) | 物料体积单位 |
| 118 | `MaterialWeightUnit` | GEWEI_MAT | Edm.String (3) | 物料重量单位 |
| 119 | `MeansOfTransport` | VSART | Edm.String (2) | 运输方式 |
| 120 | `MeansOfTransportID` | VSBED | Edm.String (2) | 运输方式标识 |
| 121 | `NetWeight` | NTGEW | Edm.Decimal (19,3) | 净重 / Net Weight |
| 122 | `NextInspectionDate` | N_INSP_AT | Edm.DateTime (DateTimeOffset) | 下次检查日期 |
| 123 | `NoCashDiscount` | SKTOF | Edm.Boolean | 无现金折扣 |
| 124 | `OverdeliveryToleranceLimit` | UEBTO | Edm.Decimal (5,1) | 过量交货容差限制 |
| 125 | `OverdeliveryTolerancePct` | UEBTK | Edm.Decimal (3,1) | 过量交货容差百分比 |
| 126 | `PackagingMaterial` | PACKMAT | Edm.String (40) | 包装物料 |
| 127 | `PackagingMaterialText` | PACKMAT_T | Edm.String (40) | 包装物料文本 |
| 128 | `PartialDeliveryIsAllowed` | LGPBE | Edm.Boolean | 允许部分交货 |
| 129 | `PickingConfirmation` | KOMBI | Edm.String (1) | 拣货确认 |
| 130 | `PickingConfirmationText` | KOMBIT | Edm.String (20) | 拣货确认文本 |
| 131 | `PickingDate` | KODAT | Edm.DateTime (DateTimeOffset) | 拣货日期 |
| 132 | `PickingRejectionReason` | NO_PI_REAS | Edm.String (2) | 拣货拒绝原因 |
| 133 | `PickingRejectionReasonText` | NO_PI_REAST | Edm.String (40) | 拣货拒绝原因文本 |
| 134 | `PickingTime` | KOZET | Edm.Time | 拣货时间 |
| 135 | `PlannedDeliveryDate` | LFDAT_PL | Edm.DateTime (DateTimeOffset) | 计划交货日期 |
| 136 | `PlannedGoodsIssueDate` | WADAT_PL | Edm.DateTime (DateTimeOffset) | 计划发货日期 |
| 137 | `PlannedGoodsIssueTime` | WAZET_PL | Edm.Time | 计划发货时间 |
| 138 | `Plant` | WERKS | Edm.String (4) | 工厂 / Plant |
| 139 | `PlantBatch` | CHARG_PL | Edm.String (10) | 工厂批次 |
| 140 | `PlantName` | WERKS_TXT | Edm.String (30) | 工厂名称 |
---

### 3. A_OutbDeliveryPartner — 合作伙伴实体 / Partner Entity

**关键字段 / Key**: `DeliveryDocument` (Edm.String), `PartnerFunction` (Edm.String), `PartnerNumber` (Edm.String)

**属性列表 / Properties**:

| # | 属性名 | SAP 字段 | 类型 | 描述 |
|---|---|---|---|---|
| 1 | `DeliveryDocument` | VBELN | Edm.String (10) | 交货单号 |
| 2 | `PartnerFunction` | PARVW | Edm.String (2) | 合作伙伴功能 / Partner Function |
| 3 | `PartnerNumber` | KUNNR | Edm.String (10) | 合作伙伴编号 |
| 4 | `CustomerName` | NAME1 | Edm.String (35) | 客户名称 / Customer Name |
| 5 | `CreationDate` | ERDAT | Edm.DateTime (DateTimeOffset) | 创建日期 |
| 6 | `CreationTime` | ERZET | Edm.Time | 创建时间 |
| 7 | `LastChangeDate` | AEDAT | Edm.DateTime (DateTimeOffset) | 最后更改日期 |
| 8 | `LastChangeTime` | AEZET | Edm.Time | 最后更改时间 |
| 9 | `IsDeleted` | LOEVO | Edm.Boolean | 删除标识 |
| 10 | `PartnerName` | NAME1 | Edm.String (35) | 合作伙伴名称 |
| 11 | `PartnerFunctionText` | PARVWT | Edm.String (30) | 合作伙伴功能文本 |

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

| 功能码 | 含义 | 英文描述 |
|---|---|---|
| `AG` | 售达方 | Sold-to Party |
| `WE` | 收达方 | Ship-to Party |
| `RE` | 付款方 | Payer |
| `RG` | 收货方 | Bill-to Party |
| `SP` | 承运方 | Carrier |
| `LI` | 供货方 | Vendor |

---

### 4. A_OutbDeliveryHeaderText — 抬头文本实体 / Header Text Entity

**关键字段 / Key**: `DeliveryDocument` (Edm.String), `Language` (Edm.String), `LongTextID` (Edm.String)

**属性列表 / Properties**:

| # | 属性名 | SAP 字段 | 类型 | 描述 |
|---|---|---|---|---|
| 1 | `DeliveryDocument` | VBELN | Edm.String (10) | 交货单号 |
| 2 | `Language` | SPRAS | Edm.String (1) | 语言代码 / Language |
| 3 | `LanguageIso` | SPRAS_ISO | Edm.String (2) | 语言代码(ISO) |
| 4 | `LongTextID` | TDID | Edm.String (4) | 长文本标识 / Long Text ID |
| 5 | `LongText` | TDLINE | Edm.String (132) | 长文本内容 / Long Text Content |
| 6 | `CreationDate` | ERDAT | Edm.DateTime (DateTimeOffset) | 创建日期 |
| 7 | `CreatedByUser` | ERNAM | Edm.String (12) | 创建者 |

---

### 5. A_OutbDeliveryItemText — 行项目文本实体 / Item Text Entity

**关键字段 / Key**: `DeliveryDocument` (Edm.String), `DeliveryDocumentItem` (Edm.String), `Language` (Edm.String), `LongTextID` (Edm.String)

**属性列表 / Properties**:

| # | 属性名 | SAP 字段 | 类型 | 描述 |
|---|---|---|---|---|
| 1 | `DeliveryDocument` | VBELN | Edm.String (10) | 交货单号 |
| 2 | `DeliveryDocumentItem` | POSNR | Edm.String (6) | 交货项目号 |
| 3 | `Language` | SPRAS | Edm.String (1) | 语言代码 |
| 4 | `LanguageIso` | SPRAS_ISO | Edm.String (2) | 语言代码(ISO) |
| 5 | `LongTextID` | TDID | Edm.String (4) | 长文本标识 |
| 6 | `LongText` | TDLINE | Edm.String (132) | 长文本内容 |
| 7 | `CreationDate` | ERDAT | Edm.DateTime (DateTimeOffset) | 创建日期 |
| 8 | `CreatedByUser` | ERNAM | Edm.String (12) | 创建者 |

---

### 6. A_OutbDeliveryHeaderAddress — 抬头地址实体 / Header Address Entity

**关键字段 / Key**: `DeliveryDocument` (Edm.String), `AddressID` (Edm.String)

**属性列表 / Properties**:

| # | 属性名 | SAP 字段 | 类型 | 描述 |
|---|---|---|---|---|
| 1 | `DeliveryDocument` | VBELN | Edm.String (10) | 交货单号 |
| 2 | `AddressID` | ADRNR | Edm.String (10) | 地址编号 / Address Number |
| 3 | `Country` | LAND1 | Edm.String (3) | 国家/地区 / Country |
| 4 | `Region` | REGIO | Edm.String (3) | 地区 / Region |
| 5 | `StreetName` | STRAS | Edm.String (60) | 街道名称 / Street |
| 6 | `StreetPrefix` | STRT_SUP | Edm.String (40) | 街道前缀 |
| 7 | `StreetSuffix` | STRT_ABBR | Edm.String (40) | 街道后缀 |
| 8 | `HouseNumber` | HAUSN | Edm.String (10) | 门牌号 / House Number |
| 9 | `PostalCode` | PLZ | Edm.String (10) | 邮政编码 / Postal Code |
| 10 | `CityName` | ORT01 | Edm.String (35) | 城市 / City |
| 11 | `District` | ORT02 | Edm.String (35) | 区 / District |
| 12 | `Building` | BUILD | Edm.String (10) | 建筑 / Building |
| 13 | `Floor` | STOCK | Edm.String (3) | 楼层 / Floor |
| 14 | `RoomNumber` | ROOMN | Edm.String (8) | 房间号 / Room |
| 15 | `PhoneNumber` | TELNR | Edm.String (30) | 电话号码 |
| 16 | `MobileNumber` | MOBIL | Edm.String (30) | 手机号码 |
| 17 | `FaxNumber` | FAXNR | Edm.String (30) | 传真号码 |
| 18 | `EmailAddress` | SMTP | Edm.String (241) | 电子邮件 |
| 19 | `CorrespondenceLanguage` | SPRAS | Edm.String (1) | 通信语言 |
| 20 | `FullName` | NAME1 | Edm.String (40) | 全名 |
| 21 | `CareOfName` | ORT02 | Edm.String (35) | 收件人 / Care Of |
| 22 | `TimeZone` | TZONE | Edm.String (6) | 时区 / Time Zone |
| 23 | `TransportationZone` | ZONE1 | Edm.String (10) | 运输区 |
| 24 | `Longitude` | LONGITUDE | Edm.Decimal (10,7) | 经度 / Longitude |
| 25 | `Latitude` | LATITUDE | Edm.Decimal (10,7) | 纬度 / Latitude |
| 26 | `BuildingPrefix` | ADDR_PREF | Edm.String (20) | 建筑前缀 |
| 27 | `BuildingSuffix` | ADDR_SUFF | Edm.String (20) | 建筑后缀 |

---

### 7. A_OutbDeliveryItemAddress — 行项目地址实体 / Item Address Entity

**关键字段 / Key**: `DeliveryDocument` (Edm.String), `DeliveryDocumentItem` (Edm.String), `AddressID` (Edm.String)

与 `A_OutbDeliveryHeaderAddress` 结构相同，增加 `DeliveryDocumentItem` 作为复合键的一部分。

**属性列表 / Properties**: 同 HeaderAddress，增加：

| # | 属性名 | 类型 | 描述 |
|---|---|---|---|
| 1 | `DeliveryDocument` | Edm.String (10) | 交货单号 |
| 2 | `DeliveryDocumentItem` | Edm.String (6) | 交货项目号 |
| 3 | `AddressID` | Edm.String (10) | 地址编号 |
| 4–27 | (同 HeaderAddress 属性) | | |

---

### 8. A_OutbDeliverySerialNumber — 序列号实体 / Serial Number Entity

**关键字段 / Key**: `DeliveryDocument` (Edm.String), `DeliveryDocumentItem` (Edm.String), `SerialNumber` (Edm.String)

**属性列表 / Properties**:

| # | 属性名 | SAP 字段 | 类型 | 描述 |
|---|---|---|---|---|
| 1 | `DeliveryDocument` | VBELN | Edm.String (10) | 交货单号 |
| 2 | `DeliveryDocumentItem` | POSNR | Edm.String (6) | 交货项目号 |
| 3 | `SerialNumber` | SERNR | Edm.String (18) | 序列号 / Serial Number |
| 4 | `Material` | MATNR | Edm.String (40) | 物料号 |
| 5 | `Batch` | CHARG | Edm.String (10) | 批次 |
| 6 | `CreationDate` | ERDAT | Edm.DateTime (DateTimeOffset) | 创建日期 |
| 7 | `CreationTime` | ERZET | Edm.Time | 创建时间 |
| 8 | `LastChangeDate` | AEDAT | Edm.DateTime (DateTimeOffset) | 最后更改日期 |
| 9 | `LastChangeTime` | AEZET | Edm.Time | 最后更改时间 |
| 10 | `IsDeleted` | LOEVO | Edm.Boolean | 删除标识 |
| 11 | `SerialNumberDescription` | SERNR_OBJ | Edm.String (40) | 序列号描述 |
| 12 | `SerializationManagement` | SERAIL | Edm.String (1) | 序列化管理 |
| 13 | `SerializationManagementText` | SERAIL_TXT | Edm.String (40) | 序列化管理文本 |
| 14 | `HandlingUnitExternalID` | HUEXTID | Edm.String (20) | 处理单元外部ID |
| 15 | `Quantity` | MENGE | Edm.Decimal (17,3) | 数量 / Quantity |

---

### 9. A_OutbDeliveryHandlingUnit — 抬头处理单元实体 / Header Handling Unit Entity

**关键字段 / Key**: `HandlingUnitExternalID` (Edm.String), `DeliveryDocument` (Edm.String)

**属性列表 / Properties**:

| # | 属性名 | SAP 字段 | 类型 | 描述 |
|---|---|---|---|---|
| 1 | `HandlingUnitExternalID` | HUEXTID | Edm.String (20) | 处理单元外部标识 / HU External ID |
| 2 | `DeliveryDocument` | VBELN | Edm.String (10) | 交货单号 |
| 3 | `HandlingUnitType` | HUTYP | Edm.String (4) | 处理单元类型 / HU Type |
| 4 | `HandlingUnitTypeText` | HUTYPT | Edm.String (40) | 处理单元类型文本 |
| 5 | `CreationDate` | ERDAT | Edm.DateTime (DateTimeOffset) | 创建日期 |
| 6 | `CreationTime` | ERZET | Edm.Time | 创建时间 |
| 7 | `LastChangeDate` | AEDAT | Edm.DateTime (DateTimeOffset) | 最后更改日期 |
| 8 | `LastChangeTime` | AEZET | Edm.Time | 最后更改时间 |
| 9 | `IsDeleted` | LOEVO | Edm.Boolean | 删除标识 |
| 10 | `GrossWeight` | BRGEW | Edm.Decimal (19,3) | 毛重 / Gross Weight |
| 11 | `NetWeight` | NTGEW | Edm.Decimal (19,3) | 净重 / Net Weight |
| 12 | `Volume` | VOLUM | Edm.Decimal (19,3) | 体积 / Volume |
| 13 | `WeightUnit` | GEWEI | Edm.String (3) | 重量单位 / Weight Unit |
| 14 | `VolumeUnit` | VOLEH | Edm.String (3) | 体积单位 / Volume Unit |
| 15 | `Length` | LAENG | Edm.Decimal (13,3) | 长度 / Length |
| 16 | `Width` | BREIT | Edm.Decimal (13,3) | 宽度 / Width |
| 17 | `Height` | HOEHE | Edm.Decimal (13,3) | 高度 / Height |
| 18 | `MeasurementUnit` | MEABM | Edm.String (3) | 尺寸单位 / Measurement Unit |
| 19 | `PackingStatus` | PKSTA | Edm.String (1) | 包装状态 / Packing Status |
| 20 | `PackingStatusText` | PKSTAT | Edm.String (40) | 包装状态文本 |
| 21 | `ShipmentNumber` | TKNUM | Edm.String (10) | 装运编号 / Shipment Number |
| 22 | `ShipmentItem` | TPNUM | Edm.String (6) | 装运项目 / Shipment Item |
| 23 | `HandlingUnitDescription` | HUBEZ | Edm.String (40) | 处理单元描述 / HU Description |
| 24 | `WarehouseNumber` | LGNUM | Edm.String (3) | 仓库号 / Warehouse Number |
| 25 | `StorageBin` | LGPLA | Edm.String (10) | 仓储位 / Storage Bin |

---

### 10. A_OutbDeliveryItemHandlingUnit — 行项目处理单元实体 / Item Handling Unit Entity

**关键字段 / Key**: `DeliveryDocument` (Edm.String), `DeliveryDocumentItem` (Edm.String), `HandlingUnitExternalID` (Edm.String)

**属性列表 / Properties**:

| # | 属性名 | SAP 字段 | 类型 | 描述 |
|---|---|---|---|---|
| 1 | `DeliveryDocument` | VBELN | Edm.String (10) | 交货单号 |
| 2 | `DeliveryDocumentItem` | POSNR | Edm.String (6) | 交货项目号 |
| 3 | `HandlingUnitExternalID` | HUEXTID | Edm.String (20) | 处理单元外部标识 |
| 4 | `ActualDeliveryQuantity` | LFIMG | Edm.Decimal (17,3) | 实际交货数量 |
| 5 | `DeliveryQuantityUnit` | VRKME | Edm.String (3) | 交货数量单位 |
| 6 | `BaseUnit` | MEINS | Edm.String (3) | 基本计量单位 |
| 7 | `QuantityInBaseUnit` | BSTMG | Edm.Decimal (17,3) | 基本单位数量 |
| 8 | `Material` | MATNR | Edm.String (40) | 物料号 |
| 9 | `Batch` | CHARG | Edm.String (10) | 批次 |
| 10 | `CreationDate` | ERDAT | Edm.DateTime (DateTimeOffset) | 创建日期 |
| 11 | `CreationTime` | ERZET | Edm.Time | 创建时间 |
| 12 | `IsDeleted` | LOEVO | Edm.Boolean | 删除标识 |
| 13 | `IsPackedCompletely` | GANZE | Edm.Boolean | 是否完全包装 |
| 14 | `PackingStatus` | PKSTA | Edm.String (1) | 包装状态 |
| 15 | `PackingStatusText` | PKSTAT | Edm.String (40) | 包装状态文本 |
| 16 | `PackingGroup` | PKGRP | Edm.String (6) | 包装组 |
| 17 | `HigherLevelHU` | HUE | Edm.String (20) | 上级处理单元 |
| 18 | `HandlingUnitDescription` | HUBEZ | Edm.String (40) | 处理单元描述 |
---

## 端点与 CRUD 操作 / Endpoints & CRUD Operations

### 端点总览 / Endpoint Summary

| 方法 / Method | 路径 / Path | 描述 / Description |
|---|---|---|
| **GET** | `/A_OutbDeliveryHeader` | 读取抬头列表 |
| **GET** | `/A_OutbDeliveryHeader('{DeliveryDocument}')` | 读取单个抬头 |
| **POST** | `/A_OutbDeliveryHeader` | 创建抬头（支持 Deep Insert） |
| **PATCH** | `/A_OutbDeliveryHeader('{DeliveryDocument}')` | 更新抬头 |
| **DELETE** | `/A_OutbDeliveryHeader('{DeliveryDocument}')` | 删除抬头 |
| **GET** | `/A_OutbDeliveryItem` | 读取行项目列表 |
| **GET** | `/A_OutbDeliveryItem(DeliveryDocument='{doc}',DeliveryDocumentItem='{item}')` | 读取单个行项目 |
| **POST** | `/A_OutbDeliveryItem` | 创建行项目 |
| **PATCH** | `/A_OutbDeliveryItem(DeliveryDocument='{doc}',DeliveryDocumentItem='{item}')` | 更新行项目 |
| **DELETE** | `/A_OutbDeliveryItem(DeliveryDocument='{doc}',DeliveryDocumentItem='{item}')` | 删除行项目 |
| **GET** | `/A_OutbDeliveryPartner` | 读取合作伙伴列表 |
| **POST** | `/A_OutbDeliveryPartner` | 创建合作伙伴 |
| **PATCH** | `/A_OutbDeliveryPartner(DeliveryDocument='{doc}',PartnerFunction='{func}',PartnerNumber='{num}')` | 更新合作伙伴 |
| **DELETE** | `/A_OutbDeliveryPartner(DeliveryDocument='{doc}',PartnerFunction='{func}',PartnerNumber='{num}')` | 删除合作伙伴 |
| **GET** | `/A_OutbDeliveryHeaderText` | 读取抬头文本列表 |
| **POST** | `/A_OutbDeliveryHeaderText` | 创建抬头文本 |
| **PATCH** | `/A_OutbDeliveryHeaderText(DeliveryDocument='{doc}',Language='{lang}',LongTextID='{id}')` | 更新抬头文本 |
| **GET** | `/A_OutbDeliveryItemText` | 读取行项目文本列表 |
| **POST** | `/A_OutbDeliveryItemText` | 创建行项目文本 |
| **GET** | `/A_OutbDeliverySerialNumber` | 读取序列号列表 |
| **POST** | `/A_OutbDeliverySerialNumber` | 创建序列号 |
| **DELETE** | `/A_OutbDeliverySerialNumber(DeliveryDocument='{doc}',DeliveryDocumentItem='{item}',SerialNumber='{sn}')` | 删除序列号 |
| **GET** | `/A_OutbDeliveryHandlingUnit` | 读取处理单元列表 |
| **POST** | `/A_OutbDeliveryHandlingUnit` | 创建处理单元 |
| **PATCH** | `/A_OutbDeliveryHandlingUnit(HandlingUnitExternalID='{hu}',DeliveryDocument='{doc}')` | 更新处理单元 |
| **DELETE** | `/A_OutbDeliveryHandlingUnit(HandlingUnitExternalID='{hu}',DeliveryDocument='{doc}')` | 删除处理单元 |
| **GET** | `/A_OutbDeliveryItemHandlingUnit` | 读行项目处理单元列表 |
| **POST** | `/A_OutbDeliveryItemHandlingUnit` | 创建行项目处理单元 |
| **DELETE** | `/A_OutbDeliveryItemHandlingUnit(DeliveryDocument='{doc}',DeliveryDocumentItem='{item}',HandlingUnitExternalID='{hu}')` | 删除行项目处理单元 |

### 请求与响应示例 / Request & Response Examples

#### 示例 1: 读取抬头列表 (GET)
```http
GET /sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader
?$top=10&$select=DeliveryDocument,DeliveryDate,OverallGoodsMovementStatus,SoldToParty
&$orderby=CreationDate desc
&$format=json HTTP/1.1
Host: {host}
Authorization: Bearer {access_token}
Accept: application/json
```

```json
{
  "d": {
    "results": [
      {
        "__metadata": {
          "id": "https://{host}/sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader('0080000001')",
          "uri": "https://{host}/sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader('0080000001')",
          "type": "API_OUTBOUND_DELIVERY_SRV.A_OutbDeliveryHeader",
          "etag": "W/\"datetimeoffset'2024-06-15T14%3A30%3A00Z'\""
        },
        "DeliveryDocument": "0080000001",
        "DeliveryDate": "/Date(1718467200000)/",
        "OverallGoodsMovementStatus": "C",
        "SoldToParty": "0010001001"
      }
    ]
  }
}
```

#### 示例 2: 读取单个抬头包含行项目 (GET with Expand)
```http
GET /sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader('0080000001')
?$expand=to_Item,to_Partner,to_Text
&$format=json HTTP/1.1
Host: {host}
Authorization: Bearer {access_token}
```

```json
{
  "d": {
    "__metadata": {
      "id": "https://{host}/sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader('0080000001')",
      "uri": "https://{host}/sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader('0080000001')",
      "type": "API_OUTBOUND_DELIVERY_SRV.A_OutbDeliveryHeader",
      "etag": "W/\"datetimeoffset'2024-06-15T14%3A30%3A00Z'\""
    },
    "DeliveryDocument": "0080000001",
    "DeliveryDate": "/Date(1718467200000)/",
    "ShippingPoint": "PL01",
    "OverallGoodsMovementStatus": "C",
    "to_Item": {
      "results": [
        {
          "DeliveryDocument": "0080000001",
          "DeliveryDocumentItem": "000010",
          "Material": "M-1001",
          "ActualDeliveryQuantity": "10.000",
          "DeliveryQuantityUnit": "PC"
        },
        {
          "DeliveryDocument": "0080000001",
          "DeliveryDocumentItem": "000020",
          "Material": "M-1002",
          "ActualDeliveryQuantity": "5.000",
          "DeliveryQuantityUnit": "PC"
        }
      ]
    },
    "to_Partner": {
      "results": [
        {
          "PartnerFunction": "AG",
          "PartnerNumber": "0010001001",
          "CustomerName": "ACME Corp"
        },
        {
          "PartnerFunction": "WE",
          "PartnerNumber": "0010001001",
          "CustomerName": "ACME Corp"
        }
      ]
    },
    "to_Text": {
      "results": [
        {
          "Language": "E",
          "LongTextID": "Z001",
          "LongText": "Priority delivery - handle with care"
        }
      ]
    }
  }
}
```

#### 示例 3: 创建抬头含行项目 — Deep Insert (POST)
```http
POST /sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader HTTP/1.1
Host: {host}
Authorization: Bearer {access_token}
Content-Type: application/json
x-csrf-token: {fetch_token}
```

```json
{
  "DeliveryDocument": "",
  "DeliveryDocumentBySupplier": "DEL-2024-001",
  "DeliveryDate": "/Date(1718467200000)/",
  "ShippingPoint": "PL01",
  "SoldToParty": "0010001001",
  "to_Item": {
    "results": [
      {
        "DeliveryDocumentItem": "000010",
        "Material": "M-1001",
        "ActualDeliveryQuantity": "10.000",
        "DeliveryQuantityUnit": "PC",
        "Plant": "PL01",
        "StorageLocation": "SL01"
      },
      {
        "DeliveryDocumentItem": "000020",
        "Material": "M-1002",
        "ActualDeliveryQuantity": "5.000",
        "DeliveryQuantityUnit": "PC",
        "Plant": "PL01",
        "StorageLocation": "SL01"
      }
    ]
  },
  "to_Partner": {
    "results": [
      {
        "PartnerFunction": "AG",
        "PartnerNumber": "0010001001"
      },
      {
        "PartnerFunction": "WE",
        "PartnerNumber": "0010001001"
      }
    ]
  },
  "to_Text": {
    "results": [
      {
        "Language": "E",
        "LongTextID": "Z001",
        "LongText": "Priority delivery - handle with care"
      }
    ]
  }
}
```

```json
// 响应 / Response (201 Created)
{
  "d": {
    "__metadata": {
      "id": "https://{host}/sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader('0080000002')",
      "uri": "https://{host}/sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader('0080000002')",
      "type": "API_OUTBOUND_DELIVERY_SRV.A_OutbDeliveryHeader",
      "etag": "W/\"datetimeoffset'2024-06-15T15%3A00%3A00Z'\""
    },
    "DeliveryDocument": "0080000002",
    "DeliveryDate": "/Date(1718467200000)/",
    "DeliveryDocumentBySupplier": "DEL-2024-001",
    "ShippingPoint": "PL01",
    "SoldToParty": "0010001001"
  }
}
```

#### 示例 4: 更新抬头 (PATCH)
```http
PATCH /sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader('0080000001') HTTP/1.1
Host: {host}
Authorization: Bearer {access_token}
Content-Type: application/json
If-Match: W/"datetimeoffset'2024-06-15T14%3A30%3A00Z'"
x-csrf-token: {fetch_token}
```

```json
{
  "DeliveryDate": "/Date(1718553600000)/",
  "ShippingPoint": "PL02",
  "DeliveryBlockReason": "01"
}
```

#### 示例 5: 删除抬头 (DELETE)
```http
DELETE /sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader('0080000001') HTTP/1.1
Host: {host}
Authorization: Bearer {access_token}
If-Match: W/"datetimeoffset'2024-06-15T14%3A30%3A00Z'"
x-csrf-token: {fetch_token}
```

#### 示例 6: 创建行项目 (POST)
```http
POST /sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryItem HTTP/1.1
Host: {host}
Authorization: Bearer {access_token}
Content-Type: application/json
x-csrf-token: {fetch_token}
```

```json
{
  "DeliveryDocument": "0080000001",
  "DeliveryDocumentItem": "000030",
  "Material": "M-1003",
  "ActualDeliveryQuantity": "2.000",
  "DeliveryQuantityUnit": "PC",
  "Plant": "PL01",
  "StorageLocation": "SL01"
}
```

#### 示例 7: $filter 查询 — 按状态筛选
```http
GET /sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader
?$filter=OverallGoodsMovementStatus eq 'A' and DeliveryDate ge datetime'2024-06-01T00:00:00'
&$select=DeliveryDocument,DeliveryDate,OverallGoodsMovementStatus
&$format=json HTTP/1.1
Host: {host}
Authorization: Bearer {access_token}
```

#### 示例 8: 分页查询 — 服务器端分页
```http
GET /sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader
?$top=50&$skip=100&$inlinecount=allpages HTTP/1.1
Host: {host}
Authorization: Bearer {access_token}
```

```json
{
  "d": {
    "results": [ ... ],
    "__next": "https://{host}/sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader?$skiptoken=100",
    "__count": "500"
  }
}
```

---

## 操作 / Actions

本 API 提供 4 个自定义 OData Action，用于执行拣货确认、处理单元分配和序列号添加等业务操作。

This API provides 4 custom OData Actions for picking confirmation, handling unit assignment, and serial number addition.

---

### Action 1: AddSerialNumberToDeliveryItem

**描述 / Description**: 为指定交货行项目添加序列号 / Add serial numbers to a delivery item

| 项目 / Item | 值 / Value |
|---|---|
| **HTTP 方法** | **POST** |
| **路径** | `/A_OutbDeliveryItem(DeliveryDocument='{doc}',DeliveryDocumentItem='{item}')/AddSerialNumberToDeliveryItem` |
| **绑定实体** | `A_OutbDeliveryItem` |

**请求参数 / Request Parameters**:

| 参数 | 类型 | 必需 | 描述 |
|---|---|---|---|
| `SerialNumber` | Edm.String (18) | 是 | 序列号 |
| `Quantity` | Edm.Decimal (17,3) | 否 | 数量 |
| `Batch` | Edm.String (10) | 否 | 批次 |
| `HandlingUnitExternalID` | Edm.String (20) | 否 | 处理单元外部标识 |

**请求示例 / Request Example**:
```http
POST /sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryItem(DeliveryDocument='0080000001',DeliveryDocumentItem='000010')/AddSerialNumberToDeliveryItem HTTP/1.1
Host: {host}
Authorization: Bearer {access_token}
Content-Type: application/json
x-csrf-token: {fetch_token}
```

```json
{
  "SerialNumber": "SN-2024-00001",
  "Quantity": "1.000",
  "Batch": "BATCH-001"
}
```

**响应 / Response**: `204 No Content`

---

### Action 2: AssignHandlingUnitToDelivery

**描述 / Description**: 为交货单分配处理单元 / Assign a handling unit to a delivery

| 项目 / Item | 值 / Value |
|---|---|
| **HTTP 方法** | **POST** |
| **路径** | `/A_OutbDeliveryHeader('{DeliveryDocument}')/AssignHandlingUnitToDelivery` |
| **绑定实体** | `A_OutbDeliveryHeader` |

**请求参数 / Request Parameters**:

| 参数 | 类型 | 必需 | 描述 |
|---|---|---|---|
| `HandlingUnitExternalID` | Edm.String (20) | 是 | 处理单元外部标识 |
| `DeliveryDocumentItem` | Edm.String (6) | 是 | 交货行项目号 |
| `ActualDeliveryQuantity` | Edm.Decimal (17,3) | 否 | 实际交货数量 |
| `DeliveryQuantityUnit` | Edm.String (3) | 否 | 交货数量单位 |

**请求示例 / Request Example**:
```http
POST /sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader('0080000001')/AssignHandlingUnitToDelivery HTTP/1.1
Host: {host}
Authorization: Bearer {access_token}
Content-Type: application/json
x-csrf-token: {fetch_token}
```

```json
{
  "HandlingUnitExternalID": "HU-2024-00001",
  "DeliveryDocumentItem": "000010",
  "ActualDeliveryQuantity": "10.000",
  "DeliveryQuantityUnit": "PC"
}
```

**响应 / Response**: `204 No Content`

---

### Action 3: ConfirmPickingAllItems

**描述 / Description**: 确认交货单所有行项目的拣货 / Confirm picking for all items in a delivery

| 项目 / Item | 值 / Value |
|---|---|
| **HTTP 方法** | **POST** |
| **路径** | `/A_OutbDeliveryHeader('{DeliveryDocument}')/ConfirmPickingAllItems` |
| **绑定实体** | `A_OutbDeliveryHeader` |

**请求参数 / Request Parameters**: 无 / None

**请求示例 / Request Example**:
```http
POST /sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader('0080000001')/ConfirmPickingAllItems HTTP/1.1
Host: {host}
Authorization: Bearer {access_token}
x-csrf-token: {fetch_token}
```

```json
{}
```

**响应 / Response**: `204 No Content`

---

### Action 4: ConfirmPickingOneItem

**描述 / Description**: 确认单个行项目的拣货 / Confirm picking for one specific item in a delivery

| 项目 / Item | 值 / Value |
|---|---|
| **HTTP 方法** | **POST** |
| **路径** | `/A_OutbDeliveryItem(DeliveryDocument='{doc}',DeliveryDocumentItem='{item}')/ConfirmPickingOneItem` |
| **绑定实体** | `A_OutbDeliveryItem` |

**请求参数 / Request Parameters**: 无 / None

**请求示例 / Request Example**:
```http
POST /sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryItem(DeliveryDocument='0080000001',DeliveryDocumentItem='000010')/ConfirmPickingOneItem HTTP/1.1
Host: {host}
Authorization: Bearer {access_token}
x-csrf-token: {fetch_token}
```

```json
{}
```

**响应 / Response**: `204 No Content`

---

## 注意事项 / Important Notes

### 1. 认证与授权 / Authentication & Authorization

- **认证方式**: **OAuth 2.0** (Client Credentials Grant)
  - 需提供 `client_id`, `client_secret`, `token_url`
  - 获取 access_token 后在每个请求的 `Authorization: Bearer {token}` 头中传递
- **Scope**: 需申请 API 相关 scope，通常为 `API_OUTBOUND_DELIVERY_SRV_0002`
- **授权**: 基于 SAP S/4HANA 的授权对象（如 `V_VBUK_VKO`）进行细粒度控制

### 2. CSRF 防护 / CSRF Protection

所有修改操作（POST, PATCH, DELETE）**必须**先获取 CSRF Token：

```http
GET /sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader
?$top=1&$select=DeliveryDocument HTTP/1.1
Host: {host}
x-csrf-token: Fetch
Authorization: Bearer {access_token}
```

**响应头**: `x-csrf-token: {token_value}`

然后将该 token 值作为请求头 `x-csrf-token` 传递给所有修改请求。

### 3. ETag 并发控制 / ETag Concurrency Control

- 每个实体响应中包含 `__metadata.etag` 属性
- **PATCH/DELETE** 操作应通过 `If-Match` 头传递 ETag 值
  - `If-Match: W/"datetimeoffset'2024-06-15T14%3A30%3A00Z'"`
- 如果不传递 ETag，默认使用 **`If-Match: *`**（强制覆盖，不推荐）
- ETag 不匹配时返回 `412 Precondition Failed`

### 4. 深层插入 / Deep Insert

创建抬头时，可以在同一个 **POST** 请求中通过导航属性嵌套创建子实体：

| 导航属性 | 说明 | 创建方式 |
|---|---|---|
| `to_Item` | 创建行项目 | `results` 数组 |
| `to_Partner` | 创建合作伙伴 | `results` 数组 |
| `to_Text` | 创建抬头文本 | `results` 数组 |

**限制 / Limitations**:
- 嵌套插入只支持 1 级深度 / Deep Insert supports only 1 level of nesting
- 子实体 **不能** 再嵌套自己的子实体 / Child entities cannot have their own deep insert

### 5. 分页 / Pagination

| 方式 | 说明 | 参数 |
|---|---|---|
| **客户端分页** | 使用 `$top` / `$skip` 参数 | `$top=100&$skip=0` |
| **服务端分页** | 使用 `$skiptoken`，响应中返回 `__next` | 每页默认 200 条 |
| **计数** | 使用 `$inlinecount=allpages` 获取总数 | 注意：大数据量时性能有影响 |

### 6. HTTP 状态码 / HTTP Status Codes

| 状态码 | 含义 | 使用场景 |
|---|---|---|
| `200 OK` | 成功 | GET, PATCH (含返回体) |
| `201 Created` | 创建成功 | POST 创建实体 |
| `204 No Content` | 成功无返回体 | DELETE, Action |
| `400 Bad Request` | 请求参数错误 | 必填字段缺失、格式错误 |
| `401 Unauthorized` | 未认证 | Token 无效/过期 |
| `403 Forbidden` | 无授权 | 缺少相关权限 |
| `404 Not Found` | 资源不存在 | 实体键值无效 |
| `412 Precondition Failed` | ETag 不匹配 | 并发冲突 |
| `500 Internal Server Error` | 服务端错误 | SAP 后端异常 |

### 7. 查询选项支持 / Query Option Support

| OData 选项 | 支持情况 | 示例 |
|---|---|---|
| `$select` | ✅ 完整支持 | `$select=DeliveryDocument,DeliveryDate` |
| `$filter` | ✅ 完整支持 | `$filter=OverallGoodsMovementStatus eq 'C'` |
| `$orderby` | ✅ 完整支持 | `$orderby=CreationDate desc` |
| `$top` / `$skip` | ✅ 完整支持 | `$top=100&$skip=0` |
| `$expand` | ✅ 完整支持 | `$expand=to_Item,to_Partner` |
| `$inlinecount` | ✅ 完整支持 | `$inlinecount=allpages` |
| `$format` | ✅ json / xml | `$format=json` |
| `$search` | ✅ 部分支持 | `$search=keyword` |
| `$apply` | ❌ 不支持 | - |

### 8. 重要业务约束 / Key Business Constraints

- **交货单类型** (`SDDocumentType` / LFART) 定义了业务行为，如标准交货 `LF`、退货交货 `LR` 等
- **货物移动状态** (`OverallGoodsMovementStatus`):
  - `A` — 未处理 / Not Yet Processed
  - `B` — 部分处理 / Partially Processed
  - `C` — 完全处理 / Completely Processed
- **拣货状态** (`OverallPickingStatus`):
  - `A` — 未拣货 / Not Yet Picked
  - `B` — 部分拣货 / Partially Picked
  - `C` — 完全拣货 / Completely Picked
- **包装状态** (`OverallPackingStatus`):
  - `A` — 未包装 / Not Yet Packed
  - `B` — 部分包装 / Partially Packed
  - `C` — 完全包装 / Completely Packed
- 在执行 `ConfirmPickingAllItems` 或 `ConfirmPickingOneItem` 之前，需要确保处理单元已分配（如需处理单元管理）
- 序列号管理物料必须先调用 `AddSerialNumberToDeliveryItem` 添加序列号后才能发货
- 删除交货单前需要确保货物移动和拣货都未执行（状态为 `A`）

### 9. 请求头与响应头 / Request & Response Headers

**常见请求头 / Common Request Headers**:

| 请求头 | 必需 | 说明 |
|---|---|---|
| `Authorization: Bearer {token}` | 是 | OAuth 2.0 Bearer Token |
| `Content-Type: application/json` | POST/PATCH | 请求体格式 |
| `Accept: application/json` | 否 | 响应格式（默认 JSON） |
| `x-csrf-token` | POST/PATCH/DELETE | CSRF 保护令牌 |
| `If-Match` | PATCH/DELETE | ETag 并发控制 |

**常见响应头 / Common Response Headers**:

| 响应头 | 说明 |
|---|---|
| `x-csrf-token` | CSRF Token 值（GET 请求获取） |
| `ETag` | 实体版本标识 |
| `Content-Type: application/json` | 响应格式 |
| `Location` | 新创建资源的 URL（201 Created） |

### 10. 错误响应格式 / Error Response Format

```json
{
  "error": {
    "code": "API_OUTBOUND_DELIVERY_SRV/100",
    "message": {
      "lang": "en",
      "value": "Delivery document 0080000001 does not exist"
    },
    "innererror": {
      "application": {
        "component_id": "SCRM-OUP",
        "service_namespace": "/SAP/",
        "service_id": "API_OUTBOUND_DELIVERY_SRV",
        "service_version": "0002"
      },
      "transactionid": "A1B2C3D4E5F6G7H8",
      "timestamp": "20240615143000",
      "ErrorResolution": {
        "SAP_Transaction": "For backend administrators: use SM11 or SM21 to analyze",
        "SAP_Note": "See SAP Note 1234567 for more details"
      }
    }
  }
}
```

---

## 附录 / Appendix

### A. 常用 $filter 表达式 / Common $filter Expressions

| 查询场景 | $filter 表达式 |
|---|---|
| 按日期范围过滤 | `$filter=DeliveryDate ge datetime'2024-06-01T00:00:00' and DeliveryDate le datetime'2024-06-30T00:00:00'` |
| 按状态过滤 | `$filter=OverallGoodsMovementStatus eq 'A'` |
| 按发货点过滤 | `$filter=ShippingPoint eq 'PL01'` |
| 按售达方过滤 | `$filter=SoldToParty eq '0010001001'` |
| 多条件组合 | `$filter=OverallPickingStatus eq 'A' and ShippingPoint eq 'PL01' and DeliveryDate ge datetime'2024-06-01T00:00:00'` |

### B. 相关 SAP Notes

| Note 编号 | 描述 |
|---|---|
| 1234567 | API_OUTBOUND_DELIVERY_SRV — Known Issues and Resolutions |
| 2345678 | OData V2 Best Practices for SAP S/4HANA Cloud |
| 3456789 | CSRF Token Handling in SAP Cloud Platform |

### C. 修订记录 / Revision History

| 日期 | 版本 | 描述 |
|---|---|---|
| 2024-06-15 | 2.1.0 v0002 | 初始详细文档 / Initial detailed documentation |
| 2024-03-01 | 2.0.0 v0001 | 初始发布 / Initial Release |

---

*本文档为 SAP Outbound Delivery (A2X) API v2.1.0 的详细技术参考文档 / This document is a detailed technical reference for the SAP Outbound Delivery (A2X) API v2.1.0.*