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-1001has no MRP data in plant1020, 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 MM02 | Table and key | Fields often mass updated | BAPI_MATERIAL_SAVEDATA structure | What the change affects |
|---|---|---|---|---|
| Basic data | MARA: material | Material group, old material number, gross and net weight, product hierarchy | CLIENTDATA | Every plant and sales area at once |
| Description | MAKT: material + language | Material description per language | MATERIALDESCRIPTION | Searches, forms and reports |
| Purchasing | MARC: material + plant | Purchasing group, goods receipt processing time | PLANTDATA | Who receives the next requisitions in that plant |
| MRP | MARC: material + plant | MRP type, MRP controller, lot size, procurement type, planned delivery time, safety stock | PLANTDATA | The next planning run's proposals |
| Storage | MARD: material + plant + storage location | Storage bin, storage location MRP fields | STORAGELOCATIONDATA | Warehouse and storage location planning |
| Sales | MVKE: material + sales org + distribution channel | Item category group, delivering plant, material pricing group | SALESDATA | Item category and pricing on new orders |
| Accounting | MBEW: material + valuation area | Valuation class, price control | VALUATIONDATA | Account 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:
| Route | Values | Fields it reaches | Before and after record | Fits when |
|---|---|---|---|---|
PostNow.ai Mass Change on BAPI_MATERIAL_SAVEDATA or an MM02 recording | A different value per row, from a list or formula | The BAPI's structures, or any field on the recorded MM02 screens | Downloaded old values, reviewed new values and SAP's message per row in one sheet | Values differ per material or plant, come from the business, or need a review before posting |
MM17 mass maintenance | One value for every selected record, or typed cell by cell | Fields the mass object offers per table; some fields are missing | SAP's log and change documents | One field, one value, a selection SAP can make |
BAPI_MATERIAL_SAVEDATA from your own program | Per call | The BAPI's structures, with X flags | Whatever the program logs | IT owns a recurring interface |
MM02 by hand | One material at a time | Every field on the screens | Change documents | A 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.
- Choose the tables. On the first screen, tick the tables whose fields you will change:
MARCfor an MRP controller,MARAfor a material group. Each extra table adds rows to the change screen, so tick only what the change needs. - Select the records. Paste material numbers through the multiple selection, and enter the plant for a plant-level table: a
MARCfield 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. - 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.
- 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.
- 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.
- 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 element | Setting |
|---|---|
| BAPI fields | HEADDATA-MATERIAL, HEADDATA-MRP_VIEW = X (fixed), PLANTDATA-PLANT, PLANTDATA-MRP_CTRLER with its flag in PLANTDATAX |
| Mass Change table | MARC |
| Key Field / Download | Material (MATNR) and plant (WERKS) / MRP controller (DISPO) |
| Criteria | Plant equal to 1010, MRP controller equal to 001, Max rows raised to 400 |
- Download. 400 rows arrive, each with material, plant
1010and controller001. - Edit. An
XLOOKUPagainst the planning list fills the new controller. Four materials are missing from the list, and the lookup returns an empty string for them. - Review. The review shows "400 changed of 400 rows", and four rows read
001followed by nothing. An empty cell would clear the MRP controller, so the planner puts001back on those rows and asks the planning lead about them. The next review shows 396 changed rows. - Simulate. Validate passes. Simulate returns SAP's success message on 396 rows and rolls each call back.
- 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.
- Prove it. Re-download for the next cycle reads
MARCagain with the controller filter on001: 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:
| Message | What it usually means | Fix |
|---|---|---|
M3 305 The material … does not exist or is not activated | The number reached SAP changed: Excel dropped leading zeros, turned a long number into scientific notation, or the material belongs to another client | Format 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 changed | The material has valuated stock in the current or previous period, open purchase orders, or production orders with goods movements in that valuation area | Agree 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 Customizing | Transport 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 transferred | The call carried nothing SAP could write: no view switch in HEADDATA, or no X flags | Set the view switch as a fixed value and check the X pairs in the mapper |
| Material locked by another user | Someone had the material open in MM02, or a job was processing it | Retry Failed after the lock clears; this is timing, not bad data |
| Success, but the field did not change | The field was sent without its X flag, or is not mapped | Run Review update flags in the mapper, then post the row again |
| Success, and the material gained a plant | A plant key was edited on the sheet; BAPI_MATERIAL_SAVEDATA creates the missing segment instead of rejecting the row | Never 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.
- Before. Download, save a copy, then edit. The copy shows each material, plant and value as SAP held it.
- 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.
- 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.
- Audit. SAP's change documents (tables
CDHDRandCDPOS, shown per material inMM04) 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:
| Topic | SAP ECC | SAP S/4HANA |
|---|---|---|
| Material number | Up to 18 characters | Up 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 maintenance | MM17 | MM17, 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 checks | As configured | SAP 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.
