{"audience":"Product engineering, master data teams and PP consultants who manage supplier or part changes.","authorization_objects":[{"note":"Change BOMs by plant","object":"C_STUE_WRK"},{"note":"Change BOMs by BOM authorization group","object":"C_STUE_BER"}],"components":[],"countries":[],"effort_days_max":7,"effort_days_min":5,"effort_size":"M","faq":[{"a":"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.","q":"Are open production orders updated as well?"},{"a":"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.","q":"Is a change number mandatory?"},{"a":"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.","q":"Does it work on S/4HANA?"}],"features":[{"code":"test_run","label":"Test mode (check without posting)","note":""},{"code":"log","label":"Line-by-line result and error log","note":""},{"code":"error_file","label":"Download failed lines as a separate file","note":""},{"code":"background","label":"Runs as a background job","note":"Large files are processed in the background from the application server."},{"code":"excel","label":"Export to Excel","note":""}],"functions":[{"name":"CSAP_MAT_BOM_READ","role":"Reads the current items on the validity date"},{"name":"CSAP_MAT_BOM_MAINTAIN","role":"Adds, deletes or replaces components or updates quantities in the BOM"},{"name":"BAPI_TRANSACTION_COMMIT","role":"Saves successful BOMs permanently"},{"name":"BAPI_TRANSACTION_ROLLBACK","role":"Rolls back the change in test mode and for failed BOMs"}],"gap":"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.","id":"pp-bom-component-mass-change-upload","industries":[],"input_columns":[{"derived":false,"label":"Parent material","required":true,"rule":"","target_field":"MATNR","target_table":"MAST"},{"derived":false,"label":"Plant","required":true,"rule":"","target_field":"WERKS","target_table":"MAST"},{"derived":false,"label":"BOM usage","required":true,"rule":"","target_field":"STLAN","target_table":"MAST"},{"derived":false,"label":"Alternative","required":false,"rule":"","target_field":"STLAL","target_table":"MAST"},{"derived":true,"label":"Action","required":true,"rule":"R = replace, A = add, D = delete, Q = update quantity","target_field":null,"target_table":null},{"derived":false,"label":"Old component","required":false,"rule":"","target_field":"IDNRK","target_table":"STPO"},{"derived":false,"label":"New component","required":false,"rule":"","target_field":"MATNR","target_table":"MARA"},{"derived":false,"label":"Quantity","required":false,"rule":"","target_field":"MENGE","target_table":"STPO"},{"derived":false,"label":"Unit","required":false,"rule":"","target_field":"MEINS","target_table":"STPO"},{"derived":false,"label":"Item number","required":false,"rule":"","target_field":"POSNR","target_table":"STPO"},{"derived":false,"label":"Valid from","required":true,"rule":"","target_field":"DATUV","target_table":"STPO"},{"derived":false,"label":"Change number","required":false,"rule":"","target_field":"AENNR","target_table":"STPO"}],"kind":"program","language":"en","lastmod":"2026-11-17","logic":"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.\n2. 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).\n3. 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.\n4. 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.\n5. 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.\n6. 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.","module":"PP","object_type":"upload","output_columns":[{"calculated":true,"formula":"Row number in the file","label":"Row","source_field":null,"source_table":null},{"calculated":false,"formula":"","label":"Parent material","source_field":"MATNR","source_table":"MAST"},{"calculated":false,"formula":"","label":"Plant","source_field":"WERKS","source_table":"MAST"},{"calculated":true,"formula":"Action code from the file: R, A, D or Q","label":"Action","source_field":null,"source_table":null},{"calculated":false,"formula":"","label":"Old component","source_field":"IDNRK","source_table":"STPO"},{"calculated":false,"formula":"","label":"New component","source_field":"MATNR","source_table":"MARA"},{"calculated":false,"formula":"","label":"Valid from","source_field":"DATUV","source_table":"STPO"},{"calculated":true,"formula":"Number of production orders that carry the old component as an open requirement in RESB","label":"Affected open orders","source_field":null,"source_table":null},{"calculated":true,"formula":"Test passed, changed or error","label":"Status","source_field":null,"source_table":null},{"calculated":true,"formula":"Function return message or check error","label":"Message","source_field":null,"source_table":null}],"parameters":[{"example":"C:\\temp\\bilesen-degisikligi.xlsx","kind":"parameter","label":"Upload file (XLSX or CSV)","name":"P_FILE","ref_field":"","required":true},{"example":"500000000412","kind":"parameter","label":"Default change number","name":"P_AENNR","ref_field":"STPO-AENNR","required":false},{"example":"X","kind":"checkbox","label":"Test mode (check without posting and show impact)","name":"P_TEST","ref_field":"","required":false}],"part_of":["pp-production-master-data-pack"],"performance":"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.","quote_url":"https://nekuhub.com/en/request-a-quote/?report=pp-bom-component-mass-change-upload","related":["pp-bom-where-used-open-orders","pp-expired-production-version-orders"],"releases":[],"source":"custom","standard_alternatives":[{"note":"Replaces one component in the selected BOMs; does not read a file or show the impact on open orders.","tcode":"CS20"},{"note":"Changes a single BOM.","tcode":"CS02"}],"summary":"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.","tables":[{"access":"read","join_on":"MAST-MATNR = dosya üst malzeme AND MAST-WERKS = dosya üretim yeri","role":"Check of the parent material – BOM link","table":"MAST","variant":"both"},{"access":"write","join_on":"STKO-STLNR = MAST-STLNR AND STKO-STLAL = MAST-STLAL","role":"BOM header; updated with the change number","table":"STKO","variant":"both"},{"access":"write","join_on":"STPO-STLNR = STKO-STLNR","role":"BOM items: component, quantity, item number","table":"STPO","variant":"both"},{"access":"read","join_on":"MARA-MATNR = dosya yeni bileşen","role":"Existence, deletion flag and material status of the new component","table":"MARA","variant":"both"},{"access":"read","join_on":"RESB-MATNR = eski bileşen AND RESB-WERKS = MAST-WERKS","role":"Open production order requirements of the old component (impact preview)","table":"RESB","variant":"both"}],"title":"Mass BOM Component Replacement Upload Program","url":"https://nekuhub.com/en/programs/mass-bom-component-replacement-upload-program/","vendor_id":"nekudos"}