Create a Sales Order with the Create Sales Order Block

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:

You should also be familiar with building flows. See Create your first automation flow.

Add the block to a flow

  1. Open or create a flow in the automation builder.
  2. Hover over the block you want the sales order to be created after, then click the + icon that appears.
  3. In the block picker, select the Create sales order block of your SAP S/4HANA integration.
  4. 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
Sold-To Party 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 Party The customer number of the ship-to party (the delivery location). Like the Sold-To Party 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
Delivery Block The delivery block code, up to 2 characters. Z1
Sales Group The sales group code, up to 3 characters. Derived from the customer if not specified. 001
Shipping Condition The shipping condition code, up to 2 characters. Derived from the customer if not specified. 01
Shipping Type The shipping type code, up to 2 characters. 01
Text Language The language of the header and line texts, 2 characters. Defaults to EN. NL

Repeatable header fields

You can also add one or more rows to the following optional groups:

  • Additional Partners: extra partners on the order. Each row has a Partner Function code as the SAP API expects it (e.g., BP for bill-to or CR for forwarding agent) and a Customer, Supplier or Contact Person. Use the Ship-To Party field for the ship-to partner.
  • Header Texts: texts on the order, each with an SAP Text ID (e.g., 0001 or Z001) and the Text.
  • Header Conditions: manually enterable pricing conditions, each with a Condition Type (e.g., ZH02), a Value (amount or percentage, with a dot as decimal separator) and, for amount conditions only, a Currency.
  • Custom Fields: custom fields of the sales order, each with the SAP API Field Name from the sales order metadata (e.g., YY1_CRMOpportunity_SDH, not the F1 technical name) and a Value. Rows without a value are skipped.

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
Plant No The delivering plant, up to 4 characters. Derived by SAP if not specified. 1000
Reason for Rejection No A rejection reason code, up to 2 characters. Setting it rejects this line in SAP. 01
Item Description No A short item text, up to 40 characters. Defaults to the material description. Blue pallet
Line Texts No Texts for the line in the form ID=text; ID2=text, in the Text Language. Texts cannot contain ;. Z001=Leave at gate
Line Conditions No Pricing conditions for the line in the form TYPE=value; TYPE2=value, with a dot as decimal separator. Z004=10
Custom Fields No Custom fields of the line in the form NAME=value; NAME2=value2, using SAP API field names. Values cannot contain ;. YY1_ShipDays_SDI=5

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, sold-to and ship-to party, partners, dates, currency, and payment terms
  • The created line items, each with its item number, material, quantity, unit, and the optional line fields you filled in
  • 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-DD format.
  • 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.

Related articles

0 comments

Please sign in to leave a comment.