SELECT WE.WIP_ENTITY_NAME,
MSI.SEGMENT1,
MSI.DESCRIPTION,
WDJ.CLASS_CODE,
msi2.segment1,
WDJ.START_QUANTITY,
WDJ.SCHEDULED_START_DATE
FROM WIP.WIP_ENTITIES WE,
WIP.WIP_DISCRETE_JO WDJ,
INV.MTL_SYSTEM_ITEMS_B MSI,
WIP.WIP_REQUIREMENT_OPERATIONS WRO,
INV.MTL_SYSTEM_ITEMS_B msi2
WHERE WE.WIP_ENTITY_ID = WDJ.WIP_ENTITY_ID
AND MSI.INVENTORY_ITEM_ID = WDJ.PRIMARY_ITEM_ID
AND MSI.ORGANIZATION_ID = WDJ.ORGANIZATION_ID
AND WRO.WIP_ENTITY_ID=WE.WIP_ENTITY_ID
AND msi2.inventory_item_id=wro.inventory_item_id
AND msi2.organization_id=wro.organization_id
AND msi2.organization_id=X
AND WDJ.ORGANIZATION_ID = X
AND WDJ.JOB_TYPE = 3
AND WDJ.STATUS_TYPE IN (1, 3)
AND WRO.MRP_NET_FLAG!=1
AND WDJ.PRIMARY_ITEM_ID!=WRO.INVENTORY_ITEM_ID