SAP sales order automation means booking sales orders from data instead of typing each one into VA01. PostNow runs it from Excel: an order header and its partners sit together, the line items follow on their own rows, and the add-in posts everything through the standard BAPI_SALESORDER_CREATEFROMDAT2, attaching the sold-to and ship-to, scheduling and pricing each line, checking the values, and committing every order in one run, with any SAP error explained in plain language.

SAP sales order automation infographic showing how sales orders are created from Excel by sales area, customer, and item.
Creating validated SAP sales orders from a spreadsheet in a single run.

This is a twelve-step worked example of creating sales orders from Excel to SAP, single-line and multi-line orders together, in one mass run. Keep the mapping, partners and grouping included, and you have a sales order Excel template ready for the next batch. It holds on classic ECC and on S/4HANA, where Sales and Distribution still books orders behind VA01 and the same BAPI. After a one-time setup, the order desk running the load needs no ABAP and no developer.

Why create sales orders from Excel instead of keying VA01

Entering a sales order in VA01 means setting the order type and sales area, naming the sold-to and ship-to, then adding each material with its quantity, plant, and date. A single order is straightforward. A daily wave of orders from a portal export, a seasonal surge, or a backlog at cutover turns it into screen after screen, and a wrong sales area or an unextended customer only shows once the order refuses to save.

Creating sales orders from Excel rebalances the work. The orders are already in a spreadsheet, often dropped out of a webshop or EDI feed, and each one books in a single governed run. For a steady bulk sales order creation or a one-off mass sales order upload, the awkward parts, choosing the function, mapping header, partner, and item fields, getting requested dates right, and reading SD messages, are taken care of. The twelve steps below set out the whole flow.

Before you start: what you need

  • Your orders in Excel, the header and partners on one row and a row per line item, with a shared key (an order reference) so the parts can be grouped into one order.
  • SAP authorization to create sales orders, the access you would use for VA01, across the order types and sales areas you are loading.
  • PostNow in Excel, with a live link to your SAP system. Its function modules are deployed to SAP once at setup, and the order loads then run entirely from the task pane.
🧭
ECC or S/4HANA? Sales and Distribution books orders the same way on both, VA01 on the surface and BAPI_SALESORDER_CREATEFROMDAT2 beneath, so the steps apply unchanged. S/4HANA may present the order through Fiori sales apps, but the posting interface is the same.
🔧
Installed once. PostNow's function modules are set up in SAP a single time by your Basis or ABAP team. None of the sales order loads below call for further development.

Your sales order Excel template: the fields SAP expects

A sales order joins a header, the partners it is sold and shipped to, and the items being ordered, so the template blends header columns, partner columns, and repeating item columns. These are the fields an order load depends on; carry them, and check that the customers, materials, and sales area they name already exist.

Excel columnSAP fieldWhy it matters
Order typeAUARTHeader; sets the order category and number range (TVAK)
Sales areaVKORG / VTWEG / SPARTHeader; the sales org, channel, and division must be set up together
Sold-to partyKUNNR (AG)Partner; required, and must exist for the sales area (KNA1)
Customer PO numberBSTKDHeader; the customer's reference for the order
MaterialMATNRItem; the product being ordered
Target quantityZMENGItem; how much is ordered, in the sales unit
PlantWERKSItem; the delivering plant, which must exist (T001W)
⚠️
What sinks most sales order loads: a sold-to customer not extended to the sales area, a material not maintained for that sales org, or a missing ship-to partner. Step 9 checks the customer, material, and sales area against live SAP, and the grouping in Step 6 keeps each partner and line tied to the right order, so nothing has to be repaired by hand.
⚙️
Which BAPI creates a sales order? Sales and Distribution uses a single standard call. BAPI_SALESORDER_CREATEFROMDAT2 books the order and BAPI_SALESORDER_CHANGE amends it. It brings together ORDER_HEADER_IN, a required ORDER_PARTNERS table carrying at least the sold-to (and usually a ship-to), ORDER_ITEMS_IN for the lines, ORDER_SCHEDULES_IN for requested quantities and dates, and ORDER_CONDITIONS_IN for any manual pricing, with INX structures marking which fields to write. The order is persisted by BAPI_TRANSACTION_COMMIT and the call returns the new SALESDOCUMENT number. Step 2 has PostNow's function finder pick BAPI_SALESORDER_CREATEFROMDAT2, pull its structures in, and run the commit.

The sales order load, step by step

Lay out and open your sheet

Put each order header on a row with columns like Order Ref, Order Type, Sales Org, Channel, Division, Sold-To, Ship-To, and Customer PO, and give every line item its own row carrying the same Order Ref plus Material, Quantity, and Plant. Open the workbook and launch the PostNow task pane beside it.

The PostNow pane is open beside your header, partner, and item rows.

Choose the sales order BAPI

A standard call books the order, so nothing is recorded. Open the function finder and take the call the job needs:

  • For new orders, take BAPI_SALESORDER_CREATEFROMDAT2, which books a header with its partners and items in one call
  • To amend an order, take BAPI_SALESORDER_CHANGE, which writes the fields you flag
  • The order is saved only once the commit runs, and PostNow issues BAPI_TRANSACTION_COMMIT after each successful booking

Confirm the function and PostNow brings in its header, partner, and item structures, ready to line up with your columns, and keeps the choice for every order so VA01 stays closed.

SAP sales order automation: Function finder with BAPI_SALESORDER_CREATEFROMDAT2 selected and its structures
Select the sales order BAPI and pull in its structures
BAPI_SALESORDER_CREATEFROMDAT2 is chosen and its structures are ready to map.

Look over the structures it returns

The call returns a header that appears once, a partner table the order cannot do without, and items that repeat. Because it mirrors how an order is built, a glance shows what belongs to the order and what belongs to each line:

Header (one per order)
ORDER_HEADER_IN / INXOrder type, sales area, customer PO number, requested delivery date.
Partners (required)
ORDER_PARTNERSAt least the sold-to (AG); ship-to (WE) and others as the order needs.
Items (many per order)
ORDER_ITEMS_IN / INXLine number, material, target quantity, plant, item category.
ORDER_SCHEDULES_INRequested quantities and dates for each line.
ORDER_CONDITIONS_INManual pricing where it applies.
Result
RETURN / SALESDOCUMENTMessages per order, and the order number the call hands back.

That tells you, before any mapping, which columns are header, which are partners, and which repeat per line.

Open the Mapping Designer

Picking the BAPI loads the Mapping Designer with a line for every header, partner, and item field. Two things help here:

  • Extensions are detected. Append fields your system adds to the order header or item, often custom SD fields, are pulled in automatically.
  • You can add your own. Whatever it does not catch you add yourself, so standard and custom fields travel in the same load.
SAP sales order automation: Mapping Designer listing order header, partner, and item fields and detected extensions (view 1 of 2)SAP sales order automation: Mapping Designer listing order header, partner, and item fields and detected extensions (view 2 of 2)
Header, partner, and item fields, ready to map
Header, partner, and item fields, plus any extensions, are listed.

Match columns with Mapping AI AI

Now connect the structures to your spreadsheet. Mapping AI proposes an Excel column for each header, partner, and item field, reading your headers or a screenshot you drop in, and you confirm or adjust, which helps when an order mixes header attributes, partner roles, and repeating line fields.

SAP sales order automation: Mapping AI matching order header, partner, and item fields from headers or a screenshot
AI proposes the field-to-column mapping for you to confirm
Each field shows a suggested column to accept or change.

Auto Map and nest items under each order

Press Auto Map to lock the mapping in and tag the sheet headers with their SAP fields. Because an order has structure, this is where you set the header/detail grouping: rows sharing an order reference are gathered into one order, the header and partners read once and the item rows read as lines. The workbook is now the template, and the grouping is saved alongside it.

SAP sales order automation: Auto Map with grouping: partners and item rows nested under each order header (view 1 of 2)SAP sales order automation: Auto Map with grouping: partners and item rows nested under each order header (view 2 of 2)
Columns mapped, with partners and items grouped under their order
🔁
Single-line or multi-line? A one-line order is a header, its partners, and one item row. For multi-line orders, repeat the order reference down the item rows and the grouping folds them into one document.
Partners and item rows are grouped under their order and the columns are tagged.

Set formatting and the update flags

A field's properties shape how its value posts: upper case on codes, a date format on the requested delivery date, the right decimals on quantities, defaults, and regex. Customer and material numbers are padded to their stored length so the partner and item resolve.

For amendments through BAPI_SALESORDER_CHANGE, the INX structures (ORDER_HEADER_INX, ORDER_ITEMS_INX) decide what is written: each field is written only if its indicator is switched on. Rather than ticking them by hand, PostNow spots the fields you have edited and raises their INX indicators for you, so amending a run of orders stays limited to the values you changed.

SAP sales order automation: Field properties with requested-date format, quantity decimals, and auto-marked INX indicators
Formatting rules, with the change indicators set for you
Numbers are padded, dates and quantities are formatted, and amendments carry their INX indicators.

Run the checks in Excel first

There is a good reason to check first: an SD error usually arrives as a short code once an order has already failed. Validate pulls that check forward, measuring every row against SAP's length, format, and required-field rules and marking the cells that fall short, so nothing leaves the sheet broken.

No format issues are left in the validation summary.

Confirm against live SAP

Good formatting is no guarantee a value is usable, a customer can read fine and not be extended to the sales area. To test it, open the field's properties, enable field validation, and supply the check table and field, a sold-to against KNA1, a material against MARA, or the sales organisation against its configuration. Pick the cell, run Validate master data, and PostNow checks live SAP for the value before you rely on it.

⚙️
Enable it before checking. Field validation has to be switched on with a table and field before the lookup will run. Leave it off and the value is checked for shape only, never against live SAP.
Customer, material, and sales-area references check out in live SAP.

Group items into orders with loops

A sales order is a natural header/detail case, with partners in the mix, so this is where the structure pays off:

  • Header/detail loops: rows sharing an order reference collapse into one order, the header and partners taken once and each item row added as a line, however many lines the order runs to.
  • IF conditions: include only the lines you want, for example dropping rows with a zero quantity or holding back items flagged as not orderable.
Partners and item rows are folded into their orders and any conditions are set.

Set the scope, post, and review AI

Set the range with Run Scope, post one order first, then release the rest, and hit Run. A few aids:

  • Run log: results stream into the run window and drop into a log column next to each row.
  • Payload view: open the exact data sent to SAP for any order, header, partners, and items together, so a failure is never a guess.
  • AI error review: AI Review reads the SD message and explains, plainly, what blocked the order and where to fix it.
  • RETURN per order: the BAPI reports messages per document, and PostNow ties each to its rows, writing the new order number back beside the order it belongs to.
Orders book, their numbers return to Excel, and any failure carries a readable explanation.

Publish and roll it out to the team

With a clean run done, hit publish. The configuration, partners, grouping, and all, becomes a script the order desk runs unchanged, they open it, paste their orders, and post, with no mapping to rebuild and no need to know the BAPI underneath. A one-time build becomes the standard way to book sales orders.

🔗
Chain it through order-to-cash. A Chain links published scripts and passes values along, book the sales order, then create the outbound delivery or the billing document against it. An order-to-cash step runs as one job rather than several manual loads, and a step can be made conditional so it only fires when the data calls for it.
The script is live and the order desk can book sales orders themselves.

Let's talk

Bring a real order file and a live SAP connection to a working session. We will tie the partners and items to their headers, map, validate, and book the orders for real, with AI taking the strain. No slide decks.

Frequently asked questions

What is SAP sales order automation?
It is booking sales orders in SAP through a programmatic call rather than keying each one in VA01. With PostNow the order data stays in Excel, partners and item rows tie to their header, and the orders post in one governed run via BAPI_SALESORDER_CREATEFROMDAT2, with AI mapping fields, validating values, and explaining errors.
How do you create sales orders in SAP from Excel?
Lay out the order header, the sold-to and ship-to partners, and one row per line item under a shared key, map the columns to the SAP fields, validate, then post in a single run. PostNow calls BAPI_SALESORDER_CREATEFROMDAT2, groups partners and items under each order, and commits it, so there is no VA01 keying and no ABAP.
Which BAPI creates SAP sales orders?
BAPI_SALESORDER_CREATEFROMDAT2 creates sales orders and BAPI_SALESORDER_CHANGE amends them. The call combines ORDER_HEADER_IN, a required ORDER_PARTNERS table for the sold-to and ship-to, ORDER_ITEMS_IN, ORDER_SCHEDULES_IN, and ORDER_CONDITIONS_IN, with INX structures flagging the fields to write. It is saved with BAPI_TRANSACTION_COMMIT, which PostNow handles for you.
Can you upload multi-line sales orders from Excel?
Yes. List the header and partners once and each line item on its own row under a shared key, and PostNow's header/detail loop collects the partners and items under the right order before posting through BAPI_SALESORDER_CREATEFROMDAT2. One sheet can carry many multi-line sales orders in a single mass run.
Is there a template for creating sales orders in SAP?
Yes, your spreadsheet is the template: header and partner columns plus one row per line item. PostNow saves the finished mapping and the grouping, so the same sales order Excel template serves every later load and can be shared across the order desk.

Related SAP automation solutions

This guide is part of PostNow's SAP automation library. Explore related topics and business areas.

Related topics
SAP Data MigrationSAP Process AutomationExcel to SAP AutomationSAP Automation Tools
By business area
SAP Transaction Data MigrationSAP Sales Automation