I have the need to get a BOM with all components , currently using Tc. CK86 , but this doesn't give enough information, so I want to do this by SQL, I come from oracle background and dont know how could I get this done in DB2 R/3, I do not have access to query builder or quickview , but i do have read access via SQL, I'm currently trying to figure out a way of getting this info using tables :
MAST Material to BOM Link
STKO BOM Header
STPO BOM item
Does any of you have a solution for this?
In Oracle I did something like the following:
SELECT DISTINCT LEVEL
,sys_connect_by_path(msil.segment1, ' @ ') AS "BOM TREE"
,lpad(' ', LEVEL, '') || msil.segment1 Cod_Component
FROM mtl_system_items msi
WHERE msi.organization_id = 332
AND BOM.ASSEMBLY_ITEM_ID = MSI.INVENTORY_ITEM_ID
AND BOM.ORGANIZATION_ID = MSI.ORGANIZATION_id
AND bom.bill_sequence_id = bic.bill_sequence_id
AND nvl(bic.disable_date, sysdate) >= SYSDATE
AND BIC.component_ITEM_ID = MSIL.INVENTORY_ITEM_ID
AND Bom.ORGANIZATION_ID = MSIL.ORGANIZATION_ID
AND msil.inventory_item_status_code = 'Active'
AND msi.inventory_item_status_code = 'Active' connect BY prior bic.component_item_id = bom.assembly_item_id
WITH msi.segment1 = trim(:parte)
ORDER BY 2