Mass BOM Component Replacement Upload Program
Short answer: A custom program that replaces, adds or deletes components or updates quantities in many material BOMs from Excel or CSV rows. Validity is set with a change number; in test mode it shows what will change in each BOM and how many open production orders still use the old component.
- Estimated effort
- M · 5–7 working days
- System
- ECC and S/4HANA
- Tables
- 5
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
CS20 mass change can replace one component in the selected BOMs, but it does not read a file; to give a different new component, quantity and validity date per line it has to be run one by one. There is no preview of the impact on open production orders before the change. CS02 changes a single BOM. Jobs with hundreds of lines, such as seasonal product changes or a supplier switch, need a templated upload with a test mode.
Who uses it? Product engineering, master data teams and PP consultants who manage supplier or part changes.
Closest standard alternatives
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| MASTMaterial to BOM Link | Check of the parent material – BOM link | Read | ECC + S/4 |
| STKOBOM Header | BOM header; updated with the change number | Write | ECC + S/4 |
| STPOBOM Item | BOM items: component, quantity, item number | Write | ECC + S/4 |
| MARAGeneral Material Data | Existence, deletion flag and material status of the new component | Read | ECC + S/4 |
| RESBReservation/Dependent Requirements | Open production order requirements of the old component (impact preview) | Read | ECC + S/4 |
BAPIs and functions used
- CSAP_MAT_BOM_READDisplay Material BOM. Reads the current items on the validity date
- CSAP_MAT_BOM_MAINTAINMaintain Material BOM. Adds, deletes or replaces components or updates quantities in the BOM
- BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Saves successful BOMs permanently
- BAPI_TRANSACTION_ROLLBACKRoll Back BAPI Transaction. Rolls back the change in test mode and for failed BOMs
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| P_FILE | Upload file (XLSX or CSV) | Single value | — | Yes | C:\temp\bilesen-degisikligi.xlsx |
| P_AENNR | Default change number | Single value | STPO-AENNR | No | 500000000412 |
| P_TEST | Test mode (check without posting and show impact) | Checkbox | — | No | X |
Input file columns
The columns of the upload template and the SAP fields they are written to. Columns with an asterisk are mandatory.
| # | Column | Target field | Required |
|---|---|---|---|
| 1 | Parent material | MAST-MATNR | Yes |
| 2 | Plant | MAST-WERKS | Yes |
| 3 | BOM usage | MAST-STLAN | Yes |
| 4 | Alternative | MAST-STLAL | No |
| 5 | Action | By rule R = replace, A = add, D = delete, Q = update quantity | Yes |
| 6 | Old component | STPO-IDNRK | No |
| 7 | New component | MARA-MATNR | No |
| 8 | Quantity | STPO-MENGE | No |
| 9 | Unit | STPO-MEINS | No |
| 10 | Item number | STPO-POSNR | No |
| 11 | Valid from | STPO-DATUV | Yes |
| 12 | Change number | STPO-AENNR | No |
Sample upload file
| 1 | Parent material * | Plant * | BOM usage * | Alternative | Action * | Old component | New component | Quantity | Unit | Item number | Valid from * | Change number |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | FG-6100 | 1000 | 1 | 01 | R | RM-3220 | RM-3225 | 1 | PC | 0040 | 12/01/2026 | 500000000412 |
| 3 | FG-5003 | 1000 | 1 | 01 | Q | RM-2040 | 1.95 | KG | 0010 | 12/01/2026 | 500000000412 | |
| 4 | FG-7200 | 2000 | 1 | 01 | A | RM-4410 | 2 | PC | 0060 | 12/01/2026 | ||
| 5 | SA-3100 | 1000 | 1 | 01 | D | RM-2990 | 0030 | 12/01/2026 | 500000000412 |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Row | Calculated Row number in the file |
| 2 | Parent material | MAST-MATNR |
| 3 | Plant | MAST-WERKS |
| 4 | Action | Calculated Action code from the file: R, A, D or Q |
| 5 | Old component | STPO-IDNRK |
| 6 | New component | MARA-MATNR |
| 7 | Valid from | STPO-DATUV |
| 8 | Affected open orders | Calculated Number of production orders that carry the old component as an open requirement in RESB |
| 9 | Status | Calculated Test passed, changed or error |
| 10 | Message | Calculated Function return message or check error |
Sample result list
| Row | Parent material | Plant | Action | Old component | New component | Valid from | Affected open orders | Status | Message |
|---|---|---|---|---|---|---|---|---|---|
| 2 | FG-6100 | 1000 | R | RM-3220 | RM-3225 | 12/01/2026 | 2 | Test passed | Item 0040 will be replaced |
| 3 | FG-5003 | 1000 | Q | RM-2040 | 12/01/2026 | 4 | Test passed | Quantity 1.8 → 1.95 KG | |
| 4 | FG-7200 | 2000 | A | RM-4410 | 12/01/2026 | 0 | Test passed | Item 0060 will be added | |
| 5 | SA-3100 | 1000 | D | RM-2990 | 12/01/2026 | 1 | Error | Component RM-2990 is not in this BOM |
How does the program work?
- 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.
- For every row the parent material, plant, usage and alternative are looked up in MAST and the new component in MARA; components with a deletion flag (LVORM) or a blocking material status (MSTAE) are rejected. The action must be R (replace), A (add), D (delete) or Q (quantity).
- CSAP_MAT_BOM_READ reads the BOM items valid on the validity date; the old component to replace or delete is found together with its item number, otherwise the row fails.
- Rows of the same BOM are grouped and passed to CSAP_MAT_BOM_MAINTAIN in one call with the change number and validity date; for a replacement the old item is sent with the deletion flag and the new component with the same item number.
- In test mode the change is rolled back and the number of open production orders that still carry the old component as a requirement in RESB is written on the row.
- In a real run BAPI_TRANSACTION_COMMIT is called after each successful BOM; results and messages are listed per row, and failed rows can be downloaded as a separate file.
Performance notes
One call per BOM reduces lock conflicts and the number of commits. Run files above a few thousand rows in the background. Using a change number keeps the history and makes the change traceable.
Features
- Test mode (check without posting)
- Line-by-line result and error log
- Download failed lines as a separate file
- Runs as a background job Large files are processed in the background from the application server.
- Export to Excel
Authorization objects
- C_STUE_WRKChange BOMs by plant
- C_STUE_BERChange BOMs by BOM authorization group
Frequently asked questions
Are open production orders updated as well?
No. A BOM change only affects orders that are created or re-read afterwards. In test mode the program counts the affected open orders; changing the components of those orders is a separate mass order change step and can be added if required.
Is a change number mandatory?
It is not mandatory, but recommended. With a change number the old and the new component are both kept by date and it is traceable who made the change and when. The number can be given per row in the file or as a default on the selection screen.
Does it work on S/4HANA?
Yes. The CSAP functions are also used in S/4HANA. For a clean core approach, a move to the released BOM APIs can be evaluated separately.
Packages that include this solution
BOM, Routing and Production Version Pack
A five-component pack that loads, changes and audits production master data: mass routing creation from Excel, mass BOM component changes, an audit of …
Related reports
Multi-Level BOM Where-Used Report with Open Production Orders
A custom ALV report that shows in which assemblies and, at the top, in which finished goods one or more components are used, as a flat list that …
Orders Using Expired or Locked Production Versions Report
A custom ALV report that checks production versions against their validity dates, lock status and the validity of the BOM and routing they point to, …
Let us build this program for your system
Briefly describe your system and expectations. We will clarify the scope and come back with an effort and price quote.