Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1. You need to list out all Internal Requisitions that do not have an associated Internal Sales
order.
---used to list all Internal Requisitions that do not have an
associated Internal Sales order
SELECT rqh.segment1 req_num, rql.line_num, rql.requisition_header_id,
rql.requisition_line_id, rql.item_id,
rql.unit_meas_lookup_code,
rql.unit_price, rql.quantity, rql.quantity_cancelled,
rql.quantity_delivered, rql.cancel_flag, rql.source_type_code,
rql.source_organization_id, rql.destination_organization_id,
rqh.transferred_to_oe_flag
FROM po_requisition_lines_all rql, po_requisition_headers_all rqh
WHERE rql.requisition_header_id = rqh.requisition_header_id
AND rql.source_type_code = 'INVENTORY'
AND rql.source_organization_id IS NOT NULL
AND NOT EXISTS (
SELECT 'existing internal order'
FROM oe_order_lines_all lin
WHERE lin.source_document_line_id = rql.requisition_line_id
AND lin.source_document_type_id = 10)
ORDER BY rqh.requisition_header_id, rql.line_num;
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
2. You want to display what requisition and PO are linked(Relation with Requisition and PO )
-----Relation with Requistion and PO
SELECT r.segment1 "Req Num", p.segment1 "PO Num"
FROM po_headers_all p,
po_distributions_all d,
po_req_distributions_all rd,
po_requisition_lines_all rl,
po_requisition_headers_all r
WHERE p.po_header_id = d.po_header_id
AND d.req_distribution_id = rd.distribution_id
AND rd.requisition_line_id = rl.requisition_line_id
AND rl.requisition_header_id = r.requisition_header_id
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
4. You need to list those PR which havn't auto created to PO.(Purchase Requisition without a
Purchase Order)
-----list all Purchase Requisition without a Purchase Order that means
a PR has not been autocreated to PO.
select
prh.segment1 "PR NUM",
trunc(prh.creation_date) "CREATED ON",
trunc(prl.creation_date) "Line Creation Date" ,
prl.line_num "Seq #",
msi.segment1 "Item Num",
prl.item_description "Description",
prl.quantity "Qty",
trunc(prl.need_by_date) "Required By",
ppf1.full_name "REQUESTOR",
ppf2.agent_name "BUYER"
from
po.po_requisition_headers_all prh,
po.po_requisition_lines_all prl,
apps.per_people_f ppf1,
(select distinct agent_id,agent_name from apps.po_agents_v ) ppf2,
po.po_req_distributions_all prd,
inv.mtl_system_items_b msi,
po.po_line_locations_all pll,
po.po_lines_all pl,
po.po_headers_all ph
WHERE
prh.requisition_header_id = prl.requisition_header_id
and prl.requisition_line_id = prd.requisition_line_id
and ppf1.person_id = prh.preparer_id
and prh.creation_date between ppf1.effective_start_date and
ppf1.effective_end_date
and ppf2.agent_id(+) = msi.buyer_id
and msi.inventory_item_id = prl.item_id
and msi.organization_id = prl.destination_organization_id
and pll.line_location_id(+) = prl.line_location_id
and pll.po_header_id = ph.po_header_id(+)
AND PLL.PO_LINE_ID = PL.PO_LINE_ID(+)
AND PRH.AUTHORIZATION_STATUS = 'APPROVED'
AND PLL.LINE_LOCATION_ID IS NULL
AND PRL.CLOSED_CODE IS NULL
AND NVL(PRL.CANCEL_FLAG,'N') <> 'Y'
ORDER BY 1,2
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
5. You need to list all information form PR to PO ...as a requisition moved from different stages
till converting into PR. This query capture all details related to that PR to PO.
----- List and all data entry from PR till PO
SELECT DISTINCT u.description "Requestor", porh.segment1 AS "Req
Number",
TRUNC (porh.creation_date) "Created On",
pord.last_updated_by,
porh.authorization_status "Status",
porh.description "Description", poh.segment1 "PO
Number",
TRUNC (poh.creation_date) "PO Creation Date",
poh.authorization_status "PO Status",
TRUNC (poh.approved_date) "Approved Date"
FROM apps.po_headers_all poh,
apps.po_distributions_all pod,
apps.po_req_distributions_all pord,
apps.po_requisition_lines_all porl,
apps.po_requisition_headers_all porh,
apps.fnd_user u
WHERE porh.requisition_header_id = porl.requisition_header_id
AND porl.requisition_line_id = pord.requisition_line_id
AND pord.distribution_id = pod.req_distribution_id(+)
AND pod.po_header_id = poh.po_header_id(+)
AND porh.created_by = u.user_id
ORDER BY 2
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
7. List all the PO's with there approval ,invoice and Payment Details
----- List and PO With there approval , invoice and payment details
SELECT a.org_id "ORG ID", e.segment1 "VENDOR NUM",
e.vendor_name "SUPPLIER NAME",
UPPER (e.vendor_type_lookup_code) "VENDOR TYPE",
f.vendor_site_code "VENDOR SITE CODE", f.address_line1 "ADDRESS",
f.city "CITY", f.country "COUNTRY",
TO_CHAR (TRUNC (d.creation_date)) "PO Date", d.segment1 "PO NUM",
d.type_lookup_code "PO Type", c.quantity_ordered "QTY ORDERED",
c.quantity_cancelled "QTY CANCELLED", g.item_id "ITEM ID",
g.item_description "ITEM DESCRIPTION", g.unit_price "UNIT PRICE",
(NVL (c.quantity_ordered, 0) - NVL (c.quantity_cancelled, 0)
)
* NVL (g.unit_price, 0) "PO Line Amount",
(SELECT DECODE (ph.approved_flag, 'Y', 'Approved')
FROM po.po_headers_all ph
WHERE ph.po_header_id = d.po_header_id) "PO Approved?",
a.invoice_type_lookup_code "INVOICE TYPE",
a.invoice_amount "INVOICE AMOUNT",
TO_CHAR (TRUNC (a.invoice_date)) "INVOICE DATE",
a.invoice_num "INVOICE NUMBER",
(SELECT DECODE (x.match_status_flag,
'A', 'Approved'
)
FROM ap.ap_invoice_distributions_all x
WHERE x.invoice_distribution_id = b.invoice_distribution_id)
"Invoice
Approved?",
a.amount_paid, h.amount, h.check_id, h.invoice_payment_id
"Payment Id",
i.check_number "Cheque Number",
TO_CHAR (TRUNC (i.check_date)) "PAYMENT DATE"
FROM ap.ap_invoices_all a,
ap.ap_invoice_distributions_all b,
po.po_distributions_all c,
po.po_headers_all d,
po.po_vendors e,
po.po_vendor_sites_all f,
po.po_lines_all g,
ap.ap_invoice_payments_all h,
ap.ap_checks_all i
WHERE a.invoice_id = b.invoice_id
AND b.po_distribution_id = c.po_distribution_id(+)
AND c.po_header_id = d.po_header_id(+)
AND e.vendor_id(+) = d.vendor_id
AND f.vendor_site_id(+) = d.vendor_site_id
AND d.po_header_id = g.po_header_id
AND c.po_line_id = g.po_line_id
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
8.You need to know the link to GL_JE_LINES table for purchasing accrual and budgetary
control actions..
The budgetary (encumbrance) and accrual actions in the purchasing module generate records that
will be imported into GL for the corresponding accrual and budgetary journals.
The following reference fields are used to capture and keep PO information in the GL_JE_LINES
table.
These reference fields are populated when the Journal source (JE_SOURCE in GL_JE_HEADERS)
is Purchasing.
Budgetary Records from PO (These include reservations, reversals and cancellations):
REFERENCE_1- Source (PO or REQ)
REFERENCE_2- PO Header ID or Requisition Header ID (from
po_headers_all.po_header_id or
po_requisition_headers_all.requisition_header_id)
REFERENCE_3- Distribution ID (from po_distributions_all.po_distribution_id or
po_req_distributions_all.distribution_id)
REFERENCE_4- Purchase Order or Requisition number (from po_headers_all.segment1 or
po_requisition_headers_all.segment1)
REFERENCE_5- (Autocreated Purchase Orders only) Backing requisition number (from
po_requisition_headers_all.segment1)
Take a note for Period end accruals, the REFERENCE_5 column is not used.
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
and you should note: When we finally close the requisition from Requisition Summary form the
authorization_status of the requisition does not change. Instead it's closed_code becomes
'FINALLY CLOSED'.
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
--po_lines_all
select * from po_lines_all where po_header_id =<po_header_id>;
--po_line_locations_all
select * from po_line_locations_all where po_header_id =<po_header_id>;
--po_distributions_all
select * from po_distributions_all where po_header_id =<po_header_id>;
--po_releases_all
SELECT * FROM po_releases_all WHERE po_header_id =<po_header_id>;
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
Stage 2: Once PO is received data is moved to respective receving tables and inventory tables
--RCV_SHIPMENT_HEADERS
select * from rcv_shipment_headers where shipment_header_id in
(select shipment_header_id from rcv_shipment_lines
where po_header_id =<po_header_id>);
--RCV_SHIPMENT_LINES
select * from rcv_shipment_lines where po_header_id =<po_header_id>;
--RCV_TRANSACTIONS
select * from rcv_transactions where po_header_id =<po_header_id>;
--RCV_ACCOUNTING_EVENTS
SELECT * FROM rcv_Accounting_Events WHERE rcv_transaction_id IN
(select transaction_id from rcv_transactions
where po_header_id =<po_header_id>);
--RCV_RECEIVING_SUB_LEDGER
select * from rcv_receiving_sub_ledger where rcv_transaction_id in
(select transaction_id from rcv_transactions where po_header_id
=<po_header_id>);
--RCV_SUB_LEDGER_DETAILS
select * from rcv_sub_ledger_details
where rcv_transaction_id in (select transaction_id from rcv_transactions
where po_header_id =<po_header_id>);
--MTL_MATERIAL_TRANSACTIONS
select * from mtl_material_transactions where transaction_source_id
=<po_header_id>;
--MTL_TRANSACTION_ACCOUNTS
select * from mtl_transaction_accounts where transaction_id in ( select
transaction_id from mtl_material_transactions where
transaction_source_id = =<po_header_id>);
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
--AP_INVOICES_ALL
select * from ap_invoices_all where invoice_id in
(select invoice_id from ap_invoice_distributions_all where
po_distribution_id in
( select po_distribution_id from po_distributions_all where po_header_id
=<po_header_id>));
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
--GL_INTERFACE
SELECT *
FROM GL_INTERFACE GLI
WHERE user_je_source_name ='Purchasing'
AND gl_sl_link_table ='RSL'
AND reference21='PO'
AND EXISTS
( SELECT 1
FROM rcv_receiving_sub_ledger RRSL
WHERE GLI.reference22 =RRSL.reference2
AND GLI.reference23 =RRSL.reference3
AND GLI.reference24 =RRSL.reference4
AND RRSL.rcv_transaction_id in
(select transaction_id from rcv_transactions
where po_header_id <po_header_id>));
--GL_IMPORT_REFERENCES
SELECT *
FROM gl_import_references GLIR
WHERE reference_1='PO'
AND gl_sl_link_table ='RSL'
AND EXISTS
( SELECT 1
FROM rcv_receiving_sub_ledger RRSL
WHERE GLIR.reference_2 =RRSL.reference2
AND GLIR.reference_3 =RRSL.reference3
AND GLIR.reference_4 =RRSL.reference4
AND RRSL.rcv_transaction_id in
(select transaction_id from rcv_transactions
where po_header_id =<po_header_id>))
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
Therefore thought to share this query, hope this would be great help who have such kind of adhoc
requirement from daily life.
SELECT a.org_id "ORG ID", e.vendor_name "VENDOR NAME",
UPPER (e.vendor_type_lookup_code) "VENDOR TYPE",
f.vendor_site_code "VENDOR SITE", f.address_line1 "ADDRESS",
f.city "CITY", f.country "COUNTRY",
TO_CHAR (TRUNC (d.creation_date)) "PO DATE", d.segment1 "PO
NUMBER",
d.type_lookup_code "PO TYPE", c.quantity_ordered "QTY ORDERED",
c.quantity_cancelled "QTY CANCALLED",
g.item_description "ITEM DESCRIPTION", g.unit_price "UNIT PRICE",
(NVL (c.quantity_ordered, 0) - NVL (c.quantity_cancelled, 0)
)
* NVL (g.unit_price, 0) "PO Line Amount",
(SELECT DECODE (ph.approved_flag, 'Y', 'Approved')
FROM po.po_headers_all ph
WHERE ph.po_header_id = d.po_header_id) "PO STATUS",
a.invoice_type_lookup_code "INVOICE TYPE",
a.invoice_amount "INVOICE AMOUNT",
TO_CHAR (TRUNC (a.invoice_date)) "INVOICE DATE",
a.invoice_num "INVOICE NUMBER",
(SELECT DECODE (x.match_status_flag,
'A', 'Approved'
)
FROM ap.ap_invoice_distributions_all x
WHERE x.invoice_distribution_id = b.invoice_distribution_id)
"Invoice
Approved?",
a.amount_paid, h.amount, i.check_number "CHEQUE NUMBER",
TO_CHAR (TRUNC (i.check_date)) "PAYMENT DATE"
FROM ap.ap_invoices_all a,
ap.ap_invoice_distributions_all b,
po.po_distributions_all c,
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
po.po_headers_all d,
po.po_vendors e,
po.po_vendor_sites_all f,
po.po_lines_all g,
ap.ap_invoice_payments_all h,
ap.ap_checks_all i
WHERE a.invoice_id = b.invoice_id
AND b.po_distribution_id = c.po_distribution_id(+)
AND c.po_header_id = d.po_header_id(+)
AND e.vendor_id(+) = d.vendor_id
AND f.vendor_site_id(+) = d.vendor_site_id
AND d.po_header_id = g.po_header_id
AND c.po_line_id = g.po_line_id
AND a.invoice_id = h.invoice_id
AND h.check_id = i.check_id
AND f.vendor_site_id = i.vendor_site_id
AND c.po_header_id IS NOT NULL
AND a.payment_status_flag = 'Y'
AND d.type_lookup_code != 'BLANKET';
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
1.Item Creation:
1)Attach the Responsibility called "Inventory Vision Operations (USA)"
2)Open the Items form
Items=>Master Item
3)Select the Organization name - Vision Operations
4)Enter the Item Name , Item Description
goto Inventory tab check the checkbox called Inventory
goto purchasing tab check the check box called Purchasing
5)Save
6)Goto Tools Menu => Organization Assignment option to assign for the multiple organizations.
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
2.Supplier Creation:
1)Attach the Responsibility called "Purchasing Vision Operations (USA)"
2)Goto the Supplier Form
Supply Base=>Suppliers
3)Enter the Supplier Name . Save supplier number will be created automatically.
4)Select the Sites button enter the supplier site address and other details
5)Goto the Contacts tab enter the Contact details
Name
Phno
Postion and so on.....
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
3.Buyer Creation:
1)attach the Responsibility called "US HRMS Manager"
2)Create Employee
People => Enter and Maintain=>Select New button
3)Enter Emp name
select action option select "create Employement" select the optiona s "Buyer"
4)enter Data of Birth
save => Ok = > Empoyee number will be generated.
5)Goto System Administrator open the User form create or query user
select the Person field attach the emp name (Which we have created)
6)Save.
7)Goto Purchasing Responsibility
open the Buyers form
enter the employee name and save the transactions.
Setup => Personnal =>Buyers
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
1.REQUISITION:
Requisition: is one of the purchasing document will be prepared by the employee whenever he
required the materials or Services or Training and so on.
we have two types of Requisitions
1)Internal
2)Purchase
Internal requisition will be created if materials are receiving from another Inventory
inside of the organization.
Purchase requisition will be created while purchasing the materials from the Suppliers.
Requisitions=>Requisitions
We will enter the Requisition at three level 1)Header
2)Line
3)Distributions.
Open the Requisition form enter the Reqno and select the type at Header level
Enter the Items information at line level like Item name,qty,unitprice,tax and so on select
Distributions button enter the Distributions details.
Save
Select the Button called Approve button to go for approving the Requisition Document Open the
Requisition summary form.
Enter the Reqno select find button we can find the Requisition status wether it is approved or not.
select Tools menu => View Action History to find the history details
Select Tools Menu =>Control option to Cancel the requisition.
SELECT * FROM PO_REQUISITION_HEADERS_ALL WHERE SEGMENT1='5716' --
REQUISITION_HEADER_ID=56885
SELECT * FROM PO_REQUISITION_LINES_ALL WHERE REQUISITION_HEADER_ID=56885
--REQUISITION_LINE_ID=60797
SELECT * FROM PO_REQ_DISTRIBUTIONS_ALL WHERE REQUISITION_LINE_ID=60797
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
RFQ: This will be create for te materials which we will purchase from the suppliers regularley ,
and large number of quantity. Here we can specify the Price Breaks.
Standard RFQ: This will be prepared for the Items which we will purchase only once not very
often,Here we can include the Discounts information at different auantity levels.
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
3.QUOTATION:
Quotation is another purchasing document we will receive from the Supplier which contains the
supplier quote details , Price, Payment terms and so on.
Whatever the quotations we have received from the supplier we will enter in the system through
form.
We have three types of Quotations 1)Bid 2)Catalog 3)Standard
For Bid RFQ we will receive Bid quotation from the Supplier
For Catalog RFQ we will receive Catalog quotation from the Supplier
For Standard RFQ we will receive Standard quotation from the Supplier.
After enter all the quotations in the system management will do quote analysis as per that one
best quotation will be elected as Purchase Order.
Quotation Report
Item Name (Table Value set MTL_SYSTEM_ITEMS_B Segment1)
QuoteNo Type Cdate Supplier Site ContactPerson Buyer Created(UserName)
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
4.PURCHASE ORDER:
PO is one of the Main document which will be prepared and approved by the buyer and send it to
the supplier. which contains the following information terms and Conditions
Items deails
Qty,Price
Distiribution and Shipment Details and so on.
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
AUTO CREATE:
It is one of the Purchasing feature to create the RFQ and PO documents automatically
by using requisition lines.
1)Create Requisition and approve
2)Open the AutoCreate form
3)Select Clear button enter the RequisitionNO
4)Select find button which will shows all the requisition lines
select the lines whatever we want to include into the RFQ
5)select Action = Create to create new RFQ
AddTo to add lines to exisiting to RFQ
6)Select DocumentType = RFQ
7)select Automatic button which will create RFQ document automatically .
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
5.RECEIPTS:
Receipts are one of the documents it will be used to find out how much quantity Supplier
has supplied. We will find out Purchase Order status if it is successfully approved then we will
create the Receipt. We will give the PO Number select Find button check the PO lines right mark
and save. It will create the Receipt number select Header button it will shows the receipt number
and date.
SELECT * FROM RCV_SHIPMENT_HEADERS WHERE RECEIPT_NUM=7472 --
SHIPMENT_HEADER_ID=61421
SELECT * FROM RCV_SHIPMENT_LINES WHERE SHIPMENT_HEADER_ID=61421 --
SHIPMENT_LINE_ID=68368
SELECT * FROM RCV_TRANSACTIONS WHERE SHIPMENT_HEADER_ID=61421
Once Receipt will created go Inventory module and check whether the requested items are
received or not by using these tables.
SELECT * FROM MTL_SYSTEM_ITEMS_B WHERE SEGMENT1='APACHE'
SELECT * FROM MTL_ONHAND_QUANTITIES WHERE INVENTORY_ITEM_ID=20817 AND
ORGANIZATION_ID=204
SELECT SEGMENT1 FROM PO_HEADERS_ALL WHERE PO_HEADER_ID=32881 AND
TYPE_LOOKUP_CODE='STANDARD'
Match Approval Level :- While creating the Purchase Order we will mention the Match Approval
Level at Shipments we will have 3 types they are
2-way:- Purchase Order and Invoice Quantities must match within tolerance before the
corresponding invoice can be paid.
3-way:- Purchase Order, Receipts and Invoice Quantities must match with in tolerance before the
corresponding invoice can be paid.
4-way:- Purchase Order, Receipts, Inspection and Invoice Quantities must match with in tolerance
before the corresponding invoice can be paid.
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
From the company point of view a person or Organization who is going to receive amount we
will call as Supplier.
Types of Invoices:-
1. Standard
2. Credit Memo
3. Debit Memo
4. With Holding Tax
5. Po Default
6. Mixed
7. Pre Payment
8. Expense Report
9. Recurring Invoices
10. Quick Match
Standard Invoice:- We will create the Standard Invoice to particular Supplier and Supplier site
we will enter the invoice amount, invoice date and soon……..
Credit Memo & Debit Memo Invoices:- Both Invoices has got negative (-ve) amount and adjusted
against Standard Invoice. Credit Memo will be created whenever Supplier is giving discount.
Debit Memo will be created if buyer is going to deduct the amount.
With Holding Tax Invoice:- If supplier is not registered supplier then buyer will make the
Income Tax to the government on behalf of supplier.
Po Default Invoice:- Here we will create the Invoice as per Purchase Order amount. We will
give the Po number system will retrieve PO amount and Invoice will be created as per PO details.
Prepayment Invoice:- When ever we want make payment to supplier in advance that tome we
will create this Prepayment Invoice and we make the Payment.
Expense Reports Invoice:- It will be created for employee expenses as per the employee grade,
position this Invoices will be calculated.
Recurring Invoice:- For some of the Invoices we will not be having supplier invoice that time
we will create Recurring Invoices.
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
Ex:- For rent account we will be creating Invoice which has got fixed amount and fixed rate (duration).
Quick Match Invoice:- While creating Purchase Order we will be giving the match approval
option as per that match approval we will create the Invoice and the Invoice type is Quick Match
Invoice.
Mixed Invoice:- Mixed Invoices will be created for miscellaneous expenses. Once we create the
invoice you have to do following 3 activities.
1. Validate Invoice
2. Approve the Invoice
3. Create Accounting entries for Invoice
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
INVOICES
Here we will select the Invoice type and we will give the Supplier number, name, site invoice
date, invoice number, invoice currencies, and amount. Select Distributions button to distribute the
Invoice amount into different accounts.
1. Invoice total should be equal to the distributions total then we will call it as Invoice validated
successfully.
2. Select Actions…1 button chooses approve check box press OK then system will approve the
Invoice.
3. Select Actions…1 button choose create accounting check box press OK button it will create
the accounting entries we can see all this accounting transactions from tools view accounting
option.
SELECT * FROM AP_INVOICES_ALL WHERE INVOICE_NUM='INV4516' --
INVOICE_ID=63379 ,--VENDOR_ID(LINK B/WAP INVOICE AND PO_VENDORS
Invoice Holds:- If invoice is not approved then that invoice will be keeping under hold status.
By selecting holds button in invoice form we can see the holds details.
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
PAYMENTS:
Payments:- Once the Invoice is approved then we can go for payments. The Payments are or 3
types. They were
1. Manual
2. Quick
3. Refund
Manual:- Here we will issue the checks manually to the supplier and we will capture that
information in the payment scheme by using manual payment option.
Quick:- Through the Quick Payment type we can generate checks through the system and we
can have the transactions directly in the system.
Refund:- When ever company is going to give advance back to the customer that time we will
select payment type as Refund.
Distribution Set:- It is one of the option is available in Invoices Screen. While creating the
Invoice we will attach distribution set. System will automatically create the transactions in
distributions forms as per the distribution set.
Navigation:
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
We will execute the concurrent program from SRS Window. This program will transfer all
the payment transactions into the G.L Module. It will take following parameters.
Validate Accounts
Transfer To GL Interface
Submit Journal Import : yes (It should be always YES)
To view posting:
Select * from gl_balances;
After submitting the request select viewà output button. It will shows number of transactions has
been transferred to G.L. then select G.L Module (General Ledger, Vision Operations (USA)).
SELECT * FROM GL_JE_HEADERS
SELECT * FROM GL_JE_LINES
SELECT * FROM GL_JE_BATCHES
SELECT * FROM GL_BALANCES
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
PO to GL query
SELECT prh.segment1 req_number,
prd.distribution_id,
poh.segment1 po_num,
poh.org_id,
rsh.receipt_num,
api.invoice_num,
apl.line_number,
aps.vendor_name
FROM
-- Purchase Requisition --
po_requisition_headers_all prh,
po_requisition_lines_all prl,
po_req_distributions_all prd,
-- Purchase Order --
po_distributions_all pod,
po_headers_all poh,
po_lines_all pol,
-- Receipt --
rcv_transactions rct,
rcv_shipment_lines rsl,
rcv_shipment_headers rsh,
-- AP Invoice --
ap_invoice_distributions_all apd,
ap_invoice_lines_all apl,
ap_invoices_all api,
-- Subledger Accounting--
xla_distribution_links xldl,
apps.xla_ae_lines al,
xla_ae_headers ah,
apps.xla_events e,
apps.xla_transaction_entities te,
-- GL --
gl_import_references gir,
apps.gl_je_lines jl,
gl_je_headers glh,
apps.gl_code_combinations glcc,
-- Supplier Detail --
ap_suppliers aps
WHERE 1 = 1
-- Purchase Requisition --
AND prh.requisition_header_id = prl.requisition_header_id
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
-- Receipt TO Invoice --
AND apd.po_distribution_id = rct.po_distribution_id
-- AP Invoice --
AND api.invoice_id = apd.invoice_id
AND api.invoice_id = apl.invoice_id
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
Query to List all Purchase Orders with India Localization Tax attached
SELECT distinct pha.segment1 "Po Number",
pha.creation_date "Date",
pha.approved_date "Approved Date",
(pla.unit_price* pla.quantity) "Amount w/o Tax",
jpt.tax_amount "Tax Amount",
jpll.total_amount "Total Amount",
pla.line_num "Line Num",
pv.vendor_name"Vendor Name",
jrt.tax_name"Tax Name",
DECODE(NVL(PLLA.CLOSED_CODE,'OPEN'),'OPEN', NULL,
POLC1.DISPLAYED_FIELD)||
DECODE(PLLA.CANCEL_FLAG,'Y',','||''|| POLC2.DISPLAYED_FIELD,
NULL) "Po Line Status",
hou.name "Organization Name"
FROM po_headers_all pha,
po_lines_all pla,
po_line_locations_all plla,
po_vendors pv,
JAI_PO_LINE_LOCATIONS jpll,
hr_operating_units hou,
JAI_RCV_TAX_V jrt,
jai_po_taxes jpt,
PO_LOOKUP_CODES POLC1,
PO_LOOKUP_CODES POLC2
WHERE pha.po_header_id=pla.po_header_id
AND plla.po_header_id=pha.po_header_id
AND pv.vendor_id=pha.vendor_id
AND plla.po_line_id=pla.po_line_id
AND pha.segment1=:P_PONUM --'2012102020109'
AND jpll.po_header_id=pha.po_header_id
AND jpll.po_line_id=plla.po_line_id
AND pha.org_id= hou.organization_id
AND jrt.vendor_id=pha.vendor_id
AND jrt.tax_id= jpt.tax_id
AND jpt.po_header_id=pha.po_header_id
AND jpt.po_line_id=pla.po_line_id
AND PLLA.SHIPMENT_TYPE IN ('STANDARD', 'PLANNED', 'PRICE
BREAK','RFQ', 'QUOTATION')
AND POLC1.LOOKUP_TYPE(+) = 'DOCUMENT STATE'
AND POLC1.LOOKUP_CODE(+) = NVL(PLLA.CLOSED_CODE, 'OPEN')
AND POLC2.LOOKUP_TYPE (+) = 'DOCUMENT STATE'
AND POLC2.LOOKUP_CODE (+) = 'CANCELLED'
AND pha.po_header_id=plla.po_header_id
--AND jrt.tax_type=jpt.tax_type
--AND jpll.tax_category_id=jpt.tax_category_id
/*GROUP BY pha.segment1,
pha.creation_date,
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
pha.approved_date,
jpt.tax_amount ,
jpll.total_amount,
pla.line_num ,
pv.vendor_name,
jrt.tax_name,
DECODE(NVL(PLLA.CLOSED_CODE,'OPEN'),'OPEN', NULL,
POLC1.DISPLAYED_FIELD)||
DECODE(PLLA.CANCEL_FLAG,'Y',','||''|| POLC2.DISPLAYED_FIELD,
NULL),
hou.name*/
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
hope this will help to you.... keep watching this site for more updates or bookmark this site.
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
Query to list out all Internal Requisitions that do not have an associated Internal Sales order.
SELECT rqh.segment1 req_num, rql.line_num, rql.requisition_header_id,
rql.requisition_line_id, rql.item_id,
rql.unit_meas_lookup_code,
rql.unit_price, rql.quantity, rql.quantity_cancelled,
rql.quantity_delivered, rql.cancel_flag, rql.source_type_code,
rql.source_organization_id, rql.destination_organization_id,
rqh.transferred_to_oe_flag
FROM po_requisition_lines_all rql, po_requisition_headers_all rqh
WHERE rql.requisition_header_id = rqh.requisition_header_id
AND rql.source_type_code = 'INVENTORY'
AND rql.source_organization_id IS NOT NULL
AND NOT EXISTS (
SELECT 'existing internal order'
FROM oe_order_lines_all lin
WHERE lin.source_document_line_id = rql.requisition_line_id
AND lin.source_document_type_id = 10)
ORDER BY rqh.requisition_header_id, rql.line_num;
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
RAJU CHINTHAPATLA
Oracle Purchasing, Payables and P2P Queries and Scripts Scripts
RAJU CHINTHAPATLA