Quick answer

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.

  1. 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.
  2. 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 in CLIENTDATA, the plant's fields in PLANTDATA, and the accounting fields in VALUATIONDATA. By default PostNow.ai sends each row as its own call, so SAP's answer belongs to exactly one material and one plant.
  3. 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.
  4. 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.
  5. 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_SAVEDATA for every row and then BAPI_TRANSACTION_ROLLBACK instead of a commit, so SAP's own messages appear on each row and no material is created.
  6. Run. For each row PostNow.ai calls the BAPI and commits with BAPI_TRANSACTION_COMMIT only 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.
  7. 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:

JobSAP transactionRoute in PostNow.ai
Create new materialsMM01Template on BAPI_MATERIAL_SAVEDATA, or an MM01 recording
Extend materials to a new plant, storage location or sales areaMM01 on an existing materialAn extend template on the same BAPI: only the new segment and its view switch are sent
Change fields on existing materialsMM02A change template on BAPI_MATERIAL_SAVEDATA; see MM02 mass update
Download, edit and post backMM02PostNow.ai SAP mass change: current values read from the material tables, edited in Excel, changed rows posted back
Check the resultMM03The 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, HAWA and 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 (M mechanical engineering, C chemical, P pharmaceuticals 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. MMAM changes 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 MM01Switch in HEADDATABAPI structureOrganisational level (table)
Basic dataBASIC_VIEWCLIENTDATA, MATERIALDESCRIPTION, UNITSOFMEASUREClient (MARA, MAKT, MARM)
PurchasingPURCHASE_VIEWPLANTDATA (purchasing group and other plant fields)Plant (MARC)
MRPMRP_VIEWPLANTDATA, plus STORAGELOCATIONDATA for storage location MRPPlant (MARC)
SalesSALES_VIEWSALESDATA (sales organisation, distribution channel); plant-level sales fields in PLANTDATASales organisation + distribution channel (MVKE)
AccountingACCOUNT_VIEWVALUATIONDATA (valuation class, price control, price)Valuation area (MBEW)
CostingCOST_VIEWPLANTDATA, VALUATIONDATAPlant and valuation area
StorageSTORAGE_VIEWSTORAGELOCATIONDATAStorage 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 1020 with 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 MARC in SE16N for 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 parameterKindWhat an MM01 upload puts in it
HEADDATAImportMaterial number, industry sector, material type and the view switches (BASIC_VIEW, PURCHASE_VIEW, MRP_VIEW, ACCOUNT_VIEW, SALES_VIEW and the others)
CLIENTDATA / CLIENTDATAXImportBase unit, material group, division, weights, old material number
PLANTDATA / PLANTDATAXImportThe plant and its fields: purchasing group, MRP type, MRP controller, lot size, procurement type, planned delivery time
VALUATIONDATA / VALUATIONDATAXImportValuation area, valuation class, price control, standard or moving average price, price unit
SALESDATA / SALESDATAXImportSales organisation, distribution channel and the sales fields, such as the item category group
MATERIALDESCRIPTIONTableThe description, one line per language
UNITSOFMEASURE / UNITSOFMEASUREXTableAlternative units with their conversion to the base unit
EXTENSIONIN / EXTENSIONINXTableCustomer fields added to the material master
RETURN, RETURNMESSAGESExport, tableSAP'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 into HEADDATA-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_SAVEDATA expects the number in HEADDATA-MATERIAL; BAPI_MATERIAL_GETINTNUMBER draws 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 FERT can tick a different view when it replays for ROH, 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.

ColumnRow 2 (first material)
Material / industry sector / material typeTG-1101 / M (fixed) / ROH (fixed)
Description (EN) / base unit / material groupSteel bar cold drawn 40 mm / KG / M0200
Plant / purchasing group1010 / 100
MRP type / MRP controller / lot size / planned delivery timePD / 001 / EX / 14 days
Valuation area / valuation class / price control / moving average price1010 / 3000 / V / 1.85 per 1 KG
  1. 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.
  2. Simulate. Six rows pass. Row 5 returns M3 180: it carries valuation class 7920, which is not allowed for material type ROH in this system, and accounting confirms 3000. Row 8 returns MG 144 for the purchasing group, left empty; field selection makes it required for this material type.
  3. 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.
  4. 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 for TG-1101 in plant 1010 picks up purchasing group 100.

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:

TopicSAP ECCSAP S/4HANA
Material number lengthUp to 18 charactersUp 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 numberHEADDATA-MATERIALSAP 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 loadLSMW or a custom programThe 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:

MessageWhat it meansFix
MG 144 The field … is defined as a required field; it does not contain an entryField 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 structureFill 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 typePick 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 referenceAsk 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 transferredThe call carried no field SAP could write: no view switch set, or no X flagsCheck the view switches in HEADDATA and the X structures in the mapping
Success, but a field is empty in MM03The field was sent without its X flag, or in a structure whose view switch was not setReview 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 createdLook 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.

  1. 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.
  2. Material type and industry sector were reviewed row by row, or are fixed values in the template.
  3. Every material type in the sheet, with its number range, exists in the client you load into.
  4. The file has one row per material per plant, and per sales area where a sales view is created.
  5. Each view the material needs has its required columns: purchasing group, MRP type, valuation class and price control, sales organisation and distribution channel.
  6. Material numbers are formatted as text, with Leading Zeros switched on where your numbers are numeric, and none of them exists in SAP yet.
  7. Descriptions and old material numbers were compared with existing materials, to catch an item that is already in SAP under another number.
  8. 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.

Frequently asked questions

How do I mass create materials in SAP from Excel?
With PostNow.ai, put one row per material per plant (material number, industry sector, material type, description, base unit, material group, plant, and the purchasing, MRP and accounting fields the material needs) in a template mapped to BAPI_MATERIAL_SAVEDATA, such as the free MM01 template. PostNow.ai sets the X flags for every mapped field. Validate checks the sheet offline, Simulate lets SAP check every material and rolls it back, and Run creates them and writes SAP's result to each row.
What is MM01 in SAP?
MM01 is the transaction that creates a material master record. On the initial screen you enter the material number (or leave it to internal numbering), the industry sector and the material type, then select the views and the organisational levels: plant, storage location, sales organisation and distribution channel. MM02 changes a material, MM03 displays it, and MM01 on an existing material extends it to new views or plants.
Which BAPI creates a material master?
BAPI_MATERIAL_SAVEDATA, which SAP describes as "Create and Change Material Master Data". HEADDATA holds the material, industry sector, material type and view switches; CLIENTDATA, PLANTDATA, VALUATIONDATA and SALESDATA hold the fields, each with an X structure that flags which fields to write. The call is committed with BAPI_TRANSACTION_COMMIT. For large migrations SAP also provides BAPI_MATERIAL_SAVEREPLICA, the BAPI for mass maintenance of several materials, and IS-Retail articles use BAPI_MATERIAL_MAINTAINDATA_RT.
How do I extend existing materials to a new plant or view?
Use the same BAPI_MATERIAL_SAVEDATA with the existing material number, the switch of the view you are adding and the new organisational level, such as plant 1020 with its MRP and accounting fields. SAP adds the segment and leaves the existing data as it is. Keep extensions in their own file, one row per material and new plant, sales area or storage location, and check MARC or MVKE first so the file holds only the missing segments.
Can the material type be changed after creation?
Yes, with transaction MMAM, under conditions SAP checks before it changes anything: SAP KBA 2698971, for example, covers MMAM refusing the change because production orders exist for the material. Because the material type drives the number range, the screens and the quantity and value update, review it on the sheet before the run, when a correction is one cell.
Is the material number 18 or 40 characters in S/4HANA?
Up to 40 characters, once the extended material number is activated in Customizing (Activate Extended Fields, transaction FLETS) and the length is set in OMSL; SAP Note 2267140 describes the extension, which is off by default. Without it the material number stays at 18 characters, as in ECC. A template built on ECC needs its material column widened before longer numbers are used, and the BAPI's long fields, such as HEADDATA-MATERIAL_LONG, should be checked in SE37 on your release.
What does SAP material master automation from Excel cover?
In PostNow.ai it covers creating materials (MM01, BAPI_MATERIAL_SAVEDATA or an MM01 recording), extending them to new plants and sales areas, changing them (MM02), downloading and editing them with Mass Change, and checking the result per row in the Run Log and in the Material Master 360 report. Each user runs the published template under their own SAP login, with an optional approval before Run. Which material type, views and valuation each material gets stays the business's decision.
Who assigns the material number, SAP or the file?
That depends on the material type's number range. With external numbering the number is in the file and goes into HEADDATA-MATERIAL. For internal numbering with the BAPI, SAP's documentation has the number drawn first with BAPI_MATERIAL_GETINTNUMBER. With an MM01 recording you can leave the material field empty and let SAP assign the number at save; set the template's Run Log Message to a text such as "Material $V1 created" so each row shows the number SAP gave it.
Your material list. SAP's material master rules.

Mass create your next SAP materials from Excel

Map MM01 once, simulate every material against field selection and Customizing, then create them all in one run.

Start free trial
  • 14-day free trial
  • Works with ECC and S/4HANA
  • Posts under your own SAP login