P2P Interview Preparation -‐ by Dinesh Kumar S Contents: • • • • • • • • • • • • R12 -‐ Multi Org Setup Oracle R12 – P2P Setup P2P Table Hits SQL Loader & External Tables FND Load UNIX Commands Report 6i Form Personalization FND API’s Oracle Workflow Builder Advance PL/SQL Oracle Interfaces Overview P2P Interview Preparation -‐ by Dinesh Kumar S R12 - Multi Org Setup Sno. 1 2 3 4 5 6 7 8 9 10 Setup Description Menu Creation Create Responsibility Create User Create Currency Create Calendar Create Accounting Flexfield Create Valuesets Key Flexfield Segment Values Profile: HR: HR:User Type Create Workday Calendar 11 12 Create Locations Create Business Group 13 Create Legal Entity 14 Create Operating Unit Navigation Sys Admin à Application à Menu SYS ADMIN à Security à Responsibility à Define SYS ADMIN à Security à User à Define GLà Setup à Currencies à Define GL à Setup à Financials à Calendars à Types GL à Setup à Financials à Flexfields à Key à Segments GL à Setup à Flexfields à Validation à Sets GL à Setup à Financials à Flexfields à Key à Values Value: HR With Payroll User INV à Setup à Organizations à Calendars Build Calendar: Tools à Build HRMS à Work Structures à Location HRMS à Work Structures à Organization à Description Organization Classification: • Business Group o Business Group Info (Grade, People, Job, Position, Cost Allocation & Competence Flexfield) • HR Organization Using Responsibility • General Ledger o GL à Setup à Financials à Accounting Setup Manager à Accounting • Legal Entity Manager o Legal Entity Manager à Legal Entity Configurator Create Accounting Setups à Create Legal Entity (Button) • Identification Information • Legal Address Create Accounting setup: Assign Legal Entity Define Accounting Options: Primary Ledger (Section) à Ledger Options (Update) • Standard Information (Ledger Short name) • Accounting Calendar (First Calendar Period Open) • Sub ledger Accounting (Assign SLAM) Update Ledger: Ledger Options • Year end Processing (Retained Earnings Account) • Journal Processing (Optional) Update Ledger: Advance Options • Journal Reconciliation (Optional) • Budgetary control (Optional) • Average Balance (Optional) • HRMS Responsibility HRMS à Work Structures à Organization à Description P2P Interview Preparation -‐ by Dinesh Kumar S • • 15 Create Security Profile • • • • • GL Super User Responsibility – Accounting Setup Manager Accounting options à Primary Ledger (Section) à Operating Units (Update) o Click “Add Operating Unit”. o Map it to Business Group and Legal Entity Context. Complete the Ledger Setup. HRMS Responsibility HRMS à Security à Profile o Name o Business Group Organization Security Security Type: Secure Organizations by organization hierarchy and/or organization list Include the Operating units in the list. Run Program “Security List Maintenance” Parameters: o Generate List for: One Named Security Profile o Security Profile: <<Profile created above>> Profile Setup: @ Responsibility Level o MO: Security Profile à <<>Sec_Profile> o MO: Default Operating Unit à <<Set default OU from Sec Profile defined>> o MO: Operating Unit à <<>OU from Sec Profile> Run “Replicate Seed Data” for each operating unit. 16 17 Create Inventory Master Organization (IMO) Open Inventory Accounting Period HRMS Responsibility HRMS à Work Structure à Organizations à Description 1. Create IMO with user defined name / Business Std. 2. Organization Classification: Name: Inventory Organization Save it and Click “Other”. 3. Additional Information: o Accounting Information o Inventory Information o Receiving Information 4. Create Child Inventory Organization Repeat steps 2 – 3 but point child inventory organization to master organization. Inventory Responsibility INV à Accounting Close Cycle à Inventory Accounting Period P2P Interview Preparation -‐ by Dinesh Kumar S o o o 18 Enable Inventory transactions 19 Creating Sub-‐Inventory 20 Create Jobs 21 22 Create Positions Create Employees 23 Create Position Hierarchy 24 Create Oracle User & Map Employee 25 Run Fill Employee Hierarchy Select Organization. Click Change Status button and open the period. Repeat this step for all child organizations as well. INV à Transactions à Miscellaneous Transaction INV à Setup à Organizations à Subinventories Choose child organizations and create the same. HRMS Responsibility HRMS à Work Structures à Job à Description HRMS à Work Structures à Position à Description HRMS à People à Enter and Maintain Assign Job & Position created in previous steps based on business requirement. HRMS à Work Structures à Position à Hierarchy Define all sub-‐ordinates starting from highest position to lowest one. SYS Admin à Security à User à Define o Create User o Map the Employee to user o Assign responsibilities to user Run this program to enable the position hierarchy defined for each OU separately. P2P Interview Preparation -‐ by Dinesh Kumar S Oracle R12 – P2P Setup Sno. Description Purchasing Setups Navigation 1 2 Buyer Setup Financial Option Setup 3 Purchasing Options 4 5 6 Document Type Setup Approval Group Creation Approval Assignment Creation PO à Setup à Personal à buyer PO à Setup à Organizations à Financial Options Accounting Tab: • Liability , prepayment & Discount Taken Accounts Supplier Purchasing Tab: • Inventory Organization Encumbrance Tab (optional) Tax Tab (Optional) Human Resource Tab: • Use Approval Hierarchies (if Position based) PO à Setup à Organizations à Purchasing Options Document Control: • Enforce Full Lot Quantity (Advisory) • Receipt Close Point (Accepted) • Cancel Requisition (Always) • Output Format (PDF) Document Defaults: • Requisition Import Group by (Vendors) • Line Type (Goods) Receipt Accounting: • Accrue Expense Items (Period end) • Accrue Inventory Items (At Receipt) • Automatic Offset method (none) Document Numbering: RFQ , Quotation, PO, Requisition PO à Setup à Purchasing à Document Types PO à Setup à Approvals à Approval Group PO à Setup à Approvals à Approval Assignments 7 Inventory Item Creation 8 Item Cross References (Optional) Payables Setups 9 Supplier Creation Inventory Setups INV à Items à Master Items • Choose Organization • Tools Menu à Copy From (Template: Purchased Item) • Assign it to Child Organizations INV à Items à Cross References • Profile: PO: item Cross Reference Warning • Purchasing Options à Display Disposition Messages AP à Suppliers à Entry • Create Supplier Quick Update Window: • Address Book • Manage Sites (Communication, Identification) • Contact Directory P2P Interview Preparation -‐ by Dinesh Kumar S • • 10 11 12 13 Financial Options Payables System Setup Payables Options Aging Periods 14 15 Bank & Bank Branches Bank Setup 16 Bank Branch Setup 17 Bank Account Setup User Management Setups Cash Management Setups Tax Details (Rounding Rule, Tax Registrations) Organizations (D.U.N.S Number, Tax Payer ID) Terms & Control: o Accounting: Liability Account o Purchasing: Ship-‐to & Bill-‐to Location o Receiving: Enforce Ship-‐to, Receipt Routing, Matching Approval Level o Payment: Payment Method o Invoice Management: § Invoice Currency § Invoice Matching Option o Invoice Payment Terms: § Payment Currency § Terms, Pay Date Basis & Term Date basis § Pay Group AP à Setup à Options à Financial Options AP à Setup à Options à Payables System Setup AP à Setup à Options à Payables Options AP à Setup à Calendar à Aging Period AP à Setup à Payment à bank and Bank Branches Bank (Hyperlink) à Create o Bank Information o Bank Address o Bank Contacts Bank Branches (Hyperlink) o Bank Branch Information o Branch address o Branch Contact AP à Setup à Payment à Bank Account Create Bank Account § Country, Bank Name, Branch Name Create bank Account: Account Owner & Use: § Bank Account Owner Note** Sometimes the Owner LOV with no values displayed to resolve the issue do the below setups o Log in as “SYSADMIN” o Click “User Management” Responsibility. o Go to “Roles & Role Inheritance” Create a Role: o Category: Miscellaneous o Role Code, Display Name & Description (user choice) o Application: Payables o Active From: <Date> Run Security Wizard: o Query the Role à Click “Update” o Click “Security Wizard” button o Run: CE UMX Security Wizard o Add the legal Entity § Enable All check boxes (Use, Maintenance, Bank Account Transfer) P2P Interview Preparation -‐ by Dinesh Kumar S 18 Supplier Bank Setup 19 20 21 Bank Charges Invoice Validation Payment Document Setup § Save & Apply Assign Role to the user. Continue … (step 17) Create Bank Account: Owner and Use § Bank Account Owner § Account Use (Payables) o Account Information § Account Name, Description & Short Name o Account Controls § Cash a/c, Cash Clearing a/c, Bank Charges & Bank Errors a/c Create Bank Account: Account Access § Add Organization Access (select OU) Create Bank Account: Account Access Options Account Contact In Quick Updates Window, o Query for Supplier Site o Select “Banking Details” o Click “Create” o Select Existing Bank & Apply. AP à Setup à Payment à Bank Charge Calculation AP à Setup à Options à Allow Online Validation (Checkbox) AP à Setup à Payment à Bank Accounts o Select Account Name. o Click “Manage Payment Documents” o Click “Create” § Name § Paper Stock type (Blank Stock) § Format (Standard Check Format) § First Available Document Number P2P Interview Preparation -‐ by Dinesh Kumar S RFQ & Quotations: RFQ Type Catalog Description Standard Bid § § § § § § § § Quotation Type Used for high Volume Items. Catalog Supplier sends information regularly. It includes Price Break. Items you will order only once or not very often. Standard It includes Price Break at different quantity levels. Used for item with specific Quantity, Location Bid and date. Used to procure large or expensive equipment. No Price Breaks. PO Type Blanket Purchase Agreement (BPA) à Blanket Release Blanket Purchase Agreement (BPA) à Blanket Release Planned PO / Standard PO Matching Types: Matching Type Requisition PO Receipts Inspection Invoice 2 Way Yes Yes -‐-‐ -‐-‐ Yes 3 Way Yes Yes Yes -‐-‐ Yes 4 Way Yes Yes Yes Yes Yes Payments Yes Yes Yes Calendar Periods: Calendar Type PO INV AP GL Navigation PO à Setup à Financial Accountings à Control Purchasing Periods INV à Accounting Close Cycle à Inventory Accounting Periods AP à Accounting à Control Payable Periods GL à Setup à Open / Close Invoice Processing: Create Invoice à Match Invoice à Validate Invoice à Payment Payment Actions: Create Accounting: Mode Draft Description § It will create journal entries which are not final. § They are not ready to transfer to GL. Table Hits XLA_AE_HEADERS § Accounting_Entry_Status_Code = D XLA_EVENTS § Process_Status_Code = D § Event_Status_Code = U P2P Interview Preparation -‐ by Dinesh Kumar S Final § It will create journal entries which can be transferred to GL Final Post § § Create Journal Entries in final mode. Post them. XLA_AE_HEADERS § Accounting_Entry_Status_Code = F XLA_EVENTS § Process_Status_Code = P § Event_Status_Code = P XLA_AE_HEADERS § Accounting_Entry_Status_Code = F § Transfer_Status_Code = Y XLA_EVENTS § Process_Status_Code = P § Event_Status_Code = P GL_JE_HEADERS § Status = P Accrual Reconciliation: Accumulation of expenses that is recognized before cash is paid. Setups Expense AP Accrual Navigation PO à Setup à Organizations à Purchasing Options o Accrue Expense Items : Period End o Accrue Inventory Items: At Receipt Table: PO_SYSTEM_PARAMETERS_ALL INV à Setup à Organizations à Parameters o Other Accounts Tab – Receiving Option – Inventory AP Accrual Table: MTL_PARAMETERS PO à Accounting à Accrual Write Off à Select Accrual Accounts Inventory AP Accrual Declare Accrual Accounts Accrual Reconciliation Flow: Create Accounting Transfer Journal Entries to GL Accrual Reconciliation Load Run AP and PO Accrual Reconciliation Report § § § § § § Miscellaneous Accrual Reconciliation Report § Summary Accrual Reconciliation Report § Purchasing Accrual Event Transfer Data from Sub ledgers à SLA Create Journals in SLA Transfer entries from SLA à GL Posting can also be done. Populates Accrual Reconciliation tables. Shows transactions based on each accrual account for, o PO Distribution o Receiving Transaction o Invoice Transactions amount with net balance Shows transactions based on each accrual account for, o Miscellaneous Inventory Transactions o AP Transactions Shows total balances for each accrual account. Table Hits P2P Interview Preparation -‐ by Dinesh Kumar S Process Receive Purchase Order Receiving Transaction Create Accounting Transfer Journal Entries to GL Rcv_Transactions RCV_Receiving_Sub_Ledger Xla_Ae_Headers Xla_Ae_Links Xla_Distribution_links GL_Je_Headers Gl_Je_Lines Gl_Import_References • • • • • • • • Inventory Accrual Process Event Table Hits Inventory Miscellaneous Transactions Consignment Transacrtions Cost Manager • Mtl_Transaction_accounts Create Accounting – Cost Management Transfer Journal Entries to GL • • • • • • Xla_Ae_Headers Xla_Ae_Links Xla_Distribution_links GL_Je_Headers Gl_Je_Lines Gl_Import_References Payables Accrual Process Event Create Invoice Invoice Creation • Create Accounting Transfer Journal Entries to GL • • • • • • Period End Activity: Suggested order for closing oracle modules: 1. 2. 3. 4. 5. 6. 7. 8. 9. Order Management Cash Management Payables Receivables Purchasing Inventory Projects Assets General Ledger Procure-‐2-‐Pay order: 1) Payables Table Hits AP_Invoice_Distributions_all Xla_Ae_Headers Xla_Ae_Links Xla_Distribution_links GL_Je_Headers Gl_Je_Lines Gl_Import_References P2P Interview Preparation -‐ by Dinesh Kumar S 2) 3) 4) Purchasing Inventory General Ledger Payables: SNo. Activity Details 1 Complete all transactions • 2 Approve Invoice & Complete Payments 3 Invoice Hold Report • • • 4 Journal Entries Report • 5 Unaccounted Transaction Report • 6 Payment Instruction Register • 7 Reconcile Payments to bank Statement Activity • • • 8 9 Create Accounting Optional Reports 10 Unposted Invoice and Payment Sweep Program • • • • • Invoice & Credits, Prepayments, Expense Report, invoice Imports & Payments. To approve all “un-‐Approved ” invoice run program “Payables Approval”. Lists holds applied to invoices for which journal entries and posting cannot be created. It produces details or summary listing of accounting information that have been accounted with error and entries that cannot be transfer to GL. Lists of all payment transactions with reasons, for which payables cannot account for transaction. Actual payments are compared against this register to verify oracle payables have recorded payment correctly. Bank Statement Import Auto Reconciliation Program (or) Bank Statement Import & AutoReconciliation Creating accounting entries Posted Invoice Register Posted Payment Register It transfers unaccounted transactions from one accounting period to another. This program will not forward accounted transactions with errors. Purchasing: SNo. Activity Details 1 2 Complete all transactions Uninvoiced Receipts Report • • 3 Receipt Accrual -‐ Period End • 4 Reconcile Accrual Accounts • Complete Requisition, PO & Releases and Receipts To review receipts for which supplier invoice not available for the same. It creates Period end accruals for uninvoiced receipts for expense distribution. Run Reconciliation reports. P2P Interview Preparation -‐ by Dinesh Kumar S P2P Accounting Entries: Purchasing Module: Transaction Create Requisition Create PO Receipts Inventory Items Expense Items Return to Vendor Inventory Items Expense Items Period End @ Period End Close @Next Period Open Debit Credit -‐-‐ -‐-‐ -‐-‐ -‐-‐ Receiving Inspection A/C Receiving Inspection A/C Inventory AP Accrual A/C Expense AP Accrual A/C PO Charge A/C Expense AP Accrual A/C Inventory AP Accrual A/C Expense AP Accrual A/C Receiving Inspection A/C Receiving Inspection A/C Expense AP Accrual A/C PO Charge A/C Debit Credit Payables Module: Transaction Create Std. Invoice Inventory Items Expense Items Payment of Invoice Payment for Std. Invoice Inventory AP Accrual A/C Liability A/C Expense AP Accrual A/C Liability A/C Liability A/C Cash Clearing A/C (or) Cash / Bank A/C Credit / Debit Memo Refund through Credit Memo Liability A/C AP Accrual A/C. Prepayments Create Prepayment Invoice Expense A/C Liability A/C Apply Prepayment Liability A/C Prepayment A/C Inventory Module: Transaction Debit Credit Delivery of Items (Std. Cost) Delivery of Inventory Items Material / Inventory A/c Receiving Inspection A/c Delivery of Expense Items PO Distribution Charge A/c Receiving Inspection A/c Purchase Return Inventory AP Accrual A/c Inventory A/c P2P Interview Preparation -‐ by Dinesh Kumar S P2P Table Hits Requisition Requisition Headers: PO Requisition Headers à PO_Requisition_Lines_All à PO_Req_Distributions_All à PO_Vendor_Sites_All à RCV_Transactions à PA_Tasks Requisition Lines: PO_Requisition_Lines_All à PO_Req_Distributions_All à MTL_Categories_B à PO_Vendors à RCV_Shipment_Lines PO_Req_Distributions_All à GL_Code_Combinations à PA_Projects_All à PA_Expenditure_Types PO_Headers_All à PO_Lines_All à PO_Releases_All à PO_Vendors Requisition Distributions: Purchase Order PO Headers: à PO_Line_Locations_All à PO_Vendor_Sites_All à HR_Locations_All à PO_Agents à RCV_Transactions à PO_Action_History à PO_Headers_Archive_All à AP_Invoices_All à RCV_Shipment_Lines à PO_Distributions_All P2P Interview Preparation -‐ by Dinesh Kumar S PO Lines: PO_Lines_All à PO_Line_Locations_All à PO_Line_Types_B à MTL_Categories_B à PO_Lines_Archive_All à RCV_Transactions à PO_Distributions_All à PO_Releases_All à PO_Distributions_All à RCV_Shipment_Lines PO Shipments: PO_Line_Locations_All à RCV_Routing_Headers à HR_Locations_All à PO_Line_Locations_Archive_All à RCV_Accounting_Events à RCV_Transactions à AP_Holds_All à AP_Invoice_Lines_All PO_Distributions_All à HR_Locations_All à PO_Distributions_Archive_All à PO_Req_Distributions_All à GL_Code_Combinations à PA_Projects_All à AP_Invoice_Distributions_All à Cst_Ap_Po_Reconciliation à Cst_Misc_Reconsiliation à PO Distributions: à RCV_Transactions à à PA_Tasks RCV_Shipment_Lines RCV_Shipment_Lines P2P Interview Preparation -‐ by Dinesh Kumar S Receiving RCV_Transactions à RCV_Shipment_Headers à RCV_Shipment_Lines à RCV_Routing_Headers à PO_Requisition_Lines_All à PO_Req_Distributions_All à PO_Lines_All à PO_Line_Locations_All à PO_Vendors à PO_Vendor_Sites_All à AP_Invoice_Distributions_All à PO_Distributions_All Payable Invoice Invoice Distribution: AP_Invoice_Distributions_All à PO_Distributions_All à RCV_Transactions à GL_Code_Combinations à PA_Projects_All à PA_Expenditure_Types -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ à AP_Invoices_All à à AP_Accounting_Events_All à AP_Invoices_All à AP_Invoice_Payments_All à AP_Trial_Balance AP_Invoices_All à PO_Headers_All à PO_Vendors à GL_Code_Combinations à PA_Projects_All à PA_Expenditure_Types à AP_Payment_Schedules_All à PA_Tasks AP_Invoice_Lines_All Invoice Details: à PO_Vendor_Sites_All à PA_Tasks P2P Interview Preparation -‐ by Dinesh Kumar S à AP_Invoice_Payments_All à AP_Invoice_Payments_All à AP_Bank_Accounts_All à AP_Invoice_Distributions_All à AP_Invoices_All Payables Payment Information AP_Payment_Schedules_All AP_Invoice_Payments_All à AP_Supplier_Sites_All à AP_Checks_All à AP_Accounting_Events_All à AP_Payment_Schedules_All à AP_Check_Formats à AP_Invoice_Payments_All à AP_Payment_History_All à AP_Bank_Accounts_All à PO_Vendors AP_Accounting_Events_All à AP_Ae_Headers_All AP_Checks_All à PO_Vendor_Sites_All Accounting Events: à Bank Information: AP_Bank_Accounts_All à GL_Code_Combinations à AP_Bank_Branches à AP_Bank_Account_Uses_All à AP_Checks_All AP_Bank_Branches à AP_Bank_Accounts_All à AP_Bank_Charges AP_Ae_Lines_All P2P Interview Preparation -‐ by Dinesh Kumar S à AP_Bank_Transmissions à AP_Bank_Accounts_All à PO_Vendors AP_Bank_Account_Uses_All à PO_Vendor_Sites_All AP_SUPPLIERS: • • • • • This table replaces the old PO_VENDORS table. It stores information about your supplier level attributes. Each row includes the purchasing, receiving, invoice, tax, classification, and general information. Oracle Purchasing uses this information to determine active suppliers. The supplier name, legal identifiers of the supplier will be stored in TCA and a reference to the party created in TCA will be stored in AP_SUPPLIERS.PARTY_ID, to link the party record in TCA. AP_SUPPLIER_SITES_ALL: • • • • • This table replaces the old PO_VENDOR_SITES_ALL table. It stores information about your supplier site level attributes. There is a row for unique combination of supplier address, operating unit and the business relationship that you have with the supplier. The supplier address information is not maintained in this table and is maintained in TCA. The reference to the internal identifier of address in TCA will be stored in AP_SUPPLIER_SITES_ALL.LOCATION_ID, to link the address record in TCA. Each row includes the supplier reference, purchasing, invoice, and general information. AP_INVOICES_ALL: • • • It contains records for invoices you enter. There is one row for each invoice you enter. An invoice can have one or more invoice distribution lines and can have one or more scheduled payments. AP_INVOICE_LINES_ALL: • • • • It contains records for invoice lines entered manually, generated automatically or imported from the Open Interface. An invoice can have one or more invoice lines. An invoice line represents goods (direct or indirect materials), service(s), and/or associated tax/freight/miscellaneous charges invoiced from a supplier. An invoice line should contain all the attributes that are present on the physical or electronic invoice presented by the supplier. P2P Interview Preparation -‐ by Dinesh Kumar S AP_INVOICE_DISTRIBUTIONS_ALL: • • • It holds the distribution information that is manually entered or system-‐generated. There is one row for each invoice distribution and a distribution must be associated with an invoice. An invoice can have multiple distributions. AP_INVOICE_PAYMENTS_ALL: • • • • It contains records of invoice payments that you made to suppliers. There is one row for each payment you make for each invoice and there is one payment and one invoice for each payment in this table. Oracle Payables application updates this table when you confirm an automatic payment batch, enter a manual payment, or process a Quick payment. When you void a payment, your Oracle Payables inserts an additional payment line that is the negative of the original payment line. AP_PAYMENT_SCHEDULES_ALL: • This table stores information about scheduled payment information on invoices. AP_PAYMENT_HISTORY_ALL: • • • • It stores the clearing/unclearing history for payments. It also stores the maturity history for future dated payments. The table contains a row for each future dated payment, once the future dated payment matures, i.e. becomes negotiable. Any time a payment is cleared or uncleared, a row is inserted into this table for the payment. AP_BATCHES_ALL: • • • • It contains summary information about invoices you enter in batches if you enable the Batch Control Payables option. There is one row for each batch of invoices you enter. If you enable Batch Control, each invoice must correspond to a record in this table. Your Oracle Payables application uses this information to group together invoices that one person entered in a batch. AP_CHECKS_ALL: • • • • It stores information about payments issued to suppliers or refunds received from suppliers. There is one row for each payment you issue to a supplier or refund received from a supplier. Oracle Payables application uses this information to record payments you make to suppliers or refunds you receive from suppliers. Oracle Payables application stores the supplier name and bank account name for auditing purposes, in case either one is changed after you create the payment. Oracle Payables application also stores address information for all payments. AP_HOLDS_ALL: • • • • It contains information about holds that you or your Oracle Payables application place on an invoice. For non-‐matching holds, there is one row for each hold placed on an invoice. For matching holds, there is one row for each hold placed on an invoice-‐shipment match. An invoice may have one or more corresponding rows in this table. Your Oracle Payables application does not pay invoices that have one or more unreleased holds recorded in this table. AP_BANK_ACCOUNTS_ALL: P2P Interview Preparation -‐ by Dinesh Kumar S • • It contains information about your bank accounts. There is one row for each bank account you define and each bank account must be affiliated with one bank branch. AP_BANK_ACCOUNT_USES_ALL: • It stores information for the internal and external bank accounts you define in Oracle Payables and Oracle Receivables applications. AP_CARDS_ALL: • It stores information about the corporate credit cards issued to your employees by your corporate credit card providers. AP_TRIAL_BALANCE: • It contains demoralized information about invoices and payments posted to the accrual set of books. Subledger Accounting: XLA_Events à XLA_Event_Classes_B à XLA_Event_Mappings_B à XLS_Event_Sources à XLA_Event_Types_B XLA_Ae_Headers à XLA_Ae_Lines à XLA_Trial_Balances à GL_Je_Batches à GL_Je_Headers à GL_Je_Lines à AP_Invoice_Transmissions à AP_Check_Transmissions GL_Je_Lines à GL_Ledgers à GL_Code_Combinations GL Journal Entries: GL_Import_References GL_Je_Headers à Inventory: GL_Je_Lines P2P Interview Preparation -‐ by Dinesh Kumar S Table MTL_PARAMETERS MTL_SYSTEM_ITEMS_B MTL_ITEM_STATUS MTL_UNITS_OF_MEASURE_TL MTL_ITEM_LOCATIONS MTL_ITEM_CATEGORIES MTL_CATEGORIES_B MTL_CATEGORY_SETS_B MTL_DEMAND MTL_SECONDARY_INVENTORIES Description It maintains a set of default options like general ledger accounts; locator, lot, and serial controls, inter-‐organization options, costing method, etc. for each organization defined in Oracle Inventory. Each organization’s item master organization (MASTER_ORGANIZATION_ID) and costing organization (COST_ORGANIZATION_ID) are maintained here. This is the definition table for items. This table holds the definitions for inventory items, engineering items, and purchasing items. The primary key for an item is the INVENTORY_ITEM_ID and ORGANIZATION_ID. Therefore, the same item can be defined in more than one organization. Items now support multilingual description. MLS is implemented with a pair of tables: MTL_SYSTEM_ITEMS_B and MTL_SYSTEM_ITEMS_TL. Translations table (MTL_SYSTEM_ITEMS_TL) holds item Description and Long Description in multiple languages. This is the definition table for material status codes. Status code is a required item attribute. It indicates the status of an item, i.e., Active, Pending, Obsolete. This is the definition table for both the 25-‐character and the 3-‐character units of measure. The base_uom_flag indicates if the unit of measure is the primary unit of measure for the uom_class. Oracle Inventory uses this table to keep track of the units of measure used to transact an item. This is the definition table for stock locators. The associated attributes describe which subinventory this locator belongs to, what the locator physical capacity is, etc. This table stores inventory item assignments to categories within a category set. For each category assignment, this table stores the item, the category set, and the category. Items always may be assigned to multiple category sets. However, depending on the Multiple Assignments Allowed attribute value in a given category set definition, an item can be assigned to either many or only one category in that category set. This is the code combinations table for item categories. Items are grouped into categories within the context of a category set to provide flexible grouping schemes. Item categories now support multilingual category description. MLS is implemented with a pair of tables: MTL_CATEGORIES_B and MTL_CATEGORIES_TL. MTL_CATEGORIES_TL table holds translated Description for Categories. It contains the entity definition for category sets. A category set is a categorization scheme for a group of items. Items may be assigned to different categories in different category sets to represent the different groupings of items used for different purposes. An item may be assigned to only one category within a category set, however. STRUCTURE_ID identifies the flexfield structure associated with the category set. Category Sets now support multilingual category set name and description. MLS is implemented with a pair of tables: MTL_CATEGORY_SETS_B and MTL_CATEGORY_SETS_TL. MTL_CATEGORY_SETS_TL table holds translated Name and Description for Category Sets. This table stores demand and reservation information used in Available To Promise, Planning and other Manufacturing functions. There are three major row types stored in the table: Summary Demand rows, Open Demand Rows, and Reservation Rows. This is the definition table for the subinventory. A subinventory is a section of inventory, i.e., raw material, finished goods, etc. Subinventories are assigned to items (in a many to one relationship), indicating a list of P2P Interview Preparation -‐ by Dinesh Kumar S MTL_ONHAND_QUANTITIES MTL_TRANSACTION_TYPES MTL_MATERIAL_TRANSACTIONS MTL_ITEM_ATTRIBUTES MTL_ITEM_CATALOG_GROUPS_B MTL_ITEM_REVISIONS_B MTL_ITEM_TEMPLATES_B MTL_DESCRIPTIVE_ELEMENTS MTL_DESCR_ELEMENT_VALUES ORG_ACCT_PERIODS MTL_CUSTOMER_ITEMS MTL_SYSTEM_ITEMS_INTERFACE MTL_TRANSACTIONS_INTERFACE MTL_ITEM_REVISIONS_INTERFACE MTL_ITEM_CATEGORIES_INTERFACE valid places where this item will physically exist in inventory. It stores quantity on hand information by control level and location. It is maintained as a stack of receipt records, which are consumed by issue transactions in FIFO order. The quantity on hand of an item at any particular control level and location can be found by summing TRANSACTION_QUANTITY for all records that match the criteria. It contains seeded transaction types and the user defined ones. USER_DEFINED_FLAG will distinguish the two. The table also stores the TRANSACTION_ACTION_ID and TRANSACTION_SOURCE_TYPE_ID that is associated with each transaction type. This table stores a record of every material transaction or cost update performed in Inventory. Records are inserted into this table either through the transaction processor or by the standard cost update program. The columns TRANSACTION_TYPE_ID, TRANSACTION_ACTION_ID, TRANSACTION_SOURCE_TYPE_ID, TRANSACTION_SOURCE_ID and TRANSACTION_SOURCE_NAME describe what the transaction is and against what entity it was performed. This table stores information on item attributes. Each row in the table corresponds to an attribute. The table stores the attribute name, the corresponding user-‐friendly name seen by the users, and the kind of validation enforced on the attribute. This is the code combinations table for item catalog groups. An item catalog group consists of items that can be described by the same set of descriptive elements or item properties. When an item is associated with an item catalog group, the item inherits the descriptive elements for that group which then behave like additional item attributes. It stores revision levels for an inventory item. When an item is defined a starting revision record is written out to this table, so every item will at least have one starting revision. This is the definition table for item templates. It contains the user-‐defined name (TEMPLATE_NAME) and description (DESCRIPTION) ONLY for backward compatibility. You can use a template to set certain item attributes. It stores the descriptive element definitions for an item catalog group. Descriptive elements are defining properties used to describe in the catalog group. It stores the descriptive element values for a specific item. When an item is associated with a particular item catalog group, one row per descriptive element (for that catalog group) is inserted into this table. It holds the open and closed financial periods for organizations. It stores customer item information for a specific customer. Each record can be defined at one of the following levels: Customer, Address Category, and Address. The customer item definition is organization independent. It temporarily stores the definitions for inventory items, engineering items and purchasing items before loading this information into Oracle Inventory. It allows calling applications to post material transactions (movements, issues, receipts etc. to Oracle Inventory transaction module. It temporarily stores revision levels for an inventory item before loading this information into Oracle Inventory. This table temporarily stores data about inventory item assignments to category sets and categories before loading this information into Oracle Inventory. P2P Interview Preparation -‐ by Dinesh Kumar S MTL_DESC_ELEM_VAL_INTERFACE This table temporarily stores descriptive element values for an item that is associated with an item catalog group before loading this information into Oracle Inventory. It is the interface point between non-‐Inventory applications and the Inventory demand module. Records inserted into this table are processed by the Demand Manager concurrent program. It stores errors that occur during the item interface process reporting where the errors occurred along with the error messages. MTL_DEMAND_INTERFACE MTL_INTERFACE_ERRORS P2P Interview Preparation -‐ by Dinesh Kumar S SQL Loader & External Tables How many ways are there to load data into interface tables? 1. 2. SQL * Loader • Conventional Path Load • Direct Path Load External Tables SQL Loader: • • • • • • Loads table across n/w. Load from multiple data files. Specify character set Selective load data. Manipulate data before loading. Use conventional / direct path. Source File Formats: There are 3 File formats available. 1. 2. 3. Fixed Record Format Variable Record Format Stream Record Format Files Generated: • • • • • Bad File: o SQL Loader Rejected records and Oracle DB rejected records will be stored. o Default file name will be same as source feed file name. Discard File: o Records not inserted into DB. o User needs to give the discard file name else file will not be created. Log File : o The log file contains a detailed summary of the load, including a description of any errors that occurred during the load. Parfile: o It specifies the name of a file that contains commonly used command-‐line parameters. Control File: o o The control file is a text file written in a language that SQL*Loader understands. The control file tells SQL*Loader where to find the data, how to parse and interpret the data, where to insert the data, and more. P2P Interview Preparation -‐ by Dinesh Kumar S Loading Objects: 1. Column Objects: o 2. When a column of a table is of some object type, the objects in that column are referred to as column objects. Row Objects: o These objects are stored in tables, known as object tables that have columns corresponding to the attributes of the object. The object tables have an additional system-‐generated column, called SYS_NC_OID$, that stores system-‐ generated unique identifiers (OIDs) for each of the objects in the table. Loading Collection Types: 1. 2. Nested Table Varray Control File Insert Modes: Append Insert Replace Truncate The append keyword denotes that these records can be inserted even if the table has other data. which allows records to enter the table only if the table is empty Delete all rows from the table before loading the new records. Delete all rows from the table before loading the new records. Control File Keywords: Load Data Inflie Badfile= ‘abc.bad’ Discardfile = ‘abc.discard’ APPEND WHEN TRAILING NULLCOLS P2P Interview Preparation -‐ by Dinesh Kumar S LOAD DATA statement tells SQL*Loader that this is the beginning of a new data load. INFILE clause specifies the name of a datafile containing data that you want to load. BADFILE clause specifies the name of a file into which rejected records are placed. DISCARDFILE clause specifies the name of a file into which discarded records are placed. APPEND clause is one of the options you can use when loading data into a table that is not empty. INTO TABLE clause enables you to identify tables, fields, and datatypes. WHEN clause specifies one or more field conditions. TRAILING NULLCOLS clause tells SQL*Loader to treat any relatively positioned columns that are not present in the record as null columns. For example some of the last columns data will not be available in feed file rather we can load them during runtime like “DATE” columns which we can load automatically by using keyword “SYSDATE”. Option Clause: BINDSIZE = n COLUMNARRAYROWS = n DIRECT = {TRUE | FALSE} ERRORS = n LOAD = n MULTITHREADING = {TRUE | FALSE} PARALLEL = {TRUE | FALSE} READSIZE = n RESUMABLE = {TRUE | FALSE} RESUMABLE_NAME = 'text string' RESUMABLE_TIMEOUT = n ROWS = n SILENT = {HEADER | FEEDBACK | ERRORS | DISCARDS | PARTITIONS | ALL} SKIP = n SKIP_INDEX_MAINTENANCE = {TRUE | FALSE} SKIP_UNUSABLE_INDEXES = {TRUE | FALSE} STREAMSIZE = n P2P Interview Preparation -‐ by Dinesh Kumar S Executing SQL * Loader from Command Line: C:\> SQLLDR Username/Password CONTROL = ‘ ’ LOG = ‘’ BAD = ‘’ DISCARD = ‘’ DIRECT = TRUE SKIP = 1 //if DIRECT keyword not given the default load will be conventional Path Load. Command Line Parameters: USERID Oracle userid and password CONTROL Control filename LOG Log filename BAD Bad filename DATA Datafile name DISCARD Discard filename DISCARDS Number of discards to terminate the load (default: all) SKIP Number of logical records to skip (default: 0) LOAD Number of logical records to load (default: all) ERRORS Number of errors to terminate the load (default: 50) ROWS Number of rows in the conventional path bind array or between direct path data saves (conventional path: 64, direct path: all) BINDSIZE Size of conventional path bind array in bytes SILENT Suppress messages between run (header, feedback, errors, discards) DIRECT Use direct path load (default: FALSE) PARFILE Parameter filename PARALLEL Perform parallel load (default: FALSE) FILE Datafile to allocate extents Multiple File à Single Table: Load Data Infile ‘a1.txt’ Infile ‘a2.txt’ Infile ‘a3.txt’ APPEND Into Table emp ( eid number, Ename char ) Single File à Multiple Table: P2P Interview Preparation -‐ by Dinesh Kumar S Load Data Infile ‘a1.txt’ REPLACE Into Table emp1 WHEN edept = ’10’ ( eid int, Ename char, Edept char ) Into Table emp2 WHEN edept = ’20’ ( eid int, Ename char, Edept char ) Into Table emp3 WHEN edept = ’30’ ( eid int, Ename char, Edept char ) SQL Loader Performance Tips: Make logical record processing efficient. o o Make field setting efficient. o o Make conversions efficient. o Direct Path & Conventional Path Load o o o o o Make it easy for the software to figure out physical record boundaries. That is, use the file processing option string "FIX nnn" or "VAR". If you use the default (stream mode), on most platforms (e.g., UNIX) SQL*Loader has to scan each physical record for the terminating newline character. Field setting is the process of mapping the "fields" in the datafile to their corresponding columns in the database. Avoid delimited fields; use positional fields. If you use delimited fields, SQL*Loader has to scan the input data looking for the delimiter(s)/enclosure(s). If you use positional fields, SQL*Loader just increments a pointer to get to the next field (very fast). There are several conversions that SQL*Loader does for you; character set conversions and datatype conversions.. Avoid character set conversions if you can. If you can, use the "unrecoverable" option on direct path loads. Even for conventional path loads, always run SQL*Loader directly on the server rather than across a network. Disable Indexes and Constraints. For conventional data loads only, disabling of indexes and constraints can increase the performance. Use Fixed Width Data. Fixed width data format saves Oracle some processing when parsing the data. P2P Interview Preparation -‐ by Dinesh Kumar S Common Error: When using SQL/Loader to load input a data file it only loads 5000 rows, then generates the following error Error “ORA-‐01460: unimplemented or unreasonable conversion requested”. This is a bug in SQL*Loader when direct path with column transformation (SQL string) is used. Solution: o o use conventional load. use direct path and set COLUMNARRAYROWS to a higher value that contains all rows. External Table Load: The external tables feature is a complement to existing SQL*Loader functionality. It enables you to access data in external sources as if it were in a table in the database. How External Tables Created? CREATE TABLE ………… ……….. ORGANIZATIONAL EXTERNAL ………… ……….. ; Steps to Create External Tables: 1. Create Directory Path 2. Create External Table Step 1: Create Directory Path Create or Replace Directory AS ‘C:\Program Files\Feed\’; dir1 P2P Interview Preparation -‐ by Dinesh Kumar S Step 2: Creating External table Create TABLE employee ( eid int, ename Varchar2(50), edept Varchar2(10) ) ORGANIZATIONAL EXTERNAL ( TYPE Oracle_Loader DEFAULT DIRECTORY dir1 ACCESS PARAMETERS ( Records Delimited by NEWLINE Badfile ‘a1.bad’ Logfile ‘a1.log’ SKIP 1 Fields Terminated by ‘|’ Optionally Enclosed by ‘”’ Missing Fields Values are NULL ) LOCATION (‘a1.csv’) ) ; Load Data on Condition: Create TABLE employee ………… ……….. ORGANIZATIONAL EXTERNAL ( TYPE Oracle_Loader DEFAULT DIRECTORY dir1 ACCESS PARAMETERS ( Records Delimited by NEWLINE LOAD WHEN edept != SALES‘’ Badfile ‘a1.bad’ Logfile ‘a1.log’ SKIP 1 Fields Terminated by ‘|’ Optionally Enclosed by ‘”’ Missing Fields Values are NULL ) LOCATION (‘a1.csv’) ) ; P2P Interview Preparation -‐ by Dinesh Kumar S FND Load FNDLOAD is an Oracle utility for the transfer of a wide range of Oracle Foundation (FND) data from one instance to another instance. How it Works: Conversion between database format and text file format is specified by a configuration file. Oracle does provide a confirmation file and it is important to just pass the configuration file name and then just call the loader and leave everything. Configuration Files: Configuration File Object Name afattach.lct Load attachments setup data afcpprog.lct Concurrent Program Definitions afcppstl.lct Concurrent Program Printer Styles afcpreqg.lct Concurrent Request Groups afcprset.lct Concurrent Request Sets Flex fields (KFF, DFF, value sets, value sets afffload.lct data) aflvmlu.lct Lookup types and codes afscprof.lct Profiles and Profile Values afscursp.lct Security data (users, responsibilities, etc) afsload.lct Menu / Function Security Data Lookup Types FND_LOAD Modes: 1. DOWNLOAD : Generate & Download .LDT file 2. UPLOAD : Upload the .LDT file. Steps: Step 1: Log into UNIX Server & go to $FND_TOP Select * from apps.fnd_env_context where variable_name like '%FND_TOP%'; Step 2: Generate .LDT file $FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.LCT /home/applmgr/sysadmin_resp.LDT FND_RESPONSIBILITY RESP_KEY=SYSTEM_ADMINISTRATOR Step 3: Now FTP/SFTP the file to Destination Server Instance. Step 4: Log into Destination Server instance UNIX Box. $FNDLOAD apps/apps 0 Y UPLOAD_PARTIAL $FND_TOP/patch/115/import/afscursp.LCT /home/applmgr/sysadmin_resp.LDT FND_RESPONSIBILITY RESP_KEY=SYSTEM_ADMINISTRATOR P2P Interview Preparation -‐ by Dinesh Kumar S DBLink Database Link (dblink) to execute SQL against external database as if it was the database you are logged in to. You create an Oracle dblink with the following command: CREATE DATABASE LINK <link_name> CONNECT TO <user_name> IDENTIFIED BY <password> USING '<remote_sid>'; Now you can execute SQL statements using the remote database. To specify a table from the remote database, you specify the table name and the database link name: <table_name>@<dblink_name>. To remove an existing Oracle database link, you use the DROP DATABASE LINK command: DROP DATABASE LINK <link_name>; INSERT INTO sales SELECT * FROM emp@Server_Name WHERE creation_date >= TRUNC (sysdate, 'DD'); COMMIT; P2P Interview Preparation -‐ by Dinesh Kumar S UNIX Commands Commands Usage & Examples CUT Cut a specific Character from each line in a file SED Cut -‐c1-‐3 file1.txt // first 3 character from each line will be displayed Cut a specific Field from each line in a delimited (|) file Cut -‐d’|’ -‐f5 file1.txt // fifth word from each line will be displayed Usage: It is mostly used to replace the text in a file. Replace word “abc” with “xyz” in a file. Sed ‘s / abc/ xyz/’ file1.txt S à Substitution Operation / à Delimiters (user can use any delimiter of their choice) Replace nth occurrence of the pattern, below command replaces 2nd occurance Sed ‘s / abc/ xyz/2’ file1.txt Replace all occurrence of the pattern Sed ‘s / abc/ xyz/g’ file1.txt g à Global Replacement Replace Http:// to Https:// Note in the above case both delimiter and replacement string is ”/”. To use make system to understand which Sed Command delimiter is and string delimiter we have to use “\” backslash. Sed ‘s / http:\ /\ / / https: \ / \ / /g’ file1.txt (or) to avoid confusion change the delimiter of user choice for example, GREP Sed ‘s _http:// _https:/ /_g’ file1.txt Usage: The grep command allows you to search one file or multiple files for lines that contain a pattern. Exit status is 0 if matches were found, 1 if no matches were found, and 2 if errors occurred Syntax: Grep [Options] Pattern [Files] Options: -‐c à Display then no. of matched lines. -‐I à Ignore case sensitive -‐s à Silent mode -‐v à display all lines that don’t match -‐w à Match whole word Search for a string in a file. P2P Interview Preparation -‐ by Dinesh Kumar S Grep “abc” file1.txt Search for string in multiple files. Grep “abc” file1.txt file2.txt Checking for whole word in a file Grep -‐ w “abc” file1.txt Search for a string in all file recursively Grep -‐r “abc” * Display count of no. of matched Grep -‐c “abc” file1.txt Display the line numbers AWK NAWK GAWK Grep -‐n “abc” file1.txt AWK -‐ the (very old) original from AT&T NAWK -‐ A newer, improved version from AT&T GAWK -‐ The Free Software foundation's version Syntax: AWK ‘BEGIN { Begin_action} { Body_action} END { End_action} ’ filename For example, awk BEGIN {sum=0} {sum=sum+$5} END {print sum} Using if Condition, This awk command checks for the string "t4" in the 9th column and if it finds a match then it will print the entire line. awk '{ if ( $9 == "t4" ) print $0; }' input_file Using for Loop, This awk command checks for the string "t4" in the 9th column and if it finds a match then it will print the entire line. awk 'BEGIN { for(i=1;i<=5;i++) print "square of", i, "is",i*i; }' Features available in AWK: only some features are listed below P2P Interview Preparation -‐ by Dinesh Kumar S FS à Input field separator OFS à Output field separator RS à Record separator ORS à Output record separator NR à Number of the record NF à Number of fields in a record FILENAME à Contains current input-‐file Examples to print a word from delimiter string awk 'BEGIN {FS=":"} {print $2}' input_file To print output in delimited format, MAILX awk 'BEGIN {OFS=":"} {print $4,$5}' input_file Usage: The mail command allows you to read or send mail. If user’s option is left blank, it allows you to read mail. If users have a value, then it allows you send mail to those users. Syntax: mailx [options] [users] Options: for sending emails -‐m à type Display a "Message-‐type:" line at the heading of the message, followed by type. -‐t à Display a "To:" line at the heading of the message with the names of the recipients. -‐w à Send mail to users without waiting for a remote transfer program to finish. -‐F à Save message in a file called the name of the first recipient. -‐h à n If message has not been sent after n network connections, do not send message. -‐i à Ignore interrupts -‐r address à address is the return address for mail messages. -‐s subject à Displays subject in the subject header. -‐U à Convert uucp-‐type addresses to Internet format. -‐v à Verbose. P2P Interview Preparation -‐ by Dinesh Kumar S If Statement in UNIX: Primary Options are available for file validation. Option Meaning [ -a FILE ] True if FILE exists. [ -c FILE ] True if FILE exists and is a character-‐special file. [ -d FILE ] True if FILE exists and is a directory. [ -e FILE ] True if FILE exists. [ -f FILE ] True if FILE exists and is a regular file. [ -r FILE ] True if FILE exists and is readable. [ -s FILE ] True if FILE exists and has a size greater than zero. [ -w FILE ] True if FILE exists and is writable. [ -x FILE ] True if FILE exists and is executable. [ -O FILE ] True if FILE exists and is owned by the effective user ID. [ -L FILE ] True if FILE exists and is a symbolic link. Read Concurrent Parameters in UNIX Shell Script Often when concurrent program is created on a shell script there is a need to extract parameters passed from concurrent program in the shell script. In Shell Script, $1 is the variable that stores following information -‐ Concurrent Program Short Name -‐ Request ID -‐ Login Information (APPS username and password) -‐ User Id -‐ User Name -‐ Printer Name -‐ Save output Flag -‐ Print number of Copies -‐ List of concurrent program parameters Following code can be used to extract different values requestid=`(echo $1 | cut -‐f2 -‐d' ' | cut -‐f2 -‐d= | tr -‐d '"' )` #request_id login_usr_pwd=`(echo $1 | cut -‐f3 -‐d' ' | cut -‐f2 -‐d= | tr -‐d '"' )` #database username/password conc_user_id=`(echo $1 | cut -‐f4 -‐d' ' | cut -‐f2 -‐d= | tr -‐d '"' | cut -‐c1-‐8)` #userid conc_user_name=`(echo $1 | cut -‐f5 -‐d' ' | cut -‐f2 -‐d= | tr -‐d '"' | cut -‐c1-‐8)` #username prog_param1=`(echo $1 | cut -‐f9 -‐d' ' | tr -‐d '"' )` #parameter 1 prog_param2=`(echo $1 | cut -‐f10 -‐d' ' | tr -‐d '"' )` #parameter 2 prog_param3=`(echo $1 | cut -‐f11 -‐d' ' | tr -‐d '"' )` #parameter 3 prog_param4=`(echo $1 | cut -‐f12 -‐d' ' | tr -‐d '"' )` #parameter 4 prog_param5=`(echo $1 | cut -‐f13 -‐d' ' | tr -‐d '"' )` #parameter 5 prog_param6=`(echo $1 | cut -‐f14 -‐d' ' | tr -‐d '"' )` #parameter 6 P2P Interview Preparation -‐ by Dinesh Kumar S How to connect SQL*PLUS from UNIX Shell: Example 1: #!/usr/bin/ksh emp_id=`sqlplus –s $USER/$PASSW@$INST << EOF set pagesize 0 set feedback off set verify off set heading off select EMP_ID from EMPLOYEE where EMP_NAME='Blogger'; exit; EOF` echo $emp_id Example 2: This example explains the same as above, except this uses a variable name as a parameter. #!/usr/bin/ksh EMP="Blogger" emp_id=`sqlplus –s $USER/$PASSW@$INST << EOF set pagesize 0 set feedback off set verify off set heading off select EMP_ID from EMPLOYEE where EMP_NAME='$EMP'; exit; EOF` echo $emp_id Example 3: This example shows another way to connect to sqlplus from shell. #!/usr/bin/ksh EMP="Blogger" emp_id=`echo " set pagesize 0 set feedback off set verify off set heading off select EMP_ID from EMPLOYEE where EMP_NAME='$EMP'; exit;" | sqlplus –s $USER/$PASSW@$INST ` echo $emp_id SET System Variables Summary: P2P Interview Preparation -‐ by Dinesh Kumar S Pagesize Feedback Verify Heading Autotrace Echo Sets the number of rows on each page of output in iSQL*Plus, and the number of lines on each page of output in command-‐line and Windows GUI. Displays the number of records returned by a script when a script selects at least n records. ON or OFF turns this display on or off. Turning feedback ON sets n to 1. Setting feedback to zero is equivalent to turning it OFF. SET FEEDBACK OFF also turns off the statement confirmation messages such as 'Table created' and 'PL/SQL procedure successfully completed' that are displayed after successful SQL or PL/SQL statements. Controls whether to list the text of a SQL statement or PL/SQL command before and after replacing substitution variables with values. ON lists the text; OFF suppresses the listing. Controls printing of column headings in reports. ON prints column headings in reports; OFF suppresses column headings. The SET HEADING OFF command does not affect the column width displayed, it only suppresses the printing of the column header itself. Displays a report on the execution of successful SQL DML statements (SELECT, INSERT, UPDATE or DELETE). The report can include execution statistics and the query execution path. OFF does not display a trace report. ON displays a trace report. TRACEONLY displays a trace report, but does not print query data, if any. Controls whether or not to echo commands in a script that is executed with @, @@ or START. ON displays the commands on screen. OFF suppresses the display. ECHO does not affect the display of commands you enter interactively or redirect to SQL*Plus from the operating system. P2P Interview Preparation -‐ by Dinesh Kumar S Report 6i Different types of layout in report? 1) Tabular 2) Group Above 3) Group Left 4) Matrix 5) Matrix with Group 6) Form like 7) Form Letter 8) Mailing Label Different type of columns in data model: Summary Column: A Summary Column is a field that sums items in another column and generates a total (or other function). Formula Column: A Formula column performs a user-‐defined computation on the data of one or more columns. Placeholder Column: Used to store runtime values. What are various Report triggers? 1) Before Parameter 2) After Parameter 3) Before report 4) Between pages 5) After Report What are other triggers available in Reports? i. Validation Trigger: ü Validation triggers are PL/SQL functions that are executed when parameter values are specified on the command line and when you accept the Runtime Parameter Form. ü Validation triggers are also used to validate the Initial Value property of the parameter. The function must return a boolean value (TRUE or FALSE). ii. Format Trigger: ü Format triggers are PL/SQL functions executed before the object is formatted. The trigger can be used to dynamically change the formatting attributes of the object. The function must return a Boolean value (TRUE or FALSE). For example, mainly used for in case report uses Multiple Layouts. ü Applies to Frames, Repeating Frames, Fields, Boilerplate objects iii. Action Trigger: ü Action triggers are PL/SQL procedures executed when a button is selected in the Runtime Previewer. The trigger can be used to dynamically call another report (drill down) or execute any other PL/SQL. P2P Interview Preparation -‐ by Dinesh Kumar S Report Trigger order of execution: 1. Before Parameter Form trigger is fired. • Runtime Parameter Form appears (if not suppressed). 2. After Parameter Form trigger is fired (unless the user cancels from the Runtime Parameter Form). • Report is "compiled." • Queries are Parsed 3. Before Report Trigger is fired. • SET TRANSACTION READONLY is executed (if specified via the READONLY argument or setting). 4. The report is executed and the Between Pages trigger fires for each page except the last one. (Note that data can be fetched at any time while the report is being formatted.). • COMMITs can occur during this time due to any of the following—user exit with DDL, SRW.DO_SQL with DDL, or if ONFAILURE=COMMIT, and the report fails. • COMMIT is executed (if READONLY is specified) to end the transaction. 5. After Report trigger is fired. • COMMIT/ROLLBACK/NOACTION is executed based on what was specified via the ONSUCCESS argument or setting. What is Anchor and explain its types? An anchor determines vertical/horizontal positioning of the parent/child objects. There are two types of anchors: 1) Implicit (not visible, Reports created) By Default, Reports implicitly anchors each object to its immediate enclosing object. 2) Explicit (visible, Designer created) Various types of parameters available in reports: 1) System Parameters 2) User Defined Parameters: A USER parameter is an object that you create to hold a value that users can change at runtime. o Restrict values in the WHERE clause of the SELECT statement o Substitute any part of the SELECT statement o Substitute a single column or expression in the SELECT statement. o Restrict printing in the Layout. Referring parameters in Report: There are two ways you can reference parameters in a query: use a bind reference or a lexical reference. § Bind Reference -‐ replaces a single value or expression. o To create a bind references in a query, reference the parameter with a colon (:). § Lexical Reference -‐ replaces any part of a SELECT statement, such as column names, the FROM clause, the WHERE clause, or the ORDER BY clause. o To create a lexical reference in a query, prefix the parameter name with an ampersand (&). Comparing Bind & Lexical: P2P Interview Preparation -‐ by Dinesh Kumar S Type Bind Lexical Prefix Use to Replace : WHERE, GROUP BY ORDER BY HAVING CONNECT BY, START WITH Any part of SELECT & Statement Parameter Yes Created by Default If it does not already No You must always create the parameter in the navigator yourself. Data type must be CHAR. Modes in Layout Model: • Confine Mode: o On: child objects cannot be moved outside their enclosing parent objects. o Off: child objects can be moved outside their enclosing parent objects. • Flex Mode: o On: parent borders “stretch” when child objects are moved against them. o Off: parent borders remain fixed when child objects are moved against them. Report Builder PL/SQL Packages: This procedure temporarily stops report execution at the place at which SRW.BREAK was SRW.BREAK encountered, and displays (read-‐only) the current values of all columns and parameters. Report execution resumes when the read-‐only screen is accepted. SRW.BREAK; Restriction: o This procedure is not meaningful in a Before Form or After Form trigger, because data for the report is not fetched until the Before Report trigger. SRW.CONTEXT_FAILURE This exception stops the report execution and raises the following error message: “REP-‐1426: Running <construct_name> from incorrect context.” SRW.CONTEXT_FAILURE; Usage Note: o Report Builder raises this exception when a Report Builder packaged function or procedure is called in the wrong context. EXCEPTION when SRW.CONTEXT_FAILURE then srw.message(4000, ’Contact the Application Development group regarding SRW.CONTEXT_FAILURE.’); raise srw.program_abort; DDL (statements that define data), or DML (statements that manipulate data). DML SRW.DO_SQL statements are usually faster when they are in PL/SQL, instead of in SRW.DO_SQL. P2P Interview Preparation -‐ by Dinesh Kumar S SRW.DO_SQL (:sql_statement CHAR); SRW.DO_SQL_FAILURE This exception stops the report execution and raises the following error message: REP-‐1425: Error running DO_SQL package -‐ REP-‐msg ORA-‐msg SRW.DO_SQL_FAILURE; Usage Notes: Report Builder raises this exception when the SRW.DO_SQL packaged procedure fails. EXCEPTION when SRW.DO_SQL_FAILURE then srw.message(1000, ’Error occurred while creating table CHECKS.’); This function returns the current page number. This is useful when you want to use the SRW.GET_PAGE_NUM page number in the field’s Format Trigger property. SRW.GET_PAGE_NUM (page_num); Restriction: it is only meaningful in a format trigger. SRW.MESSAGE This procedure displays a message with the message number and text that you specify. SRW.MESSAGE (msg_number NUMBER, msg_text CHAR); EXCEPTION when srw.unknown_user_exit then srw.message(1000, ’User exit MYEXIT failed.Call Karen Smith x3455.’); raise srw.program_abort; SRW.PROGRAM_ABORT This exception stops the report execution and raises the following error message: REP-‐1419: PL/SQL program aborted. SRW.PROGRAM_ABORT; SRW.RUN_REPORT This procedure invokes RWRUN60 with the string that you specify. This procedure is useful for: o running drill-‐down reports (i.e., calling a report from a button’s action trigger) o sending parts of a report to different recipients (e.g., to send a report via e-‐mail to each manager with just his or her group’s data) o sending parts of a report to different printers (e.g., to send each manager’s report to his or her printer) o running multiple reports from a single "driver" report srw.run_report(’report=MAIL_IT desname=’||:ename ||’ desformat=dflt batch=yes mgr_no=’|| TO_CHAR(:empno) ); SRW.RUN_REPORT_FAILURE If the SRW.RUN_REPORT packaged procedure fails, this exception stops the report execution and raises the following error message: REP-‐1428: Error while running SRW.RUN_REPORT. P2P Interview Preparation -‐ by Dinesh Kumar S SRW.USER_EXIT SRW.USER_EXIT20 SRW.USER_EXIT_FAILURE EXCEPTION WHEN srw.run_report_failure then srw.message(30, ’Error mailing reports.’); raise srw.program_abort; This procedure calls the user exit named in user_exit_string. It is useful when you want to pass control to a 3GL program during a report’s execution. This procedure is the same as SRW.USER_EXIT, except that it calls the user exit with five arguments instead of just two. This enables you to share user exits with other Oracle products, such as Oracle Forms, which pass five arguments instead of two. This exception is raised when the user exit you called has failed. When called, it stops the report execution and raises the following error message: REP-‐1416: User exit <exit_name> failed. EXCEPTION when SRW.USER_EXIT_FAILURE then SRW.MESSAGE(200, ’PASS user exit failed. Check its code.’); What are User Exits in oracle Reports? It’s an API which provides easy way to pass control from report builder to 3GL program that performs some function and then returns control back to report builder. Using these we can integrate oracle reports with oracle apps AOL and run them as concurrent programs. Below are some AOL integrations. FND SRWINIT § FND_SRWEXIT § § § FND FORMAT_CURRENCY § • • This is a User Exit which sets your profile option values and allows Oracle AOL user exits to detect that they have been called by oracle repots. FND SRWINIT also allows your report to use the correct organization automatically. Can be used in BEFORE-‐REPORT Trigger. This user exit ensures that all the memory allocated for AOL user exits has been freed up properly. Can be used in AFTER-‐ REPORT Trigger. To format the currency amount dynamically depending upon the precision of the actual currency value, standard precision, users profile values and location (country) of the site. You obtain the currency value from the database into an Oracle Reports column. Define another Oracle Reports column, a formula column of type CHAR, which executes the FORMAT_CURRENCY user exit to format the currency value. A displayed field has this formula column as its source so that the formatted value is automatically copied into the field for display. Syntax: FND FORMAT_CURRENCY CODE=:column containing currency code P2P Interview Preparation -‐ by Dinesh Kumar S FND FLEXSQL FND FLEXIDVAL DISPLAY_WIDTH=field width for display AMOUNT=:source column name DISPLAY=:display column name [MINIMUM_PRECISION=:P_MIN_PRECISION] [PRECISION={STANDARD|EXTENDED}] [DISPLAY_SCALING_FACTOR=:P_SCALING_FACTOR] Call this user exit to create a SQL fragment usable by your report to tailor your SELECT statement that retrieves flexfield values. This fragment allows you to SELECT flexfield values or to create a WHERE, ORDER BY, GROUP BY, or HAVING clause to limit or sort the flexfield values returned by your SELECT statement. You call this user exit once for each fragment you need for your select statement. You define all flexfield columns in your report as type CHARACTER even though your table may use NUMBER or DATE or some other datatype. Syntax: FND FLEXSQL CODE="flexfield code" APPL_SHORT_NAME="application short name" OUTPUT=":output lexical parameter name" MODE="{ SELECT | WHERE | HAVING | ORDER BY}" [DISPLAY="{ALL | flexfield qualifier | segment number}"] [SHOWDEPSEG="{Y | N}"] [NUM=":structure defining lexical" | MULTINUM="{Y | N}"] [TABLEALIAS="code combination table alias"] [OPERATOR="{ = | < | > | <= | >= | != | "||" | BETWEEN | QBE}"] [OPERAND1=":input parameter or value"] [OPERAND2=":input parameter or value"] Call this user exit to populate fields for display. You pass the key flexfields data retrieved by the query into this exit from the formula column. With this exit you display values, descriptions and prompts by passing appropriate token (any one of VALUE, DESCRIPTION, APROMPT or LPROMPT). Syntax: FND FLEXIDVAL CODE="flexfield code" APPL_SHORT_NAME="application short name" DATA=":source column name" [NUM=":structure defining source column/lexical"] [DISPLAY="{ALL|flexfield qualifier|segment number}"] [IDISPLAY="{ALL|flexfield qualifier|segment number}"] [SHOWDEPSEG="{Y | N}"] [VALUE=":output column name"] [DESCRIPTION=":output column name"] [APROMPT=":output column name"] [LPROMPT=":output column name"] P2P Interview Preparation -‐ by Dinesh Kumar S [PADDED_VALUE=":output column name"] [SECURITY=":column name"] This is an AOL user exit available to populate key flexfields for display CODE means Key flexfield code (GL# is for Accounting Flex field, for all other check the table FND_ID_FLEXS) NUM is the structure of the key flex field(Chart of Accounts Number) DATA is where you store the retrieved data (your sql output). SRW.USER_EXIT('FND FLEXSQL CODE="GL#" NUM=":P_STRUCT_NUM" APPL_SHORT_NAME="SQLGL" OUTPUT=":P_SEC_SEG" MODE="SELECT" DISPLAY=":P_SEC_SEG_VAL" ') The userexit call FND FLEXIDVAL : SRW.REFERENCE(:SEC_SEG); SRW.USER_EXIT('FND FLEXIDVAL CODE="GL#" DATA=":SEC_SEG" APPL_SHORT_NAME="SQLGL" VALUE=":SEC_SEG_DISP" DISPLAY="ALL" NUM=":P_STRUCT_NUM" '); return(:sec_seg_disp); Properties Usage: Only Important properties discussed. Property Name Usage Anchor Properties Child Edge Type Description The Child Edge Type property is the edge of the child object on which the anchor is located. Values: Top, Bottom, Left, and Right Applies to anchors Description The Parent Edge Type property is the edge of the parent object on which the anchor is located. Values: Top, Bottom, Left, and Right Applies to anchors Parent Edge Type Common Layout Object Properties Base Printing On The Base Printing On property is the object on which to base the Print Object On property of the current object. For example, if you specify a Print Object On of All Pages and a Base Printing On of Anchoring Object, the current object will be triggered to print on every logical page on which its anchoring object (parent object) appears. P2P Interview Preparation -‐ by Dinesh Kumar S Keep with anchoring objects Minimum window Lines Page Break After Page Break Before Page Protect Print Object On Values: o Anchoring Object Is the parent object to which the current object is implicitly or explicitly anchored. o Enclosing Object Is the object that encloses the current object. Applies to: layout objects Required/Optional: required Default: Anchoring Object The Keep with Anchoring Object property indicates whether to keep an object and the object to which it is anchored on the same logical page. Yes à o Means that if the object, its anchoring object, or both cannot fit on the logical page, they will be moved to the next logical page. o For a repeating frame, it means the first instance of the repeating frame must be able to fit on the same page as its anchoring object. o Any layout object other than a repeating frame, it means the object must be able to format entirely on the same page as its anchoring object. The Page Break After property indicates that you want all children of the object to be moved to the next page. o In other words, any object that is a child object of an anchor (implicit or explicit) to this object will be treated as if it has Page Break Before set to Yes. Note that this does not necessarily mean that all the objects below the object with Page Break After will move to the next page. Applies to: layout objects Required/Optional: optional Default: No The Page Break Before property indicates that you want the object to be formatted on the page after the page on which it is initially triggered to print. Note that this does not necessarily mean that all the objects below the object with Page Break Before will move to the next page. Applies to: layout objects Required/Optional: optional Default: No o The Page Protect property indicates whether to try to keep the entire object and its contents on the same logical page. Setting Page Protect to Yes means that if the contents of the object cannot fit on the current logical page, the object and all of its contents will be moved to the next logical page. o Note: Using Page Protect may cause objects below the page protected object(s) to appear above the page protected object(s). Applies to: layout objects Required/Optional: optional Default: No The Print Object On property is the frequency with which you want the object to appear in the report. The Print Object On options indicates the logical page(s) on which the object should be triggered to print with regard to the Base Printing On object. o P2P Interview Preparation -‐ by Dinesh Kumar S Horizontal Elasticity / Vertical Elasticity Common Column Properties Break Order Set break Order Values: All Pages, All but First Page, Default, First Page, Last Page The Horizontal/Vertical Elasticity property is how the horizontal size of the object will change at runtime to accommodate the objects or data within it. • Contract Means the horizontal size of the object decreases, if the formatted objects or data within it are wide enough, but it cannot increase to a width greater than that shown in the Report Editor. • Expand Means the horizontal size of the object increases, if the formatted objects or data within it are wide enough, but it cannot decrease to a width less than that shown in the Report Editor. • Fixed Means the width of the object is the same on each logical page, regardless of the size of the objects or data within it. Truncation of data may occur; look at the examples. The width of the object is defined to be its width in the Report Editor. • Variable Means the object may expand or contract horizontally to accommodate the objects or data within it (with no extra space), which means the width shown in the Report Editor has no effect on the object’s width at runtime. The Break Order property is the order in which to display the column’s values. This property applies only to columns that identify distinct values of user-‐created groups (i.e., break groups). The order of column values in a default group is determined by the ORDER BY clause of the query. For column values in user-‐created groups, however, you must use Break Order to specify how to order the break column’s values. Values: o Ascending o Descending Applies to: columns Required/Optional: Required, if Set Break Order is set to Yes. Default: Ascending The Set Break Order property is whether to set the order in which to display the column’s values, using the Break Order property. Applies to: columns Required/Optional: optional Default: Yes P2P Interview Preparation -‐ by Dinesh Kumar S Form Personalization Profile Options: Profile Name Hide Diagnostics Menu Entry Utilities: Diagnostics Level (Value: Yes / No) Site/Application/Resp/User Site/Application/Resp/User Usage If this profile is set to Yes, the Diagnostics menu is hidden from the user. It determines whether a user can automatically use the following Diagnostics submenu items: Examine, Trace, Debug, Properties, and Custom Code. How to disable Form Personalization’s? Navigation: Help à Diagnostics à Custom Code à OFF Form Personalization Sequence: 1. Form Personalization 2. Custom.pll Components involved in form personalization: Rules: Once Rules are defined, when the target function is run the rules are automatically applied as even occur within the form. Conditions: It decides when the rule should be executed on below factors. o Triggering Event (Mandatory) ü WHEN-‐NEW-‐FORM-‐INSTANCE ü WHEN-‐NEW-‐BLOCK-‐INSTANCE ü WHEN-‐NEW-‐RECORD-‐INSTANCE ü WHEN-‐NEW-‐ITEM-‐INSTANCE ü WHEN-‐VALIDATE-‐RECORD ü MENU1 to MENU 15 ü SPECIAL1 to SPECIAL45 o Trigger Object o Condition o Processing Mode (Mandatory) Contexts: Personalization can be applied in sequence Site à Responsibility à User Actions: This is used to perform below actions. a) Property b) Message c) Builtin d) Menu P2P Interview Preparation -‐ by Dinesh Kumar S Special Triggers: Two types of special triggers available, Menu1 – Menu 15 Special1 – Special45 Special Triggers are sub classified as, 1) Tool Menu i. Menu1 -‐ Menu 15 ii. Special1 – Special 15 2) Report Menu i. Special16 – Special30 3) Action Menu i. Special31 – Special45 Action Types: o Show Message Types o Hint o Error o Debug o Warn o Launch SRS Form Builtin Types o Launch a Function o Launch a URL o DO_KEY o Execute a Procedure o GO_ITEM o GO_BLOCK o FORMS_DDL o RAISE FORM_TRIGGER_FAILURE o EXECUTE TRIGGER o SYNCHRONIZE o Call Custom Library o Create Record Group from query o Menu1 – Menu15 Menu Type o Special1 – Special45 Property Types All form object properties. P2P Interview Preparation -‐ by Dinesh Kumar S Form Personalization Tables: • FND_FORM_CUSTOM_RULES • FND_FORM_CUSTOM_SCOPES • FND_FORM_CUSTOM_ACTIONS • FND_FORM_CUSTOM_PARAMS • FND_FORM_CUSTOM_PROP_VALUES • FND_FORM_CUSTOM_PROP_LIST Steps involved in modifying Custom.pll Step 1: Open the form builder and download below libraries files and attach it. • • • APPCORE.pll APPCORE2.pll FNDSQL.pll Step 2: Download Custom.pll from location “$AU_TOP/11.5.0/Resource”. To find the TOP path execute the below query. Select * From apps.fnd_env_Context where variable_name like ‘%AU%TOP%’; Step 3: Modify Custom.pll file [CUSTOM*(PackageBody)@] Step 4: Compile the Package & Save the changes. Step 5: upload the file to location “$AU_TOP/11.5.0/Resource”. Step 6: Generate .PLX executable using below command P2P Interview Preparation -‐ by Dinesh Kumar S Different Libraries Available: P2P Interview Preparation -‐ by Dinesh Kumar S How to migrate form personalization from one instance to another? Use FNDLOAD (purely a DBA task) Step1: Download for a specific form FNDLOAD <userid>/<password> 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct <filename.ldt> FND_FORM_CUSTOM_RULES form_name=<form name>< /FONT> (or) Step 1: Download all personalization FNDLOAD <userid>/<password> 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct <filename.ldt> FND_FORM_CUSTOM_RULES function_name=<function name>< /FONT> • • Function_name is a required parameter You cann't download lct file with out any supplied value. Step 2: Usin FTP/SFTP transfer the downloaded file Step 3: Upload to the target instance FNDLOAD <userid>/<password> 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct <filename.ldt> P2P Interview Preparation -‐ by Dinesh Kumar S How to migrate Oracle Forms and Oracle Report definitions from version 6i and/or 9i to 11G? For Oracle Reports 1. Open and then save all 6i and 9i reports as type RDF. 2. These should run just fine in most cases in 11G without conversion (and you do not have to install the larger 11g Application Server release with Weblogic Server on your design platform), but if there are issues running the older RDFs, then a conversion using the rwconverter utility will be required on the 11g platform (see the Report Builder Help for the topic of conversion and rwconverter). 3. Create a reports directory on the AS 11g instance so that you can utilize the sourceDir option in the report server's configuration. This causes Reports to only look in that directory for its definitions. 4. Copy your converted and migrated Reports 10.1.2 RDF definitions to your AS 11g deployment box (make sure not to corrupt them if using FTP). Place them in the REPORTS_PATH or sourceDir directory if used). 5. One caveat is that 6i Reports could use 6i Graphics and there is no migration path for that. Due to the new Java implementation, 6i Graphics need to be redesigned with the new Graphic Wizard integrated into the new Builder. For Oracle Forms 1. Open the Forms Builder and connect to the database used to design your application. 2. Open your modules in the Forms Builder. You should do this in the following order: libraries (pll) then menus (mmb) then forms (fmb) 3. From the Builder menu, select Program > Compile PL/SQL > Compile All 4. Save the current module 5. Repeat the above for all libraries, menus, and forms associated with your application. a. The above can also be accomplished from the command line using the compiler (frmcmp from ORACLE_HOME/bin directory). The command line would look something like this: Oracle R12 Frmcmp module=myform userid=scott/tiger@orcl compile_all=yes b. Although this will also generate the executables, only the source files (fmb, mmb, pll) can be used in the new version. Do not move the fmx, mmx, or plx files to the version 11 environment. 6. Copy the updated fmb, mmb, and pll files to the version 11.x installation and generate the necessary fmx, plx, and mmx files using the version 11 compiler. Please check note in references section. P2P Interview Preparation -‐ by Dinesh Kumar S FND API’s Why to Set Org Context? FND_CLIENT_INFO Package: • FND_CLIENT_INFO.Set_Org_Context: Note** this package is obsolete in oracle R12. P2P Interview Preparation -‐ by Dinesh Kumar S FND_GLOBAL Package: • FND_GLOBAL.APPS_INITIALIZE − − − − − This procedure sets up global variables and profile values in a database session. Call this procedure to initialize the global security context for a database session. You can use it for routines such as PL/SQL or other programs that are not integrated with either the Oracle Applications concurrent processing facility or Oracle Forms (both of which already do a similar initialization for a database session). The typical use for this routine would be as part of the logic for launching a separate non– Forms session from an established Oracle Applications form session. You can also use this procedure to set up a database session for manually testing application code using SQL*Plus. This routine should only be used when the session must be established outside of a normal form or concurrent program connection. • • • • • • • • • • • • • • • • FND_GLOBAL.USER_ID FND_GLOBAL.ORG_ID FND_GLOBAL.ORG_NAME FND_GLOBAL.RESP_ID FND_GLOBAL.RESP_APPLICATION_ID FND_GLOBAL.RESP_NAME FND_GLOBAL.SECURITY_GROUP_ID FND_GLOBAL.USER_NAME FND_GLOBAL.APPLICATION_NAME FND_GLOBAL.APPLICATION_SHORT_NAME FND_GLOBAL.CONC_LOGIN_ID FND_GLOBAL.CONC_PROGRAM_ID FND_GLOBAL.CONC_REQUEST_ID FND_GLOBAL.PER_BUSINESS_GROUP_ID FND_GLOBAL.PER_SECURITY_PROFILE_ID FND_GLOBAL.CURRENT_LANGUAGE P2P Interview Preparation -‐ by Dinesh Kumar S FND_PROFILE Package: It is used to perform various actions related to profile values through PL/SQL. Some of the important ones are listed below. P2P Interview Preparation -‐ by Dinesh Kumar S P2P Interview Preparation -‐ by Dinesh Kumar S FND_REQUEST Package: • FND_REQUEST.SET_OPTIONS Optionally call before submitting a concurrent request to set request options. Returns TRUE on successful completion, and FALSE otherwise. • FND_REQUEST.SET_REPEAT_OPTIONS Optionally call before submitting a concurrent request to set repeat options. Returns TRUE on successful completion, and FALSE otherwise. • FND_REQUEST.SET_PRINT_OPTIONS Some print options that are set at the program level (i.e., using the Concurrent Programs form) cannot be overridden using this procedure. See the following argument descriptions to determine which print options can be overridden. P2P Interview Preparation -‐ by Dinesh Kumar S • FND_REQUEST.SUBMIT_REQUEST − − − − − − Submits a concurrent request for processing by a concurrent manager. If the request completes successfully, this function returns the concurrent request ID; otherwise, it returns 0. The FND_REQUEST.SUBMIT_REQUEST function returns the concurrent request ID upon successful completion. It is then up to the caller to issue a commit to complete the request submission. Your code should retrieve and handle the error message generated if there is a submission problem (the concurrent request ID returned is 0). Use FND_MESSAGE.RETRIEVE and FND_MESSAGE.ERROR to retrieve and display the error (if the request is submitted from the client side). You must call FND_REQUEST.SET_MODE before calling FND_REQUEST.SUBMIT_REQUEST from a database trigger. If FND_REQUEST.SUBMIT_REQUEST fails from anywhere but a database trigger, database changes are rolled back up to the point of the function call. After a call to the FND_REQUEST.SUBMIT_REQUEST function, all setup parameters are reset to their default values. Note** FND_REQUEST must know information about the user and responsibility from which the request is submitted. Therefore, this function only works from concurrent programs or forms within Oracle E-‐Business Suite. • FND_REQUEST.SET_MODE Call this function before calling FND_REQUEST.SUBMIT_REQUEST from a database trigger. P2P Interview Preparation -‐ by Dinesh Kumar S FND_CONCURRENT Package: • FND-‐CONCURRENT.GET_REQUEST_STATUS Returns the status of a concurrent request. If the request has already completed, also returns a completion message. • FND-‐CONCURRENT.GET_REQUEST_STATUS Waits for request completion, then returns the request phase/status and completion message to the caller. Goes to sleep between checks for request completion. • FND-‐CONCURRENT.SET_COMPLETION_STATUS Call SET_COMPLETION_STATUS from a concurrent program to set its completion status. The function returns TRUE on success, otherwise FALSE. P2P Interview Preparation -‐ by Dinesh Kumar S MO_GLOBAL Package: • MO_GLOBAL.INIT Purpose of mo_global.init :-‐ It will check if new Multi Org Security Profile is set, to decide if new Security Profile method will be used. If the new MO security profile is set, then mo_global.init inserts one record, for each Organization in Org Hierarchy, in table mo_glob_org_access_tmp When & from where is mo_global.init called ? This package procedure will be called as soon as you login or as soon as you switch responsibility. Just like FND_GLOBAL.INITIALIZE is called. It is safe to assume that Oracle will invoke MO_GLOBAL.INIT after FND_GLOBAL.INITIALIZE. From SQL*Plus, you can simulate login to a specific responsibility by calling a.Call FND_GLOBAL.INITIALIZE This will set your responsibility id, user_id etc b. call MO_GLOBAL.INIT This will read the MO profile option values for your responsibility/user, and will initialize the Multi Org Access. • MO_GLOBAL.SET_POLICY_CONTEXT • MO_GLOBAL.ORG_SECUTIRY P2P Interview Preparation -‐ by Dinesh Kumar S MOAC for table access In 11i _ALL Tables where non Org specific and Org specific views were created on these tables. But in R12 its different concept • For the table AP_INVOICES_ALL a synonym AP_INVOICES_ALL is created in APPS. • Also another synonym AP_INVOICES is created which refers to AP_INOICES_ALL. • A Row Level security is applied to AP_INVOICES, using package function • MO_GLOBAL.ORG_SECURITY. This can be double-‐checked by running SQL select * from all_policies where object_name=’AP_INVOICES’ • The effect of this policy is that,whenever you access AP_INVOICES, Oracle RLS will • dynamically append WHERE CLAUSE similar to below SELECT * FROM AP_INVOICES WHERE EXISTS (SELECT 1 FROM mo_glob_org_access_tmp oa WHERE oa.organization_id = org_id) Some of the other Functions: • MO_GLOBAL.GET_OU_NAME: This function returns the legal entity name for the org_id parameter passed, if it exists in the PL/SQL array populated by set_org_access Multi-‐Org API. FUNCTION get_ou_name(p_org_id NUMBER) • MO_GLOBAL.GET_LE_NAME: This function returns the legal entity id for the org_id parameter passed,if it exists in the PL/SQL array populated by set_org_access Multi-‐Org API. FUNCTION get_le_name(p_org_id NUMBER) • MO_GLOBAL.GET_LE_NAME FUNCTION get_le_id(p_org_id NUMBER) P2P Interview Preparation -‐ by Dinesh Kumar S • MO_GLOBAL.GET_CURRENT_ORG_ID This function returns the access mode stored in the application context. FUNCTION get_current_org_id RETURN NUMBER; • MO_GLOBAL.IS_MULTI_ORG_ENABLED Called by oracle server during parsing sql statment. Used by Multi-‐Org synonyms. FUNCTION is_multi_org_enabled RETURN VARCHAR2; • MO_GLOBAL.IS_CLIENT_INFO_POLICY Return Y if shared seed data (-‐3114) exists. Return N if shared seed data is eliminated. FUNCTION set_client_info_policy( obj_schema VARCHAR2 , obj_name VARCHAR2 ) P2P Interview Preparation -‐ by Dinesh Kumar S Oracle Workflow Builder Workflow Major Components: Component Description WF Builder WF Engine WF Definition Loader Notification Systems WF Monitor - Graphical Interface. Used to Modify & create business process. 2 Windows available [navigator, process Diagram]. It is embedded in oracle DB. Monitors the WF status and co-‐ordinates the routing of activities. The utility program that moves WF definitions b/w DB and corresponding flat file representation. It’s a standalone server program. Integrated into WF builder. Automatically Notify users. Send Notification to individuals or roles. Automatic Notification forwarding. Graphically monitors & administrate workflow transactions. It supports the below features. § Java Applet: To view WF Activity diagrammatically. § View Transaction action history. § Retry / Skip Activity. § Resend & rerun any process. Action Summary of Key Activities. Workflow Data model: Objects Description Item Type Classification of components that makes Workflow process. An item type attribute is a property associated with a given item type. Attribute A Global variable that can be used across by any activity inside WF. Process Function Manages Business Process according to the business process rules defined. It derives relationship b/w the activities. An automated unit of work usually defined as a PLSQL stored procedures & functions. Event An event activity represents a business event from the Business Event System within a workflow process. Notification When the workflow engine reaches a notification activity, it issues a Send ( ) API call to the Notification System to send the message to an assigned performer. Message A message is what a notification activity sends to a role in a workflow process. Lookup Types A lookup type is a static list of values. These lists can be referenced by activities and by item type, message or activity attributes. Transactions The relationship b/w two activities represented by an arrow [transition]. P2P Interview Preparation -‐ by Dinesh Kumar S Workflow Tables: Table Name WF_ITEM_TYPES WF_ITEM_TYPES_TL WF_ITEM_ATTRIBUTES WF_ACTIVITIES WF_ACTIVITY_ATTRIBUTES WF_ACTIVITY_TRANSITIONS WF_PROCESS_ACTIVITIES WF_MESSAGES WF_MESSAGE_ATTRIBUTES WF_LOOKUP_TYPES WF_LOOKUPS WF_NOTIFICATIONS WF_NOTIFICATION_ATTRIBUTES WF_ITEMS WF_ITEM_ACTIVITY_STATUSES Description The details of internal names of item types will be stored. Translation table for WF_ITEM_TYPES The details of Item attribute. The details of activities involved in business process. The details of attributes associated with activities. The transition details b/w the activities of the process All details of process includes Activity, sub-‐processes etc. The message definition details. The details about Attributes associated with Messages. The details of Lookup Type definitions. Details of lookup Codes created for lookup types. Notification details defined inside item type. Details of attributes associated with notification. Information of all the workflow process & its history. Activity status of all activity for different item type instance. WF_ITEM_ATTRIBUTE_VALUES The values of all the attributes associated with the item type at the particular instance. WF_ACTIVITY_ATTR_VALUES The values of activity attributes for all the activities for different instances of the workflow items. WF_ROUTING_RULES The routing rules defined by user like forward, re-‐assign, reject etc. Types of Workflow Process: Synchronous • • • Asynchronous • • • • A synchronous process is a process that can be executed without interruption from start to finish. The Workflow Engine executes a process synchronously when the process includes activities that can be completed immediately, such as function activities that are not deferred to the background engine. The Workflow Engine does not return control to the calling application that initiated the workflow until it completes the process. With a synchronous process, you can immediately check for process results that were written to item attributes or directly to the database. However, the user must wait for the process to complete. An asynchronous process is a process that the Workflow Engine cannot complete immediately because it contains activities that interrupt the flow. Examples of activities that force an asynchronous process include deferred activities, notifications with responses, blocking activities, and wait activities. Rather than waiting indefinitely when it encounters one of these activities, the Workflow Engine sets the audit tables appropriately and returns control to the calling application. The workflow process is left in an unfinished state until it is started again. The process can be restarted by the Notification System, such as when a user responds to a notification; by the background engine, such as when a deferred activity is executed; or by the Business Event System, such as when an event message is de-‐queued from an inbound queue and sent to the workflow process. With an asynchronous process, the P2P Interview Preparation -‐ by Dinesh Kumar S Forced Synchronous • • • user does not have to wait for the process to complete to continue using the application. However, the results of the process are not available until the process is completed at a later time. A forced synchronous process completes in a single SQL session from start to finish and never inserts into or updates any database tables. As a result, the execution speed of a forced synchronous process is significantly faster than a typical synchronous process. The process results are available immediately upon completion. However, no audit trail is recorded. Activity Cost: • • Each function activity and event activity has a cost associated with it. The cost is a value representing the number of seconds it takes for the Workflow Engine to execute the activity. If you do not know how long it takes for the Workflow Engine to perform the activity, you can enter an estimated cost and update it later as you accumulate more information about its performance. Generally, you should assign complex, long running activities a high cost. The valid range for cost is 0 to 1,000,000. Note** although the cost is entered and displayed in seconds in Oracle Workflow Builder, it is actually converted and stored in the database as hundredths of a second. • In normal processing, the Workflow Engine completes the execution of a single activity before continuing to a subsequent activity. • In some cases, an activity might take so long to process that background processing would be more appropriate. The default threshold for the Workflow Engine is 50 hundredths of a second. Activities with a cost higher than this are deferred to background engines. Deferred Processing: • The engine has a deferred processing feature that allows long-‐running tasks to be handled by background engines instead of in real time. Deferring the execution of activity functions to background engines allows the Workflow Engine to move forward to process other activities that are currently active. • The engine can be set up to operate anywhere on a continuum between processing all eligible work immediately, to processing nothing and marking all transitions as deferred. • Each activity has a user-‐defined processing cost. You can set this cost to be small if the activity merely sets an item attribute, or you may set it to be very high if the activity performs a resource-‐intensive operation. If the result of a completed activity triggers the execution of a costly function, you might want to defer the execution of that costly function to a background engine. • The Workflow Engine integrates with Oracle Advanced Queues to carry out deferred processing. If a function activity has a cost that exceeds the main threshold cost, the Workflow Engine marks that activity with a status of 'DEFERRED' in the workflow status tables and en-‐queues the deferred activity to a special queue for deferred activities. A special queue processor called the background engine checks and processes the activities in the 'deferred' queue. The order in which the deferred activities are processed are based on the first in, first out ordering of an activity's en-‐queue time. P2P Interview Preparation -‐ by Dinesh Kumar S Deferred Activity: When an activity is deferred, the main Workflow Engine can then continue to the next available activity, which may occur on some other parallel branch of the process. If no other activity is available to be executed, the Workflow Engine returns control immediately to the calling application. The user remains unaware that processing is still taking place, rendering a faster execution time. To defer an activity, Activity Cost > Threshold Cost The threshold cost is a PL/SQL package variable with a default value of 50 hundredths of a second. Set a cost above this threshold for all activities that you don't want the user to wait for. At runtime, the Workflow Engine defers any thread to the background as soon as it encounters an activity with a cost higher than the threshold. Then the background engine later identifies the process as deferred and continues its execution. Workflow Access Protection: P2P Interview Preparation -‐ by Dinesh Kumar S • Access protection is a feature that prevents workflow seed data created by a 'seed data provider' from being modified by a 'seed data consumer'. 'seed data provider' -‐-‐> any organization that creates 'seed data' for other organizations ('seed data consumers') to use in defining and customizing a workflow process. − Workflow objects definitions that can be customized. − Workflow object definitions protected against customization. Scenario: There are 2 teams in my organization Global Team & Regional Team. Global Team does development across all regions where as regional team does development within their own region and not shared by other. Consider my organization Global team using oracle std. item type in my workflow in a custom workflow process. Now my organization wants to enable below protections, Identify certain workflow objects in its custom workflow definition as corporate standards that the regional teams should adhere to and not modify. Designate certain objects in its deployed process as customizable for the regional offices to alter to their offices' needs. How this can be achieved? By using Access Protection Feature in Oracle Workflow. Access Protection Features: 1. Access Level 2. Customization Level 3. Protection Level − The combination of protection, customization, and access levels make up the access protection feature and determines whether a user can modify a given workflow object. − The level, in all three cases, is a numeric value ranging from 0 to 1000 that indicates the relationship between different organizations as providers and consumers of seed data. The following ranges of levels are presumed by Oracle Workflow: 0-‐9 Oracle Workflow 10-‐19 Oracle Application Object Library 20-‐99 Oracle Applications development 100-‐999 Customer organization. You can determine how you want this range to be interpreted. For example, 100 can represent headquarters, while 101 can represent a regional office, and so on. 1000 Public P2P Interview Preparation -‐ by Dinesh Kumar S Access Level: A "user of Oracle Workflow" in this case, represents someone who is operating Oracle Workflow Builder, or the Workflow Definitions Loader program, which loads workflow process definitions from a file into a database. As a seed data provider, you should always operate Oracle Workflow Builder at the same consistent access level because the level you work at affects the protection level of the seed data you create. You can view your access level as follows: • In Oracle Workflow Builder, select About Workflow from the Help menu. • If you are going to run the Workflow Definitions Loader program to download workflow process definitions from the database to a file, check the value for the environment variable WF_ACCESS_LEVEL on your workflow server. Protection Level: Whenever you create a workflow object in Oracle Workflow Builder, you have the option of protecting the object at a certain level. An object's protection level helps control whether other users can modify the object based on their access levels, by allowing only users with an access level equal to or lower than the object's protection level to modify the object. The protection level that you set for an object is dependent on the setting of the Lock at this Access Level check box and on your current access level. • If you check the Lock at this Access Level check box, the protection level for the object is set to your current access level. Users with an access level higher than your current access level will not be able to modify the object. These users will see a small lock on the workflow object's icon, indicating that the object can be used but not modified. For users with an access level equal to or lower than your current access level, the customization level for the object will determine whether they can modify the object. • If you do not check the Lock at this Access Level check box, the protection level for the object is set to 1000. In this case all users who are not restricted by the customization level can modify the object. Customization Level: • Every workflow object, in addition to having a protection level, also records a customization level when you modify the object and save it to a database or file. An object's customization level helps control whether other users can modify the object based on their access levels, by allowing only users with an access level equal to or higher than the object's customization level to modify the object. • Setting the customization level ensures that a customizable object that has been customized never gets overwritten during a seed data upgrade, because the upgrade always occurs with the Workflow Definitions Loader operating at an access level below the customized object's customization level. P2P Interview Preparation -‐ by Dinesh Kumar S Workflow Definition Loader (WFLOAD): We use the Workflow Definitions Loader to save or load process definitions from a database or flat file. We can also define as it is a utility that moves workflow data between a file and a database and it is also used to upgrade, upload and download the workflow data. Usage: • • Normally when we upgrade our database, we use the Workflow Definitions Loader to preserve and back up our process definitions to a flat file. When the database upgrade is completed, we use the Loader program again to upload the definitions back into your database. We can also use the Loader program to upgrade our database with a newer version of a process definition or to transfer process definitions to other databases. Modes: The Workflow Definitions Loader automatically validates the process definition to ensure that it conforms to specific process design rules. There are four modes available with WFLOAD.These are as follows: 1) 2) 3) 4) DOWNLOAD -‐ Download the WF definitions into Flat file. UPGRADE – Honors both protection and customization levels of data UPLOAD – Honors only protection level of data [No respect of Customization Level] FORCE – Force upload regardless of protection or customization level WFLOAD Username/password <access_level> Y <Mode> <File_name>.wft <Item_Type> For Example, WFLOAD apps/apps 0 Y DOWNLOAD poxwfrqa.wft POAPWF Workflow API’s: P2P Interview Preparation -‐ by Dinesh Kumar S Below are some important API’s frequently used in workflow development / customizations. WF_ENGINE API’s WF_ENGINE. CreateProcess WF_ENGINE. SetItemUserKey WF_ENGINE. GetItemUserKey WF_ENGINE. SetItemOwner WF_ENGINE. StartProcess WF_ENGINE. LaunchProcess WF_ENGINE. SuspendProcess WF_ENGINE. AbortProcess CreateProcess (itemtype in varchar2,itemkey in varchar2,process in varchar2 default ); Creates a new runtime process for an application item. For example, a Requisition item type may havea Requisition Approval Process as a top level process. When a particular requisition is created, an application calls CreateProcess to set up the information needed to start the defined process. SetItemUserKey (itemtype in varchar2,itemkey in varchar2, userkey in varchar2); Lets you set a user–friendly identifier for an item in a process, which is initially identified by an item type and item key. The user key is intended to be a user– friendly identifier to locate items in the Workflow Monitor and other user interface components of Oracle Workflow. GetItemUserKey (itemtype in varchar2,itemkey in varchar2) return varchar2; Returns the user–friendly key assigned to an item in a process, identified by an item type and item key. The user key is a user–friendly identifier to locate items in the Workflow Monitor and other user interface components of Oracle Workflow. SetItemOwner (itemtype in varchar2,itemkey in varchar2,owner in varchar2); A procedure to set the owner of existing items. The owner must be a valid role. Typically, the role that initiates a transaction is assigned as the process owner, so that any participant in that role can find and view the status of that process instance in the Workflow Monitor. StartProcess (itemtype in varchar2,itemkey in varchar2); Begins execution of the specified process. The engine locates the activity marked as START and then executes it. CreateProcess( ) must first be called to define the itemtype and itemkey before calling StartProcess( ). LaunchProcess (itemtype in varchar2,itemkey in varchar2,process in varchar2 default'',userkey in varchar2 default '',owner in varchar2 default ''); Launches a specified process by creating the new runtime process and beginning its execution. This is a wrapper that combines CreateProcess and StartProcess. SuspendProcess (itemtype in varchar2,itemkey in varchar2,process in varchar2 default ''); Suspends process execution so that no new transitions occur. Outstanding notifications can complete by calling CompleteActivity( ), but the workflow does not transition to the next activity. Restart suspended processes by calling ResumeProcess( ). ResumeProcess(itemtype in varchar2,itemkey in varchar2,process in varchar2 default ''); Returns a suspended process to normal execution status. Any activities that were transitioned to while the process was suspended are now executed. AbortProcess (itemtype in varchar2,itemkey in varchar2,process in varchar2 default '',result in varchar2 default eng_force); Aborts process execution and cancels outstanding notifications. The process status is considered COMPLETE, with a result specified by the result argument. Also, any outstanding notifications or subprocesses are set to a status of P2P Interview Preparation -‐ by Dinesh Kumar S COMPLETE with a result of force, regardless of the result argument. AddItemAttr (itemtype in varchar2,itemkey in varchar2,aname in varchar2); Adds an empty item type attribute variable to the process. Although most item type attributes are defined at design time, developers can create new attributes at runtime for a specific process. WF_ENGINE. SetItemAttrText SetItemAttrText(itemtype in varchar2,itemkey in varchar2,aname in varchar2,avalue in varchar2); WF_ENGINE. SetItemAttrNumber SetItemAttrNumber(itemtype in varchar2,itemkey in varchar2,aname in varchar2,avalue in number); WF_ENGINE. SetItemAttrDate SetItemAttrDate (itemtype in varchar2,itemkey in varchar2,aname in varchar2,avalue in date); WF_ENGINE. GetItemAttrText GetItemAttrText(itemtype in varchar2,itemkey in varchar2,aname in varchar2) return varchar2; WF_ENGINE. GetItemAttrNumber GetItemAttrNumber(itemtype in varchar2,itemkey in varchar2,aname in varchar2) return number; WF_ENGINE. GetItemAttrDate GetItemAttrDate(itemtype in varchar2,itemkey in varchar2,aname in varchar2) return date; WF_ENGINE. BeginActivity BeginActivity (itemtype in varchar2,itemkey in varchar2,activity in varchar2); Determines if the specified activity can currently be performed on the process item and raises an exception if it cannot. The CompleteActivity() procedure automatically performs this function as part of its validation. However, you can use BeginActivity to verify that the activity you intend to perform is currently allowed before actually calling it. WF_ENGINE. CompleteActivity CompleteActivity(itemtype in varchar2,itemkey in varchar2,activity in varchar2,result_code in varchar2); Notifies the workflow engine that the specified activity has been completed for a particular item. WF_ENGINE. ItemStatus ItemStatus(itemtype in varchar2,itemkey in varchar2,status out varchar2,result out varchar2); Returns the status and result for the root process of the specified item instance. Possible values returned for the status are: ACTIVE, COMPLETE, ERROR, or SUSPENDED. If the root process does not exist, then the item key does not exist and will thus cause the procedure to raise an exception. Workflow core APIs: PL/SQL procedures called by function activities can use a set of core Oracle Workflow APIs to raise and catch errors. When a PL/SQL procedure called by a function activity either raises an unhandled exception, or returns a result beginning with 'ERROR:', the Workflow Engine sets the function activity's status to ERROR and sets the columns ERROR_NAME, ERROR_MESSAGE, and ERROR_STACK in the table WF_ITEM_ACTIVITY_STATUSES to reflect the error. WF_CORE. CLEAR CLEAR Clears the error buffers. WF_CORE. GET_ERROR GET_ERROR(err_name out varchar2,err_message out varchar2 err_stack out varchar2); Returns the name of a current error message and the token substituted error message. Also clears the error stack. Returns null if there is no current error. WF_CORE. RAISE RAISE (name in varchar2); Raises an exception to the caller by supplying a correct error number and token substituted message for the name of the error message provided. Workflow Directory Service APIs: WF_DIRECTORY. GetRoleUsers GetRoleUsers(role in varchar2,users out UserTable); Returns a table of users for a given role. WF_DIRECTORY. GetUserRoles GetUserRoles(user in varchar2,roles out RoleTable); Returns a table of roles that a given user is assigned to. WF_DIRECTORY. GetRoleInfo GetRoleInfo(Role in varchar2,Display_Name out varchar2,Email_Address out WF_ENGINE. AddItemAttr P2P Interview Preparation -‐ by Dinesh Kumar S WF_DIRECTORY. IsPerformer WF_DIRECTORY. GetRoleName WF_DIRECTORY. SetAdHocUserStatus WF_DIRECTORY. SetAdHocRoleStatus WF_DIRECTORY. CreateAdHocUser WF_DIRECTORY. CreateAdHocRole WF_DIRECTORY. AddUsersToAdHocRole WF_DIRECTORY. RemoveUsersFromAdHocRole varchar2,Notification_Preference out varchar2,Language out varchar2,Territory out varchar2); Returns the following information about a role: • Display name • Email address • Notification Preference ('QUERY', 'MAILTEXT', 'MAILHTML','MAILATTH', 'SUMMARY') • Language • Territory IsPerformer (user in varchar2,role in varchar2); Returns true or false to identify whether a user is a performer of a role. GetRoleName (p_orig_system in varchar2,p_orig_system_id in varchar2,p_name out varchar2,p_display_name out varchar2); Returns a Workflow display name and role name for a role given the system information from the original user and roles repository. SetAdHocUserStatus (user_name in varchar2,status in varchar2 default 'ACTIVE'); Sets the status of an ad hoc user as 'ACTIVE' or 'INACTIVE'. SetAdHocRoleStatus (role_name in varchar2,status in varchar2 default 'ACTIVE'); Sets the status of an ad hoc role as 'ACTIVE' or 'INACTIVE'. CreateAdHocUser (name in out varchar2,display_name in out varchar2, language in varchar2 default null, territory in varchar2 default null, description in varchar2 default null, notification_preference in varchar2 default 'MAILHTML', email_address in varchar2 default null, fax in varchar2 default null, status in varchar2 default 'ACTIVE', expiration_date in date default sysdate); Creates a user at runtime by creating a value in the WF_LOCAL_USERS table. This is referred to as an ad hoc user. CreateAdHocRole (role_name in out varchar2, role_display_name in out varchar2, language in varchar2 default null, territory in varchar2 default null, role_description in varchar2 default null, notification_preference in varchar2 default'MAILHTML', role_users in varchar2 default null, email_address in varchar2 default null, fax in varchar2 default null, status in varchar2 default 'ACTIVE',expiration_date in date default sysdate); Creates a role at runtime by creating a value in the WF_LOCAL_ROLES table. This is referred to as an ad hoc role. AddUsersToAdHocRole (role_name in varchar2,role_users in varchar2); Adds users to a existing ad hoc role. RemoveUsersFromAdHocRole (role_name in varchar2,role_users in varchar2 default null); Removes users from an existing ad hoc role. P2P Interview Preparation -‐ by Dinesh Kumar S Advance PL/SQL Ref Cursor: • • A ref cursor is a variable, defined as a cursor type, which points to, or references a cursor result. Ref cursor is a Data type. A variable created using this data type is usually called as a Cursor Variable. A cursor variable can be associated with different queries at run-‐time. Types of REF Cursor: 1) Strong: With a Return Type 2) Weak: Without a Return Type Features of REF Cursor: • There can be a TYPE of ref cursor. The variable of this TYPE can be used to pass the parameters to a program and return value from the cursor. • The variable of REF CURSOR type returns the same data type as the cursor variable. • The cursor variable is passed as a parameter to a procedure. • The cursor variable takes all the rows from the specified table. • These rows are given to the bind variable. So the parameter passed should satisfy two conditions -‐-‐ o The parameter should be taken from the TYPE of Ref Cursor. o It should be of IN OUT mode. • Finally the data retrieved by the cursor variable can be seen through the bind variable. For this the data type of the bind variable should be REFCURSOR. • While executing the procedure bind variable should be directly given. And then by print statement the data is displayed. • The cursor variable's data structure and the procedure block's data structure should be same. Usage Restrictions: • Comparison operators cannot be used to test cursor variables for equality, inequality, null, or not null. • Null cannot be assigned to a cursor variable. • The value of a cursor variable cannot be stored in a database column. • Static cursors and cursor variables are not interchangeable. For example, a static cursor cannot be used in an OPEN FOR statement. P2P Interview Preparation -‐ by Dinesh Kumar S Std. Cursor Vs. REF Cursor: Std. Cursor It is static in definition. It can’t be returned to a client. A normal cursor can be global. A normal cursor can’t be passed from subroutine to subroutine. Better Performance than REF Cursor REF Cursor It may be dynamically opened or opened based on logic. It can be returned to a client. A ref cursor cannot. (you cannot define them OUTSIDE of a procedure / function) A ref cursor can be passed from subroutine to subroutine. Not as good as Std. Cursor but need to use in appropriate situation. REF Cursor Syntax: Method1: Example: TYPE rc1 IS REF CURSOR; Obj_rc1 rc1; Method2: Obj_rc1 SYS_REFCURSOR; DECLARE TYPE r_cursor IS REF CURSOR; c_employee r_cursor; er employee%ROWTYPE; BEGIN OPEN c_employee FOR select * from employee; LOOP FETCH c_employee INTO er; exit when c_employee%NOTFOUND; dbms_output.put_line(er.ename || ' -‐ ' || er.position); END LOOP; CLOSE c_employee; END; Ref Cursor with Record Type: P2P Interview Preparation -‐ by Dinesh Kumar S DECLARE TYPE r_cursor IS REF CURSOR; c_employee r_cursor; TYPE rec_emp IS RECORD ( name VARCHAR2(40), position VARCHAR2(40) ); er rec_emp; BEGIN -‐-‐-‐ -‐-‐-‐ End; PLSQL Collections: A collection is an ordered group of elements of the same type. Each element from the group can be accessed using a unique subscript. The element types of a collection can be either built-‐in datatypes, user-‐defined types or references (REFs) to object types. VARRAY: • Varrays are ordered groups of items of type VARRAY. Varrays can be used to associate a single identifier with an entire collection. • • The maximum size of a varray needs to be specified in its type definition. The range of values for the index of a varray is from 1 to the maximum specified in its type definition. If no elements are in the array, then the array is atomically null. • The main use of a varray is to group small or uniform-‐sized collections of objects. • Elements of a varray cannot be accessed individually through SQL, although they can be accessed in PL/SQL. The type of the element of a VARRAY can be any PL/SQL type except the following: o BOOLEAN o TABLE o VARRAY o object types with TABLE or VARRAY attributes o REF CURSOR o NCHAR o NCLOB o NVARCHAR2 When a varray is declared, a constructor with the same name as the varray is implicitly defined. The constructor creates a varray from the elements passed to it. You can use a constructor wherever you can use a function call, including the SELECT, VALUES, and SET clauses. • • P2P Interview Preparation -‐ by Dinesh Kumar S • A varray can be assigned to another varray, provided the datatypes are the exact same type. Syntax: TYPE <type_name> IS VARRAY (10) OF NUMBER; Steps in defining VARRAY: 1. Declare 2. Initialize using constructor 3. Allocate place to store 4. Assign Value Example: When VARRAY Fails? VARRAY is bounded i.e. when defining VARRAY we define the SIZE. Consider above example we have defined size as 10, when the SQL query pulls records more than 10, VARRAY fails. Any way to increase size of array dynamically? Yes, using “NESTED TABLE”. Nested Table is Unbounded. Nested Table: • An ordered group of items of type TABLE are called nested tables. Nested tables can contain multiple columns and can be used as variables, parameters, results, attributes, and columns. They can be thought of as one column database tables. Rows of a nested table are not stored in any particular order. P2P Interview Preparation -‐ by Dinesh Kumar S • The size of a nested table can increase dynamically, i.e., nested tables are unbounded. Elements in a nested table initially have consecutive subscripts, but as elements are deleted, they can have non-‐consecutive subscripts. • Nested tables can be fully manipulated using SQL, Pro*C, OCI, and PL/SQL. The range of values for nested table subscripts is 1..2147483647. To extend a nested table, the built-‐in procedure EXTEND must be used. To delete elements, the built-‐in procedure DELETE must be used. • An uninitialized nested table is atomically null, so the IS NULL comparison operator can be used to see if a nested table is null. Oracle provides new operators such as CAST, THE, and MULTISET for manipulating nested tables. Syntax: TYPE <type_name> IS TABLE OF NUMBER; Steps in defining VARRAY: • Same as VARRAY. P2P Interview Preparation -‐ by Dinesh Kumar S VARRAY varrays have a maximum size i.e. bounded But not from a varray. Whereas varrays are always dense. Varrays are stored by Oracle in-‐line (in the same tablespace) When stored in the database, varrays retain their ordering and subscripts. varrays do not indexes NESTED TABLE Nested tables are unbounded Individual elements can be deleted from a nested table. The nested tables can be sparse Nested table data is stored out-‐of-‐line in a store table which is a system-‐generated database table associated with the nested table. When stored in the database, nested tables do not retain their ordering and subscripts, Nested tables support indexes Associative Arrays (or) Index by Table (or) PLSQL Table: What VARRAY and NESTED TABLE cannot do? Associating a Key value with array. Syntax: TYPE <type_name> IS TABLE OF NUMBER INDEX BY PLS_INTEGER; TYPE <type_name> IS TABLE OF NUMBER INDEX BY VARCHAR2 (20); TYPE <type_name> IS TABLE OF VARCHAR2 (20) INDEX BY PLS_INTEGER; Note** The Key is always UNIQUE & NOT NULL. P2P Interview Preparation -‐ by Dinesh Kumar S Manipulating Collections: This is done by built-‐in functions and procedures called “Collection Methods”. COUNT Counts no. of elements with values Example: V2.COUNT; LIMIT Current Max. Size of Array Example: V2.LIMIT FIRST Return 1st element value. Example: V2.FIRST LAST Returns last element value. Example: V2.LAST PRIOR Returns prior value of current element Example: V2.PRIOR(3) EXTEND Extend the size of the array. Example: V2.EXTEND(5) TRIM Decrease the size of the array Example: V2.EXTEND(5) DELETE Deletes the value of specific element. Does not apply to VARRAY. EXISTS (n) Checks any key available, if YES returns TRUE NO returns FALSE NEXT Returns next key value Bulk Binding: P2P Interview Preparation -‐ by Dinesh Kumar S What is Bulk Binding? The assignment of values to PL/SQL variables in SQL statements is called binding. The binding of an entire collection at once is referred to as bulk binding. What is the Advantage? Bulk binds improve performance by minimizing the number of context switches between PL/SQL and SQL engines while they pass an entire collection of elements (varray, nested tables, index-‐by table, or host array) as bind variables back and forth. Prior to Oracle8i, the execution of every SQL statement required a switch between the PL/SQL and SQL engines, whereas bulk binds use only one context switch. How to Bulk Bind? Bulk binding includes the following: 1. Input collections, use the FORALL statement 2. Output collections, use BULK COLLECT clause Input Collections: Input collections are data passed from the PL/SQL engine to the SQL engine to execute INSERT, UPDATE, and DELETE statements. FORALL index IN lower_bound..upper_bound sql_statement; Note: If a FORALL statement fails, then database changes are rolled back to an implicit savepoint marked before each execution of the SQL statement. P2P Interview Preparation -‐ by Dinesh Kumar S Output Collections: Output collections are data passed from the SQL engine to the PL/SQL engine as a result of SELECT or FETCH statements. The keywords BULK COLLECT can be used with SELECT INTO, FETCH INTO, and RETURNING INTO clauses. The syntax is as follows: ... BULK COLLECT INTO collection_name[, collection_name] .... Example: SELECT INTO Example: FETCH INTO Restriction: You cannot bulk-‐fetch from a cursor into a collection of records. P2P Interview Preparation -‐ by Dinesh Kumar S Example: Cursor Attribute The new composite cursor attribute for bulk binds is %BULK_ROWCOUNT. It's syntax is as follows: IF SQL%BULK_ROWCOUNT(i) = ... THEN ..... ENDIF; P2P Interview Preparation -‐ by Dinesh Kumar S Oracle Interfaces Overview PO Import: Program Name: Import Standard Purchase Orders Short Name: POXPOPDOI Application: Purchasing Executable: POXPDOI Executable Method: SQL*Plus Tables: Table Name Mandatory Columns PO_HEADERS_INTERFACE § INTERFACE_HEADER_ID § INTERFACE_LINE_ID PO_LINES_INTERFACE § INTERFACE_HEADER_ID § INTERFACE_LINE_ID PO_DISTRIBUTIONS_INTERFACE § INTERFACE_HEADER_ID § INTERFACE_DISTRIBUTION_ID § INTERFACE_TYPE PO_INTERFACE_ERRORS § INTERFACE_TRANSACTION_ID § CREATION_DATE § CREATED_BY § LAST_UPDATE_DATE § LAST_UPDATED_BY FAQ -‐ PO Import: What should I do if the Purchase Document Open Interface (PDOI) process fails? The first thing is to check for the error message and examine description from the po_interface_errors table for the given interface_header_id. The description would be self explanatory. Accordingly check for the data in the po_headers_interface, po_lines_interface tables and correct them and run the PDOI again with the corrected data. How do I to get the log file for the PDOI run? To get the log file for the PDOI set the following profile option to Yes : PO: Write server output to file. How to view/purge and correct the errors tables? To view the errors run the following Report: Purchasing interface error report. To Purge the error and interface tables run the following Reports: Purge purchasing open interface processed data report. Purchasing interface error report. P2P Interview Preparation -‐ by Dinesh Kumar S What do I do when POs are not being picked up by PDOI and these records remain in pending status? Check if the client is a single org instance. If you are using single org instance then you are not supposed to populate the org_id in the interface tables. Org_id should be null for a single org implementation. How should I populate the project and task information in PDOI? The point to be noted here is that always populate project name and task name into the project and task column of po_headers_interface table instead of project number and task number. Based on project name and task name PDOI derives the project_id and task_id and inserts in the po_distributions table. What should I do if PDOI errors out with "po_pdoi_invalid_dest_type destination type (value = expense) is not valid" for expense items? This Error can arise out of following situation: 1. Validation of destination organization id fails. 2. Validation of destination type code fails. 3. Item_id is NULL and destination_type_code is INVENTORY. 4. Validation of destination subinventory fails. 5. Destination_type_code in ('SHOP FLOOR','EXPENSE') and destination_subinventory is not null. 6. Validation of destination organization id fails. Can you update documents via PDOI which were created manually? Yes we can update. Its important to note that it is necessary to supply DOCUMENT_NUM in the PO_HEADERS_INTERFACE when trying to update blanket purchase agreements which has not been created through the PDOI. For documents created through PDOI, VENDOR_DOC_NUM can be specified in the PO_HEADERS_INTERFACE. Why does PDOI error out with "ora-‐00001 unique constraint violation in po_headers_u2"? Though this issue may occur rarely but it can and its explained below: The document number is generated at the end of the PDOI process before commit and updated in the po_headers table. When the PDOI process starts, po_headers table is updated with poi_temp_po_b679535 value in segment1 and then later after headers and lines are processed document_number is generated and the po_headers is updated with that. Assume for any reason on account of an incomplete transaction there is a record in po_headers table with poi_temp_po_b679535 value in segment1 then PDOI would fail with the above error message. So just check for a record in po_headers table with poi_temp_po_b679535 value of the segment1 for this error. How is data deleted from the interface tables after it has been loaded? After successful creation of data through PDOI, the process_code in the interface tables will be set to 'Accepted'. If the Customer wants to delete this interface data which is used no more then they need to run the concurrent request 'Purge purchasing interface processed data'. I had loaded all the data into the interface tables and with process_code as 'PENDING'. I run the PDOI program, but data is not getting picked up by PDOI. The records remain in status 'PENDING' in the interface tables. What do I do? Check whether client is single org. If they are single org, then they should not populate org_id into the interface tables. make the org_id null in the interface tables and re-‐run PDOI. P2P Interview Preparation -‐ by Dinesh Kumar S I want to update header of a document. Is it possible via PDOI? No. It is not possible to update header information but only line information can be updated from PDOI. you can use 'Replace' option to replace the entire document in this case. I am trying to update item description through PDOI. The program is updating the item description at the line level but is not updating the same at item master. This is desired functionality of PDOI. PDOI will only update the item description at the line level and not at item master. The first thing is to check for the error message and examine description from the po_interface_errors table for the given interface_header_id. The description would be self explanatory. Accordingly check for the data in the po_headers_interface, po_lines_interface tables and correct them and run the PDOI again with the corrected data. What documents types are supported ? Currently, the Purchasing Document Open Interface can import the following: Blanket Quotation Item Sourcing Rules ** Standard Purchase Orders can be imported through POXPDOI in Release 11i only with one-‐off Patch 1550991. This one-‐off patch will also be included in 11i.PO.D. ** Standard Purchase Orders cannot be imported in release 11.0.X ** Blanket Releases cannot be imported in any release What Actions are supported? ORIGINAL -‐ create a new document ADD -‐ add new lines onto an existing document UPDATE -‐ update existing line information for a document REPLACE -‐ Replace the existing document Which interface tables are involved? PO_HEADERS_INTERFACE PO_LINES_INTERFACE PO_DISTRIBUTIONS_INTERFACE(Used for Standard PO only) Which document types can be updated by using Purchasing Document Open interface? Blankets and quotations created by Purchasing Document Open Interface. Blankets and quotations created manually via Oracle Applications standard forms can not be updated by using Purchasing Document Open Interface since there is no value for vendor_order_num for blanket or quote_vendor_quote_number for quotation. In release 11.5.10, new lines and associated shipments can be added to an existing standard purchase order created by PDOI. Existing lines in the Standard PO can not be updated using this process. P2P Interview Preparation -‐ by Dinesh Kumar S REQ Import: Program Name: Requisition Import Short Name: REQIMPORT Application: Purchasing Executable: POCIRM Executable Method: Spawned Tables: Table Name Mandatory Columns § INTERFACE_SOURCE_CODE PO_REQUISITIONS_INTERFACE_ALL § DESTINATION_TYPE_CODE § AUTHORIZATION_STATUS PO_REQ_DIST_INTERFACE_ALL § INTERFACE_SOURCE_CODE § INTERFACE_TYPE PO_INTERFACE_ERRORS § INTERFACE_TRANSACTION_ID § CREATION_DATE § CREATED_BY § LAST_UPDATE_DATE § LAST_UPDATED_BY FAQ -‐ REQ Import: What methods are available in the application to resolve errored records in the PO_INTERFACE_ERRORS table? Oracle Purchasing provides the Requisition Import Exceptions Report, which can be used to diagnose problems with the records, which have currently errored out in the PO_REQUISITIONS_INTERFACE_ALL table. To run the report, follow these steps: 1. Using Purchasing responsibility, navigate to Reports-‐>Run 2. Select the Requisition Import Exceptions Report There is a parameter titled 'Delete Exceptions'. If this is populated with 'Yes', then all records in the PO_REQUISITIONS_INTERFACE_ALL table with a status of 'ERROR' and the corresponding records in the PO_INTERFACE_ERRORS will be deleted when the report is executed. You can also restrict the deleted records by selecting the Batch_id and the Interface Source code. If the parameter is set to No, then you will see the errors from the report and be able to manually fix the data in the table, if so desired; then, upon completion of the data correction, run Requisition Import again to process the modified rows in the interface table. What are the grouping options for imported requisitions? The requisition import process has a group by parameter. Use this feature to determine how requisition lines are grouped on the requisitions you create. The default in this field is set in the Purchasing Options window. Choose one of the following options: • All: Group all requisition lines on one requisition P2P Interview Preparation -‐ by Dinesh Kumar S • Buyer: Group requisition lines for each buyer name on a separate requisition • Category: Group requisition lines for each purchasing category on a separate requisition • Item: Group requisition lines for each item on a separate requisition • Location: Group requisition lines for each location on a separate requisition • Supplier: Group requisition lines for each supplier name on a separate Requisition To define a default in the Purchasing Options form, follow these steps: 1. Using Purchasing responsibility, navigate to Setup-‐> Organizations-‐> Purchasing Options 2. Enter a default value for the 'Requisition Import Group-‐By' field (under Document Defaults) 3. Save changes The Requisition Import process will first look at the group by parameter selected when the process is submitted; should this parameter be left blank, the system will then look to the group by field residing in the Purchasing Options form. How does Requisition Import determine the grouping method for incoming pieces of data? The process groups requisitions following this order: 1. Assign values to REQUISITION_LINE_ID and REQ_DISTRIBUTION_ID 2. Group requisitions based on the REQ_NUMBER_SEGMENT1 column. All requisitions with the same NOT NULL REQ_NUMBER_SEGMENT1 are assigned the same REQUISITION_HEADER_ID. 3. Group requisitions based on the GROUP_CODE column. All requisitions with the same value in the GROUP_CODE column are assigned the same REQUISITION_HEADER_ID. 4. Group requisitions based on the GROUP_BY parameter, which takes on the value of DEFAULT_GROUP_BY if not provided. GROUP_BY could be one of the following: BUYER, CATEGORY, ITEM, VENDOR, LOCATION or ALL. How can automatically approve the requisitions I am creating? There are two ways of doing this: 1. You can populate records in the Interface table with status as Approved. In this case the Approval process is not called after creating the requisition. 2. If you want the requisitions created to go through the approval process then you have to set Requisition Import Parameter 'Initiate Approval after Reqimport' to 'Yes' when Launching the Requisition Import Concurrent Program. 3. Yes: The PO Requisition Approval workflow is launched automatically for requisitions imported with a status of Pre-‐Approved or Incomplete. No: The PO Requisition Approval workflow is not automatically launched for Pre-‐Approved or Incomplete requisitions. You can submit these to the approval process later, when you select the Approve button on the requisition. For the Requisition to be automatically Approved, the APPROVER_ID value from PO_REQUISITIONS_INTERFACE_ALL must have authority to approve the requisition. If that user does not have approval authority, then the requisition will be in status = In Process and forwarded up that user's Approval Hierarchy. Can requisition import handle multiple currencies? Requisition Import is capable of handling multiple currencies, provided that all rate types and currency conversions have been defined. Can requisition import handle multiple distributions? P2P Interview Preparation -‐ by Dinesh Kumar S Requisition Import can handle multiple distributions. Is requisition import organization-‐specific? Requisition Import is operating unit-‐specific. Within the PO_REQUISITIONS_INTERFACE_ALL table lies the column ORG_ID.Upon Initiating the Requisition Import program, the profile 'MO: Operating Unit' is queried to derive the value of ORG_ID tied to the login running the program. Then the Requisition Import program executes, all records in the interface table which are the same as the organization listed in the 'MO: Operating Unit' profile will be processed. If you don't see any valid Import source when you launch Reqimport but if you had already populated the Interface table then you have to check the org_id Column you populated. this org_id will be your operating unit tied to your Applications log-‐ in responsibility. If the org_id is NULL then you can see you record in the Import Source. Here is a script to assist: select hr.name from hr_all_organization_units hr, po_requisitions_interface_all pri where hr.organization_id = pri.org_id and pri.interface_source_code = '&source' order by pri.creation_date desc; How does requisition import process generate accounts? It can be either one of two methods for accounts to be generated: 1. By a valid CCID or 2. By a valid combination of account segments. Requisition import does not use the account generator process. The process validates the charge_account_id or the combination of account segments which are populated in the interface table. This is the existing functionality. An enhancement request Bug 2245333 is logged to request the ability for the requisition import to use the same logic used in the requisition form. When I load the Requisition Interface and create Requisitions it always does sourcing. How can I stop sourcing from happening? You have to set the autosource_flag in the Requisition interface to 'N' to avoid vendor Sourcing How can I avoid sourcing from overriding my vendor information? You have to set the autosource_flag to 'P' for partial sourcing. Does the requisition import allow note to vendor to be imported on requisitions? The requisition import does not support the note to vendor field at this time. How to Import the Requisition ordered by Line Number? Per standard functionality the line number is a sequence number starting from 1 for records having the same requisition header id order by item_description and quantity. In other words, the po_requisition_lines table is ordered by item_description and quantity for the same header_id and then the line_num is updated with a counter that increments by 1. It is not possible to populate line number in the interface table. The following enhancement requests are logged requesting the ability to sort the lines: Enhancement Request < Bug 3906591> and Enhancement Request Bug 4205941. Item Import : P2P Interview Preparation -‐ by Dinesh Kumar S Import Overview: § Use the item import process to import items from your legacy system or PDM system. You can import items from any source into Oracle Inventory and Oracle Engineering. § When you import items through the Item Interface, you create new items in your Item Master organization or assign existing items to additional organizations. You can specify values for all the item attributes, or you can specify just a few attributes and let the remainder default or remain Null. § You can also specify an item template for each item and inherit attribute values from the template. § The Item Interface also lets you import revision details, including past and future revisions and effective dates. Program Name: Import Items Short Name: INCOIN Application: Inventory Executable: INCOIN Executable Method: Spawned Tables: Table Name Mandatory Columns MTL_SYSTEM_ITEM_INTERFACE § SET_PROCESS_ID MTL_ITEM_REVISIONS_INTERFACE § SET_PROCESS_ID MTL_ITEM_CATEGORIES_INTERFACE § SET_PROCESS_ID § LAST_UPDATE_DATE MTL_INTERFACE_ERRORS § LAST_UPDATED_BY § CREATION_DATE § CREATED_BY § The Item Interface reads data from two tables for importing items and item details. You use the MTL_SYSTEMS_ITEM_INTERFACE table for new item numbers and all item attributes. This is the main item interface table, and can be the only table you choose to use. § If you are importing revision details for new items, you can use the MTL_ITEM_REVISIONS_INTERFACE table. A third table, MTL_INTERFACE_ERRORS, is used for error tracking of all items that the Item Interface fails. You can import item categories using interface table called as MTL_ITEM_CATEGORIES_INTERFACE. § Before you use the Item Interface, you must write and run a custom program that extracts item information from your source system and inserts it into the MTL_SYSTEM_ITEM_INTERFACE table, and (if revision detail is included) the MTL_ITEMS_REVISIONS_INTERFACE table. § After you load the items into these interface tables, you run the Item Interface to import the data. § The Item Interface assigns defaults, validates data you include, and then imports the new items. You may also specify an item template for each item being imported. P2P Interview Preparation -‐ by Dinesh Kumar S § You must import items into the Item Master organization before you import items into additional organizations. You can accomplish this by specifying only your Item Master organization on first run of the Item Interface. Once this has completed, you can run the Item Interface again, this time specifying an additional or all organizations. You can also use the Item Interface to import a single item material cost and material overhead, and revision details. FAQ -‐ Item Import: How do I know what error has occurred? § The process_flag in mtl_system_items_interface will be 3. Now the error message will be in mtl_interface_errors table. § The record in mtl_system_items_interface will have a transaction_id. There will be corresponding record with error code and explanation in mtl_interface_errors. select transaction_id from mtl_system_items_interface where process_flag = 3; § Now substitue the &transaction_id value in the following sql by the value that you get in the ablove sql. You should be able to see the error. select message_name,column_name,error_message from mtl_interface_errors where transaction_id = &transaction_id; What things should I check if I getting errors? § First check if you are populating the correct values in all the fields. § Then check if there are any mandatory descriptive flexfield columns. § You can go to application setup > flexfields > descriptive > segments and on query type ?Items? in title field and then check each segment whether it is mandatory and whether it is doing any validation against some pre-‐ existing values in some value set. § If so check if the corresponding attributes are populated properly. Many times user forgets to populate mandatory values and item import fails. § Also check for invalid objects. Select object_name,object_type from all_objects where status = 'INVALID'; If any invalid objects please recompile those and retest item import. I run item import but records are not getting processed. The process_flag is still 1? § Check under sysadmin> concurrent managers whether inventory namager is running. § Then check if there is suffcient memory and extent spaces. § Please use the following truncate . This frees up space. TRUNCATE TABLE INV.MTL_SYSTEM_ITEMS_INTERFACE; TRUNCATE TABLE INV.MTL_INTERFACE_ERRORS; TRUNCATE TABLE INV.MTL_ITEM_REVISIONS_INTERFACE; TRUNCATE TABLE INV.MTL_ITEM_CATEGORIES_INTERFACE; P2P Interview Preparation -‐ by Dinesh Kumar S § Now try importing one record and see if you are able to import it successfully. § If you see ORA-‐1654 happens while inserting records into mtl_pending_item_status table in the log file (01654, 00000, "unable to extend index %s.%s by %s in tablespace %s") please use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated. After importing items, they can't be seen in the Master Item form. Querying the items return "No Items Found". § Do a SELECT from the mtl_system_items table and confirmed the items are loaded. Also verify that the item organization id is the same as the Master organization. § Check the value of the eng_item_flag. If value is 'N' then the item is an inventory item. If the value is 'Y' then the item is an engineering item and is not viewable from inventory. While importing items from a legacy system into the mtl_transactions_interface table, during the validation process an error occurs: 'oracle error 1426 in inltev' cause: inltev failed due to ora -‐ 01426 numeric overflow. The sql statement being executed at the time of the error was update mtl_transaction_interface mti set last_update_date= sysdate, l and was executed... § Check the script being using to load the transactions and make sure there is no item in the legacy system that isn't in oracle mtl_system_items table. § During the validation process the transaction being loaded for an item couldn't find the item in oracle. The error occurs because it was trying to insert transactions for a non existant item into the system. -‐ The way it works is that it flags (errors) that item with an invalid item id, and then the other items following the errored item (invalid item id) would have a numeric overflow error. If items in the interface exist in the item master but not in the child org it was inserting into, this error could also occur. When trying to insert records in the MTL_SYSTEM_ITEMS_INTERFACE_TABLE, getting an error: ORA-‐00001: unique constraint (INV.MTL_SYSTEM_ITEMS_INTERFACE_U2) violated § INVPAGI2. assign_item_header_recs: ORA-‐00001: unique constraint (INV.MTL_SYSTEM_ITEMS_INTERFACE_U2) violated § This is due to index MTL_SYSTEM_ITEMS_INTERFACE_U2 which is created incorrectly in systems setup. Find out how many segments are used in the System Items Key Flex Field. Drop the index MTL_SYSTEM_ITEMS_INTERFACE_U2. Create a new MTL_SYSTEM_ITEMS_INTERFACE_U2 index on ORGANIZATION_ID and all the enabled segments of the System Items Flex Field. P2P Interview Preparation -‐ by Dinesh Kumar S Item import process appears to have run successfully. There are no errors in the mtl_interface_errors table. The log file contains no warnings or error messages. The System_items_interface table still contains the items and the process_flag is still at 1. It is as if the process has never been run. § Running the item import process normally gives error messages to indicate problems with validating new items. When no errors appear, it can only be due to two reasons. First, that item import has completed successfully, or second, that there is a machine resource issue/problem. § Item Import loads the records from the interface table into system memory before it starts processing them. If there are more rows of data than available memory, the item import process will fail without giving any error messages or indication of a problem. § Thus before loading data to be imported, you need to consider the memory resources available on your system and load the data accordingly. § It is always recommended that the user test with 1 item initially, to verify that it is imported successfully. User should verify that the loaded data is valid and will run through the system without errors. Following this, batches of 100 -‐ 1000 can be tested to determine the most suitable batch size for your system. The following errors occur in the concurrent request log after an unsuccessful attempt at item import: § INVPOPIF:ORA-‐6502 pl/sql numeric or value error This error may occur more than once. § The solution to this issue is to disable any custom triggers that may be on the MTL-‐SYSTEM_ITEMS table. Custom triggers on any of the tables involved with item import could potentially cause problems. Also, check MTL_ITEM_REVISIONS (if importing item revisions) and MTL_ITEM_CATEGORIES. If importing costs also check for custom triggers on the CST_ITEM_COST_DETAILS, and CST_ITEM_COSTS tables. What are the required key flexfields in Oracle Inventory? The required flexfields for Oracle Inventory and their corresponding codes appear in the error statement: (app-‐xxxxx fdfrkf:appl=401 code = XXXX num = 101): Key Flexfield Code Owner Accounting Flexfield GL# GL System Items MSTK INV Item Categories MCAT INV Item Catalogs MICG INV Stock Locators MTLL INV Account Aliases MDSP INV Sales Orders MKTS INV P2P Interview Preparation -‐ by Dinesh Kumar S Oracle Application Validation Error Codes: Please refer the below Oracle documents for validation errors. http://docs.oracle.com/cd/E19509-‐01/820-‐4390/6nfs0i9e0/index.html • Manufacturing o Inventory : http://docs.oracle.com/cd/E19509-‐01/820-‐4390/ggtqg/index.html o Requisition: http://docs.oracle.com/cd/E19509-‐01/820-‐4390/ggtrg/index.html o Purchase Order : http://docs.oracle.com/cd/E19509-‐01/820-‐4390/ggtng/index.html o Receiving: http://docs.oracle.com/cd/E19509-‐01/820-‐4390/ggtrm/index.html • Financial Budget-‐GL o Account Payables: http://docs.oracle.com/cd/E19509-‐01/820-‐4390/ggtpw/index.html o Account Receivable: http://docs.oracle.com/cd/E19509-‐01/820-‐4390/ggtne/index.html o Cash Management: http://docs.oracle.com/cd/E19509-‐01/820-‐4390/ggtqw/index.html o Fixed Assets: http://docs.oracle.com/cd/E19509-‐01/820-‐4390/ggtsa/index.html o General Ledger: http://docs.oracle.com/cd/E19509-‐01/820-‐4390/ggtsb/index.html P2P Interview Preparation -‐ by Dinesh Kumar S