Query to find Service Contract, Line, Subline, Item, Order Information

The following query lists all the service contract related information.


-------------------------------------------------------------------------------
-- Query to find Service Contract, Line, Subline, Item, Order Information
-------------------------------------------------------------------------------
SELECT okh.contract_number         "Contract Number",
       okh.scs_code                "Code",
       ooh.order_number            "Order Number",
       TO_NUMBER(sl.line_number)   "SL Line",
       sl.lse_id                   "SL LSE ID",
       TO_NUMBER(cl.line_number)   "CL Line",
       cl.lse_id                   "CL LSE ID",
       TO_CHAR(cl.id)              "CL ID",
       msi.inventory_item_id,
       msi.segment1                "Item Number",
       cii.serial_number           "Serial Number",
       okh.start_date              "Contract Start Date",
       sl.start_date               "Line Start Date",
       cl.start_date               "Subline Start Date"
  FROM okc_k_headers_all_b   okh,
       okc_k_lines_b         sl,
       okc_k_lines_b         cl,
       okc_k_items           oki,
       okc_k_rel_objs        rel,
       csi_item_instances    cii,
       mtl_system_items_b    msi,
       oe_order_headers_all  ooh
 WHERE 1=1
   AND okh.id                   =  sl.chr_id
   AND cl.cle_id                =  sl.id
   AND sl.cle_id IS NULL
   AND cl.id                    =  oki.cle_id(+)
   AND oki.object1_id1          =  cii.instance_id
   AND cii.inventory_item_id    =  msi.inventory_item_id
   AND okh.inv_organization_id  =  msi.organization_id
   AND rel.chr_id               =  okh.id
   AND rel.jtot_object1_code    =  'OKX_ORDERHEAD'
   AND rel.object1_id1          =  ooh.header_id
   AND oki.object1_id2          =  '#'
   ----
   -- AND okh.cust_po_number       =  ooh.cust_po_number
   -- AND okh.ship_to_site_use_id  =  ooh.ship_to_org_id
   --
   /* if subline start date is earlier than line start date */
   -- AND sl.start_date > cl.start_date
   ----
   -- following conditions are for test purpose only
   ----
   -- AND okh.contract_number = '12796'
   -- AND sl.line_number      = 1
 ORDER BY okh.contract_number,
       TO_NUMBER(sl.line_number),
       TO_NUMBER(cl.line_number);

No comments:

Topics Covered

Purchasing Concurrent program INVENTORY MODULE Inventory Concepts Min-Max Puchasing Sales Order Supply Chain Management Xml Publisher dff Alert Creation Assembly Pull Assigning Approval Groups Assigning Item BOM Tables Backend Tables Base Tables Bills of Material Tables CATALOG TABLES CATEGORY TABLES Closed not Summarized Concurrent Programs Concurrent Request Consigned and VM Inventory Count (*) Customer Items Customer Items Architecture DDL DML Defining Line Type Defining Subinventories Drop Ship EBS EVEN NUMBERED Error: - APP-PER-50022 FND Tables FRM-40735 Fetch Item Information Flexfields Functional GENERIC DISPOSITIONS Hosting ITEM LOCATIONS TABLE Idle Session Timeout Important questions Introduction to Database Invalid Identifier Error Inventory Inventory Implementation Inventory Item master Inventory Transaction Item Attributes Item Cross Reference Item Defining Attributes Item Deletion Item Master Item Relationships Item Status Attributes Item Tables Java Setup for R12 Key Tables Location Creation Lot and Serial Manufacturer Items Move order Normalization ODD NUMBERED ORA-29273 ORDER MANAGEMENT Oracle Apps Oracle Instance Oracle Order Management PURCHASING MODULE Payable Table Payment Terms Procure to Pay Cycle Profile Categories Purchase - PO Revisions Purchase - Purchase Document Types Purchase Order Purchasing - Define Buyers Purchasing - Defining Approval Groups Purchasing - Invoice matching Purchasing Options Quotations Quote Analysis RFQ RICE Components Receipt Routings Receivables (AR) Tables Receiving Options Registration of a Report Requisition Templates Responsibility Query SALES ORDER TABLE SALES PERSON CREATION SCM Service Contract Sql Self Joins Subinventory Subinventory Transfer Supplier Lists Suppliers TEMP Tablespace Toad Value Sets Wildcard Workflow copy column find an PO details implementation inbound order to cash org_id out bound out of the box implementation vanilla implementation