Oracle Approvals Management or AME, as it is called in general, is a module of Oracle Applications that contains the hierarchy list for all seeded/standard workflows. We can configure individual approval lists for each workflow in this module. To enable the workflows to use AME hierarchy list a profile option, AME: Installed, has to be set. Just like any profile option it can be set at any of the flowing levels,
  • Site
  • Responsibility
  • Application
  • User 

AME profile option
Demonstration of setup and usage of AME
We shall look at setting up the AP Invoice Approval hierarchy in AME. This hierarchy has not been used in the instance as the customer does not use AME for AP.
Responsibility: Approvals Management Business Analyst
Navigation: Business Analyst Dashboard
Enter %invoice% and press tab
Attributes 
Click on Attributes
We are selecting Attribute, SUPPLIER_INVOICE_AMOUNT. Click Next on the attributes are to find the this attribute
Clicking on this attribute gives the details of the attribute,
You can see how Oracle derives the value of the attribute. Let us go back to the Attributes screen by clicking Return to Attributes link at the bottom left of the screen.
If you want to modify the logic that Oracle uses on this attribute you can click on Update icon (the pencil icon) for this attribute.
Note the input parameter for the query. The condition, ai.invoice_id = :transactionId, means that the input to the AME rule will be validated against the invoice_id from the ap_invoices_all table. Thus the input into AME rule for this transaction will be invoice_id. We shall use this for testing AME later on. Make the change to the query and press Apply button.
ConditionsWe shall now add a condition. Click on Conditions.
Click on Create button and select,
Condition Type: Ordinary
Attribute: SUPPLIER_INVOICE_AMOUNT
Let’s add the condition that an invoice should be sent to 1 selected approver if the invoice amount is between AED 1000 and AED 5000.

Use the drop down lists to create the condition. Click Apply.
You can see the confirmation message on top that the condition has been added to the list.
Action Types
Now we have created a condition, we have to create an Action Type. Click on Action Types link on the top menu.
We will select an existing Action Type. Click Use Existing Action Type button.
Click on the Next button until you see “Supervisory level“. Select this Action Type
Click on Continue button.
Click Finish button.
Rules
The Action Type is now created. We now need to create a Rule. Click on the Rules tab to the top right menu.
Click on Create button to create a new rule.
Enter a new name,
Name: Invoice test rule
Rule Type: List Creation is defaulted
Start Date: today’s date is defaulted
End Date: Defaulted as 31-Dec-4712
Click on Next
Click on Add Conditions button. Now we get to select which conditions are to be added to this rule.
Let us select the condition we created named, “SUPPLIER_INVOICE_AMOUNT is greater than 1000 and less than or equal to 5000,AED“. Select this condition and click Continue button.
Check the details and click on Next
Action Type is populated automatically as this is the Action Type that was selected earlier for this transaction type. Select an Action from the list of values. Select the Action from the List of Values.
We select “Requires approvals up to the first two superiors
Click Next
Review and click Finish
Now the rule is ready to be tested and deployed.
Test the AME setup
Let us test the rule before we start using it in the transaction.
First we shall create a test invoice for testing the AME rule.
Navigation: Payables Administrator
Navigation: Invoices > Entry > Invoices
We have put a condition in AME for currency, AED, and amount between 1000 and 5000. Hence we have created an invoice with the following details,
Invoice number: TEST-AME
Invoice currency: AED
Invoice amount: 1500
Go to back to Business Analyst Dashboard in Approvals Management Business Analyst responsibility.
Click on Test icon corresponding to Payables Invoice Approval transaction type.
Click on Run Real Transaction Test.
Enter the transaction id 720374. This is the invoice_id from the ap_invoices_all table (explained in Attributes section above). The invoice amount is between AED 1000 and AED 5000, (AED1500 for the invoice we have created) i.e. as per the condition we have set in AME.
Click Go
Now the AME transaction data is shown on this page. We also have a warning message from Oracle. The message is “The Line Item attribute SUPPLIER_INVOICE_DISTRIBUTION_ASSETS_TRACKING_FLAG has invalid usage for item 278866“. Approver listmay not be generated if this attribute used in conditions”.
We need to look into the attribute SUPPLIER_INVOICE_DISTRIBUTION_ASSETS_TRACKING_FLAG.
Let us check this attribute.
Click on Setup tab on the top menu. Then click on Attributes underneath the top menu. Select the attribute by entering the name in Search form in the middle of the form.

Click Update

Select the query from the Value field and paste it in SQL.
1
2
3
4
5
6
SELECT   assets_tracking_flag
    FROM ap_invoice_distributions_all
   WHERE invoice_id = :transactionid AND invoice_distribution_id IN (SELECT invoice_distribution_id
                                                                       FROM ap_invoice_distributions_all
                                                                      WHERE invoice_id = :transactionid)
ORDER BY invoice_distribution_id
Execute the sql and pass the invoice_id, 130384 (that was being used for the AME test).
The output is ‘Y’. If you notice the Attribute Data Type in the Attribute screen in AME, it is Number. Hence there is a mismatch.
Let us change this query to return only 1. Change the query to the following and paste it on the Value field in the Attribute form in AME.
1
2
3
4
5
6
SELECT   1
    FROM ap_invoice_distributions_all
   WHERE invoice_id = :transactionId AND invoice_distribution_id IN (SELECT invoice_distribution_id
                                                                       FROM ap_invoice_distributions_all
                                                                      WHERE invoice_id = :transactionId)
ORDER BY invoice_distribution_id
Click on Validate button to validate the query
The message on top shows that the query is valid. Click on Apply. Go back to the Test Workbench page by clicking on Test Workbench tab on the top right menu. Click on Run Real Transaction Test (1) button.
Enter the same transaction Id, 130384, and click on Go.
Click on Run Test Case (2) button.
Oracle throws an error, “This transaction’s requestor lacks a person ID, so AME cannot locate the requestor’s supervisor to begin the chain of authority“. This means the requester_id field has to be populated in the table.
Let us populate the requester_id field for this invoice. For demonstration we shall perform this action using an update statement. Go back to the AP invoices form and query for the invoice. Click on Folder > Show field. Query for Re%
Select Requester from the value set.
Set the value for Requester. This can be any active employee. The hierarchy of this employee will be used up to 2 levels.
Save the form. Go back to Test Workbench in AME. Enter Transaction Id: 720374. Click on Run Test Case (1) button.
Now click on Run Test Case (2) button
Now the approver list comes up for AME as the requester has been set for the invoice.
We can get AME rule details by clicking on the + or Show buttons.
We get to see the AME rule information. Now by clicking Show button for the 2nd approver, i.e. the approver on top.
Now check the 1st approver
The AME rule is now setup. Once the Invoice is sent for approval after setting the requester name the flow will be similar to what we tested now. The same logic applies to all AME approval rules.
We have used a very simple example to illustrate setting up AME rules. The same method is used to create AME rules for all transactions. Certain setup options have not been used, like Approval Groups, etc. Once AME setup is clear using the extra options will be very easy.
We have tested the approval list for the AP invoice workflow through AME. Once we send the invoice for approval, the workflow will be executed and the approval notifications will be sent in the same hierarchy.
Oracle Application Object Library uses values; value sets and validation tables as important components of key FLEXFIELDs, descriptive FLEXFIELDs, and Standard Request Submission. This section helps you understand, use and change values, value sets, and validation tables. When you first define your FLEXFIELDs, you choose how many segments you want to use and what order you want them to appear. You also choose how you want to validate each of your segments. The decisions you make affect how you define your value sets and your values. You define your value sets first, either before or while you define your FLEXFIELD segment structures. You typically define your individual values only after your FLEXFIELD has been completely defined (and frozen and compiled). Depending on what type of value set you use, you may not need to predefine individual values at all before you can use your FLEXFIELD.
You can share value sets among segments in different FLEXFIELDs, segments in different structures of the same FLEXFIELD, and even segments within the same FLEXFIELD structure. You can share value sets across key and descriptive FLEXFIELDs. You can also use value sets for report parameters for your reports that use the Standard Request Submission feature.
Because the conditions you specify for your value sets determine what values you can use with them, you should plan both your values and your value sets at the same time. For example, if your values are 01, 02 instead of 1, 2, you would define the value set with Right–Justify Zero–fill set to Yes.
Value set is nothing but List of Values with validations. We can use the Value Sets when ever the Concurrent Program has parameters and while defining the Flex Fields. We have to attach the value sets to the Concurrent Program. Validations are depending on Client Requirement.
Value sets are of 8 types.There are several validation types that affect the way users enter and use segment or parameter values:
1. None (not validated at all)
2. Independent
3. Dependent
4. Table
5. Special (advanced)
6. Pair (advanced)
7. Translatable Independent
8. Translatable Dependent


You cannot change the validation type of an existing value set, since your changes affect all FLEXFIELDs and report parameters that use the same value set.

None: You use a None type value set when you want to allow users to enter any value so long as that value meets the value set formatting rules. That is, the value must not exceed the maximum length you define for your value set, and it must meet any format requirements for that value set. For example, if the value set does not allow alphabetic characters, your user could not enter the value ABC, but could enter the value 456 (for a value set with maximum length of three). The values of the segment using this value set are not otherwise validated, and they do not have descriptions. Because a NONE value set is not validated, a segment that uses this value set does not provide a list of values for your users. A segment that uses this value set (that is, a non–validated segment) cannot use FLEXFIELD value security rules to restrict the values a user can enter.
Independent > An Independent value set provides a predefined list of values for a segment. These values can have an associated description. For example, the value 01 could have a description of ‘Company 01’. The meaning of a value in this value set does not depend on the value of any other segment. Independent values are stored in an Oracle Application Object Library table. You define independent values using an Oracle Applications window, Segment Values.

Table > A table–validated value set provides a predefined list of values like an independent set, but its values are stored in an application table. You define which table you want to use, along with a WHERE cause to limit the values you want to use for your set. Typically, you use a table–validated set when you have a table whose values are already maintained in an application table (for example, a table of vendor names maintained by a Define Vendors form). Table validation also provides some advanced features such as allowing a segment to depend upon multiple prior segments in the same structure.

Dependent > A dependent value set is similar to an independent value set, except that the available values in the list and the meaning of a given value depend on which independent value was selected in a prior segment of the FLEXFIELD structure. You can think of a dependent value set as a collection of little value sets, with one little set for each independent value in the corresponding independent value set. You must define your independent value set before you define the dependent value set that depends on it. You define dependent values in the Segment Values windows, and your values are stored in an Oracle Application Object Library table.

Special and Pair Value Sets:
Special and pair value sets provide a mechanism to allow a”FLEXFIELD–within–a–FLEXFIELD”. These value sets are primarily used for Standard Request Submission parameters. You do not generally use these value sets for normal FLEXFIELD segments. Special and Pair value sets use special validation routines you define. For example, you can define validation routines to provide another FLEXFIELD as a value set for a single segment or to provide a range FLEXFIELD as a value set for a pair of segments.

Translatable Independent and Translatable Dependent :A Translatable Independent value set is similar to Independent value set in that it provides a predefined list of values for a segment. However, a translated value can be used. A Translatable Dependent value set is similar to Dependent value set in that the available values in the list and the meaning of a given value depend on which independent value was selected in a prior segment of the FLEXFIELD structure. However, a translated value can be used. FLEXFIELD Value Security cannot be used with Translatable Independent or Translatable Dependent value sets. For format validation, translatable value sets must use the format type Char. The maximum size must be no greater than 150. The Number Only option and the Right–justify and Zero–Fill Numbers option cannot be used with translatable value sets. Range FLEXFIELDs cannot use Translatable Independent or Translatable Dependent value sets.

PL/SQL Stored Procedures :
If you want to make a PL/SQL procedure as a Concurrent Program, then we will define that procedure by using fallowing syntax

Syntax:
CREATE OR REPLACE PROCEDURE Procedure_Name
(errbuf OUT VARCHAR2,
recoded IN VARCHAR2
,
x IN NUMBER,
y IN NUMBER) AS
BEGIN
PL/SQL statements;
Fnd_file.put_line (fnd_file.output, ’message’variables);
Fnd_file.put.line (fnd_file.log, ’message’variables);
END ;

ERRBUF: Used to get the error messages in to the log file if any errors occur in side of procedure.
RETCODE: Used to get the status of Concurrent Program

The Status can be either 0 – for success
1 – for warning
2 – for error

Inside of procedure body we can use all valid PL/SQL statements except DBMS_OTUPUT.PUT_LINE Instead of this we will use fallowing to API’S (Application Programming Interface).
API is nothing but a package.
Fnd_file.put_line(fnd_file.output,’message’variables); – is write for the output file.
Fnd_file.put.line(fnd_file.log,’message’variables); – is used for log file.

Steps for Developing the Procedure:
1. Develop the procedure as per client requirement.
2. Create an executable with execution method as PL/SQL stored procedure
3. Define the Concurrent Program at as
• EXECUTION
• PARAMETER
• INCOMPATIBILITIES PROGRAM
4. Attach the Concurrent Program to the request group.
5. Attach the request group to the responsibility.
6. Attach the responsibility to user.
7. User will submit program from SRW window

Example for ErrorCode and retCode:

PROCEDURE Load_Cust_Item(ERRBUF OUT VARCHAR2,
                  RETCODE OUT VARCHAR2,
                  ARGUMENT1 IN VARCHAR2,
                  ARGUMENT2 IN VARCHAR2) IS

    L_Retcode Number;
        CONC_STATUS BOOLEAN;
BEGIN

    L_Retcode := Load_Cust_Items_Iface(argument1,
                               argument2);

    if L_Retcode = 0 then
        RETCODE := ‘Success’;
                CONC_STATUS := FND_CONCURRENT.SET_COMPLETION_STATUS(‘NORMAL’,Current_Error_Code);
    elsif L_Retcode = 1 then
        RETCODE := ‘Warning’;
                CONC_STATUS := FND_CONCURRENT.SET_COMPLETION_STATUS(‘WARNING’,Current_Error_Code);
    elsif L_Retcode = 2 then
        RETCODE := ‘Error’;
                CONC_STATUS := FND_CONCURRENT.SET_COMPLETION_STATUS(‘ERROR’,Current_Error_Code);
    end if;

END Load_Cust_Item;

Functional Training  of Purchase Order Flow
What is flow of PO:

Step 1:We will be raising the Requisitions for the items which are needed.
Requisition is 2 types • Internal Requisition • Purchase
Internal Requisition is used when we are getting the items from one organization to another organization of the same business group.
Purchase Requisition is raised when we are getting the items from outside the business group.

Step 2:Once the Requisition has been approved, we will be sending (Request For Quotes) RFQ’s to different Suppliers. It contains the information regarding the type of RFQ, terms and conditions, shipments, currency.
RFQ is of 3 types
• Bid RFQ • Catalog • Standard
BID: Used for a fixed specific quantity, Location and date. This will be used for large or expensive price of equipments. That you have never order before. There won’t be price any breaks for a BID Quotation.
CATALOG: This will be used for high volume items for which your supplier sends information regularly. The CATALOG RFQ includes price breaks at different quantity levels.
STANDARD: It is used for items we need only once or not very often for a specific fixed quantity, location and date. It includes price breaks at different quantity levels.

Step 3:We will be receiving the quotations from different suppliers. Quotation is of 3 Types.
• Bid
• Catalog
• Standard

Step 4:Based on the quotations, we will be deciding the supplier and purchasing order is given to that supplier.
Purchasing is of 4 types
• Standard
• Planned
• Blanket
• Contract

Step 5:Once we receive the items from the Supplier we will issue the receipts to the Supplier. This is done in 3 ways.
• Two-Way: In 2-way we will compare PO and Invoice.• Three-Way: In 3-way we will compare the PO, Receipt and Invoice.• Four-Way: In 4-way we will compare PO, Receipt, Inspection and Invoice.

2-Way Matching verifies that Purchase order and invoice information match within your tolerances as follows:Quantity Billed <-Quantity Ordered Invoice Price <- Purchase Order Price (<- Sign is used because of tolerances)

3-Way Matching verifies that the receipt and invoice information match with the quantity tolerances defined:Quantity billed Quantity received

4-Way Matching verifies that acceptance documents and invoice information match within the quantity tolerances defined:Quantity billed <- Quantity accepted. (Acceptance is done at the time of Inspecting goods).Whether a PO shipment has 2-way, 3-way or 4-way matching can be setup in the Shipment Details zone of the Enter PO form (character).

RECEIPT REQUIRED INSPECTION REQUIRED MATCHING
Yes Yes 4-Way
Yes No 3-Way
No No 2-Way
In ‘More’ alternative region of Shipments block, you define the Invoice Matching option, where you can choose 2-way, 3-way or 4-way match.

Step 6:Because of these Transactions Inventory and Payables get affected.

Training  of Account Payables -> Account Payables Flow:
PO -> Receipt -> AP -> GL

Invoice ->; Payments->; Move Transactions from AP to GLIn AP there are 2 Thumb rules.

• Without supplier there is no invoice.
• Without invoice there is no payment.

How many types of Invoices and What are Invoice Types:
1. Standard: We will make all the payments based on the standard invoice. It will have the information of Invoice Number, Invoice Date, Invoice Amount, and Currency.
2. Credit Memo: We will create credit memo invoice whenever supplier is giving the discount and it will be adjusted in standard invoice. It is always negative amount.
3. Debit Memo: Sometimes Company will deduct some amount from the invoice amount. This will be adjusted in standard invoice. It is always negative amount.
4. With-Holding TAX: This type of invoice will be created to make the invoice tax to the Govt. on behalf of supplier.
5. Pre-Payment: If we want to make some payments to the supplier in advance then we create the Pre-Payment invoice.
6. PO Default: If we want to make the invoice as per the PO then we create PO default. We will give Po Number. System will pick up the complete PO information.
7. Mixed: Includes both positive and negative amount. We can match this invoice with PO’s and other invoices.
8. Expense Report: This will be applicable for the employees who are working in the Company where payables and internet expense and project account. Expense will be included.
9. Recurring invoice: We can enter invoice for periodic expense for which we may not receive. Invoice from supplier. To create a Recurring invoice first we will take template.
As per that we will create the invoice.Once the invoice is successfully completed, we can go for payments. It is of 3 types.

Manual Payment: Here we will be mentioning the Invoice Number, Bank Account, and Document Number, Payment Date and Currency.

Refund payment: This is used for Employee expenses and for adjusting the Supplier account,

Quick payment: In this payment, system will automatically generate checks. To print Checks there will be a concurrent program for each check format.Once the payment was done, we will move all the transactions to GL.

Wo is Suppliers:
Set up suppliers in the Suppliers window to record information about individuals and companies from whom you purchase goods and services. You can also enter employees whom you reimburse for expense reports. When you enter a supplier that does business from multiple locations, you store supplier information only once, and enter supplier sites for each location. You can designate supplier sites as pay sites, purchasing sites, RFQ only sites, or procurement card sites. For example, for a single supplier, you can buy from several different sites and send payments to several different sites. Most supplier information automatically defaults to all supplier sites to facilitate supplier site entry. However, you can override these defaults and have unique information for each site. The system uses information you enter for suppliers and supplier sites to enter default values when you later enter transactions for a supplier site. Most information you enter in the Suppliers window is used only to enter defaults in the Supplier Sites window. When the system enters that information in a later transaction, it only uses supplier site information as a default, even if the supplier site value is null and the supplier has a value. If you update information at the supplier level, existing supplier sites are not updated. When you enter a supplier, you can also record information for your own reference, such as names of contacts or the customer number your supplier has assigned to you.

What is Invoices:
Invoice Type (LOV): The type of invoice. Standard and Credit are the only invoice types you can enter in this window. If you do not enter a value for this field then a value will be assigned during import based on the amount of the invoice.

Standard: A trade invoice you receive from a supplier. The amount of a Standard invoice must be zero or greater.

Credit: Credit Memo. A negative amount invoice you receive from a supplier representing a credit for goods or services purchased. Note that in the Invoice Gateway you can match a credit memo to a purchase order to perform a price correction, but you cannot match a credit memo to an invoice. If you want to match to an invoice, then use the Invoice Workbench.

Debit Memo: Negative amount invoice created by you and sent to a supplier to notify the supplier of a credit you are recording. Usually send with a note explaining the debit memo. Purchase Order Matched Invoices: You can match Payables invoices to purchase orders to ensure that you pay only for the goods that you have ordered, or you can match to purchase order receipts to ensure that you pay only for goods that you have received. Purchase order matched invoices are invoices that you match to any of the following:
• Purchase order shipments
• Purchase order receipts
• Purchase order receipt lines
• Purchase order distributions

Foreign Currency Invoices: When you enter an invoice in a currency other than your functional currency, Payables uses an exchange rate to convert the invoice and invoice distributions into your functional currency for creating journal entries. You define your functional currency during setup for your set of books.
Mixed Invoices: Mixed Invoices are invoices or credit/debit memos for which you can perform both positive and negative matching to purchase orders and to other invoices. For example, you can enter an invoice for –$100 with Invoice Type Mixed. You can match to an invoice for $–200, and match to a purchase order for $100.

Prepayments:A prepayment is a type of invoice you enter to make an advance payment to a supplier or employee. For example, you need to pay a deposit on a lease, or pay an employee an advance for travel expenses. You can later apply the prepayment to one or more invoices or expense reports you receive from the supplier or employee to offset the amount paid to them. The supplier might send an invoice that references a prepayment. The supplier has reduced the invoice amount by the amount of the prepayment and associated tax. You can use the Prepayment on Invoice feature to enter the invoice.
You can enter two types of prepayments:
Temporary prepayments can be applied to invoices or expense reports you receive. For example, you use a Temporary prepayment to pay a hotel a catering deposit. When the hotel’s invoice arrives, apply the prepayment to the invoice to reduce the invoice amount you pay.
Permanent prepayments cannot be applied to invoices. For example you use a Permanent prepayment to pay a lease deposit for which you do not expect to be invoiced.

What are types of Matching? 

2–way matching: The process of verifying that purchase order and invoice information matches within accepted tolerance levels.
Payables use the following criteria to verify two–way matching:

Invoice price <= Order price
Quantity billed <= Quantity ordered

3–way matching: The process of verifying that purchase order, invoice, and receiving information matches within accepted tolerance levels. Payables use the following criteria to verify three–way matching:

Invoice price <= Purchase Order price
Quantity billed <= Quantity ordered
Quantity billed <= Quantity received

4–way matching: The process of verifying that purchase order, invoice, and receiving information matches within accepted tolerance levels. Payables use the following criteria to verify four–way matching:

Invoice price <= Order price
Quantity billed <= Quantity ordered
Quantity billed <= Quantity received
Quantity billed <= Quantity accepted

What is FOB (Free On Board): The point or location where the ownership title of goods is transferred from the seller to the buyer. This indicates that delivery of a shipment will be made on board or into a carrier by the shipper without charge, and is usually followed by a shipping point or destination (e.g. ’FOB Our warehouse in New York’). The FOB code is currently available only for reference purposes. Revenue and cost recognition is not currently determined by the value entered in this field. (Receivables Lookup)

What is Purge : An Oracle Receivables Process, where you identify a group of records for Receivables to delete from the database. Receivables purge each record and its related records. Receivables maintain summary data for each record it purges.