# Spare Parts Consumption and Cost by Equipment Report

> A custom ALV report that totals goods issues to maintenance orders by equipment and functional location, showing which equipment consumes which spare part, how often and at what cost. Returns are netted off; the last issue date and the average interval between issues per part are calculated as well.

- Type: Report, Custom development, ALV report
- Module: PM
- Estimated effort: M (3–5 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/reports/spare-parts-consumption-by-equipment-report/


## Why is the standard not enough?

MB51 lists goods issues to maintenance orders with the order number, but it does not show the equipment or functional location the order belongs to; for part consumption by equipment the list is merged with the IW39 output in Excel. IW39 and order cost reports give total cost, not frequency or last issue date per part. This information is needed for minimum stock levels, critical spare decisions and repeat failure analysis.

### Closest standard alternatives

- MB51: Lists issues to orders; the equipment and functional location link, frequency and average interval are missing.
- IW39: Lists maintenance orders with costs, but does not give consumption per part.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| MSEG | Goods issues and returns to maintenance orders (driving table) | Read | - | ECC + S/4 |
| AUFK | Order type and maintenance order check | Read | AUFK-AUFNR = MSEG-AUFNR | ECC + S/4 |
| AFIH | Equipment, location and maintenance activity type of the order | Read | AFIH-AUFNR = MSEG-AUFNR | ECC + S/4 |
| ILOA | Functional location | Read | ILOA-ILOAN = AFIH-ILOAN | ECC + S/4 |
| EQKT | Equipment description | Read | EQKT-EQUNR = AFIH-EQUNR AND EQKT-SPRAS = SY-LANGU | ECC + S/4 |
| MAKT | Spare part description | Read | MAKT-MATNR = MSEG-MATNR AND MAKT-SPRAS = SY-LANGU | ECC + S/4 |

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_WERKS | Plant | Range / multiple | MSEG-WERKS | Yes |
| S_BUDAT | Posting date range | Range / multiple | MSEG-BUDAT_MKPF | Yes |
| S_EQUNR | Equipment | Range / multiple | AFIH-EQUNR | No |
| S_TPLNR | Functional location | Range / multiple | ILOA-TPLNR | No |
| S_AUART | Order type | Range / multiple | AUFK-AUART | No |
| S_ILART | Maintenance activity type | Range / multiple | AFIH-ILART | No |
| S_MATNR | Spare part | Range / multiple | MSEG-MATNR | No |
| P_TOPN | Top N parts per equipment (0 = all) | Single value | - | No |

## Output columns

| Column | Source |
|---|---|
| Equipment | AFIH-EQUNR |
| Equipment description | EQKT-EQKTX |
| Functional location | ILOA-TPLNR |
| Spare part | MSEG-MATNR |
| Part description | MAKT-MAKTX |
| Issues | Calculated: Number of MSEG lines with movement type 261 |
| Net quantity | Calculated: Σ MSEG-MENGE (261 positive, 262 negative) |
| Unit | MSEG-MEINS |
| Net value | Calculated: Σ MSEG-DMBTR (261 positive, 262 negative) |
| Currency | MSEG-WAERS |
| Orders | Calculated: Number of distinct MSEG-AUFNR values |
| Last issue | Calculated: MAX(MSEG-BUDAT_MKPF) |
| Average interval (days) | Calculated: (Last issue − first issue) ÷ (issues − 1) |
| Share of equipment % | Calculated: Part net value ÷ total part value of the equipment × 100 |

## How does the report work?

1. Goods issues to maintenance orders (BWART 261) and their returns (262) are read from MSEG for the plant and posting date range on the selection screen; lines without an order number (AUFNR) are skipped.
2. The order type is checked through AUFK and only maintenance orders are taken; equipment (EQUNR), location (ILOAN) and maintenance activity type (ILART) are added from AFIH, the functional location comes from ILOA.
3. Quantity and value are netted using SHKZG: 261 issues count positive, 262 returns negative.
4. Per equipment + material the number of issues, net quantity, net value (MSEG-DMBTR), number of distinct orders and the last issue date (BUDAT_MKPF) are summed. Average issue interval = (last issue − first issue) ÷ (number of issues − 1).
5. Share within the equipment = part net value ÷ total part value of the equipment × 100. With 'top N parts' selected, only the N highest-value parts are shown per equipment.

## Authorization objects

- M_MSEG_WWA: Display material documents by plant
- I_SWERK: Technical object authorization by maintenance plant

## Frequently asked questions

### Are issues to a cost center without an order included?

The base version evaluates only issues to maintenance orders, because the equipment link comes from the order. Issues to cost centers (201) can be shown in a separate 'consumption without equipment' section.

### Does it suggest stock levels?

The report gives consumption history; it does not suggest a minimum stock. Optionally the reorder point from MARC and the current stock can be shown side by side to flag parts that are low compared with consumption.

### Does it work on S/4HANA?

Yes. In S/4HANA reading MSEG is served from the material document table through a compatibility view; for a clean core approach the material document CDS views can be used.

---
Let us build this report for your system: https://nekuhub.com/en/request-a-quote/?report=pm-spare-parts-consumption-by-equipment
