Posts By: Phani Adivi

Script to create a Cash Receipt using Oracle API (AR)

The following post can be used to create a Cash receipt in Oracle Receivables. The “ar_receipt_api_pub.create_cash” SQL API is used to create cash receipts for the payment received in the form of a check or cash. Cash receipts can be created as identified (with a customer) or as unidentified (without a customer).

Script to create a Receipt Write-off (AR)

The following post will detail the steps that are done to create a Receipt Write-Off on an AR Receipt. The PL/SQL API Ar_receipt_api_pub.activity_application is used to apply an adjustment on a Receipt – in this case – a Write-Off on a Receipt.

In this post – before doing a Write-Off on a Receipt – let us create a sample Receipt first. In order to create a Receipt – Navigate to the following: Receivables Superuser -> Receipts -> Receipts. Enter the following mandatory fields like – Receipt Method, Receipt Number, Receipt Amount, Customer details and click Save. Upon creating a Receipt – it shows up as below:

And thus, happy Adjusting Write-offs.

Receipt Write-Off (AR) – Error Messages

There are a couple of steps to follow before doing any kind of Adjustment on AR Transactions.

  • In order to make any adjustments like a Receipt Write-Off – Approval Limits have to be defined for the user who is doing the Adjustment. If the Approval Limit is not set, then the Receivables window throws an error to set up the Approval Limit with the error Message: “APP-AR-96983: User Write-off limit does not exist.

In order to correct the above message, perform the following actions: Navigate to the following – Receivables Super User -> Setup -> Transactions -> Approval Limits. In the Approval Limits window – create a record. There exists one record with the combination of a User, Adjustment Type, Currency in the Approval Limits window. Enter a record for the user as below.

  • And there is a system profile option that needs to be setup before any adjustment is done on a receipt. Without setting that option first, the user may face the following error message – “APP-AR-96981: Please set the receipt write-off limits range system option.

In order to correct the above messages, perform the following actions: Navigate to Receivables Super User -> Setup -> System -> System Options -> Miscellaneous Tab. For the Write-off Limits Per Receipt – enter the values as required in the company. After entering the values – the screen looks like below.

These above two steps needs to be completed before creating an adjustment on an AR Receipt like a Receipt Write-Off.

Script to create a Debit Memo (AR)

The following script can be used to create a Basic Debit memo. The API that is used to create an AR Invoice is – “ar_invoice_api_pub.create_invoice“. The Cust_trx_type_id decides whether the invoice getting created is a Standard Invoice or a Credit Memo or a Debit memo. Based on this value, the API also checks the sign of the amount on the Line level that is being passed.

Script to Create a Credit Memo (AR)

The following script can be used to create a Basic Credit memo. The API that is used to create an AR Invoice is – “ar_invoice_api_pub.create_invoice“. The Cust_trx_type_id decides whether the invoice getting created is a Standard Invoice or a Credit Memo or a Debit memo. Based on this value, the API also checks the sign of the amount on the Line level that is being passed.

Query to derive the 4 C’s

The following query can be used to derive the details of the 4 C’s – that is: that have been setup for a particular Ledger.

  • Chart of Accounts
  • Currency
  • Calendar
  • Accounting Convention

Oracle Payables Query

Query to identify the various components that a Payables Invoice goes through a P2P process. Below query provides the details like Invoice, Supplier, Supplier Sites, Payment Method codes, terms, Distribution details, Payment schedules, Check details, Internal Bank Payment and Internal Bank details.

Banks in Oracle R12

Understanding Banks in Oracle R12

Bank Details such as Bank Account Name, Bank Account Number etc. are stored in multiple tables in Oracle Apps R12 environment. It may be confusing to see that sometimes the same information such as bank account name is stored in different tables. Here, we shall learn the differences between those tables and their uses.

There are two types of Banks and related bank accounts in R12.

  1. Internal
  2. External

The basic difference between an Internal bank/bank account and an External bank/bank account is that an internal bank account is an account that is created from the Cash Management module and the External Bank/bank accounts are the ones that are created from the sub-ledger modules such as the Payables or Receivables. Bank Accounts related to Suppliers or Customers are the externals bank accounts.

The Internal bank accounts and its details are stored in the CE tables like “CE_BANK_ACCOUNTS” and the external bank accounts and its details are stored in IBY tables like “IBY_EXT_BANK_ACCOUNTS”.

Internal banks and Bank Accounts – Technical details:

Steps to create a Bank, Bank Branch and a Bank Account

Navigate to Cash Management Super User -> Setup -> Banks -> Banks. Click Create Button to create a new bank.

Create Bank:

Create Bank Address: In the Step 2 – Click on Create button to create Bank Address and click Apply.

Create Contact: On step 3 – click on Create button to create a contact for the bank.

 That’s it – A new Bank with the name Test Bank 4 is created.

Creating a Bank Branch

Navigate to Cash Management Super User -> Setup -> Banks -> Banks – Click on Bank Branches and click Create Button.

First the following oracle page asks to enter the bank name for which the branch is being created for. And Click continue. We get two options here – either to “Create a new Branch” or to “Select an Existing party”. Let’s create a new branch.

Create Branch Address

Create a Contact for the Bank Branch

A bank branch is also created.

Now that a Bank, its Bank Branch, Branch Address and a Contact point is created, lets create a Bank Account and Assign it to the Bank that was created earlier.

Go to the navigation – Cash Management Super User -> Setup -> Banks -> Bank Accounts -> Click Create. The following oracle page asks for the Country, Bank name and Branch name for which the account is being created for. Select the Bank and Branch Name that we created before.

Identify the Bank Account Owner – the corresponding Legal Entity identifier and the Uses of the Bank Account. For which the Bank account will be used for:

Create Bank Account information like Bank Account Name, Account Number and Currency code.

Create the Bank Account Controls that has General control information like Cash Account, Bank Charges, Realized gain, Foreign Exchange charges, Cash Clearing account, Bank Errors, Realized Loss account etc. Click Save and Next and Click Finish.

Add Organization Access – in order to Assign a bank account to an operating unit.

Technical information about Banks and Bank Branches for CE (Cash Management)

Procure to Pay (P2P)

In this article, we shall try to understand the end to end process involved in the P2P process from a functional as well a technical point of view. We shall look at the navigation required during each step and the tables that get affected during that process.

High level Scenario: Consider a car company that buys tires from a third party supplier. And when the Supplier sends in those tires, the company fixes the tires to the cars in their assembly lines and continue their manufacturing process of building the cars. In this scenario, let us suppose the number of tires that this car company has, has fallen below a count of 100. That’s when the company’s procurement team requests the third party seller to replenish the tires inventory by sending out a new batch of tires.

In the above mentioned scenario, from an ERP perspective, the tires count is maintained in Inventory module. Suppliers are maintained in the Accounts Payables (AP) module. Procurement for new tires is made and requested from the Procurement module. And when the Invoice is paid – the Payment accounting is created as journals and printed as reports in the General Ledger module.

Thus, a P2P process flows through the following steps:

  • Create / Raise requirement for the item.
  • Create Requisition
  • Request for Quotation
  • Create Quotation
  • Quotation Analysis
  • Create Purchase Order
  • Create Invoice
  • Create Accounting (for Invoice)
    • Interface to GL
    • Journal Import and Create Journals
    • Post the Journals
  • Create Payment
  • Create Accounting (for Payment)
    • Interface to GL
    • Journal Import and Create Journals
    • Post the Journals

Step 1: Requesting for Item

Create an item – VI50000.

In the above image, we can see that for this item – in the General Planning tab –

  • Inventory Planning Method is defined as Min-Max.
  • Min-Max Quantity section the Minimum quantity is 100 and Maximum quantity is 1000.
  • Make or Buy is – Buy
  • And the Source Type is – Supplier.

That means, whenever the on-hand quantity of that item falls below a minimum of 100, then the Min-Max Planning report automatically replenishes the quantity of the item upto 1000. The tables affected during this step are:

Step 2: Now, run the Min-Max Planning Report.

Inventory Super User -> Planning -> Min-Max Planning Report

Min-Max Planning Report Navigation.

Step 3: Upon Running this report – the process of creating a requisition starts. Once this Min-Max Planning report is completed, a record is inserted into the Po Requisitions Interface table. A record is inserted into the PO_REQUISITIONS_INTERFACE_ALL table.

The PO_REQUISITIONS_INTERFACE_ALL table contains requisition information from other applications. Each row includes all the information necessary to create approved or unapproved requisitions in Oracle Purchasing. The Oracle Purchasing Requisition Import feature uses this information to create new requisition headers, lines and distributions.

Step 4 –  Create Requisition: Run the “REQUISITION IMPORT” concurrent program to import the requisition from the interface table to the base tables, thereby creating the Requisition in Oracle.

Requisition Import Concurrent Program

The Requisition Import Concurrent Program validates the data in the PO_REQUISITIONS_INTERFACE_ALL table and derives additional information as required. Upon completion, data is loaded into the PO Requisition Base Tables. The base tables are:


In order to identify the record in these base table – get the inventory_item_id of the above item

PO_REQ_DISTRIBUTIONS_ALL table contains the information about the accounting distributions associated with each requisition line. Each
requisition line must have at least one accounting distribution.

From the above query – get the code_combination_id value – that can used to get the accounting string.

Approved Requisitions can be accessed from – PO Super User -> Requisitions -> Requisition Summary.

Requisition Headers
Requisition Lines
Req Distribution – Charge Account (code combination)

If there are any errors then, then error records are written into PO_INTERFACE_ERRORS table.

The join is – PO_REQUISITIONS_INTERFACE_ALL.transaction_id = PO_INTERFACE_ERRORS.interface_transaction_id


Once the Requisition is created, now we have to Create RFQ – that is Request for Quotation – asking the Suppliers to provide their Quotation. Once we receive their quotations, we can decide which quote from the Suppliers is best for our requirement.

Navigation – Purchasing Super User -> RFQ’s and Quotations -> RFQ’s

Create an RFQ by selecting the following fields:

  • Type – Standard RFQ (the other two types are Bid RFQ, Catalog RFQ).
  • Status – Active
  • Close date – provide a date until when this RFQ is valid
  • Item – Item name
  • Target Price – provide a target price
  • Currency – Provide the currency details.
  • Terms – Payment Terms, Freight Terms, FOB.
  • Price Break – In the Price Break – you can provide the quantity and a discount.

And click on Save. Tables that get affected when Request for Quotation is created are:

Click on Suppliers tab on the RFQ window to assign the RFQ to that particular Supplier. Here you can see that this RFQ has been assigned to a couple of Suppliers.

This information is stored in PO_RFQ_VENDORS table. This table stores the information about the set of suppliers assigned to an RFQ. Each row in this table identifies the Supplier who received this RFQ. In the above example, we would get 2 records.

Once the RFQ is completed – run the PRINTED RFQ Report concurrent program that will send the RFQ details to the supplier via email / fax or other methods that have been entered. Once the below program completes, the status on the RFQ changes from ACTIVE to PRINTED.

Step 6 – Quotations

Now that an RFQ is created and sent out to Suppliers, the Suppliers send us their respective Quotes back. We select the required quote and create it in Oracle for record purpose. A Quote can be created from the RFQ screen itself. Open the RFQ -> Tools – Copy Document. Give the following values:

  • Action – Entire RFQ
  • Type – Standard Quotation
  • Supplier – Select one of the two suppliers that we entered above.
  • Site – Auto populates.

Once OK is pressed, a note appears that “A new Quotation has been copied from this RFQ. The Quotation document number is – ..

As can be seen above – a Quotation is created for the corresponding RFQ. And the tables affected are:

Click on Approve Button.

Step 7 – Quote Analysis

In this step – the Quote that was approved earlier is Analyzed and is approved. Navigation: Purchasing Super User -> RFQ’s and Quotations -> Quote Analysis -> Enter the RFQ Number. Click on Approve Entire Quotation

Step 8 – Create Purchase Order (PO)

Now that the Quote analysis is completed – we are ready to create a Purchase Order. Navigation – Purchasing Super User -> Purchase Orders -> Purchase Orders.

Enter the Supplier Name, Supplier Site, Bill-To, Ship-To, enter the Item information. As soon as we enter the quantity, the price changes to the discounted price on the quotation.

Click on Terms – and we have information about Payment Terms (30 Net or Immediate), Freight (Due), Carrier, FOB, Supplier Note, Receiver Note etc.

Click on Shipments – and we get information about the Ship-To organization Name, UOM, Quantity, Promised Date, Need By Date, Charge Account and Amount.

Click on Shipments – and More – we get information on how the Match Approval Level is defined. Whether it is a 2-way or 3-way or 4-way match approval. And Invoice Match Option – Receipt / PO.

Once the PO Is approved, we can check the PO details from the backend. The tables that get affected are:

Step 9 – Receiving

Once the PO Is created, the Supplier sends the items to the Ship-To organization specified. And once we get the goods, we receive them in Oracle too. Navigation – Purchasing Super User -> Receiving -> Receipts. Enter the PO Number and click Find to get the receipt details.

Once it is saved, we receive it in EBS. The tables that get affected are:

Step 10 – Create Invoice (Payables Invoice)

Once we received the items, we create a Payables Invoice in order to send it to the Supplier so they can pay out that amount. The Invoice is created for the amount for which the PO was created for. In the PO Number field, enter the PO number that was created earlier. And Distribution Information can be seen by clicking All Distributions.

Invoice Header and Lines

Click on Actions to Validate the Invoice.

After clicking validation – the status on the Invoice changes to “Validated”

Tables Affected after creating the invoice are:

Step 11 – Create Accounting

After the invoice is validate – Click Actions and Click Create Accounting.

When the Create Accounting program is run, it processes the eligible accounting events to create the subledger journal entries. This program:

  1. Validates and creates the journal entries.
  2. Transfers the journal entries in the current batch run to General Ledger and starts the GL posting process.
  3. Generates the Subledger Accounting Program Report, which has the results of the Create Accounting program.

Before running the Create Accounting program, the Accounting_event_id column in the AP_INVOICE_DISTRIBUTIONS_ALL is NULL. After running the program, the field is populated with the value that can be used in the Subledger Accounting (SLA) tables. The tables affected after running the Create Accounting are as below.

Step 12 – Journal Import

The Journal Import program transfers the data from the GL_INTERFACE table to the GL Base tables. The corresponding JE_Batch_id, JE_Header_ID, JE_LINE_NUM fields are populated. These can be used to check the data in the GL Base tables. The tables getting affected in GL are as below:

Step 13 – Create Payment

Now that the Invoice was sent out to the Supplier and the Supplier pays the Invoice in full, then we record that payment in the EBS. The Navigation to the payment screen is AP Super User -> Payments -> Entry -> Payments. The other way is to go from the AP Invoice Screen. Go to the Invoice – Click Actions and Click – Pay in Full. The Payment screen opens up.

Invoice Payments screen

And once all the required fields are populated – click on Save. The following tables are populated with the payment data.

The AP_Invoice_Payment_Schedules_all table holds data about any pending amount on the invoice. It contains information about scheduled payments for an invoice. The AMOUNT_REMAINING columns holds the data for any amount that is pending on the invoice. The PAYMENT_STATUS_FLAG may be ‘Y’ for fully paid payment schedules, ‘N’ for unpaid scheduled payments, or ‘P’ for partially paid scheduled payments.

The AP_CHECKS_ALL table stores the information about any payments made to the Supplier or any refund provided to the Supplier. There exists a record for each activity in this table. This table stores the supplier name and bank account name for auditing purposes, in case either one is changed after you create the payment. This table also stores Bank_Account_name, check_date, Check Number, Currency Code, Address Information etc..

Step 14 – Create Accounting (for Payment)

Now that the Payment has been recorded in EBS (AP module), the information has to pass through the Subledger Accounting (SLA) and then to GL. In order for this to happen, on the Payments screen – click Action – and Click – Create Accounting.

Create Accounting screen (for Payments)

Once this activity is completed, the Create Accounting Seeded concurrent program starts and initiates the transfer of data from AP to GL via GL interface. The following tables get affected during this process.

And once the Journal Import completes the journals can be seen from the GL base tables namely GL_JE_BATCHES,
GL_JE_HEADERS , GL_JE_LINES and upon posting the Journals – the GL data can be seen in the GL_Balances table.

That pretty much sums up the Procure to Pay Cycle in Oracle Apps.

Happy coding.

Process Flow – P2P

Oracle ERP has two important process flows that define day to day activities across multiple modules.

  • Procure to Pay (P2P)
  • Order to Cash (OTC)

Procure to Pay Process commonly known as P2P is the process of procuring items based on necessity, paying for the goods or services procured and accounting the monetary transactions that take place during the above mentioned process. More about P2P Process can be found here.

Order to Cash Process commonly known as OTC is the process of selling the goods or services, shipping the aforementioned goods and accounting of the monetary transactions that take place during the above mentioned process. More about OTC process can be found here.