In depth details of supplier with status of supplier & status of items.
SELECT DISTINCT
msi.segment1 "ITEM CODE",
pla.item_id,
msi.description "ITEM DESCRIPTION",
msi.inventory_item_status_code "ITEM STATUS",
mp.organization_code,
msi.item_type,
PV.SEGMENT1 VENDOR_NUMBER,
PV.VENDOR_NAME,
DECODE (pv.end_date_active, '', 'Active', 'Inactive')
"SUPPLIER STATUS",
pvs.VENDOR_SITE_CODE,
pvs.country,
pv.VENDOR_TYPE_LOOKUP_CODE "SUPPLIER TYPE",
atl.name "PAYMENT TERMS",
MSI.POSTPROCESSING_LEAD_TIME,
MSI.PREPROCESSING_LEAD_TIME,
MSI.FULL_LEAD_TIME,
paa.attribute1 "ORDER PPROCESSING",
paa.attribute2 "ADVANCE PAYMENT",
paa.attribute3 "ORDER CONFIRMATION",
paa.attribute4 "SUPLLIER",
paa.attribute5 "SHIPPING",
paa.attribute6 "CLEARANCE",
paa.attribute7 "PORT QA",
paa.attribute8 "FOREIGN SUPLLIER"
FROM apps.po_headers_all pha,
apps.ap_suppliers pv,
apps.ap_supplier_sites_all pvs,
hr_locations hl1,
hr_locations hl2,
apps.per_all_people_f papf,
apps.po_lines_all pla,
hr_operating_units hou,
apps.ap_terms_tl atl,
apps.po_line_locations_all plla,
ZX_LINES Lines,
inv.mtl_system_items_b msi,
mtl_parameters mp,
APPS.po_asl_attributes paa
WHERE pha.vendor_id = pv.vendor_id
AND pha.vendor_site_id = pvs.vendor_site_id
AND pha.ship_to_location_id = hl1.location_id
AND pha.bill_to_location_id = hl2.location_id
AND pha.agent_id = papf.person_id
AND pha.po_header_id = pla.po_header_id
AND pha.org_id = hou.organization_id
AND pvs.terms_id = atl.term_id
AND plla.po_header_id = pha.po_header_id
AND pla.po_line_id = plla.po_line_id
AND pha.org_id = plla.org_id
AND pha.org_id = &org_id
AND lines.trx_id(+) = pha.po_header_id
AND msi.inventory_item_id = pla.item_id
AND msi.organization_id = mp.organization_id
AND pla.item_id = paa.item_id
AND pvs.vendor_id = paa.vendor_id
ORDER BY 1 DESC