**广联智通科技公司信息系统**

**开发功能说明书**

<table><tr><td><p><strong>信息系统</strong></p></td><td><p>☑WMS ☑SAP</p></td></tr><tr><td><p><strong>功能名称</strong></p></td><td><p>采购订单收货接口</p></td></tr><tr><td><p><strong>开发类型</strong></p></td><td><p>□报表 □用户出口 ☑接口 □对话程序 □流程  </p><p>□表单</p></td></tr><tr><td><p><strong>开发记录号</strong></p></td><td></td></tr></table>

**2026年5月**

**目录**

- [**1** **创建修改记录** **3**](#_Toc531872890)
- **2** **开发类型** **4**
- [**3** **业务需求概述** **4**](#_Toc531872892)
    - [现有/样本报表](#_Toc531872893)
- [**4** **功能规范** **5**](#_Toc531872894)
    - [4.1 程序开发优先级](#_Toc531872895)
    - [4.2 权限要求](#_Toc531872896)
    - [4.3 程序运行频率](#_Toc531872897)
    - [4.4 屏幕设计及其布局](#_Toc531872898)
    - [4.5 参数和选择条件](#_Toc531872899)
    - [4.6 字段的定义](#_Toc531872900)
- [**5** **程序输出格式** **7**](#_Toc531872901)
    - [5.1 业务大概逻辑](#_Toc531872902)
    - [5.2 前台业务截图](#_Toc531872903)
    - [5.3 SAP方需要传入传出的参数](#_Toc531872904)
    - [5.4 数据转换](#_Toc531872905)
- [**6测试数据 9**](#_Toc531872906)
- [**7 附件或样本 9**](#_Toc531872907)
- [**8 测试记录 10**](#_Toc531872908)

<a id="_Toc531872890"></a>
# 1. **创建修改记录**

<table><tr><td><p>作者</p></td><td><p>李佩遥</p></td></tr><tr><td><p>业务顾问</p></td><td><p>李佩遥</p></td></tr><tr><td><p>创建日期</p></td><td><p>2026-05-29</p></td></tr><tr><td><p>最近修改日期</p></td><td></td></tr><tr><td><p>开发</p></td><td></td></tr><tr><td><p>备注</p></td><td></td></tr></table>

<a id="_Toc135387408"></a>
# 2. **文档变更**

<table><thead><tr><th><p><strong>版本号</strong></p></th><th><p><strong>修正日期</strong></p></th><th><p><strong>修改人</strong></p></th><th><p><strong>修正描述</strong></p></th><th><p><strong>备注</strong></p></th></tr></thead><tbody><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

<a id="_Toc531872892"></a>
# 3. **业务需求概述**

<table><tr><td><p><a></a><a></a><a></a>需求概述：</p></td><td colspan="3"><p>WMS系统获取SAP采购订单，用户在WMS系统扫码收货入库后，入库数据同步SAP形成收货物料凭证。</p></td></tr><tr><td><p>开发难度(高/中/低)：</p></td><td><p>低</p></td><td><p>事务代码：</p></td><td></td></tr><tr><td><p>运行类型(在线/批处理):</p></td><td><p>在线</p></td><td></td><td></td></tr><tr><td><p>交易量：</p></td><td colspan="3"><p>低</p></td></tr><tr><td><p>备注：</p></td><td colspan="3"></td></tr></table>

<a id="_Toc531872893"></a>
## 3.1. **现有/样本报表**

<table><tr><td><p>现有报表名称：</p></td><td><p>N/A</p></td></tr><tr><td><p>系统菜单/交易代码：</p></td><td><p>N/A</p></td></tr></table>

<a id="_Toc531872894"></a>
# 4. **功能规范**

<a id="_Toc531872895"></a>
## 4.1. **程序开发优先级**

**优先级别	:**	□ 高		 中		☑ 低

<a id="_Toc531872896"></a>
## 4.2. **权限要求**

全员赋予流程入口权限

<a id="_Toc531872897"></a>
## 4.3. **程序运行频率**

[请在此选择本程序的运行频率，并按照业务需要，说明具体的频率要求，例如，每日：具体到时；每周：具体到日和时；每月：具体到日和时；每年：具体到日和时]

随时	□ 周	 	□ 月 		□ 季		□ 年

<a id="_Toc531872898"></a>
## 4.4. **屏幕设计及其布局**

无

<a id="_Toc531872899"></a>
## 4.5. **参数和选择条件**

1. 获取采购订单：

<table><tr><td><p>方法</p></td><td><p>URL</p></td><td><p>认证方式</p></td></tr><tr><td><p>Get</p></td><td><p>https://my201453-api.s4hana.sapcloud.cn/sap/opu/odata4/sap/api_purchaseorder_2/sr</p><p>vd_a2x/sap/purchaseorder/0001/</p></td><td><p>Basic Auth</p></td></tr></table>

1. 采购订单收货：

<table><tr><td><p>方法</p></td><td><p>URL</p></td><td><p>认证方式</p></td></tr><tr><td><p>Post</p></td><td><p>https://my201453-api.s4hana.sapcloud.cn/sap/opu/odata/sap/API_MATERIAL_DOCUMENT_SRV</p><p>/A_MaterialDocumentHeader</p></td><td><p>Basic Auth</p></td></tr></table>

1. 采购订单退货：

<table><tr><td><p>方法</p></td><td><p>URL</p></td><td><p>认证方式</p></td></tr><tr><td><p>Post</p></td><td><p>https://my201453-api.s4hana.sapcloud.cn/sap/opu/odata/sap/API_MATERIAL_DOCUMENT_SRV</p><p>/A_MaterialDocumentHeader</p></td><td><p>Basic Auth</p></td></tr></table>

1. 查询采购相关物料凭证：

<table><tr><td><p>方法</p></td><td><p>URL</p></td><td><p>认证方式</p></td></tr><tr><td><p>Get</p></td><td></td><td><p>Basic Auth</p></td></tr></table>

1. 冲销采购物料凭证：

<table><tr><td><p>方法</p></td><td><p>URL</p></td><td><p>认证方式</p></td></tr><tr><td><p>Get</p></td><td></td><td><p>Basic Auth</p></td></tr></table>

<a id="_Toc531872900"></a>
## 4.6. **字段的定义**

[请在此处说明所涉及字段所对数据表及其字段名或结构及其字段名]

字段清单见数据转换

<a id="_Toc531872901"></a>
# 5. **程序输出格式**

<a id="_Toc531872902"></a>
## 5.1. **业务大概逻辑**

<a id="_Toc531872903"></a>
## 5.2. **前台业务截图**

[请在此处附上前台业务的截图，并将所要取出的字段标记出来]

<a id="_Toc531872904"></a>
## 5.3. **传入传出的参数**

**［仅接口类型程序需要］**

**接口用户：EXT\_USER\_TEST**

**用户密码：#xJ[zK3>VL)wDaT2m-xGx\$)[c2xXQ@QL/ZvCb<lV**

**获取token的方式**

**请求方式**

GET

URL: https://my201453-api.s4hana.sapcloud.cn/sap/opu/odata/sap/API\_MATERIAL\_DOCUMENT\_SRV

**Content-Type**

Json

**请求Header参数**

<table><tr><td><p>参数名</p></td><td><p>示例值</p></td><td><p>参数类型</p></td><td><p>是否必填</p></td><td><p>参数描述</p></td></tr><tr><td><p>Accept</p></td><td><p>application/json</p></td><td><p>string</p></td><td><p>是</p></td><td><p>-</p></td></tr><tr><td><p>x-csrf-token</p></td><td><p>fetch</p></td><td><p>string</p></td><td><p>是</p></td><td></td></tr></table>

![](images/99f2b08839f9f0c637ce7ac97906487f5aec3e9d8117035f2734dc5e96491848.jpg)

### 5.3.1. **查询采购订单的参数：**

**请求方式**

Get

URL: https://my201453-api.s4hana.sapcloud.cn/sap/opu/odata4/sap/api\_purchaseorder\_2/srvd\_a2x/sap/purchaseorder/0001/

### 5.3.2. **采购收货的参数：**

**请求方式**

POST

URL: https://my201453-api.s4hana.sapcloud.cn/sap/opu/odata/sap/API\_MATERIAL\_DOCUMENT\_SRV/A\_MaterialDocumentHeader

**Content-Type**

Json

**请求Header参数**

<table><tr><td><p>参数名</p></td><td><p>示例值</p></td><td><p>参数类型</p></td><td><p>是否必填</p></td><td><p>参数描述</p></td></tr><tr><td><p>Accept</p></td><td><p>application/json</p></td><td><p>string</p></td><td><p>是</p></td><td><p>-</p></td></tr><tr><td><p>x-csrf-token</p></td><td><p>Gy2TljN1_tq20FQYySzKzA==</p></td><td><p>string</p></td><td><p>是</p></td><td><p>填写获取的token</p></td></tr></table>

**请求BODY参数**

{

"PostingDate": "2026-06-01T00:00:00",

"DocumentDate": "2025-05-29T00:00:00",

"GoodsMovementCode": "01",

"MaterialDocumentHeaderText": "采购入库测试",

"to\_MaterialDocumentItem": [

{

"MaterialDocumentLine": "1",

"Plant": "1011",//工厂代码

"StorageLocation": "3001",

"GoodsMovementType": "101",

"PurchaseOrder": "4500000068",

"PurchaseOrderItem": "10",

"GoodsMovementRefDocType": "B",

"QuantityInEntryUnit": "1.00",

"EntryUnit": "PC",//采购订单单位

"MaterialDocumentItemText": ""

}

]

}

<table><tr><td><p>参数名</p></td><td><p>示例值</p></td><td><p>参数类型</p></td><td><p>是否必填</p></td><td><p>参数描述</p></td></tr><tr><td><p>PostingDate</p></td><td><p>2026-06-01T00:00:00</p></td><td><p>Date</p></td><td><p>是</p></td><td><p>过账日期</p></td></tr><tr><td><p>DocumentDate</p></td><td><p>2025-0-29T00:00:00</p></td><td><p>Date</p></td><td><p>是</p></td><td><p>单据日期</p></td></tr><tr><td><p>GoodsMovementCode</p></td><td><p>01</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购入库固定值01</p></td></tr><tr><td><p>MaterialDocumentHeaderText</p></td><td><p>采购入库测试</p></td><td><p>string</p></td><td><p>否</p></td><td><p>物料单据头文本</p></td></tr><tr><td><p>to_MaterialDocumentItem</p></td><td><p>-</p></td><td><p>string</p></td><td><p>是</p></td><td><p>物料单据项目</p></td></tr><tr><td><p>to_MaterialDocumentItem.MaterialDocumentLine</p></td><td><p>1</p></td><td><p>string</p></td><td><p>是</p></td><td><p>从1开始，每行加1</p></td></tr><tr><td><p>to_MaterialDocumentItem.Plant</p></td><td><p>1011</p></td><td><p>string</p></td><td><p>是</p></td><td><p>工厂代码</p></td></tr><tr><td><p>to_MaterialDocumentItem.StorageLocation</p></td><td><p>3001</p></td><td><p>string</p></td><td><p>是</p></td><td><p>接收存储地点编号</p></td></tr><tr><td><p>to_MaterialDocumentItem.GoodsMovementType</p></td><td><p>101</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购入库固定值101</p></td></tr><tr><td><p>to_MaterialDocumentItem.PurchaseOrder</p></td><td><p>4500000068</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购订单</p></td></tr><tr><td><p>to_MaterialDocumentItem.PurchaseOrderItem</p></td><td><p>10</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购订单项目</p></td></tr><tr><td><p>to_MaterialDocumentItem.GoodsMovementRefDocType</p></td><td><p>B</p></td><td><p>string</p></td><td><p>是</p></td><td><p>货物移动参考文档类型，采购订单固定为B</p></td></tr><tr><td><p>to_MaterialDocumentItem.QuantityInEntryUnit</p></td><td><p>1.00</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购订单单位的入库数量</p></td></tr><tr><td><p>to_MaterialDocumentItem.EntryUnit</p></td><td><p>PC</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购订单单位</p></td></tr><tr><td><p>to_MaterialDocumentItem.MaterialDocumentItemText</p></td><td><p>-</p></td><td><p>string</p></td><td><p>否</p></td><td><p>物料单据项目文本</p></td></tr></table>

**返回结果**

**响应示例**

**•成功(201 Created)**

{

"d": {

"\_\_metadata": {

"id": "https://my201453-api.s4hana.sapcloud.cn/sap/opu/odata/sap/API\_MATERIAL\_DOCUMENT\_SRV/A\_MaterialDocumentHeader(MaterialDocumentYear='2026',MaterialDocument='5000000131')",

"uri": "https://my201453-api.s4hana.sapcloud.cn/sap/opu/odata/sap/API\_MATERIAL\_DOCUMENT\_SRV/A\_MaterialDocumentHeader(MaterialDocumentYear='2026',MaterialDocument='5000000131')",

"type": "API\_MATERIAL\_DOCUMENT\_SRV.A\_MaterialDocumentHeaderType"

},

"MaterialDocumentYear": "2026",

"MaterialDocument": "5000000131",

"InventoryTransactionType": "WE",

"DocumentDate": "/Date(1748476800000)/",

"PostingDate": "/Date(1780272000000)/",

"CreationDate": "/Date(1780963200000)/",

"CreationTime": "PT08H32M42S",

"CreatedByUser": "CC0000000002",

"MaterialDocumentHeaderText": "采购入库测试",

"ReferenceDocument": "",

"VersionForPrintingSlip": "",

"ManualPrintIsTriggered": "",

"CtrlPostgForExtWhseMgmtSyst": "",

"GoodsMovementCode": "01",

"to\_MaterialDocumentItem": {

"results": []

}

}

}

**•失败(400 Bad Request)**

{

"error": {

"code": "M7/001",

"message": {

"lang": "en",

"value": "Check table EKPO: entry 045000000600010 00010  does not exist"

},

"innererror": {

"application": {

"component\_id": "MM-IM-VDM-SGM",

"service\_namespace": "/SAP/",

"service\_id": "API\_MATERIAL\_DOCUMENT\_SRV",

"service\_version": "0001"

},

"transactionid": "6DFFBDC8ADC50200E006A27D01527944",

"timestamp": "20260609083433.4139470",

"Error\_Resolution": {

"SAP\_Transaction": "For backend administrators: use ADT feed reader \"SAP Gateway Error Log\" or run transaction /IWFND/ERROR\_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details",

"SAP\_Note": "See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"

},

"errordetails": [

{

"ContentID": "",

"code": "M7/001",

"message": "Check table EKPO: entry 045000000600010 00010  does not exist",

"longtext\_url": "/sap/opu/odata/iwbep/message\_text;o=LOCAL/T100\_longtexts(MSGID='M7',MSGNO='001',MESSAGE\_V1='EKPO',MESSAGE\_V2='045000000600010',MESSAGE\_V3='00010',MESSAGE\_V4='')/\$value",

"propertyref": "",

"severity": "error",

"transition": false,

"target": ""

}

]

}

}

}

### 5.3.3. **采购退货的参数：**

**请求方式**

POST

URL: https://my201453-api.s4hana.sapcloud.cn/sap/opu/odata/sap/API\_MATERIAL\_DOCUMENT\_SRV/A\_MaterialDocumentHeader

**Content-Type**

Json

**请求Header参数**

<table><tr><td><p>参数名</p></td><td><p>示例值</p></td><td><p>参数类型</p></td><td><p>是否必填</p></td><td><p>参数描述</p></td></tr><tr><td><p>Accept</p></td><td><p>application/json</p></td><td><p>string</p></td><td><p>是</p></td><td><p>-</p></td></tr><tr><td><p>x-csrf-token</p></td><td><p>Gy2TljN1_tq20FQYySzKzA==</p></td><td><p>string</p></td><td><p>是</p></td><td><p>填写获取的token</p></td></tr></table>

**请求BODY参数**

{

"PostingDate": "2026-06-01T00:00:00",

"DocumentDate": "2025-05-29T00:00:00",

"GoodsMovementCode": "01",

"MaterialDocumentHeaderText": "采购退货测试",

"to\_MaterialDocumentItem": [

{

"MaterialDocumentLine": "1",

"Plant": "1011",//工厂代码

"StorageLocation": "3001",

"GoodsMovementType": "101",//采购退货移动类型固定101

"PurchaseOrder": "4500000069",

"PurchaseOrderItem": "10",

"GoodsMovementRefDocType": "B",

"QuantityInEntryUnit": "1.00",

"EntryUnit": "PC",//采购订单单位

"MaterialDocumentItemText": ""

}

]

}

<table><tr><td><p>参数名</p></td><td><p>示例值</p></td><td><p>参数类型</p></td><td><p>是否必填</p></td><td><p>参数描述</p></td></tr><tr><td><p>PostingDate</p></td><td><p>2026-06-01T00:00:00</p></td><td><p>Date</p></td><td><p>是</p></td><td><p>过账日期</p></td></tr><tr><td><p>DocumentDate</p></td><td><p>2025-0-29T00:00:00</p></td><td><p>Date</p></td><td><p>是</p></td><td><p>单据日期</p></td></tr><tr><td><p>GoodsMovementCode</p></td><td><p>01</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购入库固定值01</p></td></tr><tr><td><p>MaterialDocumentHeaderText</p></td><td><p>采购入库测试</p></td><td><p>string</p></td><td><p>否</p></td><td><p>物料单据头文本</p></td></tr><tr><td><p>to_MaterialDocumentItem</p></td><td><p>-</p></td><td><p>string</p></td><td><p>是</p></td><td><p>物料单据项目</p></td></tr><tr><td><p>to_MaterialDocumentItem.MaterialDocumentLine</p></td><td><p>1</p></td><td><p>string</p></td><td><p>是</p></td><td><p>从1开始，每行加1</p></td></tr><tr><td><p>to_MaterialDocumentItem.Plant</p></td><td><p>1011</p></td><td><p>string</p></td><td><p>是</p></td><td><p>工厂代码</p></td></tr><tr><td><p>to_MaterialDocumentItem.StorageLocation</p></td><td><p>3001</p></td><td><p>string</p></td><td><p>是</p></td><td><p>接收存储地点编号</p></td></tr><tr><td><p>to_MaterialDocumentItem.GoodsMovementType</p></td><td><p>101</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购入库固定值101</p></td></tr><tr><td><p>to_MaterialDocumentItem.PurchaseOrder</p></td><td><p>4500000068</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购订单</p></td></tr><tr><td><p>to_MaterialDocumentItem.PurchaseOrderItem</p></td><td><p>10</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购订单项目</p></td></tr><tr><td><p>to_MaterialDocumentItem.GoodsMovementRefDocType</p></td><td><p>B</p></td><td><p>string</p></td><td><p>是</p></td><td><p>货物移动参考文档类型，采购订单固定为B</p></td></tr><tr><td><p>to_MaterialDocumentItem.QuantityInEntryUnit</p></td><td><p>1.00</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购订单单位的入库数量</p></td></tr><tr><td><p>to_MaterialDocumentItem.EntryUnit</p></td><td><p>PC</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购订单单位</p></td></tr><tr><td><p>to_MaterialDocumentItem.MaterialDocumentItemText</p></td><td><p>-</p></td><td><p>string</p></td><td><p>否</p></td><td><p>物料单据项目文本</p></td></tr></table>

**返回结果**

**响应示例**

**•成功(201 Created)**

{

"d": {

"\_\_metadata": {

"id": "https://my201453-api.s4hana.sapcloud.cn/sap/opu/odata/sap/API\_MATERIAL\_DOCUMENT\_SRV/A\_MaterialDocumentHeader(MaterialDocumentYear='2026',MaterialDocument='5000000132')",

"uri": "https://my201453-api.s4hana.sapcloud.cn/sap/opu/odata/sap/API\_MATERIAL\_DOCUMENT\_SRV/A\_MaterialDocumentHeader(MaterialDocumentYear='2026',MaterialDocument='5000000132')",

"type": "API\_MATERIAL\_DOCUMENT\_SRV.A\_MaterialDocumentHeaderType"

},

"MaterialDocumentYear": "2026",

"MaterialDocument": "5000000132",

"InventoryTransactionType": "WE",

"DocumentDate": "/Date(1748476800000)/",

"PostingDate": "/Date(1780272000000)/",

"CreationDate": "/Date(1780963200000)/",

"CreationTime": "PT08H35M39S",

"CreatedByUser": "CC0000000002",

"MaterialDocumentHeaderText": "采购退货测试",

"ReferenceDocument": "",

"VersionForPrintingSlip": "",

"ManualPrintIsTriggered": "",

"CtrlPostgForExtWhseMgmtSyst": "",

"GoodsMovementCode": "01",

"to\_MaterialDocumentItem": {

"results": []

}

}

}

**•失败(400 Bad Request)**

{

"error": {

"code": "M7/001",

"message": {

"lang": "en",

"value": "Check table EKPO: entry 045000000600010 00010  does not exist"

},

"innererror": {

"application": {

"component\_id": "MM-IM-VDM-SGM",

"service\_namespace": "/SAP/",

"service\_id": "API\_MATERIAL\_DOCUMENT\_SRV",

"service\_version": "0001"

},

"transactionid": "6DFFBDC8ADC50010E006A27D0A72CC47",

"timestamp": "20260609083659.5136360",

"Error\_Resolution": {

"SAP\_Transaction": "For backend administrators: use ADT feed reader \"SAP Gateway Error Log\" or run transaction /IWFND/ERROR\_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details",

"SAP\_Note": "See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"

},

"errordetails": [

{

"ContentID": "",

"code": "M7/001",

"message": "Check table EKPO: entry 045000000600010 00010  does not exist",

"longtext\_url": "/sap/opu/odata/iwbep/message\_text;o=LOCAL/T100\_longtexts(MSGID='M7',MSGNO='001',MESSAGE\_V1='EKPO',MESSAGE\_V2='045000000600010',MESSAGE\_V3='00010',MESSAGE\_V4='')/\$value",

"propertyref": "",

"severity": "error",

"transition": **false**,

"target": ""

}

]

}

}

}

### 5.3.4. **采购订单收货冲销的参数：**

**请求方式**

POST

URL: https://my201453-api.s4hana.sapcloud.cn/sap/opu/odata/sap/API\_MATERIAL\_DOCUMENT\_SRV/A\_MaterialDocumentHeader

**Content-Type**

Json

**请求Header参数**

<table><tr><td><p>参数名</p></td><td><p>示例值</p></td><td><p>参数类型</p></td><td><p>是否必填</p></td><td><p>参数描述</p></td></tr><tr><td><p>Accept</p></td><td><p>application/json</p></td><td><p>string</p></td><td><p>是</p></td><td><p>-</p></td></tr><tr><td><p>x-csrf-token</p></td><td><p>Gy2TljN1_tq20FQYySzKzA==</p></td><td><p>string</p></td><td><p>是</p></td><td><p>填写获取的token</p></td></tr></table>

**请求BODY参数**

{

"PostingDate": "2026-06-09T00:00:00",

"DocumentDate": "2025-06-09T00:00:00",

"GoodsMovementCode": "01",

"MaterialDocumentHeaderText": "采购部分冲销测试",

"to\_MaterialDocumentItem": [

{

"MaterialDocumentLine": "1",

"Plant": "1011",//工厂代码

"StorageLocation": "3001",

"GoodsMovementType": "122",

"PurchaseOrder": "4500000068",

"PurchaseOrderItem": "10",

"GoodsMovementRefDocType": "B",

"QuantityInEntryUnit": "1.00",

"EntryUnit": "PCS",//采购订单单位

"GoodsMovementReasonCode": "0004",

"MaterialDocumentItemText": ""

}

]

}

<table><tr><td><p>参数名</p></td><td><p>示例值</p></td><td><p>参数类型</p></td><td><p>是否必填</p></td><td><p>参数描述</p></td></tr><tr><td><p>PostingDate</p></td><td><p>2026-06-01T00:00:00</p></td><td><p>Date</p></td><td><p>是</p></td><td><p>过账日期</p></td></tr><tr><td><p>DocumentDate</p></td><td><p>2025-0-29T00:00:00</p></td><td><p>Date</p></td><td><p>是</p></td><td><p>单据日期</p></td></tr><tr><td><p>GoodsMovementCode</p></td><td><p>01</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购入库固定值01</p></td></tr><tr><td><p>MaterialDocumentHeaderText</p></td><td><p>采购入库测试</p></td><td><p>string</p></td><td><p>否</p></td><td><p>物料单据头文本</p></td></tr><tr><td><p>to_MaterialDocumentItem</p></td><td><p>-</p></td><td><p>string</p></td><td><p>是</p></td><td><p>物料单据项目</p></td></tr><tr><td><p>to_MaterialDocumentItem.MaterialDocumentLine</p></td><td><p>1</p></td><td><p>string</p></td><td><p>是</p></td><td><p>从1开始，每行加1</p></td></tr><tr><td><p>to_MaterialDocumentItem.Plant</p></td><td><p>1011</p></td><td><p>string</p></td><td><p>是</p></td><td><p>工厂代码</p></td></tr><tr><td><p>to_MaterialDocumentItem.StorageLocation</p></td><td><p>3001</p></td><td><p>string</p></td><td><p>是</p></td><td><p>接收存储地点编号</p></td></tr><tr><td><p>to_MaterialDocumentItem.GoodsMovementType</p></td><td><p>122</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购部分冲销固定值122</p></td></tr><tr><td><p>to_MaterialDocumentItem.PurchaseOrder</p></td><td><p>4500000068</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购订单</p></td></tr><tr><td><p>to_MaterialDocumentItem.PurchaseOrderItem</p></td><td><p>10</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购订单项目</p></td></tr><tr><td><p>to_MaterialDocumentItem.GoodsMovementRefDocType</p></td><td><p>B</p></td><td><p>string</p></td><td><p>是</p></td><td><p>货物移动参考文档类型，采购订单固定为B</p></td></tr><tr><td><p>to_MaterialDocumentItem.QuantityInEntryUnit</p></td><td><p>1.00</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购订单单位的入库数量</p></td></tr><tr><td><p>to_MaterialDocumentItem.EntryUnit</p></td><td><p>PCS</p></td><td><p>string</p></td><td><p>是</p></td><td><p>采购订单单位</p></td></tr><tr><td><p>to_MaterialDocumentItem. GoodsMovementReasonCode</p></td><td><p>4</p></td><td><p>string</p></td><td><p>是</p></td><td><p>冲销原因，固定值4</p></td></tr><tr><td><p>to_MaterialDocumentItem.MaterialDocumentItemText</p></td><td><p>-</p></td><td><p>string</p></td><td><p>否</p></td><td><p>物料单据项目文本</p></td></tr></table>

**返回结果**

**响应示例**

**•成功(201 Created)**

{

"d": {

"\_\_metadata": {

"id": "https://my201453-api.s4hana.sapcloud.cn/sap/opu/odata/sap/API\_MATERIAL\_DOCUMENT\_SRV/A\_MaterialDocumentHeader(MaterialDocumentYear='2026',MaterialDocument='5000000133')",

"uri": "https://my201453-api.s4hana.sapcloud.cn/sap/opu/odata/sap/API\_MATERIAL\_DOCUMENT\_SRV/A\_MaterialDocumentHeader(MaterialDocumentYear='2026',MaterialDocument='5000000133')",

"type": "API\_MATERIAL\_DOCUMENT\_SRV.A\_MaterialDocumentHeaderType"

},

"MaterialDocumentYear": "2026",

"MaterialDocument": "5000000133",

"InventoryTransactionType": "WE",

"DocumentDate": "/Date(1749427200000)/",

"PostingDate": "/Date(1780963200000)/",

"CreationDate": "/Date(1780963200000)/",

"CreationTime": "PT08H55M27S",

"CreatedByUser": "CC0000000002",

"MaterialDocumentHeaderText": "采购部分冲销测试",

"ReferenceDocument": "",

"VersionForPrintingSlip": "",

"ManualPrintIsTriggered": "",

"CtrlPostgForExtWhseMgmtSyst": "",

"GoodsMovementCode": "01",

"to\_MaterialDocumentItem": {

"results": []

}

}

}

**•失败(400 Bad Request)**

{

"error": {

"code": "MM\_IM\_ODATA\_API\_MDOC/010",

"message": {

"lang": "en",

"value": "Property GoodsMovementReasonCode is mandatory for GoodsMovementType 122"

},

"innererror": {

"application": {

"component\_id": "MM-IM-VDM-SGM",

"service\_namespace": "/SAP/",

"service\_id": "API\_MATERIAL\_DOCUMENT\_SRV",

"service\_version": "0001"

},

"transactionid": "6DFFBDC8ADC50240E006A27D32F9339F",

"timestamp": "20260609084747.2097440",

"Error\_Resolution": {

"SAP\_Transaction": "For backend administrators: use ADT feed reader \"SAP Gateway Error Log\" or run transaction /IWFND/ERROR\_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details",

"SAP\_Note": "See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"

},

"errordetails": [

{

"ContentID": "",

"code": "MM\_IM\_ODATA\_API\_MDOC/010",

"message": "Property GoodsMovementReasonCode is mandatory for GoodsMovementType 122",

"longtext\_url": "/sap/opu/odata/iwbep/message\_text;o=LOCAL/T100\_longtexts(MSGID='MM\_IM\_ODATA\_API\_MDOC',MSGNO='010',MESSAGE\_V1='GoodsMovementReasonCode',MESSAGE\_V2='122',MESSAGE\_V3='',MESSAGE\_V4='')/\$value",

"propertyref": "",

"severity": "error",

"transition": **false**,

"target": ""

}

]

}

}

}

<a id="_Toc531872905"></a>
## 5.4. **数据转换**

[仅接口程序类型需要，请在此处描述SAP系统和对方系统之间的数据匹配]

<a id="_Toc531872906"></a>
# 6. **6测试数据**

[请在此处说明已经在开发环境准备好的可供程序员测试的数据]

<a id="_Toc531872907"></a>
# 7. **7 附件或样本**

<a id="_Toc531872908"></a>
# 8. **8 测试记录**

<table><tr><td><p>序号</p></td><td><p>CLIENT</p></td><td><p>测试人</p></td><td><p>测试日期</p></td><td><p>测试条件</p></td><td><p>预期测试结果</p></td><td><p>实际测试结果</p></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>