Hello All,
This is Part 5 in the series on the migration of SAP Plant Maintenance data from SAP ERP Central Component (ECC) to SAP S/4HANA® Cloud. In this blog post, I will review the Bills of Materials including material assemblies, functional locations, equipment and Group BOM objects and the key table relationships, tricks, tips and processes for migrating your data using the files approach.
Part 1 – Introduction can be found with this link
Part 1
Part 1 has the links to the other Blog Posts.
Maintenance Bills of Materials
A maintenance bill of material (BOM) is a complete, formally structured list of the components making up a technical object or an assembly. The list contains the object numbers of the individual components together with their quantity and unit of measure. The components can be stock or non-stock spares or assemblies, which in turn can be described using maintenance BOMs.
Used to structure and to identify spare parts available for technical objects.
Additional information can be found in the link to the SAP Help files –
Maintenance Bills of Materials
Material Bills of Material (Assemblies), require an IBAU material type as the header and then the other Materials can be added as well as non-stock items and text items. The material assemblies can be reused on multiple objects as needed using the Construction Type (SUBMT) Field in the Functional and Equipment records.
Equipment and Functional location BOMs are specific to one technical object and are linked internally to the technical object. I always assumed there was not a common way to manage these "individual" BOMs, yet the Group BOM concept was introduced a long time ago, I just never ran into an application for it, until now.
The Material, Equipment and Functional Locational BOMs, can be
Grouped (as alternatives / variants) by the assignment off a link through the BOM Group ID field (EXSTL). You can only link BOMS of similar type, ie., Equipment BOMs together or Functional Location BOMs together. You can then add the alternatives by adding the BOM Group ID to each individual BOM and then be able to identify which components are common or unique within each alternative BOM in a centralized place.
SAP Plant Maintenance describes the Group BOMs as Variants and the general process to manually create them is a described in this link
Create Variant BOM. The Display of the Variant BOMs is described in this link
Display Variant BOM.
This Customer used Group BOMS to manage Bill of Materials for things like Power Packs, UPS Battery Packs, Hoists and other objects where there are a lot of common parts and some variants between the technical objects. These were used primarily on equipment or functional location BOMS. Many of these variants were built manually over a period of 20 years and now the challenge was to get them extracted and built in one conversion effort,
The Group BOMs were used to manage these BOMs centrally, to identify what components were similar or unique to each equipment or functional location BOM. There is a limit of 99 individual BOMS that can be grouped together with a common alternative ID. Additional groups were made by simply abbreviating the ID and adding a numeric sequence to the ID.
BOM Group Conversions may not be supported with both the SAP S/4HANA Data Migration Cockpit (version dependent), however the standard SAP Legacy System Migration Workbench Tools does have a variant option. (See note below.)
NOTE: Check Customizing settings - In Customizing for Bills of Material, set the following indicators under Define modification parameters:
- EC management active
- BOM validity maint.
- Rptd itm effctvty via external item ID - This indicator defines that an item can become effective again under the same external item ID. The system does not check the effectivity conditions, such as the Valid-from date.
(
We did not know this upfront and I suspect this was a cause for a lot of issues with the BOM Groups that caused us to go the path we did and then require a cleanup program as we did not come across this information until much later after go-live. If I had to do it all over again, I expect that this setting might make all the difference in the conversion process we employed.)
Things to keep in mind when preparing the files;
- Check MATNR’s against the MM Files to be converted and check validities for materials. If not in MM Files, check with PM and MM Teams for inclusion or exclusion.
- Check to change the cost elements as needed, for the items that are non-stock.
- Validity date for the BOM is very important and needs to be in alignment with the overall master data strategy for the SAP Plant Maintenance objects.
Data Relationships between Tables
Download BoM Data and Prepare Files
MAST, EQST, TPST – Object BOM Links
- In SE16N, table start with the tables for the assignment of BoMs to the objects (MAST, EQST and TPST).
- MAST can be run for Plant XXXX, STLAN = 4. Should return a list of MATNR and STLNR combinations. Use this as input for STAS by Inserting a column A for INDEX1 and concatenate “M” for the STLTY and adding STLNR + STLAL. (Ylou may have more entries here than you need, will clean up later). The iNDEX1 should look something like this M_00123456_1
- EQST can be run using the list of valid equipment numbers (EQUNR), Plant XXXX, STLAN = 4, and Category E. Use this as input for STAS by Inserting a column A for INDEX1 and concatenate “E” for the STLTY and adding STLNR + STLAL. The iNDEX1 should look something like this E_00000456_1
- TPST can be run using the list of valid functional locations, Plant XXXX, STLAN = 4, and Category T. Use this as input for STAS by Inserting a column A for INDEX1 and concatenate “T” for the STLTY and adding STLNR + STLAL The iNDEX1 should look something like this T_00000345_1
STZU – BOM GROUP INFO
- In SE16N, table STZU, run for each BOM Category E, M and T, using the STLNR values from the MAST, EQST and TPST tables respectively. In each file, insert Column A – INDEX and Concatenate the STLTY + STLNR. (You can also run it for the multiple BOM Categories and later filter by the Category.)
- Insert a Column after STLNR, called “Valid Items” and do a VLOOKUP Between the STAS and STZU on the field STLTY to see if the items are still valid or no longer relevant, Delete them if #N/A.
- The field EXSTL has the BOM Group ID and identifies a BoM as belonging to a BoM Group. Blank entries do not have BoM Groups assigned. This will be used to identify which load file will be used later. For our process, there will be two files needed, one to create the initial BOM / BOM Group combination and then and another to add the alternatives for that specific BOM Group.
- For the BOM Groups, a separate STLAL will be created for each version in STKO Header and the technical object referenced. STLAL = 01 is the first Alternative, this has the initial definition of the BOM Group in EXSTL and is used to create the two files needed to load the BoMs. The second file will filter out the STLAL > 01 to get all the other alternatives.
STAS – BOM -Header to Item Linkage
- In SE16N, table STAS run for each Bom Category (STLTY) separately and use the STLNR values from the MAST, EQST and TPST BOM Object Links to get only the STLNR’s for that Bom Category (E, M, and T). I named the files STAS_E, STAS_M, STAS_T to keep them separated.
- In each file, insert Column A and create INDEX, by concatenating STLTY, STLNR. Insert Column B and create INDEX1, by concatenating STLTY, STLNR and STLAL.
- In each of the STAS Files insert a Column to the right of STASZ for EXSTL and one Column for EQUNR / MATNR / TPLNR combined field.
- We can use INDEX to do a VLOOKUP to get which BOMs belong to BOM Groups (EXSTL) in the STZU table to add to STAS.
- We can use INDEX1 to do a VLOOKUP to get the technical object each BOM is linked to (use INDEX1 in MAST, EQST or TPST to get technical Object Number (MATNR, EQUNR or TPLNR) and enter into the EQUNR / MATNR / TPLNR combined field.
- We can also create INDEX3 in STAS and Concatenate STLTY, STLNR and STLKN to be able to link the Technical object to each line of STPO.
STKO – BoM Header
- In SE16N STKO, in field STLTY run selection separately for each E,M, & T. Select BLANK for deletion indicator and Deletion flag,
- Execute then download files separately, name them STKO_HEADER_E, or M, or T as needed.
- In each file, insert Column A and call it INDEX. Create INDEX by concatenating STLTY and STLNR
- In each file, insert Column B and call it INDEX1. Create INDEX1 by concatenating STLTY and STLNR AND STLAL
- In each file, insert Column to the right of STLNR (E) in STKO for TPLNR / EQUNR / MATNR, respectively).
- M – Materials
- E – Equipment
- T – Functional locations
- In each file, use INDEX1 already created in MAST, EQST and TPST, to VLOOKUP the respective MATNR, EQUNR and TPLNR fields for STKO using INDEX1.
- Use MAST to get Materials (MATNR) via VLOOKUP with INDEX1 M+STLNR+STLAL for table STKO INDEX1.
- Use EQST to get Equipment (EQUNR) via VLOOKUP with INDEX1 E+STLNR+STLAL for table STKO INDEX1.
- Use TPST to get Functional location (TPLNR) via VLOOKUP with INDEX1 T+STLNR+STLAL for table STKO INDEX1
- USE PLMZ to get task list linkage – see PLMZ Table info for additional information
- Use INDEX to check for valid BoM items in STPO – Insert Column E, call it Valid items and do a VLOOKUP using INDEX in STPO to get valid BOM Headers that still have items, Use the STLTY field as the result. Filter and delete the entries in STKO that don’t have valid entries in STPO.
STPO – Bom Items
- In SE16N STKO, run the program for each STLTY - E, M,T & S separately. Select BLANK for deletion indicator and Deletion flag.
- Execute then download files separately, name them STKO_E, or M, or T or S as needed.
- In each file, create INDEX by concatenating STLTY and STLNR
- Use the INDEX to check for valid BoM’s in STKO
- Insert Column G for EXSTL and do a VLOOKUP using the INDEX with STZU to get the Group BOM ID’s associated. Where EXSTL is blank, these are not Group Bom’s and will be loaded in a different load file.
- Insert Column C – INDEX3, Concatenate STLTY, STLNR and STLKN. Use this to VLOOKUP the Technical object assigned to the BOM Item in STAS.
- Insert Column to the right of Field INDRK (material number), use VLOOKUP with Material Load File to find valid part numbers, filter with POSTP = L.
- POSTP = T or N may have #N/A that may need to remain or if N, may need to change to T.
- Check to see if parts that have #N/A are no longer needed and delete from STPO if no longer valid.
- Check all POSTYP = N and correct Cost Elements, Purchasing Organization, Buyers, Vendors, etc.
- Align Columns in STPO with the load file Items Tab to make copying easier
BOM Load Files Prep
Because of configuration settings identified above, we tried to use the Legacy System Migration Workbench Variant BOM Create (Object 0030, Method 0003 Create Variant BOM RCSBI030) and were not successful in getting this to work with the desired results. I believe that if we had known about the configuration changes needed, this method would have worked and saved a lot of time. I will explore further when I have another project that uses Group BOM.s. If anyone has experience with this, please share.
So we decided to approach this in three separate load sequences. (Had separate load programs for each of the different objects (Equipment, Material, Functional Location)
A. Create a file that has the BOMS without any Groups. Separate Files for Equipment, Materials and Functional locations where the EXSTL Field in STKO is blank and STLAL = 01. This allowed us to use the general structure for the Batch Input (RCSBI010 / 0001) for BOM create is as follows;
BGR00 - Batch Input Structure for Session Data
BICSK - Batch Input Structure for BOM Header Data (This example is for the equipment, the Material and Functional Location are similar with just different fields for the object id's.)
EQ_TOP = Parent Equipment
EQUNR = Equipment Number
WERKS = Plant
STLAN = BOM Usage
DATUV = Valid-From Date (BTCI)
BMENG = Base quantity (BTCI)
EXSTL = BOM group
STLAL = Alternate BOM Number
STLST = BOM status (BTCI)
ZTEXT = BOM Text
BICSP - Batch Input Structure for BOM Item Data
EQ_TOP = Parent Equipment
EKGRP = Purchasing Group
FMENG = Fixed qty
IDNRK = BOM component
LIFNR = Account Number of Vendor or Creditor
LIFZT = Delivery time in days
MATKL = Material Group
MEINS = Component Unit of Measure
MENGE = Component quantity (BTCI)
PEINH = Price unit (BTCI)
POSNR = BOM Item Number
POSTP = Item category (bill of material)
PREIS = Price (BTCI)
POTX1 = BOM Item Text (Line 1)
POTX2 = BOM item text (line 2)
PSWRK = Issuing plant
SAKTO = Cost element
SANIN = Indicator: item relevant to plant m
SANKA = Indicator: item relevant to Costing
SORTF = Sort String
STKKZ = PM assembly indicator
WAERS = Currency key (BTCI)
EKORG = Purchasing organization
BICSU - Batch Input Structure for BOM Sub-Item Data (Did not have any sub-items)
For this file we only used the Header and Items, so our load file had just two tabs.
B. The next file was to create the initial Group BOM Variant for all the first occurrences (STLST = 01) and EXSTL is not blank. This file has just one tab for the initial creation of the BOM Group information. Also use STZU for the header information. This SAP Legacy System Migration Workbench was a recording with just the fields we needed to create the BOM Header.
TPLNR or EQUNR, depending on the object
WERKS = Plant
STLAN = 4
DATUV = Validity Date, be careful to align with other objects
VTPNR or VEQNR depending on the object
EXSTL = Variant ID
ZTEXT = Text for Variant ID
BMENG = 1
STLST = 1
C. The third file then added the alternative (Group) BOMS and items for each BOM. this used the general structure for the Batch Input (RCSBI010 / 0002) for BOM change is as follows;
BGR00 - Batch Input Structure for Session Data
BICSK - Batch Input Structure for BOM Header Data (This example is for the equipment, the Material and Functional Location are similar with just different fields for the object id's. The Header is already created and we just need to give the information to change it.)
EQ_TOP = Parent Equipment
EQUNR = Equipment Number
WERKS = Plant
STLAN = BOM Usage
DATUV = Valid-From Date (BTCI)
BICSP - Batch Input Structure for BOM Item Data
EQ_TOP = Parent Equipment
EKGRP = Purchasing Group
FMENG = Fixed qty
IDNRK = BOM component
LIFNR = Account Number of Vendor or Creditor
LIFZT = Delivery time in days
MATKL = Material Group
MEINS = Component Unit of Measure
MENGE = Component quantity (BTCI)
PEINH = Price unit (BTCI)
POSNR = BOM Item Number
POSTP = Item category (bill of material)
PREIS = Price (BTCI)
POTX1 = BOM Item Text (Line 1)
POTX2 = BOM item text (line 2)
PSWRK = Issuing plant
SAKTO = Cost element
SANIN = Indicator: item relevant to plant m
SANKA = Indicator: item relevant to Costing
SORTF = Sort String
STKKZ = PM assembly indicator
WAERS = Currency key (BTCI)
EKORG = Purchasing organization
BICSU - Batch Input Structure for BOM Sub-Item Data (Did not have any sub-items)
For this file we only used the Header and Items, so our load file had just two tabs.
Equipment BoM
STKO – BOM Header
- This Table was a combined extract for the STLTY = E, M, T.
- Remove all the line items corresponding to the field STLNR, which are not available in STPO.
- Filter STLTY for E
- In EQST insert Column A for INDEX and create INDEX by concatenating the above values for STLTY =E plus the STLNR for each table
- Use EQST to get Equipment (EQUNR) via VLOOKUP with INDEX (E+STLNR) for table STKO- EQUNR
- In STKO insert Column B call it TPLNR / EQUNR / MATNR, Use EQST to get Equipment (EQUNR) via VLOOKUP with INDEX (E+STLNR) for table STKO INDEX (Column B)
- The STKO values are copied to Load file ‘BOM Header tab’ and ‘Interface for BOM Access tab’ against the respective fields.
STPO – BOM Items
- This Table was a combined extract for the STLTY = E, M, T.
- Remove all the line items corresponding to the field STLNR, which are not available in STPO.
- Filter STLTY for E.
- Remove all the duplicates for the combination of fields STLNR and POSNR.
- The STPO values are copied to Load file ‘BOM Item tab.
Created the three separate load files defined above, filtering the header and items as needed to populate the load file templates.
Material BoM
STKO – BoM Header
- This Table was a combined extract for the STLTY = E, M, T.
- Remove all the line items corresponding to the field STLNR, which are not available in STPO.
- Filter STLTY for M.
- In STKO, insert Column A for INDEX and create INDEX by concatenating the values for STLTY = M plus the STLNR for each table.
- In STKO insert Column B call it TPLNR / EQUNR / MATNR, Use MAST to get Material (MATNR) via VLOOKUP with INDEX (M+STLNR) for table STKO INDEX (Column B).
- Sort by INDEX
- The STKO values are copied to Load file ‘BOM Header tab’
STPO – BoM Items
- This Table was a combined extract for the STLTY = E, M, T.
- Remove all the line items corresponding to the field STLNR, which are not available in STPO.
- Filter STLTY for M
- Insert Column B call it TPLNR / EQUNR / MATNR, use the INDEX to VLOOKUP the values in STKO TPLNR / EQUNR / MATNR objects
- Remove all the duplicates for the combination of fields STLNR and POSNR
- The STPO values are copied to Load file ‘BOM Item tab’
MARA – Material Masters
- SE16N Table MARA: Field LVORM = Blank and Select: Equal to. In field MTART enter ERSA, NLAG, IBAU. Run in Background.
- Use MARA to get MATNR and Material Description if needed using INDRK
Load Files and SAP Legacy System Migration Workbench
- There were no BOM Groups for the Material BoMs so there is just one SAP Legacy System Migration Workbench and Load file with a tab for the header and a tab for the Items.
- Used the general structure for the Batch Input (RCSBI010 / 0001) for BOM create is as follows;
BGR00 - Batch Input Structure for Session Data
BICSK - Batch Input Structure for BOM Header Data
BICSP - Batch Input Structure for BOM Item Data
BICSU - Batch Input Structure for BOM Sub-Item Data (Did not have any sub-items)
Check that all the materials are valid and extended to the plant.
Functional Location BoM
STKO – BoM Header
- This Table was a combined extract for the STLTY = E, M, T.
- Remove all the line items corresponding to the field STLNR, which are not available in STPO.
- Filter STLTY for T
- In STKO, insert Column A for INDEX and create INDEX by concatenating the values for STLTY = T plus the STLNR for each table.
- In STKO insert Column B call it TPLNR / EQUNR / MATNR, Use TPST to get Functional Location (TPLNR) via VLOOKUP with INDEX T+STLNR for table STKO INDEX (Column B)
- The STKO values are copied to Load file ‘BOM Header tab’ and ‘Interface for BOM Access tab’ against the respective fields
STPO – BoM Items
- Remove all the line items corresponding to the field STLNR, which are not available in STPO.
- Filter STLTY for T
- Remove all the duplicates for the combination of fields STLNR and POSNR
- The STPO values are copied to Load file ‘BOM Item tab’
- Use TPST to get Functional location (TPLNR) via VLOOKUP with INDEX T+STLNR for table STKO INDEX (Column B)
Created the three separate load files defined above, filtering the header and items as needed to populate the load file templates.
Once we ran the load files, we discovered the variants were not grouped correctly as the Customizing settings - In Customizing for Bills of Material, set the following indicators under Define modification parameters were not set to allow the item numbers to be reused. We created a clean up program to align the like materials across all of the groups. It was not perfect, however it was a compromise that the Customer was able to manage.
Closing Comments
I learned a lot from going through this process, and seeing a valid application for the Group BoM functionality. The Customer built the relationships over many years and it was a challenge that we accepted to convert them so they could continue to manage their BoMs efficiently.
I hope this will help you as you convert your data to SAP S/4HANA.
Please stay tuned for the next Blog Post in this Series SAP EAM Data Migration Part 6 – Task Lists, coming soon. I look forward to your comments, feedback and engaging conversation. Please like and follow my profile to get updates as new content is added.