Quick answer

How to mass update the material master in SAP

MM02 (Change Material) is the SAP transaction that changes an existing material, one material and one view at a time. To mass update material master data in SAP, PostNow.ai downloads the current values into Excel, you edit them, and it posts only the changed rows through BAPI_MATERIAL_SAVEDATA or an MM02 recording, with SAP's answer on each row.

  • MM17 fits one value for many materials. When every selected material gets the same new value in a field MM17 offers, SAP's mass maintenance transaction does the job.
  • The row follows the field's level. A plant field such as the MRP controller needs one row per material and plant, not one per material.

This page covers changing materials that already exist. Creating materials, or extending them to a new plant or sales area, is on mass create materials with MM01. Mass changes across all SAP objects (vendors, customers, orders) are on SAP mass change from Excel, and every MM object in one load plan is on SAP MM mass upload.

What MM02 does, and what a mass update adds

PostNow.ai posts every material change through the same SAP material master checks that MM02 applies. MM02 (Change Material) is the SAP transaction that changes one existing material: you enter the material, pick the views to change (basic data, purchasing, MRP, sales, accounting and the others), give the organisational level the views need, such as plant 1010 or sales organisation 1010 with distribution channel 10, overwrite the fields and save. SAP checks the values as it does on creation and writes change documents, which MM04 displays per material.

A mass update does the same for hundreds or thousands of materials. Three things decide whether it goes well:

  • The field's level sets the row count. Material group is one value per material (MARA). MRP controller is one value per material and plant (MARC). Changing the MRP type of 4,000 materials in six plants is up to 24,000 rows, not 4,000.
  • A change only edits segments that exist. MM02 has no route to add a view or a plant: if material TG-1001 has no MRP data in plant 1020, sending an MRP controller for that plant is an extension, and extensions are done with MM01.
  • The old value is gone after the save. SAP keeps it in the change documents, one material at a time. For the run as a whole, the record of what was there before is the extract you take before you post.

How PostNow.ai mass updates the material master from Excel

PostNow.ai runs a material master mass update, an SAP mass change of existing materials, with its Mass Change module on a change template. A designer builds the template once and publishes it; planners, buyers or master data staff then download, edit and post, each with their own SAP login on their own computer.

1. Start from a change template

The template calls BAPI_MATERIAL_SAVEDATA, which SAP describes as "Create and Change Material Master Data", or replays an MM02 recording. On the BAPI, map HEADDATA-MATERIAL, the switch of the view you change (for example MRP_VIEW) as a fixed X, the organisational key such as PLANTDATA-PLANT, and only the fields this change touches. PostNow.ai sets the matching flags in PLANTDATAX, CLIENTDATAX and the other X structures for every mapped field, so SAP leaves the rest of the material alone. The free MM02 change template starts you off.

2. Name the tables and bind the columns

In the Mass Change dialog, enter the tables that hold today's values: MARC for plant fields, MARA for client fields, MBEW for valuation, MVKE for sales. Suggest from template reads the BAPI structures and proposes them (PLANTDATA to MARC, VALUATIONDATA to MBEW). Material and plant become Key Field; the fields you change become Download.

3. Download today's values

Filter with SAP-style operators, for example plant equal to 1010 and material "any of" a list pasted into an Excel range. PostNow.ai checks that your SAP user may read those tables, then fills one row per material and plant and keeps a snapshot of the values on a hidden sheet. Because the keys come from SAP, every row points at a segment that exists.

4. Edit, then review old against new

Overwrite the values, paste them, or fill them with XLOOKUP from the list the business sent. Review changes lists every changed row with the old value next to the new one, under a count such as "396 changed of 400 rows". Rows you did not change are not sent.

5. Validate, Simulate, then update changed rows

Validate checks the sheet offline: lengths, formats and allowed values. Simulate sends the changed rows to SAP: a BAPI template calls BAPI_MATERIAL_SAVEDATA and rolls back instead of committing; a recording replays MM02 without the final save. Update changed rows then posts them; under an approval policy the run waits for an approver first.

6. Read each row, retry, re-download

Every posted row gets SAP's message with SAP user, time and system in its Run Log cell, and the run goes to the portal's posting audit. Retry Failed re-posts only rows marked ERROR, such as a material another user had open. Re-download for the next cycle refreshes the sheet and its snapshot, so the next review starts from what SAP now holds.

Recordings run differently from BAPIs but report the same way. PostNow.ai replays an MM02 recording in the user's SAP GUI session as a CALL TRANSACTION with synchronous update, so each row's message returns at once. 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. The full Mass Change loop, including how empty cells and change flags behave on every object, is on SAP mass change from Excel.

Material master fields by view and organisational level

PostNow.ai binds each column of a material change to the table and key below, which is also how MM02 asks for the organisational level when you open a view. Read the table from the field you need to change, not from the view name:

View in MM02Table and keyFields often mass updatedBAPI_MATERIAL_SAVEDATA structureWhat the change affects
Basic dataMARA: materialMaterial group, old material number, gross and net weight, product hierarchyCLIENTDATAEvery plant and sales area at once
DescriptionMAKT: material + languageMaterial description per languageMATERIALDESCRIPTIONSearches, forms and reports
PurchasingMARC: material + plantPurchasing group, goods receipt processing timePLANTDATAWho receives the next requisitions in that plant
MRPMARC: material + plantMRP type, MRP controller, lot size, procurement type, planned delivery time, safety stockPLANTDATAThe next planning run's proposals
StorageMARD: material + plant + storage locationStorage bin, storage location MRP fieldsSTORAGELOCATIONDATAWarehouse and storage location planning
SalesMVKE: material + sales org + distribution channelItem category group, delivering plant, material pricing groupSALESDATAItem category and pricing on new orders
AccountingMBEW: material + valuation areaValuation class, price controlVALUATIONDATAAccount determination; SAP restricts it while stock or open orders exist

Keep each level in its own file. A client-level field repeated once per plant writes the same value several times and fills the change documents with noise. A plant-level field sent once per material changes only the plant on that row. Price changes are a separate case: on materials with stock, standard and moving average prices are usually changed through SAP's price change and cost estimate processes, not as a master data sweep, so agree that route with finance first.

MM17 vs MM02 vs BAPI_MATERIAL_SAVEDATA

PostNow.ai Mass Change fits when each material gets its own value from a list; MM17 fits when one value goes to a whole selection. The table compares the four ways to change many materials:

RouteValuesFields it reachesBefore and after recordFits when
PostNow.ai Mass Change on BAPI_MATERIAL_SAVEDATA or an MM02 recordingA different value per row, from a list or formulaThe BAPI's structures, or any field on the recorded MM02 screensDownloaded old values, reviewed new values and SAP's message per row in one sheetValues differ per material or plant, come from the business, or need a review before posting
MM17 mass maintenanceOne value for every selected record, or typed cell by cellFields the mass object offers per table; some fields are missingSAP's log and change documentsOne field, one value, a selection SAP can make
BAPI_MATERIAL_SAVEDATA from your own programPer callThe BAPI's structures, with X flagsWhatever the program logsIT owns a recurring interface
MM02 by handOne material at a timeEvery field on the screensChange documentsA few materials

Two SAP notes show why the MM17 field list matters. SAP KBA 3575808 records that the safety stock method (MARC-SFTY_STK_METH) is not available in MM17, so it cannot be mass changed there. SAP KBA 2587244 records that changing the profit center (MARC-PRCTR) in MM17 also updated fields that were not selected, such as the goods receipt processing time (MARC-WEBAZ). Check the field in MM17 on your release, and compare a before and after extract whichever route you use.

The dividing line is not the number of materials. It is whether every material gets the same value: one value for a selection is MM17's job, a value per row is a load.

Every route writes through SAP's material master update, so SAP's field checks decide each record. The difference is where the values come from and what you have afterwards. Which method suits which object in general is on BAPI vs BDC in SAP, and recording MM02 so it replays reliably is in the BDC recording guide.

MM17 step by step

PostNow.ai recommends SAP's MM17 when one new value goes to every selected material; these are the steps. MM17 is SAP's mass maintenance for the material master: the generic MASS transaction started with the material object already chosen, reaching fields in tables such as MARA, MARC, MARD, MBEW and MVKE.

  1. Choose the tables. On the first screen, tick the tables whose fields you will change: MARC for an MRP controller, MARA for a material group. Each extra table adds rows to the change screen, so tick only what the change needs.
  2. Select the records. Paste material numbers through the multiple selection, and enter the plant for a plant-level table: a MARC field changed with the plant left blank changes in every plant the material exists in. Selecting by attribute (material type, MRP type, material group) is quick and is also how the wrong 40 materials get changed; for anything that matters, select by key from a reviewed list.
  3. Enter the new value. The change screen lists the selected records. Type the new value in the header line and apply it to all selected rows with the mass change function, or type values into single cells where records differ.
  4. Save and read the log to the end. SAP updates each material through the material master update, and a record that fails a check, such as a material missing from the plant or flagged for deletion, is listed in the log and left unchanged. The log is the only list of what did not change.
  5. Verify with a fresh extract. Pull the changed field for the same materials into Excel, for example with the SAP material master report, and compare it with the intended values. A wrong plant or a selection wider than intended shows up here.
  6. Keep the before values. The old value is in each material's change documents (MM04), one material at a time. A sheet with material, plant, old value and new value, taken before the run, is the record that lets you reverse it.

Run it in the quality system first, then on a small selection in production: the change is saved when you save. MM17 changes existing materials only, so a material missing from the plant comes back as an error in the log, not as a new plant segment.

Worked example: new MRP controllers for 400 materials in plant 1010

PostNow.ai handles this with one published change template on BAPI_MATERIAL_SAVEDATA. Plant 1010 reorganises its planning team: 400 materials now planned by MRP controller 001 move to three new controllers, 007 for raw materials, 008 for packaging and 009 for the rest. The planning lead sends a list of material and new controller. In MM17 this would be three selections and three runs, or 400 values typed by hand; here the values sit beside each material.

Template elementSetting
BAPI fieldsHEADDATA-MATERIAL, HEADDATA-MRP_VIEW = X (fixed), PLANTDATA-PLANT, PLANTDATA-MRP_CTRLER with its flag in PLANTDATAX
Mass Change tableMARC
Key Field / DownloadMaterial (MATNR) and plant (WERKS) / MRP controller (DISPO)
CriteriaPlant equal to 1010, MRP controller equal to 001, Max rows raised to 400
  1. Download. 400 rows arrive, each with material, plant 1010 and controller 001.
  2. Edit. An XLOOKUP against the planning list fills the new controller. Four materials are missing from the list, and the lookup returns an empty string for them.
  3. Review. The review shows "400 changed of 400 rows", and four rows read 001 followed by nothing. An empty cell would clear the MRP controller, so the planner puts 001 back on those rows and asks the planning lead about them. The next review shows 396 changed rows.
  4. Simulate. Validate passes. Simulate returns SAP's success message on 396 rows and rolls each call back.
  5. Update changed rows. 394 rows show SAP's success message. Two show ERROR because a buyer had those materials open in MM02. Ten minutes later, Retry Failed posts both.
  6. Prove it. Re-download for the next cycle reads MARC again with the controller filter on 001: four rows come back, the four still waiting for an answer. The Material Master 360 report shows the new controllers per material for the planning lead.

The four materials kept their value and were never sent to SAP. From the save on, the collective MRP list MD06, selected by MRP controller, shows the 396 materials under their new planners.

Errors in a material master mass update

PostNow.ai writes SAP's message into each failed row's Run Log, so the fix starts from the message. These are the ones a material change run meets most:

MessageWhat it usually meansFix
M3 305 The material … does not exist or is not activatedThe number reached SAP changed: Excel dropped leading zeros, turned a long number into scientific notation, or the material belongs to another clientFormat the material column as text before pasting, switch on Leading Zeros for numeric material numbers, and compare a sample with MM03
M3 368 The valuation class cannot be changedThe material has valuated stock in the current or previous period, open purchase orders, or production orders with goods movements in that valuation areaAgree the route with finance: clear the blocking stock and documents, or change at period end; keep valuation class changes in their own run
MG 142 The value … is not allowed for the field …The new value is not in the target client's Customizing, or not allowed for this material type or plant, such as a material group or MRP type missing from CustomizingTransport the Customizing first, or pick values with SAP Lookup from the client you post to
MG 160 The material cannot be maintained since no maintainable data transferredThe call carried nothing SAP could write: no view switch in HEADDATA, or no X flagsSet the view switch as a fixed value and check the X pairs in the mapper
Material locked by another userSomeone had the material open in MM02, or a job was processing itRetry Failed after the lock clears; this is timing, not bad data
Success, but the field did not changeThe field was sent without its X flag, or is not mappedRun Review update flags in the mapper, then post the row again
Success, and the material gained a plantA plant key was edited on the sheet; BAPI_MATERIAL_SAVEDATA creates the missing segment instead of rejecting the rowNever edit Key Field columns; extend materials on purpose with an MM01 extension template

Some changes are accepted by SAP and still change behaviour. MRP type, lot size, procurement type and planned delivery time drive the next planning run; item category group changes the item category of new sales orders. A success message says SAP accepted the value. For planning and sales fields, run MRP or create a test order for a sample material in the quality client before the production file.

Before and after: extract, compare, undo

PostNow.ai makes the download the before-image of the run: save a copy of the workbook straight after Download, and it holds every material's value before the change. A material master change has no reversal document, so that copy is how you undo one.

  1. Before. Download, save a copy, then edit. The copy shows each material, plant and value as SAP held it.
  2. After. Re-download the same selection. A review that reports no changes proves SAP holds exactly what the sheet holds. Rows still marked ERROR are your open list.
  3. Undo. Re-download, paste the old values from the copy into the Download columns, review the rows going back, and post them with Update changed rows.
  4. Audit. SAP's change documents (tables CDHDR and CDPOS, shown per material in MM04) record old value, new value, user and time. PostNow.ai's Change Documents / Audit Trail report lists them for the whole run in Excel, and the portal's posting audit holds each row's SAP message.

MM02 and MM17 on S/4HANA

PostNow.ai uses the same change template on ECC and S/4HANA, because MM02, MM17 and BAPI_MATERIAL_SAVEDATA remain in S/4HANA. The differences to plan for:

TopicSAP ECCSAP S/4HANA
Material numberUp to 18 charactersUp to 40 characters once the extended material number is activated (SAP Note 2267140); the BAPI keeps the 18-character fields and adds long ones such as HEADDATA-MATERIAL_LONG. Check in SE37 which one your system reads
Mass maintenanceMM17MM17, plus SAP Fiori product apps where your release offers them: export with Export Master Data - Products, change the values in Excel and upload them with the products mass maintenance app
Save-time checksAs configuredSAP KBA 3459002 describes message 6P002 on S/4HANA 2022 and 2023 appearing at save through MM17 or BAPI_MATERIAL_SAVEDATA, not in simulation; post one real material in the quality client first

A template built on ECC with an 18-character material column needs that column widened before longer numbers are used. The view and organisational level structure of the material master is the same in both, so the fields table above applies unchanged.

Free MM02 and MM17 Excel templates

PostNow.ai publishes two free material change templates, both mapped to BAPI_MATERIAL_SAVEDATA with a field guide per column: the MM02 material master change template, one row per material, and the MM17 mass maintenance template for a one-field sweep across many materials. Open either 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 update the material master in SAP?
PostNow.ai mass updates the material master from Excel with its Mass Change module: it downloads the current values from tables such as MARC or MARA into the sheet, you edit them, and after a review of old against new it posts only the changed rows through BAPI_MATERIAL_SAVEDATA or an MM02 recording. Validate checks the sheet offline, Simulate shows SAP's messages first, and every posted row gets SAP's answer in its Run Log cell. For one value across a selection, SAP's MM17 is the standard alternative.
What is MM02 in SAP?
MM02 is the SAP transaction Change Material. You enter an existing material, choose the views to change (basic data, purchasing, MRP, sales, accounting and others) and the organisational level they need, such as a plant or a sales organisation and distribution channel, then change the fields and save. SAP checks the values and writes change documents, which MM04 displays. MM01 creates materials and MM03 displays them.
What is MM17 in SAP, and how is it different from MM02?
MM17 is SAP's mass maintenance for the material master, the MASS transaction with the material object preselected. MM02 changes one material at a time, on every field of its screens. In MM17 you choose tables such as MARA or MARC, select many materials, and set one new value for all of them, or type values cell by cell. MM17 offers a subset of fields per table, and SAP KBA 3575808, for example, records a MARC field that is not available there.
Can MM02 or MM17 create a material or add a plant to one?
No. Both change materials that already exist. Creating a material is done in MM01, and adding a view, a plant, a storage location or a sales area to an existing material is an extension, done in MM01 with the existing material number, or in a load through BAPI_MATERIAL_SAVEDATA with the new organisational level. Keep extensions and changes in separate runs, so each result is clear.
Which BAPI changes material master data?
BAPI_MATERIAL_SAVEDATA, which SAP describes as Create and Change Material Master Data. Each data structure has an X twin, for example PLANTDATA and PLANTDATAX: only fields flagged X are changed, and the X structure carries the key, such as the plant. The BAPI does not commit by itself, so the caller follows a clean call with BAPI_TRANSACTION_COMMIT. It also creates a missing plant or sales segment, so key fields must not be edited on a change file.
How do I update one field for many materials from Excel?
Map only that field, its organisational key and the material number in a change template, so nothing else is sent. In PostNow.ai, bind the field as Download in Mass Change, download the current values, overwrite the column, review the changed rows and post them. If every material gets the same value and MM17 offers the field, MM17 does it without a file.
How do I undo a material master mass update?
Post the old values back. SAP has no reversal document for master data, so keep the values from before the run: in PostNow.ai, save a copy of the workbook right after Download, then re-download, paste the old values in, review and post the changed rows. SAP's change documents in MM04 show the old value per material if no copy was kept.
Does MM17 work in S/4HANA, and what changes in MM02?
Yes. MM02, MM17 and BAPI_MATERIAL_SAVEDATA are all in SAP S/4HANA. The material number can be up to 40 characters once the extended material number is activated (SAP Note 2267140), and SAP Fiori adds product mass maintenance apps where your release offers them. Views, organisational levels and X flags work as in ECC.
Your change list. SAP's own checks.

Run your next material master mass update in SAP

Download today's values, change them in Excel, review old against new, and post only the materials you changed, with SAP's answer on every row.

Start free trial
  • 14-day free trial
  • Works with ECC and S/4HANA
  • Runs under each user's own SAP login