PP Program Custom development Mass upload

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

  • CS20 BOM Mass Change. Replaces one component in the selected BOMs; does not read a file or show the impact on open orders.
  • CS02 Change Material BOM. Changes a single BOM.

Tables used

The tables the program reads and updates. ECC and S/4HANA differences are marked separately.

TableRoleAccessSystem
MASTMaterial to BOM LinkCheck of the parent material – BOM linkReadECC + S/4
STKOBOM HeaderBOM header; updated with the change numberWriteECC + S/4
STPOBOM ItemBOM items: component, quantity, item numberWriteECC + S/4
MARAGeneral Material DataExistence, deletion flag and material status of the new componentReadECC + S/4
RESBReservation/Dependent RequirementsOpen production order requirements of the old component (impact preview)ReadECC + 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

ParameterDescriptionTypeReference fieldRequiredExample
P_FILEUpload file (XLSX or CSV)Single value—YesC:\temp\bilesen-degisikligi.xlsx
P_AENNRDefault change numberSingle valueSTPO-AENNRNo500000000412
P_TESTTest mode (check without posting and show impact)Checkbox—NoX

Input file columns

The columns of the upload template and the SAP fields they are written to. Columns with an asterisk are mandatory.

#ColumnTarget fieldRequired
1Parent materialMAST-MATNRYes
2PlantMAST-WERKSYes
3BOM usageMAST-STLANYes
4AlternativeMAST-STLALNo
5ActionBy rule R = replace, A = add, D = delete, Q = update quantityYes
6Old componentSTPO-IDNRKNo
7New componentMARA-MATNRNo
8QuantitySTPO-MENGENo
9UnitSTPO-MEINSNo
10Item numberSTPO-POSNRNo
11Valid fromSTPO-DATUVYes
12Change numberSTPO-AENNRNo

Sample upload file

1Parent material *Plant *BOM usage *AlternativeAction *Old componentNew componentQuantityUnitItem numberValid from *Change number
2FG-61001000101RRM-3220RM-32251PC004012/01/2026500000000412
3FG-50031000101QRM-20401.95KG001012/01/2026500000000412
4FG-72002000101ARM-44102PC006012/01/2026
5SA-31001000101DRM-2990003012/01/2026500000000412
A view built with fictional sample data; not real system data.

Result list columns

#ColumnSource
1RowCalculated Row number in the file
2Parent materialMAST-MATNR
3PlantMAST-WERKS
4ActionCalculated Action code from the file: R, A, D or Q
5Old componentSTPO-IDNRK
6New componentMARA-MATNR
7Valid fromSTPO-DATUV
8Affected open ordersCalculated Number of production orders that carry the old component as an open requirement in RESB
9StatusCalculated Test passed, changed or error
10MessageCalculated Function return message or check error

Sample result list

RowParent materialPlantActionOld componentNew componentValid fromAffected open ordersStatusMessage
2FG-61001000RRM-3220RM-322512/01/20262Test passedItem 0040 will be replaced
3FG-50031000QRM-204012/01/20264Test passedQuantity 1.8 → 1.95 KG
4FG-72002000ARM-441012/01/20260Test passedItem 0060 will be added
5SA-31001000DRM-299012/01/20261ErrorComponent RM-2990 is not in this BOM
A view built with fictional sample data; not real system data.

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. 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).
  3. 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.
  4. 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.
  5. 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.
  6. 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

PP Package Custom

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 …

5 components · v1.0

Related reports

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.

Related report: Mass BOM Component Replacement Upload Program