Showing posts with label Technical. Show all posts
Showing posts with label Technical. Show all posts

Thursday, July 14, 2016

Demantra tables

a) Staging Tables

select * from t_src_item_tmpl;

select * from t_src_sales_tmpl;

select  * from t_src_loc_tmpl;


b) Patch

select * from version_details_history;


c) Base tables

select * from sales_data;--sales order historical data

select * from mdp_matrix;--combination data

select * from inputs;--time buckets

select * from queries;--worksheets

select * from items;--items

select * from location;--locations


d) Workflow

select * from wf_schemas;

select * from wf_process_log;


e) Integration interface

select * from transfer_query;

Thursday, May 26, 2016

Key Tables in Inventory

a) Items
Select * from mtl_system_items_b;

b) Categories
Select * from mtl_categories_b;

c)Template
select * from mtl_item_templates;

d)Onhand
Select * from mtl_onhand_quantities;

e) Transactions
select * from mtl_material_transactions;

f) Material transaction interface
select * from mtl_transactions_interface;

g)Pending transactions
select * from mtl_material_transactions_temp;

h) Item Costs
select * from cst_item_costs;

Key tables in Order Management and Shipping Execution


a) Header
select * from oe_order_headers_all;

b) Lines
select * from oe_order_lines_all;

c) Delivery Details
select * from wsh_delivery_details;

d) Deliveries
select * from wsh_delivery_assignments


Key tables in Purchasing


a) Header
select * from po_headers_all

b) Lines
select * from po_lines_all;

c) Shipment
select * from po_line_locations_all;

d) Distributions
select * from po_distributions_all;

e)Account Expense Rules
select * from PO_RULE_EXPENSE_ACCOUNTS;

select * from PO_RULE_EXPENSE_ACCOUNTS_V;

Monday, June 23, 2014

SQL Query to identify the change requests for IR_ISO



Select * from po_change_requests
where request_status in ( 'NEW' , 'MGR_PRE_APP' , 'MGR_APP')
AND DOCUMENT_TYPE= 'REQ'
AND REQUEST_LEVEL= 'LINE'
AND ACTION_TYPE = 'MODIFICATION';

SQL Query to identify duplicate distributions for an Internal Requisition.


SELECT SEGMENT1,REQUISITION_HEADER_ID FROM PO_REQUISITION_HEADERS_ALL 
WHERE REQUISITION_HEADER_ID IN (select REQUISITION_HEADER_ID from PO_REQUISITION_LINES_ALL where REQUISITION_LINE_ID not in 
(select REQUISITION_LINE_ID FROM PO_REQ_DISTRIBUTIONS_ALL) AND SOURCE_TYPE_CODE='INVENTORY') 
and org_id =&orgid and authorization_status='APPROVED';

Tuesday, June 10, 2014

Script to identify outstanding reservation records that exist for order lines which are closed or cancelled.

This script will find outstanding reservation records that exist for order lines which are closed or cancelled. It does this for both external sales orders and internal orders.
Also, the script find reservations left after the Order line is deleted but reservations exist.
The script finds records from MTL_DEMAND which are not in sync with MTL_RESERVATIONS.

     a) SELECT L.LINE_ID, L.HEADER_ID
FROM OE_ORDER_LINES_ALL L, MTL_RESERVATIONS M
WHERE  M.PRIMARY_RESERVATION_QUANTITY>0
AND nvl(L.CANCELLED_FLAG,'N')='Y'
AND L.CANCELLED_QUANTITY IS NOT NULL
AND L.LINE_ID = M.DEMAND_SOURCE_LINE_ID
AND NOT EXISTS (SELECT NULL FROM MTL_TRANSACTIONS_INTERFACE MTI
                WHERE  MTI.TRX_SOURCE_LINE_ID = L.LINE_ID
                AND    MTI.SOURCE_HEADER_ID = L.HEADER_ID
                AND    MTI.SOURCE_CODE = ‘ ORDER ENTRY’);
    b)  SELECT 'X'
               FROM   OE_ORDER_LINES_ALL L
               WHERE  nvl(L.CANCELLED_FLAG,'N')='Y'
               AND L.CANCELLED_QUANTITY IS NOT NULL
               AND L.LINE_ID = MTL_RESERVATIONS.DEMAND_SOURCE_LINE_ID
               AND NOT EXISTS (SELECT NULL FROM MTL_TRANSACTIONS_INTERFACE MTI
                               WHERE  MTI.TRX_SOURCE_LINE_ID = L.LINE_ID
                               AND    MTI.SOURCE_HEADER_ID = L.HEADER_ID
                          AND   MTI.SOURCE_CODE = ‘ORDER ENTRY’);

c c) SELECT L.LINE_ID, L.HEADER_ID
FROM OE_ORDER_LINES_ALL L, MTL_RESERVATIONS M
WHERE   M.PRIMARY_RESERVATION_QUANTITY>0
AND nvl(L.OPEN_FLAG,'Y')='N'
AND L.LINE_ID = M.DEMAND_SOURCE_LINE_ID
AND NOT EXISTS (SELECT NULL FROM MTL_TRANSACTIONS_INTERFACE MTI
                WHERE  MTI.TRX_SOURCE_LINE_ID = L.LINE_ID
                AND    MTI.SOURCE_HEADER_ID = L.HEADER_ID
                AND    MTI.SOURCE_CODE = ' ORDER ENTRY’)
AND NOT EXISTS    (SELECT 1 FROM WSH_DELIVERY_DETAILS WDD
                 WHERE WDD.SOURCE_LINE_ID=L.LINE_ID
                   AND WDD.SOURCE_CODE ='OE'
                   AND WDD.INV_INTERFACED_FLAG IN ('N','P')
                 AND WDD.RELEASED_STATUS <> 'D');
   d) SELECT 'X'
               FROM   OE_ORDER_LINES_ALL L
               WHERE  nvl(L.OPEN_FLAG,'Y')='N'
               AND L.LINE_ID = nvl(MTL_RESERVATIONS.DEMAND_SOURCE_LINE_ID,-99)
               AND NOT EXISTS (SELECT NULL FROM MTL_TRANSACTIONS_INTERFACE MTI
                               WHERE  MTI.TRX_SOURCE_LINE_ID = L.LINE_ID
                               AND    MTI.SOURCE_HEADER_ID = L.HEADER_ID
                               AND    MTI.SOURCE_CODE = ‘ORDER ENTRY')
               AND NOT EXISTS    (SELECT 1 FROM WSH_DELIVERY_DETAILS WDD
                 WHERE WDD.SOURCE_LINE_ID=L.LINE_ID
                   AND WDD.SOURCE_CODE ='OE'
                   AND WDD.INV_INTERFACED_FLAG IN ('N','P')
                   AND WDD.RELEASED_STATUS <> 'D'));


e)  SELECT MSO.SEGMENT1 ORD_NUMBER,
       MSO.SEGMENT2 ORD_TYPE,
       MSO.SALES_ORDER_ID sALES_ORDER_ID,
       MR.DEMAND_SOURCE_LINE_ID oRDER_LINE_ID,
       MR.iNVENTORY_ITEM_ID iTEM_ID,
       MR.ORGANIZATION_ID ORGANIZATION_ID,
       MR.PRIMARY_RESERVATION_QUANTITY pRSV_QTY,
       MR.RESERVATION_QUANTITY RSV_QTY
 FROM MTL_RESERVATIONS MR,
      MTL_SALES_ORDERS MSO
WHERE MSO.SALES_ORDER_ID=MR.DEMAND_SOURCE_HEADER_ID
  AND MR.DEMAND_SOURCE_TYPE_ID IN (2,8)
  AND MR.DEMAND_SOURCE_LINE_ID NOT IN (SELECT LINE_ID FROM OE_ORDER_LINES_ALL WHERE LINE_ID=MR.DEMAND_SOURCE_LINE_ID );

Script to identify old orphan move orders

This is script to identify Open move order lines which are not linked to Delivery details , Orphan suggestions in Mtl_material_transactions_temp and  reservations link to Mtl_material_transactions_temp if reservations are not existing.

a) select mmtt.*
from mtl_material_transactions_temp mmtt,
mtl_txn_request_lines mtrl,
mtl_txn_request_headers mtrh
where mmtt.move_order_line_id IS NOT NULL
AND mmtt.move_order_line_id = mtrl.line_id
AND mtrl.line_status = 7
and mtrl.header_id = mtrh.header_id
and mtrh.move_order_type = 3
and not exists (
select 'Y'
from wsh_delivery_details
where move_order_line_id = mtrl.line_id
and released_status = 'S' 

b)  Find allocation records for closed move order
 select mmtt.* 
from mtl_material_transactions_temp mmtt, mtl_txn_request_lines mtrl 
where mmtt.move_order_line_id = mtrl.line_id 
and mtrl.line_status = 5 

c)  Find  allocation records with missing move order
  select mmtt.* 
from mtl_material_transactions_temp mmtt 
where move_order_line_id IS NOT NULL 
and not exists ( 
select mtrl.line_id 
from mtl_txn_request_lines mtrl 
where mtrl.line_id = mmtt.move_order_line_id) 

d)    select mtrl.*
from mtl_txn_request_lines mtrl,
mtl_txn_request_headers mtrh
where mtrl.line_status = 7
and mtrl.header_id = mtrh.header_id
and mtrh.move_order_type = 3
and not exists (
select 'Y'
from wsh_delivery_details
where move_order_line_id = mtrl.line_id
and released_status = 'S'


Wednesday, December 11, 2013

How to identify the personlizations on an OAF page?

Here are several ways to identify if there are Personalization’s made to a page and what those Personalizations are:

1. The first and easiest way is to go to the page you want to check for Personalization’s, then click on the 'About this page' link at the bottom left of the page.
Click on the Personalization tab.
Then you should see a list of 'Effective Personalization’s', what elements have been customized and when they were customized/personalized.


2. Another way is to use the Functional Administrator.
The first thing to do to use the Functional Administrator is to identify the Document Path.
For example, go to the Notifications link from the Workflow User Web Applications responsibility, and then click on the Personalize Page link. Notice that the Document path for the Notifications page is:
/oracle/apps/fnd/wf/worklist/webui/NotificationsPG.

From the Functional Administrator responsibility Home page, click on the Personalization tab in the upper left hand corner. Insert the document path for the document you want to check - for example: Document Path  =  /oracle/apps/fnd/wf/worklist/webui/NotificationsPG and then click on the 'Go' button to get a list of Personalization’s for this page.

3. A third way to check to see if there are personalizations on a page is to use sqlplus and run the JDR_UTILS program.
You will need the Document path to the page in question - again using the Document path for the Notifications page:
/oracle/apps/fnd/wf/worklist/webui/NotificationsPG

Run the listDocuments function to drill down and find all documents that have been personalizations under a certain Meta Data region:
Run from sqlplus:
set serveroutput on
exec JDR_UTILS.listDocuments('/oracle/apps/fnd/wf/worklist/webui/');
/oracle/apps/fnd/wf/worklist/webui/customizations/
Note, you do not include the Page ID (NotificationsPG) with this query. In my test case, notice that there are 'customizations' in this MDS region webui.  The 'customizations' indicates that personalizations have been made to the 'webui' region.

Run the query again with the new path and notice that there are 'site' level customizations, although there could be other levels such as user, responsibility, ...:
exec JDR_UTILS.listDocuments('/oracle/apps/fnd/wf/worklist/webui/customizations/');
/oracle/apps/fnd/wf/worklist/webui/customizations/site/

Run the query again with the new path and notice that the customizations are at site level '0':
exec JDR_UTILS.listDocuments('/oracle/apps/fnd/wf/worklist/webui/customizations/site/');
/oracle/apps/fnd/wf/worklist/webui/customizations/site/0/

Run the query one more time with the new path and notice that the customizations are made to the 'NotificationsPG':
exec JDR_UTILS.listDocuments('/oracle/apps/fnd/wf/worklist/webui/customizations/site/0/');
/oracle/apps/fnd/wf/worklist/webui/customizations/site/0/NotificationsPG

Once we have identified a particular page or pages that have customizations/personalization’s, then we can use the printDocument to see what personalizations have been made to the page:

exec
JDR_UTILS.printDocument('/oracle/apps/fnd/wf/worklist/webui/customizations/site/0/NotificationsPG');
-------------
<?xml version='1.0' encoding='UTF-8'?>
<customization xmlns="http://xmlns.oracle.com/jrad" version="9.0.5.4.89_554"
xml:lang="en-US"
customizes="/oracle/apps/fnd/wf/worklist/webui/NotificationsPG">
<modifications>
<modify element="MainRegion.NtfView" rendered="false"/>
</modifications>
</customization>
-------------

As you can see, rendered has been set to "false" for "MainRegion.NtfView".

You can then use the deletedocument function to remove this personalization exec
jdr_utils.deletedocument('/oracle/apps/fnd/wf/worklist/webui/customizations/site/0/NotificationsPG');