Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

select distinct pla.

line_num,
haou.name org_name,
pha.segment1 PO_Number ,
pha.type_lookup_code PO_TYPE,
pha.creation_date,
pha.comments Descriptions,
aps.vendor_name,
papf.full_name,
pha.authorization_status,
pha.currency_code,
--pla.line_num,
plt.line_type,
msib.segment1 item,
pla.item_description,
kfv.CONCATENATED_SEGMENTS PO_Category,
pla.quantity,
pla.unit_price,
(pla.quantity * pla.unit_price) extended_price,
pll.need_by_date,
pll.promised_date,
mp.organization_code SHIP_TO_ORG,
hla.LOCATION_CODE Ship_to_location_code,
prh.segment1 requisition_number

from apps.po_headers_all pha,


apps.po_lines_all pla,
apps.po_line_locations_all pll,
apps.ap_suppliers aps,
apps.per_all_people_f papf,
apps.mtl_categories_kfv kfv,
apps.po_distributions_all pda,
apps.hr_all_organization_units haou,
apps.mtl_system_items_b msib,
apps.mtl_parameters mp,
apps.po_line_types plt,
apps.hr_locations_all_tl hla,
apps.po_requisition_headers_all prh,
apps.po_requisition_lines_all prl,
apps.po_req_distributions_all prd

where 1=1
and pha.po_header_id = pla.po_header_id
and pla.po_header_id = pll.po_header_id
and pha.vendor_id = aps.vendor_id
and pha.agent_id = papf.person_id
and pla.category_id = kfv.category_id
AND prh.requisition_header_id = prl.requisition_header_id
AND prd.requisition_line_id = prl.requisition_line_id
AND prd.distribution_id (+) = pda.req_distribution_id
AND pda.po_header_id = pha.po_header_id
and haou.organization_id = pha.org_id
and msib.inventory_item_id (+) = pla.item_id
and pll.SHIP_TO_ORGANIZATION_ID = mp.organization_id
and pla.line_type_id = plt.line_type_id
and pll.SHIP_TO_LOCATION_ID = hla.LOCATION_ID
and pha.segment1 = 'XX00009774'
and PHA.org_id in (001,002)
and aps.vendor_name like '%XXXX%'
and trunc (pha.creation_date) >= trunc (sysdate-90);

You might also like