# BOM Change Log Report with E-mail Alerts

> A report that shows component additions, deletions, quantity and validity changes in bills of material in a readable list with who, when and the old and new values, and emails changes in selected material groups to the departments concerned. The same screen also gives the history of quantity, date and component changes in released production orders.

- Type: Report, Custom development, ALV report
- Module: PP
- Estimated effort: M (5–8 working days)
- Last updated: 2026-11-18
- URL: https://nekuhub.com/en/reports/bom-and-production-order-change-log-with-email-alerts/


## Why is the standard not enough?

CS80 shows BOM change documents, but as technical output per field; the component number and old/new quantity cannot be read side by side, and nobody is notified when a change happens. Changes to production orders are shown order by order in CO03. The custom report turns the change documents into readable lines per component and order, gives a combined view and produces email alerts.

### Closest standard alternatives

- CS80: Shows BOM change documents; no readable per-component list and no email alerts.
- CO03: Change documents can be displayed from within one order at a time.
- CS14: Compares two BOMs or dates; does not show who changed what and when.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| CDHDR | Change document header: user, date, time, object (driving table) | Read | - | ECC + S/4 |
| CDPOS | Changed table, field, old and new value | Read | CDPOS-OBJECTCLAS = CDHDR-OBJECTCLAS AND CDPOS-OBJECTID = CDHDR-OBJECTID AND CDPOS-CHANGENR = CDHDR-CHANGENR | ECC + S/4 |
| MAST | Header material and usage of the BOM | Read | MAST-STLNR = CDPOS-TABKEY+4(8) | ECC + S/4 |
| STKO | BOM header: base quantity, status | Read | STKO-STLNR = MAST-STLNR | ECC + S/4 |
| STPO | BOM item: component, quantity, change number, validity | Read | STPO-STLNR = CDPOS-TABKEY+4(8) AND STPO-STLKN = CDPOS-TABKEY+12(8) | ECC + S/4 |
| STAS | Alternative-to-item link and deletion indicator | Read | STAS-STLNR = STPO-STLNR AND STAS-STLKN = STPO-STLKN | ECC + S/4 |
| AENR | Change number description and valid-from date | Read | AENR-AENNR = STPO-AENNR | ECC + S/4 |
| MAKT | Header material and component descriptions | Read | MAKT-MATNR = MAST-MATNR / STPO-IDNRK | ECC + S/4 |
| AFKO | Order header and dates for order changes | Read | AFKO-AUFNR ↔ CDHDR-OBJECTID (CDHDR-OBJECTCLAS = 'ORDER') | ECC + S/4 |
| RESB | Component items for order changes | Read | RESB-AUFNR = AFKO-AUFNR | ECC + S/4 |

## BAPIs and functions used

- CHANGEDOCUMENT_READ: Reads change documents with their items
- SO_DOCUMENT_SEND_API1: Sends the change summary by email

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_UDATE | Change date | Range / multiple | CDHDR-UDATE | Yes |
| S_MATNR | Header material | Range / multiple | MAST-MATNR | No |
| S_WERKS | Plant | Range / multiple | MAST-WERKS | No |
| S_USER | Changed by | Range / multiple | CDHDR-USERNAME | No |
| P_ORDER | Also show production order changes | Checkbox | - | No |
| P_ALERT | Alert mode: email changes since the last run | Checkbox | - | No |

## Output columns

| Column | Source |
|---|---|
| Date | CDHDR-UDATE |
| Time | CDHDR-UTIME |
| User | CDHDR-USERNAME |
| Object | Calculated: BOM or production order (by object class) |
| Header material / order | Calculated: MAST-MATNR or AFKO-AUFNR |
| Component | STPO-IDNRK |
| Changed field | Calculated: CDPOS-FNAME translated into a user-friendly label |
| Old value | CDPOS-VALUE_OLD |
| New value | CDPOS-VALUE_NEW |
| Change type | Calculated: CDPOS-CHNGIND: I = added, D = deleted, U = changed |
| Change number | STPO-AENNR |
| Notified | Calculated: Recipient group if an alert email was sent |

## How does the report work?

1. BOM change documents (object class STUE) are read from CDHDR for the selected date range; optionally production order change documents (object class ORDER) are added. Order change documents are created only if change documents are activated in the order type parameters.
2. Item details come from CDPOS: table (STKO, STPO, STAS or RESB, AFKO, AFPO), field, change type (CHNGIND) and old/new value. The table key (TABKEY) is decoded to find the BOM number and item node.
3. The BOM number is linked to the header material through MAST, the item through STPO to the component (IDNRK), item number and change number (AENNR); descriptions come from MAKT. If a change number exists, its description and valid-from date are added from AENR.
4. For older records without change documents, the creation and change data in STPO/STAS (ANDAT/ANNAM, AEDAT/AENAM) and the date validity (DATUV) are used as a fallback source.
5. Field names are translated into user-friendly labels (e.g. MENGE → Component quantity, DATUV → Valid from) and each line is classified as added, deleted or changed.
6. Alert mode runs as a scheduled job: changes since the last run are mapped to a distribution setting by material group, plant or BOM usage, and each recipient group gets a summary table email sent with SO_DOCUMENT_SEND_API1; sent documents are flagged so they are not sent again.

## Authorization objects

- C_STUE_WRK: BOM display by plant
- C_STUE_BER: BOM display by authorization group
- C_AFKO_AWK: Order display for order changes
- S_OC_SEND: Sending external email from SAP

## Frequently asked questions

### Why are production order changes empty for some orders?

Order change documents are created only after change documents are activated for the order type and plant. There are no documents for changes made before activation; the report flags these orders as 'no documents'.

### How do changes made with a change number appear?

Changes made with a change number create a new validity slice for the item. The report shows the change number, its description and valid-from date, so you also see from which date the change affects production.

### Who receives the alerts?

Recipients are defined in a settings table by material group, plant or BOM usage; email addresses are taken from user master data or a distribution list. Each recipient sees only the changes within their scope.

---
Let us build this report for your system: https://nekuhub.com/en/request-a-quote/?report=pp-bom-change-log-alert
