How to mass create materials in SAP with MM01
MM01 in SAP creates a material master record: a material number with a material type and industry sector, basic data for the whole client, and views such as purchasing, MRP, accounting and sales for each plant or sales area. To mass create materials in SAP and upload the material master from Excel, PostNow.ai calls BAPI_MATERIAL_SAVEDATA, SAP's create-and-change BAPI for materials, one material per call, so a list of new materials becomes an MM01 mass upload in one run. Validate checks the sheet offline, Simulate lets SAP check every material and rolls it back, and Run writes SAP's result to each row.
- Views decide the row count. Basic data is held once per material, while each plant, storage location, sales organisation and valuation area is its own segment, so a material for three plants is three rows.
- Two columns need review first. Material type and industry sector are set at creation and drive the number range, the screens and the valuation of the material. Changing a material type later is a separate transaction,
MMAM, with conditions SAP checks.
This page covers one job: creating SAP materials in bulk from Excel and extending existing materials to new plants and views. Changing fields on materials that already exist is in SAP material master mass update (MM02). The other master data objects and the order to load them in are in SAP master data mass upload, and a one-off legacy load for a go-live is planned in SAP master data migration.
How PostNow.ai mass creates MM01 materials from Excel
PostNow.ai treats an MM01 mass upload as a template: a designer builds it once against your SAP system and publishes it, and the people who request materials run their own lists through it, each user under their own SAP login on their own computer.
- Start from the template or the BAPI. Download the free MM01 material master template, whose columns are already mapped to
BAPI_MATERIAL_SAVEDATA, or search for that BAPI by name in your own system. Find with AI proposes the same BAPI when you describe the job as MM01. - One row per material per plant. The material number, industry sector, material type and the view switches go in the BAPI's
HEADDATA; client-level fields go inCLIENTDATA, the plant's fields inPLANTDATA, and the accounting fields inVALUATIONDATA. By default PostNow.ai sends each row as its own call, so SAP's answer belongs to exactly one material and one plant. - Let PostNow.ai set the X flags. Every data structure of the BAPI has an X twin that tells SAP which fields to write. When you map a field, PostNow.ai sets its flag in the X structure, copies key fields such as the plant into the X structure at Run, and shows any pair that needs your decision in a review popup.
- Keep the keys as text. Numeric material numbers are stored with leading zeros in SAP. Format the material column as text and switch on Leading Zeros for the field, with a target length where needed, so PostNow.ai pads the value before it is sent.
- Validate, then Simulate. Validate checks every cell offline: required fields, type, length, date and decimal format, and allowed values, such as an allow-list of material types. Simulate then calls
BAPI_MATERIAL_SAVEDATAfor every row and thenBAPI_TRANSACTION_ROLLBACKinstead of a commit, so SAP's own messages appear on each row and no material is created. - Run. For each row PostNow.ai calls the BAPI and commits with
BAPI_TRANSACTION_COMMITonly when SAP returned no error; otherwise it rolls back. The Run Log cell shows SAP's result, such as "The material … has been created or extended", with the SAP user, time and system. - Re-run only what failed. Retry Failed re-posts only the rows marked ERROR. If someone clicks Run again on the same sheet, PostNow.ai first lists the rows whose Run Log already shows a success and offers Skip posted rows before anything is sent to SAP.
While the sheet is being filled, SAP Lookup (F4 help) on the ribbon lets the user pick valid values for the active cell, such as plants, material groups or purchasing groups, from the SAP system they are connected to. Where master data governance wants a second pair of eyes on new materials, an approval policy on the template holds the run until an approver has reviewed the rows in the PostNow.ai portal. The approval is tied to that exact data, so a sheet changed after approval needs approval again.
SAP material master automation from Excel: what it covers
With PostNow.ai, SAP material master automation from Excel covers the whole life of a material record, each job in its own template:
| Job | SAP transaction | Route in PostNow.ai |
|---|---|---|
| Create new materials | MM01 | Template on BAPI_MATERIAL_SAVEDATA, or an MM01 recording |
| Extend materials to a new plant, storage location or sales area | MM01 on an existing material | An extend template on the same BAPI: only the new segment and its view switch are sent |
| Change fields on existing materials | MM02 | A change template on BAPI_MATERIAL_SAVEDATA; see MM02 mass update |
| Download, edit and post back | MM02 | PostNow.ai SAP mass change: current values read from the material tables, edited in Excel, changed rows posted back |
| Check the result | MM03 | The Run Log per row; Material Master 360 and Master Data Completeness Audit in the Report Library |
What stays with the business is the design: which material type a new item gets, which plants and sales areas need it, and which valuation class accounting wants. PostNow.ai makes those decisions visible as columns, so they are reviewed before the run and not discovered in the first purchase order. A full read of the material master into Excel is covered in the SAP material master report.
Material type and industry sector: what they decide
A PostNow.ai MM01 template has material type and industry sector as required columns, because SAP reads both before any other field of the material. They sit in HEADDATA-MATL_TYPE and HEADDATA-IND_SECTOR, the same two fields as on the MM01 initial screen.
- Material type (
FERT,HALB,ROH,HAWAand your own types) decides the number assignment and number range, which screens and fields the material offers, and whether stock is updated in quantity, in value, or both. A raw material and a non-valuated material behave differently in every goods movement that follows. - Industry sector (
Mmechanical engineering,Cchemical,Ppharmaceuticals and others) is, with the material type, one of the factors that decide the screen sequence and field selection of the material master. - Changing the type later is its own job.
MMAMchanges the material type of an existing material, and SAP checks the material's situation first: SAP KBA 2698971, for example, covers MMAM refusing the change because production orders exist. Review the type column before the run, when a correction is one cell. - Fix the values per template where they never vary. When a file only ever creates purchased raw materials, set material type and industry sector as fixed values in the template, so operators cannot type a different one.
Material types and their number ranges are configuration, transported into each client before the load. A file built in a sandbox can carry a material type the production client does not have, and every row of that type then fails on the same message.
Material views and the organisational level each one needs
PostNow.ai maps each material view to the BAPI structure that holds it, and each structure has its own organisational key. This table is the map from MM01's views to BAPI_MATERIAL_SAVEDATA:
| View in MM01 | Switch in HEADDATA | BAPI structure | Organisational level (table) |
|---|---|---|---|
| Basic data | BASIC_VIEW | CLIENTDATA, MATERIALDESCRIPTION, UNITSOFMEASURE | Client (MARA, MAKT, MARM) |
| Purchasing | PURCHASE_VIEW | PLANTDATA (purchasing group and other plant fields) | Plant (MARC) |
| MRP | MRP_VIEW | PLANTDATA, plus STORAGELOCATIONDATA for storage location MRP | Plant (MARC) |
| Sales | SALES_VIEW | SALESDATA (sales organisation, distribution channel); plant-level sales fields in PLANTDATA | Sales organisation + distribution channel (MVKE) |
| Accounting | ACCOUNT_VIEW | VALUATIONDATA (valuation class, price control, price) | Valuation area (MBEW) |
| Costing | COST_VIEW | PLANTDATA, VALUATIONDATA | Plant and valuation area |
| Storage | STORAGE_VIEW | STORAGELOCATIONDATA | Storage location (MARD) |
SAP lets you save a material with basic data only, and that material cannot yet be used in a plant: the first purchase requisition or goods receipt for that plant fails with a message that the material is not maintained in the plant, not one that names the missing view. Decide with purchasing, planning, accounting and sales which views each material needs, and make those columns required in the template.
The row count follows the organisational levels
PLANTDATA, SALESDATA, VALUATIONDATA and STORAGELOCATIONDATA are single structures in BAPI_MATERIAL_SAVEDATA, so one call carries one plant, one sales area, one valuation area and one storage location. A material needed in three plants is three rows: the first creates it, the next two extend it. Four hundred materials with purchasing, MRP and accounting views in three plants are twelve hundred rows, and a sales view in two sales areas adds more. Count the rows before you build the file; a short sheet means a material missing from a plant, which nobody sees until someone orders it there.
Create or extend: one BAPI, two different jobs
PostNow.ai uses the same BAPI for both, because SAP does: BAPI_MATERIAL_SAVEDATA creates the material when the number is new and adds a segment when the material exists and the plant, sales area or valuation area does not. The difference is in the file, so keep creates and extensions in separate templates.
- Create sends the material type, industry sector, basic data and every view the material needs from day one. The material number must be new.
- Extend sends the existing material number, the view switch and the new organisational level only, such as plant
1020with its MRP and accounting fields. Material type and basic data are already in SAP and stay as they are. - A new plant opening is an extension job. The materials exist; they need purchasing, MRP and accounting data for a plant that did not exist before. Check
MARCinSE16Nfor the new plant first, so the file holds only the materials that are missing there. - A typing error turns a create into an extension. A material number that already exists in SAP is not rejected as a duplicate: the row adds or changes that material's segments. Compare the file's numbers with SAP before a create run.
An extend template has few columns: the material, the switches of the views being added, the new plant, storage location, sales area or valuation area, and the fields those views require. The worked example on the master data hub extends 240 materials to a new plant this way.
Posting route: MM01 recording or BAPI_MATERIAL_SAVEDATA
PostNow.ai creates materials either way: by calling BAPI_MATERIAL_SAVEDATA over RFC, or by replaying an MM01 recording. SAP's short text for the BAPI is "Create and Change Material Master Data", and it is the route the free template uses. These are the parameters an MM01 upload fills:
| BAPI parameter | Kind | What an MM01 upload puts in it |
|---|---|---|
HEADDATA | Import | Material number, industry sector, material type and the view switches (BASIC_VIEW, PURCHASE_VIEW, MRP_VIEW, ACCOUNT_VIEW, SALES_VIEW and the others) |
CLIENTDATA / CLIENTDATAX | Import | Base unit, material group, division, weights, old material number |
PLANTDATA / PLANTDATAX | Import | The plant and its fields: purchasing group, MRP type, MRP controller, lot size, procurement type, planned delivery time |
VALUATIONDATA / VALUATIONDATAX | Import | Valuation area, valuation class, price control, standard or moving average price, price unit |
SALESDATA / SALESDATAX | Import | Sales organisation, distribution channel and the sales fields, such as the item category group |
MATERIALDESCRIPTION | Table | The description, one line per language |
UNITSOFMEASURE / UNITSOFMEASUREX | Table | Alternative units with their conversion to the base unit |
EXTENSIONIN / EXTENSIONINX | Table | Customer fields added to the material master |
RETURN, RETURNMESSAGES | Export, table | SAP's result and the full message list; PostNow.ai writes the result to the row's Run Log |
The X structures decide what is written. A field filled in PLANTDATA is ignored unless the same field is flagged X in PLANTDATAX, and the X structure also carries the key, the plant, so SAP knows which segment the flags belong to. Without the flag, the call can return success while the field stays empty. PostNow.ai fills both from the mapping. PostNow.ai follows a clean call with BAPI_TRANSACTION_COMMIT, the commit SAP's BAPI programming model leaves to the caller.
BAPI route for large loads. PostNow.ai creates through BAPI_MATERIAL_SAVEDATA by default, one material per call. For a large migration you can pick BAPI_MATERIAL_SAVEREPLICA instead: search for it by name in your own system. SAP's short text calls it the "BAPI for Mass Maintenance of Material Data", and SAP links it to its own S/4HANA migration object for materials (SAP KBA 2565362). It carries the same views and X flags, passed as tables (CLIENTDATA, PLANTDATA, VALUATIONDATA and the others, each with its X table) keyed by material number, so one call can hold several materials. Both serve the standard material master; IS-Retail articles are maintained with BAPI_MATERIAL_MAINTAINDATA_RT instead.
Who assigns the material number
PostNow.ai sends the material number from the row, so the number assignment of the material type decides how you fill that column.
- External numbering: the number is in the file, for example
TG-1101, and goes intoHEADDATA-MATERIAL. It must fall within the material type's external number range. This is the simplest route for a mass upload, because the sheet holds the number before the run. - Internal numbering with the BAPI: SAP's documentation for
BAPI_MATERIAL_SAVEDATAexpects the number inHEADDATA-MATERIAL;BAPI_MATERIAL_GETINTNUMBERdraws internal numbers for a material type first. Numbers drawn and then not used leave gaps in the range. - Internal numbering with a recording: an MM01 recording with the material field left empty lets SAP assign the number at save. Set the template's Run Log Message to a text such as Material $V1 created: the placeholder takes the number from SAP's save message, so each row's Run Log shows the material SAP assigned.
Recording MM01 instead
A recorded MM01 works too: record one material in SHDB with the views your file fills, map the screen fields to columns, and PostNow.ai replays the recording for every row. The BDC recording guide covers how to record so the replay holds, and BAPI vs BDC in SAP compares the two methods.
- Views are picked by position. The Select Views dialog lists the views the material type offers, and the recording ticks lines by their position in that list. A recording made for
FERTcan tick a different view when it replays forROH, so keep one recording per material type and view set. - Recording mode needs PostNow.ai's
ZPOSTNOW_*objects in SAP, installed once per system. The BAPI route needs no add-on objects: RFC access plus the user's normal material master authorizations. - Simulate on a recording walks the MM01 screens without saving, so SAP's save-time checks arrive at Run. Prove the recording on one material in Debug before the first full file.
- SAP GUI stays with the user. PostNow.ai logs in to SAP GUI only on the user's own computer, with the user's own stored login, when the user starts the action (Record, Run, Debug or Call Transaction); never on a server, never unattended, never with someone else's login.
Worked example: 8 purchased raw materials for plant 1010
PostNow.ai handles this with one published MM01 create template on BAPI_MATERIAL_SAVEDATA and one sheet. Purchasing has eight new raw materials from a new supplier, needed in plant 1010 with basic data, purchasing, MRP and accounting views. Material type ROH uses external numbering in this system, so the requester fills TG-1101 to TG-1108. Material type and industry sector are fixed values in the template, so the sheet has one row per material.
| Column | Row 2 (first material) |
|---|---|
| Material / industry sector / material type | TG-1101 / M (fixed) / ROH (fixed) |
| Description (EN) / base unit / material group | Steel bar cold drawn 40 mm / KG / M0200 |
| Plant / purchasing group | 1010 / 100 |
| MRP type / MRP controller / lot size / planned delivery time | PD / 001 / EX / 14 days |
| Valuation area / valuation class / price control / moving average price | 1010 / 3000 / V / 1.85 per 1 KG |
- Validate. Two cells are flagged: a description of 44 characters, over the 40 allowed, and a base unit typed as
KGS, which is not on the template's list of units. The requester fixes both in Excel. - Simulate. Six rows pass. Row 5 returns
M3 180: it carries valuation class7920, which is not allowed for material typeROHin this system, and accounting confirms3000. Row 8 returnsMG 144for the purchasing group, left empty; field selection makes it required for this material type. - Run. All eight materials are created. Each row's Run Log shows SAP's message that the material has been created or extended, with user, time and system.
- Check. The Master Data Completeness Audit report lists the eight materials with a plant and a valuation view in
1010, and a test purchase requisition forTG-1101in plant1010picks up purchasing group100.
The sales view for these materials is not needed: they are consumed in production, not sold. If sales later needs one of them, that is an extension run with the sales organisation and distribution channel, not a new material.
MM01 and the material master in S/4HANA
PostNow.ai uses the same MM01 template on ECC and S/4HANA, because MM01 and BAPI_MATERIAL_SAVEDATA carry over. The differences sit in the material number, the migration tooling and a few release-specific messages:
| Topic | SAP ECC | SAP S/4HANA |
|---|---|---|
| Material number length | Up to 18 characters | Up to 40 characters once the extended material number is activated (SAP Note 2267140: Activate Extended Fields, transaction FLETS, then the length in OMSL); off by default |
| BAPI field for the number | HEADDATA-MATERIAL | SAP kept the 18-character BAPI fields and added long fields next to them, such as HEADDATA-MATERIAL_LONG. Check in SE37 on your release which one your system reads |
| Initial data load | LSMW or a custom program | The Migration Cockpit's material (product) objects; SAP KBA 2565362 covers internal numbering in the Material object |
Two practical points. A template built on ECC with an 18-character material column needs that column widened before longer numbers are used. And some checks run only at save: SAP KBA 3459002 describes message 6P002 on S/4HANA 2022 and 2023 appearing when the material is saved through MM17, BAPI_MATERIAL_SAVEDATA or BAPI_MATERIAL_SAVEREPLICA, but not in simulation. Run one real material in the quality client before the production file.
MM01 upload errors and the fix
PostNow.ai writes SAP's message to each failed row's Run Log, so the fix starts from the message text. These are the ones a bulk MM01 run meets most:
| Message | What it means | Fix |
|---|---|---|
MG 144 The field … is defined as a required field; it does not contain an entry | Field selection for this material type, view or plant makes the field required, and the row left it empty or did not flag it in the X structure | Fill the field and mark it required in the template. If it is filled, check that its X flag is set |
MG 142 The value … is not allowed for the field … | The value is not allowed for that field in the target client: missing from Customizing, or not permitted for this material type or plant, such as a material group, MRP type or procurement type | Pick values with SAP Lookup from the client you load into; transport missing Customizing first |
M3 180 Valuation class … not allowed for material type … | The valuation class does not belong to the material type's account category reference | Ask accounting for the right class per material type; make the column an allow-list per template |
MG 160 The material cannot be maintained since no maintainable data transferred | The call carried no field SAP could write: no view switch set, or no X flags | Check the view switches in HEADDATA and the X structures in the mapping |
Success, but a field is empty in MM03 | The field was sent without its X flag, or in a structure whose view switch was not set | Review the X pairs in the mapper; re-post the field with a change template |
| Run Log: UNKNOWN (PostNow.ai) | SAP's answer was lost after the row was sent, so the material may have been created | Look the material up in MM03 before running the row again; Retry Failed leaves UNKNOWN rows alone |
Checklist before an MM01 mass upload
PostNow.ai checks formats and allowed values and keeps operators on the published template; this list covers the decisions that stay with the people who own the materials.
- The sheet holds only new materials; extensions to new plants or sales areas are in a separate extend file, and changes in an MM02 file.
- Material type and industry sector were reviewed row by row, or are fixed values in the template.
- Every material type in the sheet, with its number range, exists in the client you load into.
- The file has one row per material per plant, and per sales area where a sales view is created.
- Each view the material needs has its required columns: purchasing group, MRP type, valuation class and price control, sales organisation and distribution channel.
- Material numbers are formatted as text, with Leading Zeros switched on where your numbers are numeric, and none of them exists in SAP yet.
- Descriptions and old material numbers were compared with existing materials, to catch an item that is already in SAP under another number.
- Simulate has run clean on the whole sheet in the target client.
What to plan for in an MM01 mass upload
PostNow.ai creates materials through SAP's material master interface, so SAP's own field selection, Customizing and number range checks decide each row. Plan the run around them:
- Run SAP's checks in Simulate. Validate checks formats, lengths and allowed values in Excel; field selection, valuation class and number range checks start when SAP sees the material in Simulate.
- Screen for duplicates first. Materials are identified by their number, so a duplicate is the same item created again under a new number. Read the existing materials with Material Master 360 and compare descriptions and old material numbers before the run.
- Load in order. Materials come before the bills of material that use them, the purchasing info records and source lists that name them, and the pricing conditions. Components are created and extended to their plants before any BOM upload.
- Prove the views, not only the records. A record count shows that materials exist. A test purchase requisition in each plant, a sales order line in each sales area and a goods receipt for one valuated material show that the views work.
- Keep re-runs in the same workbook. The re-post check reads this sheet's Run Log, and UNKNOWN rows are checked in SAP before anyone runs them again.
Making a template like this repeatable for a team (designers who build, operators who only run, a published template in the central library) is covered in Excel to SAP automation. Vendors for the new supplier are created with the SAP vendor master upload (XK01), and materials next to the other master data objects are in SAP master data mass upload.
Free MM01 material master upload template
PostNow.ai publishes a free MM01 material master template: one row per material per plant, sample rows for several material types, and a field guide that maps every column to its BAPI_MATERIAL_SAVEDATA field. Its companion, the MM02 change template, is mapped to the same BAPI. Fill the Material column on every row: BAPI_MATERIAL_SAVEDATA expects the number in HEADDATA-MATERIAL, so for a material type with internal numbering draw the numbers first, as described under who assigns the material number. Open either template in PostNow.ai to map and simulate it against your own system, or browse the other SAP master data templates.
