You can create a Material BOM in different ways:
Be aware, that you only must use one option above within one system. Otherwise, this may lead to inconsistencies.
1. Automatic creation of BOM
In <ECTR installation directory>\customize\config\default.txt set the following values:
# Define how to update a BOM. Set to true, ECTR will update a material BOM# on checkin of a document with component references.# true: Update a material BOM on checkin of a document with component references# false: BOMs can only be updated manuallyplm.bom.updateAtCheckin = true
So after each checkin of a CAD assembly the material BOM is created, if also a Material exists for the components (Document Info Record).
Material BOM is derived directly from information in CAD system (plm_metainf-cad.xml). The SAP function module CSAP_MAT_BOM_MAINTAIN is called to store the BOM.
2. Manual creation of BOM
a) Via "old" CDESK like Dialog
Simply go to the context menu of a Document Info Record of an assembly an click on "Derive Bill of Material".
b) New BOM Wizard
The context menu entries "Derive Bill of Material 2 .." call a new dialog to create/update Bill of Materials.
You can also launch the new dialog for a specific Solidworks Configuration:
The new dialog shows all BOM headers in the upper section and all BOM items in the lower section. When you click on a BOM header, the lower table only shows the BOM items belonging to the selected header above.
3. BOM creation for AutoCAD
Requirement: BOM creation for AutoCAD (also Inventor if you want to handle virtual components)
Restriction: You have to use the Integration commands to create and update a BOM, not the BOM functions in ECTR as explained above.
Accordingly to SAP Note 2107230 - ECTR: You use the CDESK_BOM_WIZARD function for maintenance of material BOMs you have to implement the method if_ex_cdesk_bom~find_existing_items of the BAdI CDESK_BOM.
Afterwards you will be able to create a BOM via the Integration. However, the BOM will be deleted and recreated each time you trigger an update of the BOM.
To prevent the recreation you can enhance the coding in find_existing_items. Please add the following lines at the end of the function:
DATA: linked_mat LIKE LINE OF all_linked_materials, plm_docs_copy LIKE plm_documents, plm_document LIKE LINE OF plm_documents. FIELD-SYMBOLS: <doc> LIKE LINE OF plm_documents, <doc_copy> LIKE LINE OF plm_documents. LOOP AT plm_documents ASSIGNING <doc>. READ TABLE plm_docs_copy WITH KEY material = <doc>-material ASSIGNING <doc_copy>. IF sy-subrc = 0. <doc_copy>-quantity = <doc_copy>-quantity + <doc>-quantity. ELSE. APPEND <doc> TO plm_docs_copy. ENDIF. ENDLOOP. plm_documents = plm_docs_copy. LOOP AT plm_documents ASSIGNING <doc>. CLEAR linked_mat. linked_mat-objecttype = 'MARA'. linked_mat-objectkey = <doc>-material. <doc>-guid_ident = sy-tabix. linked_mat-tab_index = sy-tabix. APPEND linked_mat TO all_linked_materials. ENDLOOP.
Existing BOM wil be updated and not recreated, but positions with the same material will be summarized (quantity will be adjusted for this positions).
3. Preferred Material used to derive BOM
You can have multiple Materials assigned to one Document Info Record. When deriving a Material BOM, especially the BOM item the system needs to know, whichs is the "preferred" Material to be used for the specific item. In ECTR you can mark the preferred Material.