SAP bill of material automation is the practice of building material BOMs from a spreadsheet, each parent with its components beneath, rather than keying every line into CS01. PostNow runs it from Excel: each component is a row, and the add-in posts them with the standard CSAP_MAT_BOM_CREATE function module, gathering components under their parent, checking the values, and committing in one run, with any SAP error rendered in plain language.

SAP bill of material automation infographic showing how BOM headers and components are created from Excel in one validated load.
Building multi-level SAP bills of material from a spreadsheet without manual entry.

This is a twelve-step worked example of creating bills of material from Excel to SAP, parent materials with their full component lists, built in one run. Keep the mapping, the component grouping included, and you have a BOM Excel template ready for the next product or engineering change. It works on classic ECC and on S/4HANA, where production still maintains BOMs behind CS01 and the same function. Once setup is done the first time, the people loading BOMs need no ABAP and no developer.

Why create bills of material from Excel instead of keying CS01

Building a BOM manually in CS01 means choosing the parent material, plant, and usage, then adding each component with its item category, quantity, and unit, line after line. A short BOM is quick. A finished product with dozens of parts, a new plant's product range, or a migration of an engineering library becomes hundreds of components keyed one at a time, and a wrong item category or a missing component only shows once the line is rejected.

Creating bills of material from Excel changes the work. The structures already sit in a spreadsheet, an engineering export or a planning file, and post to SAP, each parent with its components, in one run. For a routine bulk BOM upload or a one-off mass bill of material load, the awkward parts, picking the function, mapping the header and component fields, getting item categories and quantities right, and reading CS messages, are taken care of. The twelve steps below map out the whole flow.

Before you start: what you need

  • Your BOMs in Excel, one component per row, with a shared parent material so the components group into one BOM.
  • SAP authorization to maintain BOMs, the access you would use for CS01, across the plants and BOM usages you are building.
  • PostNow in Excel, connected straight to your SAP system. Its function modules are registered in SAP a single time with your Basis or ABAP team, after which the BOM runs happen from the task pane.
🧭
Parent over components. The parent material, plant, usage, and base quantity define the BOM at the header, while each component is an item with its own category, stock or non-stock, and quantity. Get the parent and the item categories right and the rest follows.
🔧
Installed once. PostNow's function modules are registered in SAP a single time with your Basis or ABAP team. None of the BOM runs below need any further development.

Your BOM Excel template: the fields SAP expects

A BOM has a parent material at the header and a component on each item line. These are the fields a BOM run depends on; carry them, and confirm the parent material, components, and plant they name already exist.

Excel columnSAP fieldWhy it matters
Parent materialMATERIALHeader; the material the BOM describes
Plant / BOM usagePLANT / BOM_USAGEWhere it applies and its usage, 1 for production
Valid fromVALID_FROMThe date the BOM takes effect
Base quantityBASE_QUANHeader (STKO_API01); the quantity the BOM is built for
ComponentCOMPONENTItem; the part that goes into the parent
Item category / quantityITEM_CATEG / COMP_QTYL for stock, N for non-stock, and how much is used
⚠️
What stalls most BOM runs: an item category that does not suit the component, a component not extended to the plant, or a valid-from date that clashes with an existing BOM. Step 9 checks the parent material, components, and plant against live SAP, and the grouping in Step 6 keeps every component on its parent, so nothing has to be reshaped by hand.
⚙️
Which function creates a BOM? SAP ships a standard interface for BOMs. CSAP_MAT_BOM_CREATE creates a material BOM from the parent material, plant, and BOM usage, a header structure STKO_API01 carrying the base quantity and unit, and a component table STPO_API01 whose rows hold each item's category, component, and quantity. It is a function module rather than a classic BAPI, returns the new BOM number, and is persisted with COMMIT WORK. Step 2 has PostNow's function finder pick the function, pull its structures in, and take care of the commit.

The bill of material run, step by step

Lay out and open your sheet

Put each component on a row under headers like Parent Material, Plant, BOM Usage, Valid From, Component, Quantity, and Item Category, with a shared Parent Material so the components group into one BOM. Open the workbook and dock the PostNow task pane to one side.

The PostNow pane is open beside your BOM lines.

Choose the BOM function

A standard interface does the work, so nothing is recorded. In the function finder, pick the one you need:

  • Take CSAP_MAT_BOM_CREATE, which builds a material BOM with its components in one call
  • It is a function module rather than a classic BAPI, so it is persisted with COMMIT WORK rather than the transaction commit
  • The parent and header sit alongside the component table, so one call carries the whole structure

Confirm the function and PostNow brings in its header and component structures, ready to line up with your columns, so CS01 stays shut.

SAP bill of material automation: Function finder with CSAP_MAT_BOM_CREATE selected and its header and component structures
Select the BOM function and pull in its structures
CSAP_MAT_BOM_CREATE is chosen and its structures are ready to map.

Look over the structures it returns

What comes back is the parent, a header structure, a table of components, and the result. Because it mirrors how a BOM is built, a glance shows what belongs to the parent and what belongs to each component:

Parent & header
MATERIAL / PLANT / BOM_USAGEThe parent material, plant, and usage that define the BOM.
STKO_API01The header structure with the base quantity, unit, and status.
Components
STPO_API01A row per component with its item category, component, and quantity.
Result
Messages + BOM numberThe message per BOM, and the BOM number the call assigns.

That tells you, before any mapping, which columns describe the parent and which repeat per component.

Open the Mapping Designer

Choosing the function loads the Mapping Designer with a line for each header and component field. Two things matter here:

  • Extensions are detected. Append fields your system adds to the BOM structures are pulled in automatically.
  • You can add your own. Anything overlooked you place manually, so standard and custom fields ride in one run.
SAP bill of material automation: Mapping Designer listing the BOM header and component fields
Header and component fields, ready to map
Header and component fields, plus any extensions, are listed.

Match columns with Mapping AI AI

Now align the structures with your data. Mapping AI proposes an Excel column for each header and component field, reading your headers or a screenshot you drop in, and you confirm or adjust, useful when a BOM brings parent data alongside a list of components.

SAP bill of material automation: Mapping AI matching BOM fields from Excel 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 group components under a parent

Run Auto Map to settle the mapping and write SAP-tagged headers across the sheet. Because a BOM gathers several components, this is where you set the grouping: rows sharing a parent material build one BOM, the header read once and the component rows read as items. The workbook is the template after this, and the grouping is carried with it.

SAP bill of material automation: Auto Map with grouping: component rows nested under each parent material (view 1 of 2)SAP bill of material automation: Auto Map with grouping: component rows nested under each parent material (view 2 of 2)
Columns mapped and components grouped under their parent
Components are grouped under their parent and the columns are tagged.

Set formatting and defaults

A field's properties steer how its value posts: leading zeros on the material numbers, upper case on codes, a date format on the valid-from date, the right decimals on the component quantity, defaults for a constant plant or usage, and regex. Getting the quantity decimals right keeps each component consuming the amount the BOM intends.

Numbers are padded, dates and quantities are formatted, and defaults are in place.

Check the rows in Excel first

Best to check before posting: a CS error usually shows up as a short code once a BOM has already failed. Validate brings the check upstream, every row is held against SAP's length, format, and required-field rules and the problem cells are flagged, so the sheet is sound before any BOM is sent.

SAP bill of material automation: Validation panel: cells flagged, fixes applied, "0 BOMs will fail in SAP"
Catch errors in Excel, ahead of a terse CS code
The summary flags no format problems.

Confirm against live SAP

Clean formatting is no proof a value exists, a component can read fine and not be extended to the plant. To confirm it, open the field's properties, switch on field validation, and set the check table and field, a parent material or component against MARA, a plant against T001W, or a BOM usage against its configuration. Select the cell, run Validate master data, and PostNow asks live SAP whether the value is present and usable.

⚙️
Field validation comes first. The check only runs once field validation is set with a table and field named. Without that the cell is judged on format alone and never reaches SAP.
Parent material, components, and plant references are confirmed in live SAP.

Group components into BOMs with loops

A parent with its components is a natural header/detail case, so this is where the structure pays off:

  • Header/detail loops: rows sharing a parent material collapse into one BOM, the header taken once and each component added as an item.
  • IF conditions: include only the components you want, for example loading a line only where a quantity is present, or skipping rows flagged as superseded.
Components are folded into their BOMs and any conditions are set.

Set the scope, post, and review AI

Set the range with Run Scope, one BOM first, then the rest, and press Run. A few aids:

  • Run log: results land live and write into a log column beside each row in Excel.
  • Payload view: open the exact data sent to SAP for any BOM, parent and components together, so a failure is never a guess.
  • AI error review: AI Review reads the CS message and explains, plainly, what blocked the BOM and where to look.
  • BOM number: PostNow writes the new BOM number back beside the parent it belongs to.
BOMs post, their numbers return to Excel, and any failure carries a readable explanation.

Publish and roll it out to the team

Once the run is clean and verified, publish. The configuration, grouping and all, becomes a script engineering and planning run unchanged, they open it, paste their BOMs, and post, with no mapping to rebuild and no need to know the function underneath. A one-time build becomes the standard way to load product structures.

🔗
Chain it through product setup. A Chain links published scripts and passes values along, create the material master, then build its BOM. A new-product setup 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 team can load BOMs themselves.

Let's talk

Bring a real product structure and a live SAP connection to a working session. We will group the components under their parent, map, validate, and build the BOMs for real, with AI taking the strain. No slide decks.

Frequently asked questions

What is SAP bill of material automation?
It is creating material BOMs in SAP through a programmatic call rather than keying each one in CS01. With PostNow the BOMs stay in Excel and post in one governed run via the standard CSAP_MAT_BOM_CREATE function module, while AI maps the fields, checks the values, and explains any CS error.
How do you create bills of material in SAP from Excel?
List one component per row with the parent material, plant, BOM usage, valid-from date, component, quantity, and item category, validate, then post in a single run. PostNow calls CSAP_MAT_BOM_CREATE, groups components under their parent, and commits the BOM, so there is no CS01 keying and no ABAP.
Which function creates SAP bills of material?
CSAP_MAT_BOM_CREATE creates a material BOM from the parent material, plant, and BOM usage, a header structure STKO_API01 with the base quantity, and a component table STPO_API01 holding each item, its category, component, and quantity. It is a function module rather than a classic BAPI, returns the BOM number, and is saved with COMMIT WORK, which PostNow handles for you.
How are the parent material and its components handled?
The parent material, plant, usage, and base quantity sit at the header, while each component is a row in the item table with its own item category, stock or non-stock, component, and quantity. PostNow groups the component rows under their parent, so one sheet can build a multi-line BOM in a single run.
Is there a template for creating bills of material in SAP?
Yes, your spreadsheet is the template: one row per component with the parent material and the header data. PostNow saves the finished mapping and the grouping, so the same BOM Excel template serves every later build and can be shared with engineering and planning.

Related SAP automation solutions

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

Related topics
SAP Master Data GovernanceSAP Master Data ManagementExcel to SAP AutomationSAP Automation Tools
By business area
SAP Master Data AutomationSAP Master Data Migration