# CO_EDI_SCHEDGAGRMT_OUT

**SOAP v1.0.0 — ACTIVE**

## Title / 标题
**Delivery Schedule of Purchase Scheduling Agreement / 采购计划协议交货计划**

## Operation / 操作
`DeliveryScheduleSend`

---

## Description / 描述
This service transmits delivery schedules for scheduling agreements, providing the supplier with forecasted delivery quantities and dates.

该服务传输计划协议的交货计划，向供应商提供预测的交货数量和日期。

---

## Endpoint / 端点
| Environment | URL |
|-------------|-----|
| Production | `https://sap.example.com/sap/bc/srt/rfc/sap/CO_EDI_SCHEDGAGRMT_OUT` |
| Test | `https://sap-test.example.com/sap/bc/srt/rfc/sap/CO_EDI_SCHEDGAGRMT_OUT` |

## Message Structure / 消息结构

### Request / 请求
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `SchedulingAgreement` | `SCHED_AGR` | Scheduling agreement header | 计划协议抬头 |
| `– AgreementNo` | `CHAR(10)` | Scheduling agreement number | 计划协议编号 |
| `– Vendor` | `CHAR(10)` | Supplier account number | 供应商账户 |
| `– Plant` | `CHAR(4)` | Plant | 工厂 |
| `ScheduleLines` | Table | Delivery schedule lines | 交货计划行 |
| `– Material` | `CHAR(18)` | Material number | 物料编号 |
| `– DeliveryDate` | `DATE` | Scheduled delivery date | 计划交货日期 |
| `– Quantity` | `QUAN(13)` | Scheduled quantity | 计划数量 |
| `– Unit` | `UNIT(3)` | Unit of measure | 计量单位 |
| `– ScheduleType` | `CHAR(1)` | Schedule type (1=forecast, 2=firm) | 计划类型（1=预测，2=确定） |

### Response / 响应
| Element | Type | Description (EN) | Description (CN) |
|---------|------|------------------|------------------|
| `Return` | `BAPIRETURN` | Application log message | 应用程序日志消息 |
| `– Type` | `CHAR(1)` | Message type (S/E/W/I) | 消息类型（成功/错误/警告/信息） |
| `– Message` | `CHAR(220)` | Message text | 消息文本 |

---

## Example Request / 请求示例
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <DeliveryScheduleSend>
      <SchedulingAgreement>
        <AgreementNo>5500000001</AgreementNo>
        <Vendor>0000600789</Vendor>
        <Plant>PL01</Plant>
      </SchedulingAgreement>
      <ScheduleLines>
        <item>
          <Material>MAT-10001</Material>
          <DeliveryDate>2026-08-15</DeliveryDate>
          <Quantity>500.000</Quantity>
          <Unit>EA</Unit>
          <ScheduleType>2</ScheduleType>
        </item>
        <item>
          <Material>MAT-10001</Material>
          <DeliveryDate>2026-09-15</DeliveryDate>
          <Quantity>1000.000</Quantity>
          <Unit>EA</Unit>
          <ScheduleType>1</ScheduleType>
        </item>
      </ScheduleLines>
    </DeliveryScheduleSend>
  </soap:Body>
</soap:Envelope>
```

## Example Response / 响应示例
```xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <DeliveryScheduleSendResponse>
      <Return>
        <Type>S</Type>
        <Message>Delivery schedule sent successfully / 交货计划已成功发送</Message>
      </Return>
    </DeliveryScheduleSendResponse>
  </soap:Body>
</soap:Envelope>
```

---

## Error Codes / 错误代码
| Code | Description (EN) | Description (CN) |
|------|------------------|------------------|
| SCH_001 | Scheduling agreement not found | 计划协议未找到 |
| SCH_002 | Invalid material number | 无效的物料编号 |
| SCH_003 | Delivery date in the past | 交货日期在过去 |
| SCH_004 | Quantity exceeds agreement limit | 数量超过协议限制 |

---

## Notes / 备注
- Schedule type 2 (firm) lines are binding / 计划类型2（确定）的行具有约束力
- Maximum 999 schedule lines per request / 每个请求最多999个计划行
- All dates must be in the future / 所有日期必须为未来日期