Tuesday, July 1, 2014

SQL query to find out Drop Ship Sales Order, Line, Requisition and Purchase order

select h.order_number,l.line_number SO_Line_number,  ph.segment1
PO_Number,pl.line_num PO_Line_Number,
ph.authorization_status,ph.closed_date,ph.closed_code,
prh.interface_source_code,
prh.segment1 Requisition_number, prl.line_num Requisition_line_number
from
OE_DROP_SHIP_SOURCES ods,
oe_order_headers_all h,
oe_order_lines_all l,
po_line_locations_all pll,
po_lines_all pl,
po_headers_all ph,
po_requisition_headers_all prh,
po_requisition_lines_all prl
where h.header_id = l.header_id
and h.header_id = ods.header_id
and ods.line_location_id = pll.line_location_id
and ods.po_header_id = ph.po_header_id
and ods.po_line_id = pl.po_line_id
and ph.po_header_id = pl.po_header_id
and prh.requisition_header_id = ods.requisition_header_id
and prl.requisition_line_id = ods.requisition_line_id
and prh.requisition_header_id = prl.requisition_header_id
and h.order_number = &sales_order_number;

SQL Query to find sales order lines whose workflow is Purged

Select Line_Id, flow_status_code,ordered_quantity,shipped_quantity, fulfilled_flag, invoice_interface_status_code
From Oe_Order_Lines_All l
where open_flag = 'Y'
And not Exists
(Select 1 From Wf_Items W
Where W.Item_Type='OEOL'
and w.item_key = to_char(l.line_id));

Friday, June 27, 2014

Sql query for relation between Business Group, Legal Entity, Operating Unit and Balancing segment

select HRL.COUNTRY,
  HROUTL_BG.name BG,
  HROUTL_BG.ORGANIZATION_ID,
  LEP.LEGAL_ENTITY_ID,
  LEP.name LEGAL_ENTITY,
  HROUTL_OU.name OU_NAME,
  HROUTL_OU.ORGANIZATION_ID ORG_ID,
  HRL.LOCATION_ID,
  HRL.LOCATION_CODE,
  GLEV.FLEX_SEGMENT_VALUE
from XLE_ENTITY_PROFILES LEP,
  XLE_REGISTRATIONS REG,
  HR_LOCATIONS_ALL HRL,
  HZ_PARTIES HZP,
  FND_TERRITORIES_VL TER,
  HR_OPERATING_UNITS HRO,
  HR_ALL_ORGANIZATION_UNITS_TL HROUTL_BG,
  HR_ALL_ORGANIZATION_UNITS_TL HROUTL_OU,
  HR_ORGANIZATION_UNITS GLOPERATINGUNITSEO,
  GL_LEGAL_ENTITIES_BSVS GLEV
where LEP.TRANSACTING_ENTITY_FLAG      = 'Y'
and LEP.PARTY_ID                       = HZP.PARTY_ID
and LEP.LEGAL_ENTITY_ID                = REG.SOURCE_ID
and REG.SOURCE_TABLE                   = 'XLE_ENTITY_PROFILES'
and HRL.LOCATION_ID                    = REG.LOCATION_ID
and REG.IDENTIFYING_FLAG               = 'Y'
and TER.TERRITORY_CODE                 = HRL.COUNTRY
and LEP.LEGAL_ENTITY_ID                = HRO.DEFAULT_LEGAL_CONTEXT_ID
and GLOPERATINGUNITSEO.ORGANIZATION_ID = HRO.ORGANIZATION_ID
and HROUTL_BG.ORGANIZATION_ID          = HRO.BUSINESS_GROUP_ID
and HROUTL_OU.ORGANIZATION_ID          = HRO.ORGANIZATION_ID
and GLEV.LEGAL_ENTITY_ID               = LEP.LEGAL_ENTITY_ID;

SQL Query To Check Form Personalizations

SELECT   ffcr.SEQUENCE "Seq", ffcr.description "Description",
         DECODE (ffcr.rule_type,
                 'F', 'Form',
                 'A', 'Function',
                 'Other'
                ) "Level",
         ffcr.enabled "Enabled", ffcr.trigger_event "Trigger Event",
         ffcr.trigger_object "Trigger Object", ffcr.condition "Condition",
         DECODE (ffcr.fire_in_enter_query,
                 'Y', 'Both',
                 'N', 'Not in Enter-Query Mode',
                 'O', 'Only in Enter-Query Mode',
                 'Other'
                ) "Processing Mode"
    FROM apps.fnd_form_custom_rules ffcr
   WHERE ffcr.function_name = 'PO_POXPOEPO'
     AND ffcr.form_name = 'POXPOEPO'
ORDER BY ffcr.SEQUENCE;

Key Tables in Oracle Inventory

TableDescription
MTL_PARAMETERSIt 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.
MTL_SYSTEM_ITEMS_BThis 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.
MTL_ITEM_STATUSThis 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.
MTL_UNITS_OF_MEASURE_TLThis 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.
MTL_ITEM_LOCATIONSThis is the definition table for stock locators. The associated attributes describe which subinventory this locator belongs to, what the locator physical capacity is, etc.
MTL_ITEM_CATEGORIESThis 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.
MTL_CATEGORIES_BThis 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.
MTL_CATEGORY_SETS_BIt 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.
MTL_DEMANDThis 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.
MTL_SECONDARY_INVENTORIESThis 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 valid places where this item will physically exist in inventory.
MTL_ONHAND_QUANTITIESIt 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.
MTL_TRANSACTION_TYPESIt 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.
MTL_MATERIAL_TRANSACTIONSThis 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.
MTL_ITEM_ATTRIBUTESThis 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.
MTL_ITEM_CATALOG_GROUPS_BThis 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.
MTL_ITEM_REVISIONS_BIt 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.
MTL_ITEM_TEMPLATES_BThis 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.
MTL_DESCRIPTIVE_ELEMENTSIt stores the descriptive element definitions for an item catalog group. Descriptive elements are defining properties used to describe in the catalog group.
MTL_DESCR_ELEMENT_VALUESIt 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.
ORG_ACCT_PERIODSIt holds the open and closed financial periods for organizations.
MTL_CUSTOMER_ITEMSIt 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.
MTL_SYSTEM_ITEMS_INTERFACEIt temporarily stores the definitions for inventory items, engineering items and purchasing items before loading this information into Oracle Inventory.
MTL_TRANSACTIONS_INTERFACEIt allows calling applications to post material transactions (movements, issues, receipts etc. to Oracle Inventory  transaction module.
MTL_ITEM_REVISIONS_INTERFACEIt temporarily stores revision levels for an inventory item before loading this information into Oracle Inventory.
MTL_ITEM_CATEGORIES_INTERFACEThis table temporarily stores data about inventory item assignments to category sets and categories before loading this information into Oracle Inventory.
MTL_DESC_ELEM_VAL_INTERFACEThis table temporarily stores descriptive element values for an item that is associated with an item catalog group before loading this information into Oracle Inventory.
MTL_DEMAND_INTERFACEIt 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.
MTL_INTERFACE_ERRORSIt stores errors that occur during the item interface process reporting where the errors occurred along with the error messages.

FND Tables

FND_APPLICATION:  Stores applications registered with Oracle Application Object Library.

FND_APPLICATION_TL: Stores translated information about all the applications registered with Oracle Application Object Library.

FND_APP_SERVERS: This table will track the servers used by the E-Business Suite system.

FND_ATTACHED_DOCUMENTS: Stores information relating a document to an application entity.

FND_CONCURRENT_PROCESSES: Stores information about concurrent managers.

FND_CONCURRENT_PROCESSORS: Stores information about immediate (subroutine) concurrent program libraries.

FND_CONCURRENT_PROGRAMS: Stores information about concurrent programs. Each row includes a name and description of the concurrent program.

FND_CONCURRENT_PROGRAMS_TL: Stores translated information about concurrent programs in each of the installed languages.

FND_CONCURRENT_QUEUES: Stores information about concurrent managers.

FND_CONCURRENT_QUEUE_SIZE: Stores information about the number of requests a concurrent manager can process at once, according to its work shift.

FND_CONCURRENT_REQUESTS: Stores information about individual concurrent requests.

FND_CONCURRENT_REQUEST_CLASS: Stores information about concurrent request types.

FND_CONC_REQ_OUTPUTS: This table stores output files created by Concurrent Request.

FND_CURRENCIES: Stores information about currencies.

FND_DATABASES: It tracks the databases employed by the eBusiness suite. This table stores information about the database that is not instance specific.

FND_DATABASE_INSTANCES: Stores instance specific information. Every database has one or more instance.

FND_DESCRIPTIVE_FLEXS: Stores setup information about descriptive flexfields.

FND_DESCRIPTIVE_FLEXS_TL: Stores translated setup information about descriptive flexfields.

FND_DOCUMENTS: Stores language-independent information about a document.

FND_EXECUTABLES: Stores information about concurrent program executable.

FND_FLEX_VALUES: Stores valid values for key and descriptive flexfield segments.

FND_FLEX_VALUE_SETS: Stores information about the value sets used by both key and descriptive flexfields.

FND_LANGUAGES: Stores information regarding languages and dialects.

FND_MENUS: It lists the menus that appear in the Navigate Window, as determined by the System Administrator when defining responsibilities for function security.

FND_MENUS_TL: Stores translated information about the menus in FND_MENUS.

FND_MENU_ENTRIES: Stores information about individual entries in the menus in FND_MENUS.

FND_PROFILE_OPTIONS: Stores information about user profile options.

FND_REQUEST_GROUPS: Stores information about report security groups.

FND_REQUEST_SETS: Stores information about report sets.

FND_RESPONSIBILITY: Stores information about responsibilities. Each row includes the name and description of the responsibility, the application it belongs to, and values that identify the main menu, and the first form that it uses.

FND_RESPONSIBILITY_TL: Stores translated information about responsibilities.

FND_RESP_FUNCTIONS: Stores security exclusion rules for function security menus. Security exclusion rules are lists of functions and menus inaccessible to a particular responsibility.

FND_SECURITY_GROUPS: Stores information about security groups used to partition data in a Service Bureau architecture.

FND_SEQUENCES: Stores information about the registered sequences in your applications.

FND_TABLES: Stores information about the registered tables in your applications.

FND_TERRITORIES: Stores information for countries, alternatively known as territories.

FND_USER: Stores information about application users.

FND_VIEWS: Stores information about the registered views in your applications.


Important Account Payables Tables

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.


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:
  • 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 denormalized information about invoices and payments posted to the accrual set of books.



Disclaimer

All content provided on this blog is for informational purposes only. The owners of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site. All trademarks, trade names, service marks, copyrighted work and logos referenced here - belong to their respective owners.If you want to report any content that is violating copyright law and you want us to remove it, please contact us.

Featured Post

Complete Oracle P2P cycle