# Mass Material Master Upload Program

> A custom program that creates or updates material master data in bulk from Excel or CSV rows, including the basic data, plant and valuation views. It checks everything in test mode first, then lists the result and error message for every row.

- Type: Program, Custom development, Mass upload
- Module: MM
- Estimated effort: M (4–6 working days)
- Last updated: 2026-11-16
- URL: https://nekuhub.com/en/programs/mass-material-master-upload-program/


## Why is the standard not enough?

MM17 only changes existing materials in bulk; it neither creates new materials nor reads a file. LSMW needs technical setup and is not recommended for many objects in S/4HANA. The Migration Cockpit is designed for the initial data migration. Companies that create hundreds of materials every month need a templated upload with a test mode that business users can run themselves.

### Closest standard alternatives

- MM17: Changes existing materials in bulk; does not create materials or read files.
- LSMW: Can load from files but needs technical setup; not recommended for many objects in S/4HANA.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| MARA | General material data: type, industry sector, base unit, material group | Write | - | ECC + S/4 |
| MAKT | Material description (per language) | Write | - | ECC + S/4 |
| MARC | Plant data: MRP type, purchasing group | Write | - | ECC + S/4 |
| MBEW | Valuation data: valuation class, price control and price | Write | - | ECC + S/4 |

## BAPIs and functions used

- BAPI_MATERIAL_SAVEDATA: Creates or updates the material with all views for each row
- BAPI_TRANSACTION_COMMIT: Saves successful rows permanently

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| P_FILE | Upload file (XLSX or CSV) | Single value | - | Yes |
| P_TEST | Test mode (check without posting) | Checkbox | - | No |
| P_UPDATE | Update existing materials | Checkbox | - | No |

## Input file columns

| Column | Target field | Required |
|---|---|---|
| Material (blank = internal number) | MARA-MATNR | No |
| Material type | MARA-MTART | Yes |
| Industry sector | MARA-MBRSH | Yes |
| Description | MAKT-MAKTX | Yes |
| Base unit | MARA-MEINS | Yes |
| Material group | MARA-MATKL | No |
| Plant | MARC-WERKS | Yes |
| MRP type | MARC-DISMM | No |
| Purchasing group | MARC-EKGRP | No |
| Valuation class | MBEW-BKLAS | No |
| Price control | MBEW-VPRSV | No |
| Price | Written to MBEW-VERPR when price control is V, to MBEW-STPRS when it is S | No |

## Result list columns

| Column | Source |
|---|---|
| Row | Calculated: Row number in the file |
| Material | MARA-MATNR |
| Status | Calculated: From the BAPI return messages: created, updated or error |
| Message | Calculated: First error or success message from the BAPI return table |

## How does the program work?

1. The file (XLSX or CSV) is read from the user's PC or, in a background job, from the application server; the first row is skipped as the header.
2. Every row is checked for mandatory fields and values: material type, industry sector, unit of measure, plant and valuation class must exist in the system.
3. The row is mapped to the BAPI_MATERIAL_SAVEDATA structures: header, basic data, description, plant data and valuation data.
4. In test mode the BAPI is called and the change is rolled back, so every error is visible without posting.
5. In a real run BAPI_TRANSACTION_COMMIT is called after each successful row; results and messages are listed per row, and failed rows can be downloaded as a separate file.

## Authorization objects

- M_MATE_MAR: Master data maintenance authorization by material type
- M_MATE_WRK: Master data maintenance authorization by plant

## Frequently asked questions

### Can this program be used on S/4HANA?

Yes. BAPI_MATERIAL_SAVEDATA is supported on S/4HANA as well. The Migration Cockpit is recommended for the initial migration; this program is for the ongoing need to create materials in daily operations.

### Which views can be loaded?

The template covers basic data, plant and valuation views. Sales, warehouse or accounting views can be added to the template as needed; each extra view increases the effort range.

### What happens to failed rows?

Failed rows are not saved and are listed with their messages. They can be downloaded as a separate file, corrected and uploaded again.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=mm-material-master-upload
