SELECT DISTINCT PLN.NAME "PLAN_NAME",
--PLN.PLAN_ID,
--ICG.ITEM_CATALOG_GROUP_ID,
--MSI.INVENTORY_ITEM_ID,
MSI.CONCATENATED_SEGMENTS ITEM_CODE,
MSI.DESCRIPTION ITEM_DESCRIPTION,
MSI.PRIMARY_UOM_CODE,
qpc.CHAR_NAME "COLLECTION_ELEMENT_NAME",
PLN_CHR.RESULT_COLUMN_NAME "COLLECTION_ELEMENT",
ELE_VAL.ELEMENT_VALUE
-- PAR.ORGANIZATION_ID
FROM MTL_SYSTEM_ITEMS_KFV MSI,
MTL_ITEM_CATALOG_GROUPS_VL ICG,
QA_PLANS PLN,
MTL_ITEM_CATALOG_GROUPS_VL CAT_GRP,
MTL_DESCRIPTIVE_ELEMENTS DES_ELE,
MTL_DESCR_ELEMENT_VALUES ELE_VAL,
QA_CHARS CHARS,
QA_PLAN_CHARS PLN_CHR,
qa_plan_chars_v qpc
-- MTL_PARAMETERS PAR
WHERE MSI.ITEM_CATALOG_GROUP_ID = ICG.ITEM_CATALOG_GROUP_ID
AND ICG.SEGMENT1 = PLN.NAME
AND CAT_GRP.ITEM_CATALOG_GROUP_ID = DES_ELE.ITEM_CATALOG_GROUP_ID
AND CAT_GRP.SEGMENT1 = PLN.NAME
AND PLN.PLAN_ID = PLN_CHR.PLAN_ID
AND PLN_CHR.CHAR_ID = CHARS.CHAR_ID
AND CHARS.NAME = DES_ELE.ELEMENT_NAME
AND DES_ELE.ELEMENT_NAME = ELE_VAL.ELEMENT_NAME
AND MSI.INVENTORY_ITEM_ID = ELE_VAL.INVENTORY_ITEM_ID
AND ELE_VAL.ELEMENT_VALUE IS NOT NULL
-- and PAR.ORGANIZATION_ID = MSI.ORGANIZATION_ID
--and PAR.ORGANIZATION_ID =104
-- AND PLN.PLAN_ID = 562
-- and ELE_VAL.ELEMENT_VALUE
-- AND ELE_VAL.INVENTORY_ITEM_ID = 373647
AND PLN.PLAN_ID = qpc.PLAN_ID
--and qpc.CHAR_NAME ='ITEM WIDTH IMPERIAL'
AND DATATYPE_MEANING <> 'Character'
AND PLN_CHR.RESULT_COLUMN_NAME = qpc.RESULT_COLUMN_NAME
--and qpc.RESULT_COLUMN_NAME ='CHARACTER12'
-- AND PLN_CHR.RESULT_COLUMN_NAME = 'CHARACTER12'
-- and MSI.CONCATENATED_SEGMENTS ='JIG3010'
-- AND PLN.NAME ='PULSE JET BAG'--'PLEATED STD CARTRIDGES'
-- and DECODE( TRANSLATE(ELE_VAL.ELEMENT_VALUE,'0123456789.',' '), NULL, 'N','C') ='C'
AND LENGTH(TRIM(TRANSLATE (ELE_VAL.ELEMENT_VALUE,
' +-.0123456789',
' '))) IS NOT NULL
AND MSI.ROWID =
(SELECT MIN (ROWID)
FROM MTL_SYSTEM_ITEMS_KFV ITEM
WHERE ITEM.ITEM_CATALOG_GROUP_ID =
MSI.ITEM_CATALOG_GROUP_ID
AND ITEM.INVENTORY_ITEM_ID = MSI.INVENTORY_ITEM_ID)
ORDER BY PLN.NAME, MSI.CONCATENATED_SEGMENTS
No comments:
Post a Comment