The Create Sales Order block creates a sales order in your SAP S/4HANA system directly from an automation flow. Use it, for example, to turn an incoming customer purchase order into a sales order automatically, using data extracted from the message and its attachments.
This article describes the fields you can or need to fill in on the block. For an overview of the integration itself, see SAP S/4HANA Integration.
Before you start
To use the block, your SAP S/4HANA integration must be set up:
- The Tekst iFlow package is deployed on your SAP BTP Cloud Integration (CPI) tenant. See Deploy the Tekst iFlow Package in CPI.
- The integration is connected in the Tekst platform. See Connect SAP S/4HANA via BTP Service Key.
You should also be familiar with building flows. See Create your first automation flow.
Add the block to a flow
- Open or create a flow in the automation builder.
- Hover over the block you want the sales order to be created after, then click the + icon that appears.
- In the block picker, select the Create Sales Order block of your SAP S/4HANA integration.
- Fill in the fields described below. Each field can hold a fixed value or a value from an earlier step in the flow, such as an extracted entity.
Required fields
The following header fields must be filled in for every sales order:
| Field | Description | Example |
|---|---|---|
| Order Type | The sales order type, up to 4 characters (e.g., OR for a standard order). |
ZOR |
| Sales Organization | The sales organization code, up to 4 characters. | 1000 |
| Distribution Channel | The distribution channel code, up to 2 characters. | 01 |
| Division | The organization division code, up to 2 characters. | 01 |
| Customer | The customer number of the sold-to party, up to 10 digits. Shorter numbers are automatically padded with leading zeros to the standard 10-digit SAP format, so 1100 and 0000001100 refer to the same customer. |
0000001100 |
Optional fields
The following header fields are optional. When a field is left empty, SAP applies its usual defaults:
| Field | Description | Example |
|---|---|---|
| Ship-To Location | The customer number of the ship-to party (the delivery location). Like the Customer field, it is padded with leading zeros to 10 digits. If left empty, SAP determines the ship-to party from the customer master data. | 0000001101 |
| Order Date | The date of the sales order. Defaults to today if not specified. | 2025-12-31 |
| Currency | The currency code for the order, up to 5 characters. Derived from the customer master data if not specified. | EUR |
| Customer PO | The customer purchase order reference, up to 35 characters. | PO-2025-001 |
| Customer PO Date | The date of the customer purchase order. | 2025-12-31 |
| Delivery Date | The requested delivery date. | 2025-12-31 |
| Payment Terms | The payment terms code, up to 4 characters. Derived from the customer master data if not specified. | 0001 |
Date format
All date fields must use the YYYY-MM-DD format (e.g., 2025-12-31). The block rejects dates in any other format.
Line items
A sales order needs at least one line item. For each line item, fill in the following fields:
| Field | Required | Description | Example |
|---|---|---|---|
| Material | Yes | The material or product number, up to 40 characters. | 20060145 |
| Quantity | Yes | The order quantity for the material. | 1 |
| Unit | Yes | The unit of measure, up to 3 characters (e.g., EA, PC, KG). |
PC |
| Item Category | No | The sales order item category, up to 4 characters. If left empty, SAP determines the item category from the order type and material. | ZSFP |
A line item is only sent to SAP when its Material, Quantity, and Unit are all filled in. If no line item is complete, the block fails with an error instead of creating an empty order.
Output of the block
When the sales order is created successfully, the block returns the details of the new order so later steps in the flow can use them, for example to send a confirmation reply to the customer. The output includes:
- The sales order number assigned by SAP (e.g.,
0000000123) - The header data of the created order, such as the order type, sales organization, customer, dates, currency, and payment terms
- The created line items, each with its item number, material, quantity, and unit
- The number of line items in the order
Troubleshooting
- A field exceeds its maximum length: The block validates field lengths before sending the order to SAP and reports which field is too long. Shorten the value and run the flow again.
- A date is rejected: Make sure every date is in the
YYYY-MM-DDformat. - The order is not created: Check that at least one line item has its Material, Quantity, and Unit filled in, and that the codes you use (order type, sales organization, distribution channel, division, item category) exist in your SAP system.
0 comments
Please sign in to leave a comment.