select ROWNUM "SL NO",
prha.segment1 "PR NO",
prha.creation_date "PR CREATION DATE",
prha.approved_date "PR APPROVAL DATE",
msib.inventory_item_id "MATERIAL CODE",
msib.description "MATERIAL DESCRIPTION",
prla.quantity "QTY",
prla.unit_meas_lookup_code "UOM",
pha.segment1 "PO NO",
pha.creation_date "PO_CREATION_DATE",
pha.approved_date "PO APPROVAL DATE",
aps.vendor_name "SUPPLIER_NAME",
papf.full_name "BUYER NAME",
(prla.quantity*prla.unit_price) "PR VALUE",
(pla.quantity*pla.unit_price) "PO VALUE"
FROM po_requisition_headers_all prha,
po_requisition_lines_all prla,
po_req_distributions_all prda,
po_distributions_all pda,
mtl_system_items_b msib,
po_headers_all pha,
ap_suppliers aps,
per_all_people_f papf,
po_lines_all pla,
hr_operating_units hou
WHERE prha.requisition_header_id=prla.requisition_header_id
AND prla.requisition_line_id=prda.requisition_line_id
AND prda.distribution_id=pda.req_distribution_id
AND pda.po_header_id=pha.po_header_id
AND prla.item_id= msib.inventory_item_id
AND msib.organization_id=prha.org_id
AND pha.vendor_id=aps.vendor_id
AND pha.agent_id=papf.person_id
AND pha.po_header_id=pla.po_header_id
AND hou.name=:Operating_Unit
AND TRUNC(prha.creation_date) BETWEEN NVL(:From_Creation_Date,to_date
(prha.creation_date,'DD-MON-RR')) AND NVL(:To_Creation_Date,to_date
(prha.creation_date,'DD-MON-RR'))
AND msib.inventory_item_id BETWEEN NVL (:From_Material_Code,msib.inventory_item_id)
AND NVL (:To_Material_code, msib.inventory_item_id)
AND aps.vendor_name=:Vendor
AND papf.full_name=:Buyer
prha.segment1 "PR NO",
prha.creation_date "PR CREATION DATE",
prha.approved_date "PR APPROVAL DATE",
msib.inventory_item_id "MATERIAL CODE",
msib.description "MATERIAL DESCRIPTION",
prla.quantity "QTY",
prla.unit_meas_lookup_code "UOM",
pha.segment1 "PO NO",
pha.creation_date "PO_CREATION_DATE",
pha.approved_date "PO APPROVAL DATE",
aps.vendor_name "SUPPLIER_NAME",
papf.full_name "BUYER NAME",
(prla.quantity*prla.unit_price) "PR VALUE",
(pla.quantity*pla.unit_price) "PO VALUE"
FROM po_requisition_headers_all prha,
po_requisition_lines_all prla,
po_req_distributions_all prda,
po_distributions_all pda,
mtl_system_items_b msib,
po_headers_all pha,
ap_suppliers aps,
per_all_people_f papf,
po_lines_all pla,
hr_operating_units hou
WHERE prha.requisition_header_id=prla.requisition_header_id
AND prla.requisition_line_id=prda.requisition_line_id
AND prda.distribution_id=pda.req_distribution_id
AND pda.po_header_id=pha.po_header_id
AND prla.item_id= msib.inventory_item_id
AND msib.organization_id=prha.org_id
AND pha.vendor_id=aps.vendor_id
AND pha.agent_id=papf.person_id
AND pha.po_header_id=pla.po_header_id
AND hou.name=:Operating_Unit
AND TRUNC(prha.creation_date) BETWEEN NVL(:From_Creation_Date,to_date
(prha.creation_date,'DD-MON-RR')) AND NVL(:To_Creation_Date,to_date
(prha.creation_date,'DD-MON-RR'))
AND msib.inventory_item_id BETWEEN NVL (:From_Material_Code,msib.inventory_item_id)
AND NVL (:To_Material_code, msib.inventory_item_id)
AND aps.vendor_name=:Vendor
AND papf.full_name=:Buyer
No comments:
Post a Comment