0% found this document useful (0 votes)
24 views2 pages

Purchase Requisition Coopy

The document appears to be an SQL query that selects data from various tables related to purchase requisitions. The query is selecting many fields including requisition header and line details, dates, amounts, statuses and more. It is joining several tables and filtering on a specific requisition number.

Uploaded by

kondetimithun1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views2 pages

Purchase Requisition Coopy

The document appears to be an SQL query that selects data from various tables related to purchase requisitions. The query is selecting many fields including requisition header and line details, dates, amounts, statuses and more. It is joining several tables and filtering on a specific requisition number.

Uploaded by

kondetimithun1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

SELECT

TO_CHAR (prha.approved_date, 'MM-DD-YYYY HH24:mi:ss') AS approved on date,


prla.quantity_cancelled AS cancelled_line_qty,
TO_CHAR (prla.req_bu_id) AS bu_key,
TO_CHAR (prla.destination_organization_id) AS org_id, TO_CHAR (prla.po_line_id) AS
po_line_id,
NVL (TO CHAR (prla.deliver to cust id), '0') AS deliver to cust id,
prla.destination_type_code AS destination_type_code, prla.item source AS item
source,
NVL (prla.suggested_supplier_item_number, 0) AS
suggested_supplier_item_num,
NVL (prla.suggested vendor name, '') AS suggested vendor name, prla.line_status AS
line_status,
(CASE
WHEN prla.matching basis = 'AMOUNT' THEN prla.amount
ELSE prla.quantity prla.unit_price
END) AS line amt, TO_CHAR (prla.requested_ship_date, 'MM-DD-YYYY HH24:mi:ss') AS
requested ship date, TO_CHAR (prla.last_approval_date, 'MM-DD-YYYY HH24:mi:ss') AS
last_approval_date,
TO_CHAR (prla.cancel_date, 'MM-DD-YYYY HH24:mi:ss') AS cancel_date, TO_CHAR
(prla.last_submitted_date, 'MM-DD-YYYY HH24:mi:ss') AS
last_submitted_date,
prla.item_description AS line_text, prla.rate AS loc_exchange_rate,
prla.uom_code AS primary_uom_code, prla.line_number AS purch_line_num,
prha.requisition_number AS purch_rqstn_num,
prla.quantity AS requested_qty,
NVL (prla.currency_unit_price, prla.unit_price) AS unit_price,
prla.secondary_uom_code AS uom_code,
prla.urgent_flag AS urgent_flg,
prha.document_status AS document_status,
TO NUMBER (TO_CHAR (prha.approved_date, 'YYYYMMDD')) AS approved_on_dt_key,
TO_NUMBER (TO_CHAR (prla.need_by_date, 'YYYYMMDD')) AS needed_by_date_key,
TO CHAR (prla.destination_organization id) AS operating_unit org _key,
TO NUMBER (TO CHAR (prha.creation date, 'YYYYMMDD')) AS
ordered on_dt key,
TO_CHAR (prla.item_id) AS item_key,
TO_NUMBER (NULL) AS received_on_dt_key,
TO CHAR (prla.requester_id) AS requestor_key,
TO_CHAR (prla.destination_organization_id) AS rqstn_org_key,
TO CHAR (prla.vendor_site_id) AS supplier_account_key, TO CHAR (NVL (pov.party_id,
prla.vendor_id)) AS supplier_key,
TO CHAR (prla.item_id) AS supplier_prod_key,
'Purchase Requisition' req_type_key, || prla.order_type lookup code AS
TO CHAR (prha.creation date, 'MM-DD-YYYY HH24:mi:ss') AS
req line creation date,
prla.quantity AS ordered_qty,
(prla.unit_price* prla.quantity) AS amount_ordered,
pda.distribution amount AS distribution amt,
NVL (pda.distribution_quantity, 0) AS distribution_qty,
pda.nonrecoverable_tax AS nonrecoverable_tax,
pda.recoverable tax AS recoverable tax,
fnd.username AS line_last_updated_by,
fnd_c.username AS line_created_by,
TO CHAR (prha.submission_date, 'MM-DD-YYYY HH24:mi:ss') AS
header submission date

FROM
por_requisition_headers_all prha, por_requisition_lines_all prla,
po_line_locations_all polla,
gl code combinations glcc,
por_req_distributions_all pda,
per_users fnd,
per users fnd c,
poz_suppliers pov

WHERE 1=1
AND prla.requisition_header_id = prha.requisition_header_id(+)
AND prla.requisition_line_id(+) = pda.requisition line id
AND pda.code_combination_id glcc.code_combination_id
AND TO CHAR (fnd.user_id (+)) = prla.last_updated_by
AND TO CHAR (fnd_c.user_id(+)) = prla.created_by
AND pov.vendor_id (+) = prla.vendor id
AND prha.requisition_number = '204073'

You might also like