Quries on Oracle Purchasing

54
Quries on Oracle Purchasing Muhammad Rafi Aamiri Madani on Saturday, March 14, 2009 CANCEL REQUISITIONS SELECT ,prh.REQUISITION_HEADER_ID ,prh.PREPARER_ID ,prh.SEGMENT1 "REQ NUM" ,trunc(prh.CREATION_DATE) ,prh.DESCRIPTION ,prh.NOTE_TO_AUTHORIZER FROM ,apps.Po_Requisition_headers_all prh ,apps.po_action_history pah WHERE action_code='CANCEL' and pah.object_type_code='REQUISITION' and pah.object_id=prh.REQUISITION_HEADER_ID -------------------------------------------------------------------------------------- ---------------------- INTERNAL REQUISITIONS THAT DO NOT HAVE AN ASSOCIATED INTERNAL SALES ORDER SELECT ,RQH.SEGMENT1 ,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

description

Oracle Purc

Transcript of Quries on Oracle Purchasing

Page 1: Quries on Oracle Purchasing

Quries on Oracle Purchasing

Muhammad Rafi Aamiri Madani on Saturday, March 14, 2009

CANCEL REQUISITIONS

SELECT

,prh.REQUISITION_HEADER_ID

,prh.PREPARER_ID

,prh.SEGMENT1 "REQ NUM"

,trunc(prh.CREATION_DATE)

,prh.DESCRIPTION

,prh.NOTE_TO_AUTHORIZER

FROM

,apps.Po_Requisition_headers_all prh

,apps.po_action_history pah

WHERE

action_code='CANCEL' and

pah.object_type_code='REQUISITION' and

pah.object_id=prh.REQUISITION_HEADER_ID

------------------------------------------------------------------------------------------------------------ 

INTERNAL REQUISITIONS THAT DO NOT HAVE AN ASSOCIATED INTERNAL SALES ORDER

SELECT

,RQH.SEGMENT1

,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

Page 2: Quries on Oracle Purchasing

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

------------------------------------------------------------------------------------------------------------ 

DISPLAY WHAT REQUISITION AND PO ARE LINKED

(Relation with Requisition 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

------------------------------------------------------------------------------------------------------------

PURCHASE REQUISITION WITHOUT PO THAT MEANS A PR HAS NOT BEEN AUTOCREATED TO

PO

(Purchase Requisition without a Purchase Order)

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"

Page 3: Quries on Oracle Purchasing

,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.pl_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

------------------------------------------------------------------------------------------------------------ 

INFORMATION FROM PR to PO

(Requisition moved from different stages till converting into PR)

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"

Page 4: Quries on Oracle Purchasing

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

------------------------------------------------------------------------------------------------------------

PO’s WHICH DOES NOT HAVE ANY PR’s

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

Page 5: Quries on Oracle Purchasing

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

------------------------------------------------------------------------------------------------------------

ALL PO’s WITH APPROVAL, INVOICE, & 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

Page 6: Quries on Oracle Purchasing

,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 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' 

------------------------------------------------------------------------------------------------------------

ALL OPEN PO'S

SELECT

,h.segment1 "PO NUM"

,h.authorization_status "STATUS"

,l.line_num "SEQ NUM"

,ll.line_location_id

,d.po_distribution_id

,h.type_lookup_code "TYPE"

FROM

,po.po_headers_all h

,po.po_lines_all l

Page 7: Quries on Oracle Purchasing

,po.po_line_locations_all ll

,po.po_distributions_all d

WHERE

h.po_header_id = l.po_header_id and

ll.po_line_id = l.po_Line_id and

ll.line_location_id = d.line_location_id and

h.closed_date is NULL and

h.type_lookup_code not in ('QUOTATION')

------------------------------------------------------------------------------------------------------------ 

STEPS TO DEBUG A PURCHASE ORDER

Get po_header_id first and run each query and then analyze the data.

For better understanding this is splited into 5 major stages.

Stage 1: PO Creation

PO_HEADERS_ALL

select po_header_id from po_headers_all where segment1 =;

select * from po_headers_all where po_header_id =;

PO_LINES_ALL

select * from po_lines_all where po_header_id =;

PO_LINE_LOCATIONS_ALL

select * from po_line_locations_all where po_header_id =;

PO_DISTRIBUTIONS_ALL 

select * from po_distributions_all where po_header_id =;

PO_RELEASES_ALL

SELECT * FROM po_releases_all WHERE po_header_id =;

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_lineswhere po_header_id =);

RCV_SHIPMENT_LINES

select * from rcv_shipment_lines where po_header_id =;

RCV_TRANSACTIONS

select * from rcv_transactions where po_header_id =;

RCV_ACCOUNTING_EVENTS

SELECT * FROM rcv_Accounting_Events WHERE rcv_transaction_id IN

(select transaction_id from rcv_transactionswhere 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 =);

RCV_SUB_LEDGER_DETAILS

Page 8: Quries on Oracle Purchasing

select * from rcv_sub_ledger_detailswhere rcv_transaction_id IN

(select transaction_id from rcv_transactions where po_header_id =);

MTL_MATERIAL_TRANSACTIONS

select * from mtl_material_transactions where transaction_source_id =;

MTL_TRANSACTION_ACCOUNTS 

select * from mtl_transaction_accounts where transaction_id IN

(select transaction_id from mtl_material_transactions where transaction_source_id =);

Stage 3: Invoicing details

AP_INVOICE_DISTRIBUTIONS_ALL

select * from ap_invoice_distributions_all where po_distribution_id in

( select po_distribution_id from po_distributions_all where po_header_id =);

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 =));

Stage 4 : Mostly there is tie up with Project related PO

PA_EXPENDITURE_ITEMS_ALL 

select * from pa_expenditure_items_all peia where peia.orig_transaction_reference IN

(select to_char(transaction_id) from mtl_material_transactions where transaction_source_id = ); 

Stage 5 : General Ledger

Prompt 17. GL_BC_PACKETS ..This is for encumbrances

SELECT * FROM gl_bc_packets WHERE reference2 IN (’‘);

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.reference3AND GLI.reference24 =RRSL.reference4AND

RRSL.rcv_transaction_id in(select transaction_id from rcv_transactionswhere 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 RRSLWHERE GLIR.reference_2 =RRSL.reference2AND

GLIR.reference_3 =RRSL.reference3 AND GLIR.reference_4 =RRSL.reference4AND

RRSL.rcv_transaction_id in

(select transaction_id from rcv_transactions where po_header_id =))

Posted by Muhammad Rafi Aamiri Madani

Page 9: Quries on Oracle Purchasing

Deleting a Scheduled Request

Muhammad Rafi Aamiri Madani on Monday, March 16, 2009

There is no standard functionality to delete any saved schedule.

The saved schedules are being stored in the table fnd_conc_release_classes_vl

SELECT

,release_class_id

,application_id

,release_class_name schedule_name

,description

,class_type schedule_type

FROM

fnd_conc_release_classes_vl

WHERE

owner_req_id is null and

enabled_flag != ‘N’ and

nvl(start_date_active,sysdate) <= sysdate and nvl(end_date_active, sysdate) >= sysdate

order by release_class_name

If you want to delete any saved schedule then you can perform any of the following:

Delete the row from the table FND_CONC_RELEASE_CLASSES_VL for the saved schedule.

OR

It will be better to update the ENABLED_FLAG = ‘N’ for the saved schedule instead of deleting the row

from the table FND_CONC_RELEASE_CLASSES_VL.

Posted by Muhammad Rafi Aamiri Madani

Trace a concurrent request and generate TKPROF file

Muhammad Rafi Aamiri Madani on Monday, March 16, 2009

Page 10: Quries on Oracle Purchasing

Steps to enable tracing for the Concurrent Manager Program

■ Responsibility: System Administrator

■ Navigate: Concurrent > Program > Define

■ Query Concurrent Program

■ Select the Enable Trace Checkbox

Turn ON Tracing

■ Responsibility: System Administrator

■ Navigate: Profiles > System

■ Query Profile Option Concurrent: Allow Debugging

■ Set profile to Yes

Run concurrent program with tracing turned ON

■ Logon to the Responsibility that runs the Concurrent Program

■ In the Submit Request Screen click on Debug Options (B)

■ Select the Checkbox for SQL Trace

Query to find Trace File Name

Run the following SQL to find out the Raw trace name and location for the concurrent program. The

SQL prompts the user for the request id

SELECT

'Request id: 'request_id

,'Trace id: 'oracle_Process_id

,'Trace Flag: 'req.enable_trace

,'Trace Name: 'dest.value'/'lower(dbnm.value) '_ora_' oracle_process_id '.trc'

,'Prog. Name: 'prog.user_concurrent_program_name

,'File Name: 'execname.execution_file_name execname.subroutine_name

,'Status : 'decode(phase_code,'R','Running') '-'decode(status_code,'R','Normal')

,'SID Serial: 'ses.sid',' ses.serial#

, 'Module : 'ses.module

FROM

fnd_concurrent_requests req

,v$session ses

,v$process proc

,v$parameter dest

,v$parameter dbnm

Page 11: Quries on Oracle Purchasing

,fnd_concurrent_programs_vl prog

,fnd_executables execname

WHERE

req.request_id = &request and

req.oracle_process_id=proc.spid(+) and

proc.addr = ses.paddr(+) and

dest.name='user_dump_dest' and

dbnm.name='db_name' and

req.concurrent_program_id = prog.concurrent_program_id and req.program_application_id =

prog.application_id and

prog.application_id = execname.application_id and prog.executable_id=execname.executable_id

TKPROF Trace File 

Once you have obtained the Raw trace file you need to format the file using TKPROF.

$tkprof raw_trace_file.trc output_file.prf explain=apps/apps sort=(exeela,fchela) sys=no

raw_trace_file.trc: Name of trace file

output_file: tkprof out file

explain: This option provides the explain plan for the sql statements

sort: This provides the sort criteria in which all sql statements will be sorted and would bring the bad

sql at the top of the outputfile.

sys=no: Disables sql statements issued by user SYS

Another example: To get (TKPROF) sorted by longest running queries first and limits the results

to the “Top 10″ long running queries

$ tkprof sys=no explain=apps/ sort=’(prsela,exeela,fchela)’ print=10

Posted by Muhammad Rafi Aamiri Madani

Oracle E-Business Tax

Muhammad Rafi Aamiri Madani on Wednesday, March 18, 2009

Taxation is having very complex model from implementation mapping point of view and must can be

Page 12: Quries on Oracle Purchasing

considered in two dimension.

U.S. TAXES 

■ Sales Tax

■ Seller’s Use Tax

■ Consumer’s Use Tax

■ Rental Tax

■ Leasing Tax

INTERNATIONAL TAXES 

■ Input VAT

■ Output VAT

■ Import VAT

■ Export VAT

■ Acquisition VAT

■ Consumption Tax

■ Goods and Services Tax

VAT

In simple layman term you understand like when you sell something you add on tax which is payable

to the tax authorities. When you buy something you are able to recover the tax.Normally the net

amount is paid to the tax authorities. Certain items are not recoverable, hence the term recoverable

and non recoverable taxes are considered.

VAT is imposed on the value added to goods or services at each stage of their supply. The VAT

charged on a customer invoice is referred to as Output Tax. Any VAT paid on a vendor invoice is

referred to as Input Tax.

The amount due each period can be described as follows:

Amount Due = Output Tax - Input Tax

GST

Goods and Services Tax – used in Canada and Australia ,Singapore– Similar to VAT

Withholding Taxes

A withholding tax is where an amount is withheld from a payment to the supplier and paid to the tax

authorities. If the overall payment due to a supplier was say 120, it may be that they are only paid

100, the remaning 20 being paid over. Essential you are acting as a tax collector. This only applies to

certain types of supplier in certain countries.

Recoverable Tax

Page 13: Quries on Oracle Purchasing

Recoverable tax is one , which you can recover from your sales.

You can say VAT system. one suffer Tax when a person makes sales and which can be adjusted against

the tax suffered when you make a purchase(Recoverable portion only) , end of the day , you pay to the

tax authorities the Net of Tax paid on purchase and tax included on your sales.

Sales Tax

Sales taxes are tax levies charged on applicable revenues according to law; and reported and paid

periodically to the relevant taxing jurisdiction.

Understanding is very important . Take a case with USA implemenation.

There is one basic rule that we need to understand when it comes to calculating tax, which is always

calculated for the destination shipping address.

Take senarios : Dell.com is an online retail website. It ships all its orders from a Warehouse. There are

a couple of customers ordering a laptop of Model xyz drive on the website. One of the customers

resides in NY and the other resides in the CA.

Now we have to decide which state’s tax law should we apply for calculating tax for the Laptop? Is it

Dell for both of the customers? No its not.

For the customer who resides in NY, NY’s state’s law will apply and for the customer in CA, CA’s tax

laws will apply.

Let’s understand the simple method:

List price of Laptop = $800

Tax on Laptop in NY = 7 %

Tax on Laptop in CA = 5 %

Sale price of Laptop for the customer in NY = $856.00

Sale price of Laptop for the customer in CA = $840.00

So, we understand that two customers, in two different states, might end up paying two different

prices for the same product purchased.

Use Tax or consumption tax

These are some sort of levied by local jurisdictions where goods and services are delivered from

outside the jurisdiction but consumed locally, and are often accrued and paid by the buyer rather than

the seller. Thailand is one such usage of such tax.Japan levies a consumption tax on the value of

goods.

More on VAT 

Page 14: Quries on Oracle Purchasing

As Value Added Tax or VAT is a tax or levy on the business at all levels of the manufacture and

production of a good or service rendered and based on the increase in price, or value, is provided at

each level. The percentages of VAT vary depending on the goods or services provided.

Benefits of VAT

The VAT has numerous benefits. They are:

■ It reduces cascading affects of taxes and removes distortions

■ It removes artificial incentives affecting choice of location of business since the VAT percentage on a

particular type of good or service is same across all territories within the country

■ It is eminently collectible and more transparent; it renders high cost to businesses not being part of

VAT chain;

...i.e. if someone conceals the output, one cannot get refund on input

■ Exports could be freed from Tax burden with World Trade Organization (WTO) compatibility

VAT @EBS 

The VAT is defined as a Tax code in Oracle Applications in Accounts Payable module and the tax is

attached to the invoice lines so that the tax is calculated as a positive tax on the invoice distribution

lines.

What is important for Implementor for Tax

■ Data identification and configuration (aka set up)

■ Sales and use tax software integration (If using any third party tax software)

■ Record retention

■ Reporting : what is required is comprehensive data requirements of a tax department and tax

reporting feature in ERP

Where is the Tax integration required 

1.Order Management :Estimation of Sales Tax on Sales Orders

2.Accounts Receivables (AR) :Calculation of Sales Tax on Standard AR Invoices ,Credit memos/Debit

memos & Adjustments ,Recurring invoices ,Manual invoices

3.iReceivables (credit memo requests)

4.Service & Project Billing (via AutoInvoice to AR)

5.CRM (iStore and Quoting via Order Capture)

6.Oracle Internet Expenses

7.Payables : GST included tax supplier Invoice

8.Purchasing :Estimate sales tax on POs, and update committed spend in Projects

9.Inventory :Self-accrue use tax on material transaction movements

10.General Ledger: Manually keyin Journal Entries

11.Oracle Trade Management

12.Oracle Services Contracts

Page 15: Quries on Oracle Purchasing

Third Party tax @EBS 

Vertex and Taxware are the two supported 3rd Party Software Vendors that Oracle Receivables uses to integrate

with for tax calculating purposes. If you setup the integration the tax rates that are stored in the Oracle locations and

rates tables are override and the calculation is done in the tax vendor.There is another Third party tax software called

is SABRIX which is also widely used.

Posted by Muhammad Rafi Aamiri Madani

Supplier Bank Details

Muhammad Rafi Aamiri Madani on Thursday, April 30, 2009

/* For Supplier Bank Account Number Use This One */

SELECT bank_account_name, bank_account_num, branch_id 

FROM iby_ext_bank_accounts 

WHERE ext_bank_account_id IN ( 

SELECT ext_bank_account_id 

FROM iby_account_owners 

WHERE account_owner_party_id IN ( 

SELECT party_id 

FROM hz_party_sites 

WHERE party_site_name LIKE ‘%UPC%’))

/* USE THIS QUERY TO GET BANK NAME AND BANK BRANCH NAME OF SUPPLIER

BANK*/

SELECT BANKORGPROFILE.HOME_COUNTRY BANK_HOME_COUNTRY, 

BANKORGPROFILE.PARTY_ID BANK_PARTY_ID, 

BANKORGPROFILE.ORGANIZATION_NAME BANK_NAME, 

BANKORGPROFILE.BANK_OR_BRANCH_NUMBER BANK_NUMBER, 

BRANCHPARTY.PARTY_ID BRANCH_PARTY_ID, 

BRANCHPARTY.PARTY_NAME BANK_BRANCH_NAME, 

BRANCHPARTY.PARTY_ID 

FROM HZ_ORGANIZATION_PROFILES BANKORGPROFILE, 

HZ_CODE_ASSIGNMENTS BANKCA, 

HZ_PARTIES BRANCHPARTY, 

Page 16: Quries on Oracle Purchasing

HZ_ORGANIZATION_PROFILES BRANCHORGPROFILE, 

HZ_CODE_ASSIGNMENTS BRANCHCA, 

HZ_RELATIONSHIPS BRREL, 

HZ_CODE_ASSIGNMENTS BRANCHTYPECA, 

HZ_CONTACT_POINTS BRANCHCP, 

HZ_CONTACT_POINTS EDICP 

WHERE SYSDATE BETWEEN TRUNC (BANKORGPROFILE.EFFECTIVE_START_DATE) 

AND NVL (TRUNC (BANKORGPROFILE.EFFECTIVE_END_DATE), 

SYSDATE + 1) 

AND BANKCA.CLASS_CATEGORY = ‘BANK_INSTITUTION_TYPE’ 

AND BANKCA.CLASS_CODE IN (’BANK’, ‘CLEARINGHOUSE’) 

AND BANKCA.OWNER_TABLE_NAME = ‘HZ_PARTIES’ 

AND (BANKCA.STATUS = ‘A’ OR BANKCA.STATUS IS NULL) 

AND BANKCA.OWNER_TABLE_ID = BANKORGPROFILE.PARTY_ID 

AND BRANCHPARTY.PARTY_TYPE = ‘ORGANIZATION’ 

AND BRANCHPARTY.STATUS = ‘A’ 

AND BRANCHORGPROFILE.PARTY_ID = BRANCHPARTY.PARTY_ID 

AND SYSDATE BETWEEN TRUNC (BRANCHORGPROFILE.EFFECTIVE_START_DATE) 

AND NVL (TRUNC (BRANCHORGPROFILE.EFFECTIVE_END_DATE), 

SYSDATE + 1) 

AND BRANCHCA.CLASS_CATEGORY = ‘BANK_INSTITUTION_TYPE’ 

AND BRANCHCA.CLASS_CODE IN (’BANK_BRANCH’, ‘CLEARINGHOUSE_BRANCH’) 

AND BRANCHCA.OWNER_TABLE_NAME = ‘HZ_PARTIES’ 

AND (BRANCHCA.STATUS = ‘A’ OR BRANCHCA.STATUS IS NULL) 

AND BRANCHCA.OWNER_TABLE_ID = BRANCHPARTY.PARTY_ID 

AND BANKORGPROFILE.PARTY_ID = BRREL.OBJECT_ID 

AND BRREL.RELATIONSHIP_TYPE = ‘BANK_AND_BRANCH’ 

AND BRREL.RELATIONSHIP_CODE = ‘BRANCH_OF’ 

AND BRREL.STATUS = ‘A’ 

AND BRREL.SUBJECT_TABLE_NAME = ‘HZ_PARTIES’ 

AND BRREL.SUBJECT_TYPE = ‘ORGANIZATION’ 

AND BRREL.OBJECT_TABLE_NAME = ‘HZ_PARTIES’ 

AND BRREL.OBJECT_TYPE = ‘ORGANIZATION’ 

AND BRREL.SUBJECT_ID = BRANCHPARTY.PARTY_ID 

AND BRANCHTYPECA.CLASS_CATEGORY(+) = ‘BANK_BRANCH_TYPE’ 

AND BRANCHTYPECA.PRIMARY_FLAG(+) = ‘Y’ 

AND BRANCHTYPECA.OWNER_TABLE_NAME(+) = ‘HZ_PARTIES’ 

AND BRANCHTYPECA.OWNER_TABLE_ID(+) = BRANCHPARTY.PARTY_ID 

AND BRANCHTYPECA.STATUS(+) = ‘A’ 

AND BRANCHCP.OWNER_TABLE_NAME(+) = ‘HZ_PARTIES’ 

AND BRANCHCP.OWNER_TABLE_ID(+) = BRANCHPARTY.PARTY_ID 

Page 17: Quries on Oracle Purchasing

AND BRANCHCP.CONTACT_POINT_TYPE(+) = ‘EFT’ 

AND BRANCHCP.STATUS(+) = ‘A’ 

AND EDICP.OWNER_TABLE_NAME(+) = ‘HZ_PARTIES’ 

AND EDICP.OWNER_TABLE_ID(+) = BRANCHPARTY.PARTY_ID 

AND EDICP.CONTACT_POINT_TYPE(+) = ‘EDI’ 

AND EDICP.STATUS(+) = ‘A’ 

AND BRANCHCA.OWNER_TABLE_ID = :IBY_BRANCH_ID /*USER BRANCH ID FROM

ABOVE QUERY*/

Posted by Muhammad Rafi Aamiri Madani

Document Access and Security Level

Muhammad Rafi Aamiri Madani on Thursday, April 30, 2009

Document Access Levels

Specify an access level to control what modification and control actions can take on a particular

document once user gain access. Document owners always have full access to their documents. The

following are Access level options :

View Only - Accessing employees can only view the document. Only the document owner may modify

or control

xxxxxxxxxxxxxthe document.

Modify xx - Accessing employees can view, modify, freeze and close the document.

Full xxxxx - Accessing employees can view, modify, freeze, close, cancel and finally close the

document.

Document Security Levels

Anyone with menu access to the document entry window can create a document. These individuals

then become the document owners. Security levels can be set for each document type. Following are

Security level options

Private .xx - Only the document owner and subsequent approvers can access the document.

Purchasing - Only the document owner, subsequent approvers, and individuals defined as buyers can

access the

xxxxxxxxxxxxxxdocument.

Hierarchyx - Only the document owner, subsequent approvers, and individuals above the document

owner in the

Page 18: Quries on Oracle Purchasing

xxxxxxxxxxxxxxsecurity hierarchy can access the document.

Public xxxx- All system users can access the document.

Posted by Muhammad Rafi Aamiri Madani

Steps to debug the Approval Workflow for Purchase Order or Purchase Requisition

Muhammad Rafi Aamiri Madani on Friday, May 1, 2009

Step 1

Review the action history of the document having a problem. This is done in the Purchasing Summary

screens – either Requisitions Requisitions Summary or Purchase Orders Purchase Order Summary. If

you attempt to view the action history and you receive the following error:

APP-14288 This document is either incomplete or you do not have access to it 

Then this represents that Workflow has not yet performed a submit into the action history table. The

document approval manager performs the action of submitting a record into the Action History and

therefore is required to be running. It should be confirmed that the document approval manager is

running.

Step 2

Notification Summary – review the Notification Summary for the user that submitted the document.

Are there any notifications present? Because online form messaging alerts are now present in the form

of notifications, it is imperative that the summary be reviewed for any informative notifications

explaining in more detail as to the problem.

Step 3

Confirmation that the Workflow Background Process has been run via the System Administrator

responsibility. This is done via Requests Run within the System Administrator Responsibility. The

parameters should be the Item Type – PO or Requisition Approval and then Processed Deferred = Yes,

Process Time Out = Yes. Process Stuck = Yes if the Process Stuck parameter is available.

Step 4

Page 19: Quries on Oracle Purchasing

Ensure that all tables contain the necessary space to record the Workflow processing data. As users

submit a document for Approval and the Workflow process is called, data is recorded into a series of

Workflow tables. To quickly confirm whether the tables are having space limitations or not? Run the

following in SQL:

select value

from v$parameter

where name like ‘background_dump_dest’;

The value returned by this SQL statement represents the location of the alert log on the database

server, For the instance in question. Please ask the Database Administrator to review the latest entries

into the alert.log to confirm if any errors are being thrown with regards to table space. The most

common scenario that has been linked to table space, is when a user hits the ‘Approve’ button in the

approval screen, only to have nothing happen. There is no message returned stating document has

been submitted for Approval, nothing happens. The hourglass comes for 1 second, and then leaves,

and the approval form is still present. This is most likely a table space issue.

Step 5 

Workflow Monitor from the Purchase Summary screens. Utilize the Workflow monitor to track the path

which the document has taken during its submission to Workflow. Some important milestones to look

for in the Workflow monitor are ‘Can Owner Approve’ and ‘Does Approver have Approval Authority’.

Are there any processes that contain errors? Or does it appear that a process has stopped at a point

that is incorrect?

Example is if a process stopped at a point that is not referencing a notification or some other request

point for user interaction

Posted by Muhammad Rafi Aamiri Madani

Turn On “About This Page” in Oracle R12 Web Forms

Muhammad Rafi Aamiri Madani on Friday, May 1, 2009

Set Following Profile Options as Required at User or Site

Personalize Self-Service Defn...........................= YES

Page 20: Quries on Oracle Purchasing

FND: Personalization Region Link Enabled.........= YES

Disable Self-Service Personal..........................= NO (Only at Site)

FND: Diagnostics ...........................................= Yes

Bounce the Apache Server

Login to Application you can see the About This Page Link on all web pages

By Using About This Page link you can have almost all information of technology Stack

Purchasing FAQs

Muhammad Rafi Aamiri Madani on Saturday, May 2, 2009

What if there is more than one holder in a job or position? 

Multiple holders in the same job or position can only occur if Oracle Human Resources is installed. If

only Oracle Purchasing is installed, you can assign only one employee to each job or position. If

multiple holders exist when using position approval hierarchies, Oracle Workflow will route the

document to the holder based on alphabetical order. You can see who the system will route the

document to by clicking the Forward radio button, overriding the defaulted name if needed.

What if there are changes to the position approval hierarchy?

Personnel changes are updated in the position approval hierarchy by running the Fill Employee

Hierarchy process which reviews the employee record to determine the current position assignment.

You will probably want to schedule this process to run on a frequent basis to ensure smooth processing

of all approval requests. Structural changes to the position approval hierarchy require the hierarchy to

be rebuilt from the point where the change occurs to the bottom of that branch. Documents are routed

according to the hierarchy in effect at the time they are submitted for approval.

What if Human Resources were already implemented with jobs set up, but no positions?

Unless the decision to set up jobs only and no positions can be revisited, you will have to route all

documents by the employee/supervisor relationship and maintain this data on the employee records.

What if the approver is unavailable for an extended period?

Oracle Purchasing has the ability to automatically forward documents when users do not respond to

notifications. This tool should be used when possible to prevent documents from holding up business

productivity. Oracle Workflow manages this functionality, typically set up to send a first and second

reminder after pre-determined time periods before forwarding the notification to the next approver.

Page 21: Quries on Oracle Purchasing

What if the document has a status of Pre-Approved?

The status of Pre-Approved is the outcome of a person forwarding a document for approval even

though the forwarding person has the necessary authority to approve it. The document may have been

forwarded by mistake or for business reasons. Once the person it was forwarded to approves the

document, the status will be changed to Approved and subsequent actions such as receiving and

invoicing can be completed.

What if there is no account range on an approval group assigned to a job or position?

By default, all accounts are excluded from an approval group and therefore documents governed by

this approval group cannot be approved. You avoid this situation by ensuring that there is at least one

Account Range Include rule on every Approval Group.

What if Workflow can’t find a supervisor to approve the document?

If this occurs, the person submitting the request for approval must forward the document to a different

person in the list of values for Forward To. If this isn’t done, the document will be returned to an

Incomplete status and a notification will be sent stating No Approver Found - Please Select a Forward

To Employee. If using employee/supervisor relationship to determine approval paths, the list of values

will include all active employees. If using position approval hierarchies to determine approval paths,

the list of values will include all employees in the hierarchy selected.

What if a job or position has different authority levels for different document types?

You may have jobs or positions that can approve one document up to a specified dollar amount, while

they can approve another document at a lower dollar amount. If this occurs, simply set up multiple

approval groups with the rules properly defined for the differences and ensure that the right approval

group is assigned to the correct document type.

What if documents flow employee/supervisor, but approval rules are needed?

Approval Groups can be used whether approval paths are determined by employee/supervisor

relationships or by position approval hierarchies.

Posted by Muhammad Rafi Aamiri Madani

trength and Weakness of Approval Hierarchies in Oracle Purchasing

Muhammad Rafi Aamiri Madani on Saturday, May 2, 2009

Using the Employee/Supervisor Relationship

Page 22: Quries on Oracle Purchasing

Strengths

Allows flexibility of establishing approval groups around either jobs or positions.

Assuming Oracle Human Resources (HR) is installed and the data is being maintained, Purchasing uses

the supervisor name on the employee which should be entered and maintained for HR purposes

already.

Weaknesses

Documents may not travel by the employee/supervisor relationship for approval purposes, but take a

different path in part or entirely. Documents can get hung up more frequently due to the volume of

personnel changes that typically occur in companies. Higher volumes of documents need to be re-

routed using the Forward-To settings. Recall that the first name alphabetically appears as the default.

Using Position Approval Hierarchies

Strengths

Allows approval paths to be set up that follow the actual flow of documents for approval. Assuming

Human Resources is installed and the data is being maintained, Purchasing can make an employee

representation of the position approval hierarchy by simply running the Fill Employee Hierarchy

process. This will allow changes occurring in personnel assignments to be updated in the position

approval hierarchy. Documents can get hung up less frequently due to the lower volume of structural

hierarchy changes compared to the higher volume of personnel changes that typically occur in

companies. Lower volumes of documents need to be re-routed using the Forward To settings,

especially when there are multiple holders in a particular job or position. Recall that the first name

alphabetically appears as the default when there are multiple holders.

Weaknesses

Cannot be used with jobs, but must be used with positions.

Period Close Checklist in AR

Muhammad Rafi Aamiri Madani on Saturday, May 2, 2009

■ Complete manual payments and adjustments for the period (including cleanup of ‘Out of Balance’

batches)

■ Check and Complete final Receivables Interface from Order Management 

■ Complete manual invoices, DEBIT Memos and credit memos

Page 23: Quries on Oracle Purchasing

■ Run your final Auto Invoice process

■ Correct ALL Auto Invoice rejects and re-run

■ Clear all receipts from Cash Management

■ Apply receipts against Invoices and Debit Memos

■ Review the Unapplied Receipts Register

■ Reconcile receipts

■ Apply Credit memo to Debit Memo and Invoices

■ Approve or reject ALL Pending Adjustments

■ Complete or delete ALL ‘Incomplete’ invoices

■ Complete or delete ALL ‘Incomplete’ credit memos

■ Correct and post ALL open Lockbox batches (If Lock Box Implemented)

■ Print Dunning (Reminder) Letters (Optional)

■ Run Journal Entries Reports

■ Review Journal Entries reports for ‘unusual’ accounts and correct as needed

■ Run Period End Reports

■ Balance to the Aged Trial Balance

■ Post to the General Ledger using the period start date through the period end date - Verify all the

steps.

■ Close the period - verify that there are no items in error

■ Open the next period and the next Future period

■ Post Journal Entries (In General Ledger)

Page 24: Quries on Oracle Purchasing

■ Balance to the General Ledger (for the key accounts)

Posted by Muhammad Rafi Aamiri Madani

Tables used in Auto Invoice Master Program

Muhammad Rafi Aamiri Madani on Sunday, May 3, 2009

When the Auto invoice program is run, data is populated into the tables listed below.

1. RA_BATCHES_ALL

2. RA_CUSTOMER_TRX_ALL

3. RA_CUSTOMER_TRX_LINES_ALL

4. RA_CUST_TRX_LINE_GL_DIST_ALL

5. RA_CUST_TRX_LINE_SALESREPS_ALL

6. AR_RECEIVABLE_APPLICATIONS_ALL

7. AR_PAYMENT_SCHEDULES_ALL

8. AR_PAYMENT_SCHEDULES_ALL

9. RA_INTERFACE_ERRORS_ALL

Query to check Invoices in Error

SELECT

,ria.line_type

,ria.description

,ria.currency_code

,ria.amount

,ria.trx_date

,ria.quantity

,ria.quantity_ordered

,ria.sales_order

,ria.sales_order_line

,ria.sales_order_date

,ria.inventory_item_id

,riea.interface_line_id

,riea.MESSAGE_TEXT

,riea.org_id

Page 25: Quries on Oracle Purchasing

FROM

,ra_interface_errors_all riea

,ra_interface_lines_all ria

WHERE

,riea.interface_line_id = ria.interface_line_id

AND

,riea.org_id = ria.org_id

Posted by Muhammad Rafi Aamiri Madani

Oracle General Ledger - Tables

Muhammad Rafi Aamiri Madani on Sunday, May 3, 2009

The commonly used tables in GL modules are

GL_SETS_OF_BOOKS

GL_IMPORT_REFERENCES

GL_DAILY_RATES

GL_JE_LINES

GL_PERIODS

GL_JE_HEADERS

GL_JE_BATCHES

GL_BALANCES

GL_CODE_COMBINATIONS

GL_SETS_OF_BOOKS 

Stores information about the sets of books you define in your Oracle General Ledger application. Each

row includes the set of books name, description, functional currency, and other information. This table

corresponds to the Set of Books form.

GL_IMPORT_REFERENCES

Stores individual transactions from subledgers that have been summarized into Oracle General Ledger

journal entry lines through the Journal Import process. You can specify the journal entry sources for

which you want to maintain your transaction’s origin by entering ’Yes’ in the Import Journal References

field of the Journal Sources form. For each source that has Import Journal References set to ’Yes’,

Oracle General Ledger will populate GL_IMPORT_REFERENCES with one record for each transaction in

your feeder system.

GL_DAILY_RATES

Page 26: Quries on Oracle Purchasing

Stores the daily conversion rates for foreign currency transactions. It replaces the

GL_DAILY_CONVERSION_RATES table. It stores the rate to use when converting between two currencies

for a given conversion date and conversion type. Each row in this table has a corresponding inverse

row in which the from and to currencies are switched.

For example, if this table contains a row with a from_currency of YEN, a to_currency of CND, a

conversion_type of Spot, and a conversion_date of January 1, 1997, it will also contain a row with a

from_currency of CND, a to_currency of YEN, a conversion_type of Spot, and a conversion_date of

January 1, 1997.

In general, this row will contain a rate that is the inverse of the matching row. One should never insert

directly into this table. They should instead insert into the DAILY_RATES_INTERFACE table. Data

inserted into the GL_DAILY_RATES_INTERFACE table will be automatically copied into this table.

GL_JE_LINES

Stores the journal entry lines that you enter in the Enter Journals form. There is a one–to–many

relationship between journal entries and journal entry lines. Each row in this table stores the

associated journal entry header ID, the line number, the associated code combination ID, and the

debits or credits associated with the journal line. STATUS is ’U’ for unposted or ’P’ for posted.

GL_PERIODS

Stores information about the accounting periods you define using the Accounting Calendar form. Each

row includes the start date and end date of the period, the period type, the fiscal year, the period

number, and other information. There is a one–to–many relationship between a row in the

GL_PERIOD_SETS table and rows inthis table.

GL_JE_HEADERS

Stores journal entries. There is a one–to–many relationship between journal entry batches and journal

entries. Each row in this table includes the associated batch ID, the journal entry name and

description, and other information about the journal entry. This table corresponds to the Journals

window of the Enter Journals form. STATUS is ’U’ for unposted, ’P’ for posted. Other statuses indicate

that an error condition was found. CONVERSION_FLAG equal to ’N’ indicates that you manually

changed a converted amount in the Journal Entry Lines zone of a foreign currency journal entry. In this

case, the posting program does not re–convert your foreign amounts. This can happen only if your user

profile option MULTIPLE_RATES_PER_JE is ’Yes’. BALANCING_SEGMENT_VALUE is null if there is only one

balancing segment value in your journal entry. If there is more than one, BALANCING_SEGMENT_VALUE

is the greatest balancing segment value in your journal entry.

GL_JE_BATCHES

Stores journal entry batches. Each row includes the batch name, description, status, running total

debits and credits, and other information. This table corresponds to the Batch window of the Enter

Journals form. STATUS is ’U’ for unposted, ’P’ for posted, ’S’ for selected, ’I’ for in the process of being

Page 27: Quries on Oracle Purchasing

posted. Other values of status indicate an error condition. STATUS_VERIFIED is ’N’ when you create or

modify an unposted journal entry batch. The posting program changes STATUS_VERIFIED to ’I’ when

posting is in process and ’Y’ after posting is complete.

GL_BALANCES

Stores actual, budget, and encumbrance balances for detail and summary accounts. This table stores

functional currency, foreign currency, and statistical balances for each accounting period that has ever

been opened. ACTUAL_FLAG is either ’A’, ’B’, or ’E’ for actual, budget, or encumbrance balances,

respectively. If ACTUAL_FLAG is ’B’, then BUDGET_VERSION_ID is required. If ACTUAL_FLAG is ’E’, then

ENCUMBRANCE_TYPE_ID is required. GL_BALANCES stores period activity for an account in the

PERIOD_NET_DR and PERIOD_NET_CR columns. The table stores the period beginning balances in

BEGIN_BALANCE_DR and BEGIN_BALANCE_CR.

An account’s year–to–date balance is calculated as BEGIN_BALANCE_DR – BEGIN_BALANCE_CR +

PERIOD_NET_DR – PERIOD_NET_CR. Detail and summary foreign currency balances that are the result

of posted foreign currency journal entries have TRANSLATED_FLAG set to ’R’, to indicate that the row is

a candidate for revaluation.

For foreign currency rows, the begin balance and period net columns contain the foreign currency

balance, while the begin balance and period net BEQ columns contain the converted functional

currency balance. Detail foreign currency balances that are the result of foreign currency translation

have TRANSLATED_FLAG set to ’Y’ or ’N’. ’N’ indicates that the translation is out of date (i.e., the

account needs to be re–translated). ’Y’ indicates that the translation is current.

Summary foreign currency balances that are the result of foreign currency translation have

TRANSLATED_FLAG set to NULL. All summary account balances have TEMPLATE_ID not NULL. The

columns that end in ADB are not used. Also, the REVALUATION_STATUS column is notused.

GL_CODE_COMBINATIONS 

Stores valid account combinations foreach Accounting Flexfield structure within your Oracle General

Ledger application. Associated with each account are certain codes and flags, including whether the

account is enabled, whether detail posting ordetail budgeting is allowed, and others. Segment values

are stored in the SEGMENT columns. Note that each Accounting Flexfield structure may use different

SEGMENT columns within the table to store the flexfield value combination. Moreover, the SEGMENT

columns that are used are not guaranteed to be in any order. The Oracle Application Object Library

table FND_ID_FLEX_SEGMENTS stores information about which column in this table is used for each

segment of each Accounting Flexfield structure. Summary accounts have SUMMARY_FLAG = ’Y’ and

TEMPLATE_ID not NULL. Detail accounts have SUMMARY_FLAG = ’N’ and TEMPLATE_ID NULL.

Posted by Muhammad Rafi Aamiri Madani

Daily Close and End of Day Reporting

Page 28: Quries on Oracle Purchasing

Muhammad Rafi Aamiri Madani on Monday, May 4, 2009

Client Industry - Banking and Financial Institution

Summary One of my banking clients had a business need to enhance end of day reporting by using a

new "processing date" field, by preventing posting of future dated transactions, and storing daily

balances to support end of day reporting requirements.

Standard Functionality Limitations since Oracle General Ledger (GL) is a real-time system, the

standard posting functionality will update the account balances of detail and summary accounts. When

you post to an earlier effective date or open period, actual balances roll forward through the latest

open period. If you post a journal entry into a prior year, Oracle GL adjusts your retained earnings

balance for the effect on your income and expense accounts. End of day reporting is complicated with

a single instance and server time stamp worldwide.

Business Case Banks and Financial Institutions in US are regulated Corporations subject to daily,

weekly, monthly, quarterly and annual report requirements as defined by the SEC, the Federal

Reserve, and IRS. Additionally, the global branches and subsidiaries are subject to foreign regulatory

agencies. These banks requires that the Oracle Financials Application's GL support the requirement

that transaction processing be cut off based on an end of day and reporting generated as a result of

that end of day. Currently, the standard functionality of Oracle GL does not support the concept of end

of day. The Open/Close is controlled by Accounting Periods in months, not days.

Solution Overview A custom solution was developed incorporating three types of changes that are

required to support end of day processing requirements: 

■ Add Processing Date

■ Store Daily Balances

■ Prevent future dated transactions from affecting end of day balances

Posted by Muhammad Rafi Aamiri Madani

General Ledger Tables

Muhammad Rafi Aamiri Madani on Sunday, May 17, 2009

GL_SETS_OF_BOOKS

Page 29: Quries on Oracle Purchasing

Stores information about the sets of books you define in your Oracle General Ledger application. Each

row includes the set of books name, description, functional currency, and other information. This table

corresponds to the Set of Books form.

GL_IMPORT_REFERENCES

Stores individual transactions from subledgers that have been summarized into Oracle General Ledger

journal entry lines through the Journal Import process. You can specify the journal entry sources for

which you want to maintain your transaction’s origin by entering ’Yes’ in the Import Journal References

field of the Journal Sources form. For each source that has Import Journal References set to ’Yes’,

Oracle General Ledger will populate GL_IMPORT_REFERENCES with one record for each transaction in

your feeder system.

GL_DAILY_RATES

Stores the daily conversion rates for foreign currency transactions. It replaces the

GL_DAILY_CONVERSION_RATES table. It stores the rate to use when converting between two currencies

for a given conversion date and conversion type. Each row in this table has a corresponding inverse

row in which the from and to currencies are switched.

For example, if this table contains a row with a from_currency of YEN, a to_currency of CND, a

conversion_type of Spot, and a conversion_date of January 1, 1997, it will also contain a row with a

from_currency of CND, a to_currency of YEN, a conversion_type of Spot, and a conversion_date of

January 1, 1997.

In general, this row will contain a rate that is the inverse of the matching row. One should never insert

directly into this table. They should instead insert into the DAILY_RATES_INTERFACE table. Data

inserted into the GL_DAILY_RATES_INTERFACE table will be automatically copied into this table.

GL_JE_LINES

Stores the journal entry lines that you enter in the Enter Journals form. There is a one to many

relationship between journal entries and journal entry lines. Each row in this table stores the

associated journal entry header ID, the line number, the associated code combination ID, and the

debits or credits associated with the journal line. STATUS is ’U’ for unposted or ’P’ for posted.

GL_PERIODS 

Stores information about the accounting periods you define using the Accounting Calendar form. Each

row includes the start date and end date of the period, the period type, the fiscal year, the period

number, and other information. There is a one to many relationship between a row in the

Page 30: Quries on Oracle Purchasing

GL_PERIOD_SETS table and rows inthis table.

GL_JE_HEADERS

Stores journal entries. There is a one to many relationship between journal entry batches and journal

entries. Each row in this table includes the associated batch ID, the journal entry name and

description, and other information about the journal entry. This table corresponds to the Journals

window of the Enter Journals form. STATUS is ’U’ for unposted, ’P’ for posted. Other statuses indicate

that an error condition was found. CONVERSION_FLAG equal to ’N’ indicates that you manually

changed a converted amount in the Journal Entry Lines zone of a foreign currency journal entry. In this

case, the posting program does not re convert your foreign amounts. This can happen only if your user

profile option MULTIPLE_RATES_PER_JE is ’Yes’. BALANCING_SEGMENT_VALUE is null if there is only one

balancing segment value in your journal entry. If there is more than one, BALANCING_SEGMENT_VALUE

is the greatest balancing segment value in your journal entry.

GL_JE_BATCHES

Stores journal entry batches. Each row includes the batch name, description, status, running total

debits and credits, and other information. This table corresponds to the Batch window of the Enter

Journals form. STATUS is ’U’ for unposted, ’P’ for posted, ’S’ for selected, ’I’ for in the process of being

posted. Other values of status indicate an error condition. STATUS_VERIFIED is ’N’ when you create or

modify an unposted journal entry batch.

The posting program changes STATUS_VERIFIED to ’I’ when posting is in process and ’Y’ after posting

is complete.

GL_BALANCES

Stores actual, budget, and encumbrance balances for detail and summary accounts. This table stores

functional currency, foreign currency, and statistical balances for each accounting period

that has ever been opened.

ACTUAL_FLAG is either ’A’, ’B’, or ’E’ for actual, budget, or encumbrance balances, respectively. If

ACTUAL_FLAG is ’B’, then BUDGET_VERSION_ID is required. If ACTUAL_FLAG is ’E’, then

ENCUMBRANCE_TYPE_ID is required.

GL_BALANCES stores period activity for an account in the PERIOD_NET_DR and PERIOD_NET_CR

columns. The table stores the period beginning balances in

BEGIN_BALANCE_DR and BEGIN_BALANCE_CR.

An account’s year to date balance is calculated as BEGIN_BALANCE_DR - BEGIN_BALANCE_CR +

Page 31: Quries on Oracle Purchasing

PERIOD_NET_DR PERIOD_NET_CR. Detail and summary foreign currency balances that are the result of

posted foreign currency journal entries have TRANSLATED_FLAG set to ’R’, to indicate that the row is a

candidate for revaluation.

For foreign currency rows, the begin balance and period net columns contain the foreign currency

balance, while the begin balance and period net BEQ columns contain the converted functional

currency balance. Detail foreign currency balances that are the result of foreign currency translation

have TRANSLATED_FLAG set to ’Y’ or ’N’. ’N’ indicates that the translation is out of date (i.e., the

account needs to be re translated). ’Y’ indicates that the translation is current.

Summary foreign currency balances that are the result of foreign currency translation have

TRANSLATED_FLAG set to NULL. All summary account balances have TEMPLATE_ID not NULL. The

columns that end in ADB are not used. Also, the REVALUATION_STATUS column is not used.

GL_CODE_COMBINATIONS

Stores valid account combinations foreach Accounting Flexfield structure within your Oracle General

Ledger application. Associated with each account are certain codes and flags, including whether the

account is enabled, whether detail posting ordetail budgeting is allowed, and others. Segment values

are stored in the SEGMENT columns. Note that each Accounting Flexfield structure may use different

SEGMENT columns within the table to store the flexfield value combination. Moreover, the SEGMENT

columns that are used are not guaranteed to be in any order. The Oracle Application Object Library

table FND_ID_FLEX_SEGMENTS stores information about which column in this table is used for each

segment of each Accounting Flexfield structure. Summary accounts have SUMMARY_FLAG = ’Y’ and

TEMPLATE_ID not NULL. Detail accounts have SUMMARY_FLAG = ’N’ and TEMPLATE_ID NULL.

Posted by Muhammad Rafi Aamiri Madani

Oracle Application Framework

Muhammad Rafi Aamiri Madani on Monday, June 1, 2009

Oracle Application Framework is the development platform for HTML-based applications. It consist of a

java-based application tier framework and associated services. It designed to facilitate the rapid

deployment of HTML-based applications. 

Oracle Application Framework uses below components: 

AOL JAVA or AOL/J 

Page 32: Quries on Oracle Purchasing

It provides the OAF with underlying security and applicaiton Java Services.Also OAF with its connection

to the DB and with application-specific functionality for e.g attachments and flexfields. 

BC4J 

JDeveloper incluedes BC4J. Java Business components are created by BC4J for representing business

logic.It seperates the business logic from UI by mapping the relational tables to java objects. 

Java Controller 

It processes the programmatic UI definition. 

Metadata UI Definition 

Apache Jserv module provides the Java servlet engine uses metadata dictionary to to construct the

Framework UI. 

HTML Generator UIX 

UIX , the HTML Generator 

HTML-based applicaiton uses the following path with OAF on application Tiers. The steps are discussed

below.

a) User click a function on browser (HTML hyperlink access). 

b) URL request to the web listener sent by browser. 

c) User access validated by AOL/J. 

d) Page definition is loaded from the metadata dicitionary on the DB tier into the application Tier (i,e.

Metadata UI definition) 

e) BC4J objects that contain the application logic and access the database are instantiated. 

f) Java controller programatically manipulates the page definition as necessary, based on dynamic UI

rules. 

g) HTML UI Generatior (UIX)interprets the page definition. It creates the related HTML based on UI

Page 33: Quries on Oracle Purchasing

standards, and send the page to the browser. 

Posted by Muhammad Rafi Aamiri Madani

Set Profile Option Value from back end

Muhammad Rafi Aamiri Madani on Monday, June 22, 2009

The PROFILE_OPTION_NAME can be found by the SQL statement,

SELECT profile_option_name

FROM fnd_profile_options_tl

WHERE user_profile_option_name LIKE 'MO%' 

It returns more than one row but i can make out that "ORG_ID" is the PROFILE_OPTION_NAME for MO:

Operating Unit.

Inorder to know the Org_ID of the Org whose value is to be set in MO: Operating Unit the following SQL

statement is used. 

SELECT organization_id, NAME

FROM hr_all_organization_units;

From the above query the default Operating Unit is found and the below code below is used to set the

profile option value usingfnd_profile.save

DECLARE

stat BOOLEAN;

BEGIN 

DBMS_OUTPUT.DISABLE;

DBMS_OUTPUT.ENABLE (100000);

stat := fnd_profile.SAVE ('ORG_ID', 286, 'SITE');

IF stat THEN

DBMS_OUTPUT.put_line ('Stat = TRUE - profile updated');

ELSE

DBMS_OUTPUT.put_line ('Stat = FALSE - profile NOT updated');

Page 34: Quries on Oracle Purchasing

END IF;

COMMIT;

END;

Posted by Muhammad Rafi Aamiri Madani

API of Profiles

Muhammad Rafi Aamiri Madani on Saturday, July 4, 2009

Inside API

Retrieve user profile values for the current run-time environment

Set user profile values for the current run-time environment

There are various Objects that can be used with this API's. These are discussed below:

1. Put :This can be used to put a value to the specified user profile option.

Usage:

FND_Profile.Put('PROFILE_NAME','New_Value')

FND_Profile.Put('USERNAME', Usr_Name)

FND_Profile.Put('RESP_ID', Resp_ID)

FND_Profile.Put('RESP_APPL_ID', Resp_App_ID)

FND_Profile.Put('USER_ID', User_ID)

2.DEFINED : this is function returns TRUE if a value has been assigned to the specified profile option.

Usage:

SELECT fnd_profile.defined('ACCOUNT_GENERATOR:DEBUG_MODE')

ACC_GEN_DEBUG_SESSION_MODE FROM DUAL;

3.GET :This is used to retrieve the current value of the specified user profile option

Usage :

Different type of options can be retrieved like

Page 35: Quries on Oracle Purchasing

FND_Profile.Get('PROFILENAME', Profile_name);

FND_Profile.Get('CONC_LOGIN_ID', Conc_login_id);

FND_Profile.Get('LOGIN_ID', loginid);

4.VALUE : This is function which returns a character string. Used to retrieve the current value of the specified user

profile option.

Usage:

fnd_profile.value('PROFILEOPTION')

fnd_profile.value('MFG_ORGANIZATION_ID')

fnd_profile.value('login_ID')

fnd_profile.value('USER_ID')

fnd_profile.value('USERNAME')

fnd_profile.value('CONCURRENT_REQUEST_ID')

fnd_profile.value('GL_SET_OF_BKS_ID')

fnd_profile.value('ORG_ID')

fnd_profile.value('SO_ORGANIZATION_ID')

fnd_profile.value('APPL_SHRT_NAME')

fnd_profile.value('RESP_NAME')

fnd_profile.value('RESP_ID')

5.VALUE_WNPS: This is a function, returns a character string. This is Used to retrieve the current value of the

specified user profile option without caching it.

6.SAVE_USER :This is function used to save a value for a profile option permanently to the database, for the current

user level. It is necessary to explicitly issue a commit when using this function. Returns TRUE if profile option is

successfully saved, otherwise FALSE.

7.SAVE :This is function used to save a value for a profile option permanently to the database, for a specified level. It

is necessary to explicitly issue a commit when using this function. Returns TRUE if profile option is successfully

saved, otherwise FALSE.

Usage

fnd_profile.save('GUEST_USER_PWD', 'GUEST/ORACLE', 'SITE');

8.INITIALIZE :This is used by internal Applications Object Library to initialize the internal profile information at the

level context.

The cache is first cleared of all database options.

Usage:

Page 36: Quries on Oracle Purchasing

fnd_profile.initialize(user_id);

9.PUTMULTIPLE :This is used by internal Applications Object Library to set multiple pairs of profile options and

values.

Posted by Muhammad Rafi Aamiri Madani

R12 – Core HR Lookups

Muhammad Rafi Aamiri Madani on Sunday, July 12, 2009

LOOK UP CODE DESCRIPTIONTITLE Represents TITLE in People Screen.SEX Represents Gender in People Screen.PERSON_TYPE Represents Person Types in People Screen.ORG_TYPE Represents the Organization Type.MAR_STATUS Represents Marital Status in People Screen.NATIONALITY Represents Nationality in People Screen.REGISTERED_DISABLED Represents Registered Disabled in People Screen.ADDRESS_TYPE Represents Address Type in People Screen.ABSENCE_CATEGORY Represents Absence Category in Absence Screen.ABSENCE_REASON Represents Absence Reason in Absence Screen.APL_ASSIGN_REASON Represents Assignment Change Reason in Application Screen.APL_INTERVIEW_TYPE Represents Interview Type in Interview Screen.EMP_EVENT_TYPE Represents Type in Bookings Screen.

PER_CM_MTHD Represents Delivery Methods in Communication Delivery Methods Screen.

PROFICIENCY_SOURCE Represents Source of Proficiency Rating in Competence Profile Screen.

CERTIFICATION_METHOD Represents Source of Certification Method in Competence Profile Screen.

CONTACT Represents Relationship Type in Contact Screen.CONTRACT_TYPE Represents Contract Type in Contract Screen.CONTRACT_STATUS Represents Contract Status in Contract Screen.CONTRACT_STATUS_REASON Represents Contract Status Reason in Contract Screen.DOCUMENT_STATUS Represents Document Status in Contract Screen.CONTRACT_START_REASON Represents Contract Start Reason in Contract Screen.CONTRACT_END_REASON Represents Contract End Reason in Contract Screen.DISABILITY_CATEGORY Represents Disability Category in Disability Screen.DISABILITY_REASON Represents Disability Reason in Disability Screen.

Page 37: Quries on Oracle Purchasing

TERM_APL_REASON Represents Reason for Ending an Application in End Application Screen.

LEAV_REAS Represents Leaving Reason in End Employment Screen.CONSULTATION_TYPE Represents Consultation Type in Medical Assessment Screen.CONSULTATION_RESULT Represents Consultation Result in Medical Assessment Screen.PHONE_TYPE Represents Phone Type in Phones Screen.PER_SUBJECT_STATUSES Represents Status of Qualification in Qualifications Screen.PER_SUBJECT Represents Subject in Qualification Screen.PER_WORK_HOURS Represents Work Hours in Work Preferences Screen.PER_WORK_SCHEDULE Represents Work Schedule in Work Preferences Screen.PER_FTE_CAPACITY Represents FTE Capacity in Work Preferences Screen.

VACANCY_CATEGORY Represents Vacancy Category in Requisition and Vacancy Screen.

VACANCY_STATUS Represents Vacancy Status in Requisition and Vacancy Screen.

REC_TYPE Represents Source Type for Recruitment Activity in Requisition and Vacancy Screen.

FREQUENCYRepresents Frequency for Review Salary, Review Performance, and Working Hours in Assignment Screen.

QUALIFYING UNITS Represents Units for Probation Period and Notice Period in Assignment Screen.

PQP_EMPLOYER_TYPE Represents Employer Type in Employment History Screen.PQP_EMPLOYER_SUBTYPE Represents Employer Sub Type in Employment History Screen.

DOCUMENT_CATEGORY Represents Document Category in Documents of Record Screen.

Posted by Muhammad Rafi Aamiri Madani

Service Tax Flow

Muhammad Rafi Aamiri Madani on Tuesday, July 14, 2009

Service Tax is a form of indirect tax imposed on specified services called "taxable services". Service tax cannot be

levied on any service which is not included in the list of taxable services. Over the past few years, service tax been

expanded to cover new services. The intention of the government is to gradually increase the list of taxable services

until most services fall within the scope of service tax.In the Union Budget of India for the year 2006-2007, service tax

has been increased from 10% to 12%. For the purpose of levying service tax, the value of any taxable service should

be the gross amount charged by the service provider for the service rendered by him

Readers, pl. update this section by providing your comments

Page 38: Quries on Oracle Purchasing

Accounting for Service Tax

Service tax follows 'cash basis' of accounting. The actual service tax impact occurs on the event of the closure of the

document. For example, the service tax recovery occurs at the time of payment of AP invoice and service tax liability

occurs at the time of entering receipts in AR. To integrate the cash basis accounting with the 'accrual basis' of

accounting, minimum of four new accounts are setup in Oracle. They are the Service Tax Interim Recovery account,

the Service Tax Interim Liability Account, Service Tax Receivable A/c and Service Tax Payable A/c.

Accounting flow in Service tax is simple and intutive.

On PO Receipt

Service Tax Interim Recovery A/c Dr

AP Accrual A/c Cr

On Payment of receipt matched invoice

Service Tax Receivable A/c Dr

Service Tax Interim Recovery A/c Cr

On entry of AR Invoice

Receivables A/c Dr

Service Tax Interim Liability A/c Cr

On applying the receipt against the invoice

Service Tax Interim Liability A/c Dr

Service Tax Payable A/c Cr.

On settlement, if there is a net service tax payable, an invoice is generated on the tax authority

Service Tax Payable A/c Dr

Supplier Liability A/c Cr

Other Features

1. You can net off service tax payable against Cenvat (RG / PLA) accounts

2. You can distribute service tax from one OU to multiple OUs

Since Service tax is an evolving legislation there will be a lot of new knowledge being generated. I want this site to be

Page 39: Quries on Oracle Purchasing

a one stop shop for Service Tax setting up in Oracle. Pl. be active with your comments so that all the users and

viewers to this site can benefit.

Posted by Muhammad Rafi Aamiri Madani

Colours in Concurrent Request

Muhammad Rafi Aamiri Madani on Wednesday, July 22, 2009

Have you noticed the colours when the concurrent requests are submitted?

Green when it is in pending or running status

Yellow for warning

Red for the errors

Do you know these colours are controlled by a profile called FND: Indicator Colors. If you se

the value to Yes, you will these colors, if you say No, you will see no colors. Also I noticed,

the prameters that are required while submiting the concurrent program usually show up in

Yello color (standard for required fields). If you set this profile value to No, even they are

becoming white.

Try it and feel the effect !

Posted by Muhammad Rafi Aamiri Madani

Increasing Auto Invoice Performance

Muhammad Rafi Aamiri Madani on Tuesday, September 8, 2009

The performance of Auto Invoice is affected by several factors. Checking the following could improve performance considerably.

When using the interface_line_attribute fields, create indexes on RA_INTERFACE_LINES_ALL for these fields. Use the minimum number of interface_line_attribute fields.

Some installations use RA_INTERFACE_DISTRIBUTIONS_ALL to populate accounting details while populating segments instead of code combination IDs. In this instance, create an index for segments to improve performance.

Page 40: Quries on Oracle Purchasing

If possible, populate all the code IDs for the RA_CUSTOMER_TRX_TYPES_ALL, MTL_SYSTEMS_ITEMS, and RA_TERRITORIES tables in RA_INTERFACE_LINES_ALL instead of passing values.

When loading more than 5,000 invoices, split them into batches of 5,000. A batch of more than 5,000 rapidly decreases Auto Invoice performance.

For a batch with 3,000 to 5,000 invoices, run more than one instance of AutoI nvoice by giving a value between five and eight in the Number of Instances field in the Auto Invoice Run screen. This will split your data into five to eight batches (and five to eight import programs), increasing performance.

The amount of memory allocated to Auto Invoice for validation can affect performance. \Navigate System System Options Invoice and Customers and enter three MB in the Max Memory (In Bytes) field. 

SQL*Trace to uncover bottleneck areas.

Posted by Muhammad Rafi Aamiri Madani

Common Queries - Responsibility

Muhammad Rafi Aamiri Madani on Friday, September 25, 2009

List of Responsibilities 

SELECT (SELECT application_short_name 

FROM   fnd_application fa 

WHERE fa.application_id = frt.application_id) application, 

          frt.responsibility_id, frt.responsibility_name 

FROM  apps.fnd_responsibility_tl frt;

Menus associated with Responsibility 

SELECT DISTINCT a.responsibility_name, c.user_menu_name 

FROM    apps.fnd_responsibility_tl a, 

           apps.fnd_responsibility b, 

           apps.fnd_menus_tl c, 

           apps.fnd_menus d, 

           apps.fnd_application_tl e, 

           apps.fnd_application f 

Page 41: Quries on Oracle Purchasing

WHERE  a.responsibility_id(+) = b.responsibility_id 

AND      a.responsibility_name p_responsbility_name 

AND      b.menu_id         =   c.menu_id 

AND      b.menu_id         =   d.menu_id 

AND      e.application_id  =   f.application_id 

AND      f.application_id   =   b.application_id 

AND      a.LANGUAGE      =   'US';

Sub Menus and Function attached to this Main Menu 

SELECT c.prompt, c.description 

FROM    apps.fnd_menus_tl a, fnd_menu_entries_tl c 

WHERE  a.menu_id             = c.menu_id 

AND      a.user_menu_name = p_menu_name; 

Assigned Responsibility to a User 

SELECT  DISTINCT 

            u.user_id ,SUBSTR (u.user_name, 1, 30)  user_name 

           ,SUBSTR (r.responsibility_name, 1, 60)     responsibility 

           ,SUBSTR (a.application_name, 1, 50)       application 

FROM    fnd_user u, 

           fnd_user_resp_groups g, 

           fnd_application_tl a, 

           fnd_responsibility_tl r 

WHERE  g.user_id(+)                         =   u.user_id 

AND      g.responsibility_application_id  =   a.application_id 

AND      a.application_id                     =   r.application_id 

AND      g.responsibility_id                  =   r.responsibility_id 

ORDER BY SUBSTR (user_name, 1, 30), 

SUBSTR (a.application_name, 1, 50), 

SUBSTR (r.responsibility_name, 1, 60); 

Responsibility and attached Request Groups 

SELECT    responsibility_name responsibility,request_group_name,frg.description 

FROM       fnd_request_groups frg, fnd_responsibility_vl frv 

WHERE     frv.request_group_id = frg.request_group_id 

ORDER BY responsibility_name; 

Request attached to Responsibility Listing 

Page 42: Quries on Oracle Purchasing

SELECT    responsibility_name, frg.request_group_name 

             ,fcpv.user_concurrent_program_name, fcpv.description 

FROM       fnd_request_groups frg, fnd_request_group_units frgu, 

              fnd_concurrent_programs_vl fcpv, fnd_responsibility_vl frv 

WHERE     frgu.request_unit_type  =  'P' 

AND         frgu.request_group_id   =  frg.request_group_id 

AND         frgu.request_unit_id     =  fcpv.concurrent_program_id 

AND         frv.request_group_id    =  frg.request_group_id 

ORDER BY responsibility_name; 

All Request with Application 

SELECT  fa.application_short_name, fcpv.user_concurrent_program_name, 

            description,DECODE (fcpv.execution_method_code, 

            'B', 'Request Set Stage Function', 

            'Q', 'SQL*Plus', 

            'H', 'Host', 

            'L', 'SQL*Loader', 

            'A', 'Spawned', 

            'I', 'PL/SQL Stored Procedure', 

            'P', 'Oracle Reports', 

            'S', 'Immediate', 

            fcpv.execution_method_code 

            ) exe_method, 

            output_file_type, program_type, printer_name,minimum_width, 

            minimum_length, concurrent_program_name,concurrent_program_id 

FROM    fnd_concurrent_programs_vl fcpv, fnd_application fa 

WHERE  fcpv.application_id = fa.application_id 

ORDER BY description 

Request Status Listing 

SELECT  f.request_id 

           ,pt.user_concurrent_program_name user_concurrent_program_name 

           ,f.actual_start_date actual_start_date 

           ,f.actual_completion_date actual_completion_date 

           ,floor(((f.actual_completion_date-f.actual_start_date)*24*60*60)/3600) 

           || ' HOURS ' || 

           floor((((f.actual_completion_date-f.actual_start_date)*24 *60*60) 

           - floor(((f.actual_completion_date-f.actual_start_date)*24*60 *60)/3600) 

Page 43: Quries on Oracle Purchasing

                                                                                               *3600)/60) 

           || ' MINUTES ' || 

            round((((f.actual_completion_date-f.actual_start_date)*24*60*60) 

           - floor(((f.actual_completion_date-f.actual_start_date)*24*60*60)/ 3600) 

                                                                                                      *3600 

           - (floor((((f.actual_completion_date-f.actual_start_date)*24*60*60) 

           - floor(((f.actual_completion_date-f.actual_start_date)*24*60*60)/3600) 

                                                                                     *3600)/60)*60) )) 

           || ' SECS ' time_difference, 

DECODE 

           (p.concurrent_program_name,'ALECDC' 

           ,p.concurrent_program_name||'['||f.description||']' 

           ,p.concurrent_program_name) concurrent_program_name 

           ,decode(f.phase_code,'R','Running','C','Complete',f.phase_code) Phase 

           ,f.status_code 

FROM    apps.fnd_concurrent_programs p 

           ,apps.fnd_concurrent_programs_tl pt 

           ,apps.fnd_concurrent_requests f 

WHERE  f.concurrent_program_id = p.concurrent_program_id 

AND      f.program_application_id = p.application_id 

AND      f.concurrent_program_id = pt.concurrent_program_id 

AND      f.program_application_id = pt.application_id 

AND      pt.language = USERENV('Lang') 

AND      f.actual_start_date IS NOT NULL;

Posted by Muhammad Rafi Aamiri Madani

API for Customer Conversion

Muhammad Rafi Aamiri Madani on Friday, November 13, 2009

STEP 1

Create Party using the API hz_party_v2pub.create_organization

   STEP 2

Once party is created then the customer accounts should be created using the API

  hz_cust_account_v2pub.create_cust_account

   STEP 3

Party & Accounts are created, customer account sites and its uses should be created.

  But before that location and party_sites should be created and attached to party.

Page 44: Quries on Oracle Purchasing

  hz_location_v2pub.create_location API is used to create location.

  hz_party_site_v2pub.create_party_site API is used to create party_site.

   STEP 4

Now that we have created the party_sites next is to create customer site using API

  hz_cust_account_site_v2pub.create_cust_acct_site

   STEP 5

The site use(SHIP_TO, BILL_TO etc.) can be created using APIhz_cust_account_site_v2pub.create_cust_site_use

 For BILL_TO the customer profiles can be created using APIhz_customer_profile_v2pub.create_customer_profile

Posted by Muhammad Rafi Aamiri Madani

FAQ – Account Receivables

Muhammad Rafi Aamiri Madani on Sunday, November 29, 2009

Adjust the payment terms to run from the date that a service was provided

The 'Payment Terms' field is linked to the Transaction 'Date' field. This field can be

backdated to the date that the service was provided; the standard 30 days payment terms

will start from that date and the due date will be adjusted accordingly.

Check when payment is due for an invoice

To see a summary of a Transaction (invoice), enter the AR responsibility and select

Collections, followed by Transaction Overview. Enter the invoice number if known, or use

one of the range of other search fields, then click on 'Find'. Due date is one of the fields

displayed.

Obtain a copy of an invoice I've raised

Enter the AR responsibility; under Transactions, Transactions. From the Transactions screen,

select the 'View' menu, then 'Requests'. From the 'Find Requests' screen, click on 'Submit a

New Request'. Make sure 'Single Request' is selected and click on 'OK'. In the 'Name' box

enter 'DCC Emailed Transaction (Copy)'. Enter the Invoice number you wish to view; the

email address field is pre-populated with your email address although the address can be

changed if necessary. Submit the request. The copy purchase order will then be issued.

Please note that although the invoice will be marked 'Copy', it will not be printed on

controlled stationery and as such should not be used to re-issue an invoice to a customer. If

Page 45: Quries on Oracle Purchasing

a customer contacts you having misplaced an invoice please ask Oracle Admin to reissue

the invoice to the customer on your behalf. 

View a list of invoices raised to customers which are currently outstanding

Follow the steps above and select 'Single Request'. In the 'Name' box, enter 'Aging – 7

Buckets – By Salesperson'. A list of Parameters will appear. For 'Report Summary', select

'Invoice Summary'. For 'Report Format', select 'Detailed'. For 'Aging Bucket Name', select

'Collections'. Under 'Salesperson', select the name of your school. Submit the request. The

subsequent report gives an aged debtor report for each of your invoices.

Cancel an invoice that I've raised

On occasion you may raise an invoice in error; perhaps the invoice was issued to the wrong

customer, or sent to the wrong address. The problem can easily be rectified in Oracle by

issuing a credit note to the customer.

To raise a credit for the entire value of the invoice, first select 'Transactions', then 'Credit

Transactions' from the Accounts Receivable responsibility in Oracle. Enter the invoice

number you wish to credit in the 'Number' field and click on 'Find. 

If the number entered is valid a window labelled 'Credit Transactions' will open; enter a

reason for the credit, and a contact name and telephone number to appear on the credit

note. Click on the button marked 'Credit Balance'; Oracle will automatically credit the

outstanding balance on the invoice. Click on 'Complete and make a note of the credit memo

'Number; a credit note will be sent to the customer. 

Change the value of an invoice that I've raised

Although you can't amend an invoice once it has been issued, you can either raise a credit,

or an additional charge, to the customer.

If you've overcharged a customer on an invoice, you are able to issue a credit note against

part of the value of that invoice. Follow the steps above to locate the invoice you wish to

credit and add a reason and contact details to the credit note. 

Click on 'Credit Lines'; enter the amount you wish to credit as a minus figure against the line

or lines that the credit relates to. Close the 'Lines' window and click on 'Complete'. Make a

note of the credit memo 'Number' for future reference.

If you have undercharged the customer on the original invoice you will need to raise a new

invoice to charge the customer for the balance.

Page 46: Quries on Oracle Purchasing

Posted by Muhammad Rafi Aamiri Madani

Types of Concurrent Manager

Muhammad Rafi Aamiri Madani on Sunday, November 29, 2009

Concurrent Program

A program that implements a business functionality and needs to be executed again and

again at regular interval or as per business needs is called concurrent program. They can be

implement in PL/SQL, Shell Script, C/C++ etc..

Concurrent Manager

Now when a concurrent program is written, it needs to be executed daily at particular time.

If we do it manual, there might be chances of delays or it might happen that two different

people run the same program at the same time which might lead problems. So we need a

manager which can do all this tasks for us. The responsibility for execution of concurrent

programs is given to Concurrent Manager, which ensures that each concurrent program can

run successfully without any conflicts. They also ensures that the applications are not

overwhelmed with requests. They also manages the batch processing and report generation.

The default installation of Oracle Applications comes with a number of pre defined

concurrent managers however you can create your custom concurrent managers to spread

out the load of your job processing. Apart from taking care of the load of your jobs the

concurrent managers can also schedule the jobs periodically. Also we can assign

specific priority and specific times to the different programs, so that the concurrent

managers can run them in specific workshifts.

Concurrent managers also allows you to tweak the number of concurrent process that it can

handle concurrently. If any request exceed this prescribed limit they are automatically put

on pending state. The processing of a request takes place based on the time of request

submission and priority of the request submitted.

There are many pre-configured Concurrent Managers, each governing flow within each

Oracle Apps areas. In addition there are "super" Concurrent Managers whose job is to

govern the behavior of the slave Concurrent Managers. The Oracle e-Business suite has

three important master Concurrent Managers:

Page 47: Quries on Oracle Purchasing

Internal Concurrent Manager — The master manager is called the Internal

Concurrent Manager (ICM) because it controls the behavior of all of the other

managers, and because the ICM is the boss, it must be running before any other

managers can be activated. The main functions of the ICM are to start up and

shutdown the individual concurrent managers, and reset the other managers after

one them has a failure.

Standard Manager — Another important master Concurrent Manager is called the

Standard Manager (SM). The SM functions to run any reports and batch jobs that

have not been defined to run in any specific product manager. Examples of specific

concurrent managers include the Inventory Manager, CRP Inquiry Manager, and the

Receivables Tax Manager.

Conflict Resolution Manager — The Conflict Resolution Manager (CRM) functions

to check concurrent program definitions for incompatibility rules. However, the ICM

can be configured to take over the CRM's job to resolve incompatibilities.

Apart from these three concurrent manages there is another type of concurrent manager

known as the Transaction Manager also exists. The transaction manager is responsible for

taking the load off the concurrent request table for pooling the request submitted by the

user.The transaction manager takes care of these requests and sends it to standard

manager directly.In a RAC environment the Transaction manager is required to be

activated on each node of the RAC environment.

From the front end you could view the status of your concurrent manager by logging with

the System Administration responsibility and going to the Concurrent Manager

administer screen.

The status of concurrent managers and the nodes on which they are configured can also be known from the Oracle

Applications manager.

Concurrent Manager Processes

The concurrent managers are like other process which run on the oracle applications

executable FNDLIBR. The FNDLIBR executable is located at $FND_TOP/bin.

You could also grep the FNDLIBR executable to check if any concurrent manager process are

running

Page 48: Quries on Oracle Purchasing

$ ps -ef|grep FNDLIBR

The $FND_TOP/sql/afcmstat.sql script gives you a list of concurrent managers and their

respective status.

Below is the list of Most of the Concurrent manager processes.

FNDLIBR

manages following Managers

Marketing Data Mining Manager

Transportation Manager

Session History Cleanup

UWQ Worklist Items Release for Crashed session

Collections Manager

OAM Metrics Collection Manager

Contracts Core Concurrent Manager

Standard Manager

WMS Task Archiving Manager

Oracle Provisioning Manager

INVLIBR

manages following Managers

Inventory Manager

MRCLIB

manages following Managers

MRP Manager

PALIBR manages following Managers

PA Streamline Manager

FNDSM

The Generic Service Management Framework Process

FNDSM is executable and core component in GSM ( Generic Service Management

Framework discussed above). You start FNDSM services via application listener on all

Nodes in Application Tier in E-Business Suite.

Concurrent Manager Scripts

Page 49: Quries on Oracle Purchasing

Oracle supplies several useful scripts, (located in $FND_TOP/sql directory), for monitoring

the concurrent managers:

   

afcmstat.sql Displays all the defined managers, their maximum capacity, pids, and their status.

afimchk.sql Displays the status of ICM and PMON method in effect, the ICM's log file, and determines if the concurrent manger monitor is running.

afcmcreq.sql

Displays the concurrent manager and the name of its log file that processed a request.

afrqwait.sql Displays the requests that are pending, held, and scheduled.

afrqstat.sql Displays of summary of concurrent request execution time and status since a particular date.

afqpmrid.sqlDisplays the operating system process id of the FNDLIBR process based on a concurrent request id. The process id can then be used with the ORADEBUG utility.

afimlock.sql

Displays the process id, terminal, and process id that may be causing locks that the ICM and CRM are waiting to get. You should run this script if there are long delays when submitting jobs, or if you suspect the ICM is in a gridlock with another oracle process.

Posted by Muhammad Rafi Aamiri Madani

Adding DBlink from GL Responsibility

Muhammad Rafi Aamiri Madani on Tuesday, December 1, 2009

To create an FSG report from Database instance "UAT" to instance "PROD" (import the

report).

The COA setup of both instance should be the same.

Only one step needed :

From GL Super User, navigate to (N)  Setup  System  Database Links

Specify the below,

Database UAT

Connect String

(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=192.168.10.139) (PORT=1522)) (CONNECT_DATA=(SERVICE_NAME=UAT)))

Domain WORLD

Page 50: Quries on Oracle Purchasing

NameAPPS User Name

APPS

APPS password

apps (use your password)

Done, You could try to import the FSG report from UAT instance to PROD instance

Note:

The connect string is the same connection string taken from client's (e.g. your PC)

tnsnames.ora file

Posted by Muhammad Rafi Aamiri Madani

Initialize Session

Muhammad Rafi Aamiri Madani on Tuesday, December 8, 2009

If you are working with Oracle Applications, here's how you can initialize your session in

whatever tool you are using to mimic the login process and pick up profile option values.

The key profile option here is usually org_id so you can select from organization aware

views, but it applied equally to other profile options, i.e. you can then use

fnd_profile.value('PROFILE_OPTION_NAME');

to get values from profile options. You need to be logged into the database as the APPS

user. The examples set up the session for SYSADMIN user, System Administrator

responsibility. e.g. SQL*Plus

exec fnd_global.apps_initialize(0,20420,1);

e.g. for PL/SQL, TOAD, SQLDeveloper, SQL Navigator etc.: 

begin fnd_global.apps_initialize(0,20420,1); end;

The parameters used here are:

1. User_ID

2. Responsibility_ID

3. Responsibility_Application_ID

To get these you have a couple of choices 

Page 51: Quries on Oracle Purchasing

a) SQL - Replace SYSADMIN and System Administrator with your user and responsibility: 

select 'begin fnd_global.apps_initialize(' ||

       fu.user_id || ',' ||

       fr.responsibility_id || ',' ||

       fr.application_id || '); end;' || chr(10) || '/'

from   fnd_user fu

,      fnd_responsibility_tl fr

where  fu.user_name = 'SYSADMIN'

and    fr.responsibility_name = 'System Administrator';

b) In your Oracle Applications forms session. Login as your user and navigate to the required

responsibility. Open a function that uses Oracle forms Go to Help > Diagnostics > Examine

In the Block enter $PROFILES$ In the field enter the appropriate field name for the

parameter: 

1. User_ID = USER_ID

2. Responsibility_ID = RESP_ID

3. Responsibility_Application_ID = RESP_APPL_ID

Posted by Muhammad Rafi Aamiri Madani