Você está na página 1de 85

Distribution and Manufacturing Commonly used tables

Inv Po Om
Items Po Orders
mtl_system_items_b po_headers_all oe_order_headers_all
mtl_item_revisions po_lines_all oe_transaction_types_all
Item Categories po_line_locations_all OE_ORDER_LINES_HISTORY

mtl_categories_b PO_HEADERS_ARCHIVE and PO_LINES_ARCHIVE (PO revisions) select * from oe_sets where header_id =
mtl_category_sets_b po_distributions_all oe_order_lines_all
mtl_item_categories Buyers Agreements
Item Costs po_agents oe_agreements_b
cst_item_costs Document and Line Types Order Sources
cst_cost_types po_document_types_all_b oe_order_sources
Organization po_line_types_b Transaction types
hr_all_organization_units Releases oe_transaction_types_all / tl
org_organization_definitions po_releases_all Pricing
hr_locations_all Requisitions qp_list_headers_b
mtl_parameters po_requisition_headers_all qp_list_lines
Transactions po_requisition_lines_all qp_pricing_attributes , oe_price_adjustments
mtl_material_transactions po_req_distributions_all Shipping
mtl_transaction_types Vendors wsh_new_deliveries
Subinventories po_vendors wsh_delivery_details
mtl_secondary_inventories po_vendor_sites_all wsh_delivery_assignments
Lot and Serial Numbers po_vendor_contacts WSH_PACKED_CONTAINERS
mtl_serial_numbers Receiving wsh_picking_batches
mtl_lot_numbers rcv_transactions WSH_SERIAL_NUMBERS ( shipped sl no's)
Location and On Hand Qty rcv_shipment_headers
mtl_item_locations rcv_shipment_lines ( expected receipts)
mtl_onhand_quantities
Requisitions Interface Order Import
po_requisitions_interface_all oe_headers_iface_all
Interfaces po_req_dist_interface_all REJECT_FLAG
Transactions Interface INTERFACE_SOURCE_CODE ERROR_FLAG
mtl_transactions_interface DESTINATION_TYPE_CODE ORIG_SYS_DOCUMENT_REF
SOURCE_CODE AUTHORIZATION_STATUS OPERATION_CODE
SOURCE_LINE_ID PREPARER_ID/NAME oe_lines_iface_all
SOURCE_HEADER_ID QUANTITY ORDER_SOURCE_ID
PROCESS_FLAG CHARGE_ACCOUNT_ID/SEGMENTS ORIG_SYS_DOCUMENT_REF
TRANSACTION_MODE DESTINATION_ORGANIZATION_ID ORIG_SYS_LINE_REF
TRANSACTION_INTERFACE_ID DELIVER_TO_LOCATION_ID/CODE ORIG_SYS_SHIPMENT_REF
INVENTORY_ITEM_ID DELIVER_TO_REQUESTOR_ID/Name INVENTORY_ITEM
ITEM_SEGMENT1 to ITEM_ DISTRIBUTION_NUMBER REQUEST_DATE

Anil Kumar R V
12/09/2021Interfaces
Distribution and Manufacturing Commonly used tables

SEGMENT20 DESTINATION_ORGANIZATION_ID DELIVERY_LEAD_TIME


TRANSACTION_QUANTITY INTERFACE_SOURCE_CODE DELIVERY_ID
TRANSACTION_UOM CHARGE_ACCOUNT_ID ORDERED_QUANTITY
TRANSACTION_DATE ORDER_QUANTITY_UOM oe_price_adjs_interface
TRANSACTION_SOURCE_ID REQUEST_ID ORIG_SYS_DOCUMENT_REF
DSP_SEGMENT1toDSP_ Purchasing Documents interface ORIG_SYS_LINE_REF
SEGMENT30 po_headers_interface ORIG_SYS_SHIPMENT_REF
TRANSACTION_SOURCE_NAME INTERFACE_HEADER_ID ORIG_SYS_DISCOUNT_REF
TRANSACTION_TYPE_ID ACTION DISCOUNT_ID
mtl_transactions_lot_interface DOCUMENT_TYPE_CODE DISCOUNT_LINE_ID
LOT_NUMBER VENDOR_DOC_NUM DISCOUNT_NAME
LOT_EXPIRATION_DATE po_lines_interface OPERATION_CODE
TRANSACTION_QUANTITY INTERFACE_LINE_ID oe_credits_interface
TRANSACTION_INTERFACE_ID INTERFACE_HEADER_ID ORDER_SOURCE_ID
SERIAL_TRANSACTION_TEMP_ID po_interface_errors ORIG_SYS_DOCUMENT_REF
mtl_serial_numbers_interface Receiving Interface ORIG_SYS_LINE_REF
TRANSACTION_INTERFACE_ ID rcv_headers_interface ORIG_SYS_SHIPMENT_REF
FM_SERIAL_NUMBER HEADER_INTERFACE_ID ORIG_SYS_CREDIT_REF
Item Interface GROUP_ID PERCENT
MTL_SYSTEM_ITEMS_INTERFACE PROCESSING_STATUS_CODE OE_LOTSERIALS_INTERFACE
PROCESS_FLAG RECEIPT_SOURCE_CODE OPERATION_CODE
TRANSACTION_TYPE VENDOR_NAME ORDER_SOURCE_ID
SET_PROCESS_ID VENDOR_NUM ORIG_SYS_DOCUMENT_REF
ORGANIZATION_CODE VENDOR_ID ORIG_SYS_LINE_REF
ITEM_NUMBER VALIDATION_FLAG ORIG_SYS_LOTSERIAL_REF
rcv_transactions_interface QUANTITY
INTERFACE_TRANSACTION_ID OPERATION_CODE
MTL_INTERFACE_ERRORS GROUP_ID OE_RESERVTNS_INTERFACE
MTL_ITEM_CATE_INTERFACE TRANSACTION_TYPE oe_actions_interface
MTL_ITEM_REVI_INTERFACE TRANSACTION_DATE ORIG_SYS_DOCUMENT_REF
PROCESSING_STATUS_CODE OPERATION_CODE
PROCESSING_MODE_CODE
TRANSACTION_STATUS_CODE
QUANTITY
UNIT_OF_MEASURE
ITEM_DESCRIPTION
RECEIPT_SOURCE_CODE
VENDOR_ID
VENDOR_NUM
VENDOR_NAME

Anil Kumar R V
12/09/2021Interfaces
Distribution and Manufacturing Commonly used tables

AUTO_TRANSACT_CODE DOCUMENT_NUM
SOURCE_DOCUMENT_CODE HEADER_INTERFACE_ID
PO_HEADER_ID VALIDATION_FLAG

select * from org_acct_periods

begin
fnd_client_info.set_org_context('539');
end;

select * from wf_item_attribute_values where item_key = '776773'

select * from fnd_responsibility_tl where RESPONSIBILITY_ID = 55295

Anil Kumar R V
12/09/2021Interfaces
Distribution and Manufacturing Commonly used tables

AP
Payable Incoives
AP_INVOICES_ALL
AP_INVOICE_DISTRIBUTIONS_ALL
Payments to Invoice

AP_PAYMENT_DISTRIBUTIONS_ALL
AP_PAYMENT_HISTORY_ALL
AP_PAYMENT_SCHEDULES_ALL
AP_INVOICE_PAYMENTS_ALL

AR
AR_VAT_TAX_ALL_B
AR_CASH_RECEIPTS_ALL
AR_CASH_RECEIPT_HISTORY_ALL
AR_AGING_BUCKETS
AR_AGING_BUCKET_LINES_B
AR_MISC_CASH_DISTRIBUTIONS_ALL
AR_RECEIVABLES_TRX_ALL
select * from ra_cust_trx_types_all
RA_CUSTOMER_TRX_ALL
RA_CUSTOMER_TRX_LINES_ALL
RA_CUST_TRX_LINE_GL_DIST_ALL
Customers
hz_parties hz_loc_assignments
hz_cust_accounts
hz_cust_acct_sites_all
hz_cust_site_uses_all
hz_party_sites hz_contact_points CP
hz_locations
GL

GL_DAILY_RATES
GL_BALANCES
GL_ACCOUNT_HIERARCHIES
GL_BUDGET_ASSIGNMENTS
GL_ENCUMBRANCE_TYPES
GL_JE_BATCHES
GL_JE_HEADERS
GL_JE_LINES

Anil Kumar R V
12/09/2021Interfaces
Distribution and Manufacturing Commonly used tables

AP
AP_INVOICES_INTERFACE
AP_INVOICES_INTERFACE

AR
RA_CUSTOMERS_INTERFACE_ALL
RA_INTERFACE_DISTRIBUTIONS_ALL
RA_INTERFACE_DISTRIBUTIONS_ALL
RA_INTERFACE_DISTRIBUTIONS_ALL

GL
GL_DAILY_RATES_INTERFACE
GL_INTERCOMPANY_ACCTS_V
GL_INTERFACE_CONTROL
GL_INTERFACE_GROUPS_V
GL_INTERFACE_HISTORY
GL_INTERFACE_SOURCES_V
GL_INTERFACE
JE_SOURCE_NAME.
STATUS
SET_OF_BOOKS_ID
USER_JE_SOURCE_NAME
USER_JE_CATEGORY_NAME
ACCOUNTING_DATE
CURRENCY_CODE
Do Not Enter any value
TRANSACTION_DATE
JE_BATCH_ID
JE_HEADER_ID
JE_LINE_NUM
CHART_OF_ACCOUNTS_ID
Validations
• Set of books
• Period name
• Source name
• Journal entry name
• Currency code
• Category name
• Actual flag

Anil Kumar R V
12/09/2021Interfaces
Distribution and Manufacturing Commonly used tables

• Encumbrance type ID
• User conversion type
• Accounting date
• Budget version ID
• Reversal period
GL_BUDGET_INTERFACE
GL_BUDGET_INTERIM

Anil Kumar R V
12/09/2021Interfaces
Reports
User Exits
FND SRWINIT
FND SRWEXIT
FND FORMAT_CURRENCY
FND FLEXIDVAL :p_org_id := TO_NUMBER(fnd_profile.VALUE('ORG_ID'));
FND FLEXSQL :cp_user_name := fnd_profile.VALUE('USERNAME')

FND SRWINIT sets your profile option values and allows Oracle
Application Object Library user exits to detect that they have been
called by an Oracle Reports program. FND SRWINIT also allows your
report to use the correct organization automatically. FND SRWEXIT
ensures that all the memory allocated for Oracle Application Object
Library user exits has been freed up properly.

FND FLEXIDVAL are used to display flex field information like prompt, value etc with dynamic query
FND FLEXSQL

OM Reports
Cancelled Orders Report
Returns by Reason Report
Cancelled Orders Reasons Detail Report
Orders by Item Report
Unbooked Orders Report
login for PO – NUAN_AME_SSP_ADMIN / welcome1

• Account combinations
• Periods
• Unbalanced journal entries
• Foreign currency errors
• Budget information
• Encumbrance information
• Other miscellaneous items

select * from PO_REQUISITION_HEADERS_ALL WHERE SEGMENT1 ='5666'

select * from PO_REQUISITION_LINES_ALL WHERE REQUISITION_HEADER_ID = 56622

select * from PO_REQ_DISTRIBUTIONS_ALL WHERE REQUISITION_LINE_ID = 60533

select * from PO_HEADERS_ALL WHERE SEGMENT1 = '326' AND TYPE_LOOKUP_CODE = 'RFQ'

select * from PO_RFQ_VENDORS WHERE PO_HEADER_ID = 32562

select * from PO_HEADERS_ALL WHERE SEGMENT1 = '517' AND TYPE_LOOKUP_CODE = 'QUOTATION'

select * from PO_HEADERS_ALL WHERE SEGMENT1 = '4451' AND TYPE_LOOKUP_CODE= 'STANDARD'

select * from PO_LINES_ALL WHERE PO_HEADER_ID = 32566

select * from PO_LINE_LOCATIONS_ALL WHERE PO_LINE_ID = 37773

select * from PO_DISTRIBUTIONS_ALL WHERE LINE_LOCATION_ID in( 72186)

select * from RCV_SHIPMENT_HEADERS WHERE RECEIPT_NUM = '9616' AND SHIP_TO_ORG_ID = 207

select * from RCV_SHIPMENT_LINES WHERE SHIPMENT_HEADER_ID = 56423

select * from ap_invoices_all where invoice_num = 'AL-346'

select * from ap_invoice_distributions_all where invoice_id = 63253

select * from AP_ACCOUNTING_EVENTS_ALL WHERE source_id = 63253 and source_table = 'AP_INVOICES'

select * from ap_payment_schedules_all where invoice_id = 63253

select * from ap_checks_all where check_number = 2473 --creation_date like sysdate

select * from AP_INVOICE_PAYMENTS_ALL where invoice_id = 63253

select * from AP_ACCOUNTING_EVENTS_ALL WHERE source_id = 28599 and source_table = 'AP_CHECKS' --ACCOUNTING_EVEN
Approval Groups : po_control_groups , po_control_rules
select * from po_control_functions
Approval Assignments : po_position_controls

The Vacation Rules for Workflow Notifications are stored in the table wf_routing_rules.
The following query can be used to determine which Routing Rules are active: select rule_id, role "Forwarded From", begin

select * from po_Approval_list_lines / headers

Purchase Order Status:

select segment1 po#, revision_num r#,


substr(type_lookup_code,1,4) type, authorization_status auth_status,
closed_code, wf_item_type, wf_item_key, org_id
from po_headers_all
where segment1 = '&PO_NUMBER'

Requisition Status:

select segment1 req#,authorization_status auth_status,


closed_code, wf_item_type, wf_item_key, org_id
from po_requisition_headers_all
where segment1 = '&REQ_NUM'

Release Status:

select po.segment1 po#, rel.release_num rel#, po.revision_num po_r#,


po.authorization_status po_status, po.closed_code close_po,
po.wf_item_type po_type, po.wf_item_key po_key, po.org_id org,
rel.wf_item_type rel_type, rel.wf_item_key rel_key,
rel.po_release_id rel_id, rel.authorization_status rel_status, rel.hold_flag hold
from po_headers_all po, po_releases_all rel
where po.po_header_id = rel.po_header_id
and po.segment1 = '&PO_NUM'
and rel.release_num = 'REL_NUM'
order by 1,2

Purchase Order Action History:

select poah.sequence_num seq#, poah.action_date, poah.action_code,


poah.employee_id emp_id, fnd.user_name, substr(poah.object_type_code,1,3) type, poah.object_sub_typ
poah.object_revision_num rev, pohead.org_id
from po_action_history poah, fnd_user fnd, po_headers_all pohead
where poah.object_id = pohead.po_header_id
and pohead.segment1 = '&PO_NUMBER'
and pohead.org_id = '&ORG_ID'
and substr(poah.object_type_code,1,3) = 'PO'
and poah.employee_id = fnd.employee_id
and fnd.session_number != 0
order by 2,1

Requisition Action History:

select poah.sequence_num seq#, poah.action_date, poah.action_code,


poah.employee_id emp_id, fnd.user_name, substr (poah.object_type_code,1,3) type, poah.object_sub_ty
poah.object_revision_num rev, pohead.org_id, poah.note
from po_action_history poah, fnd_user fnd, po_requisition_headers_all pohead
where poah.object_id = pohead.requisition_header_id
and pohead.segment1 = '&REQ_NUMBER'
and substr(poah.object_type_code,1,3) = 'REQ'
and pohead.org_id = '&ORG_ID'
and poah.employee_id = fnd.employee_id
and fnd.session_number != 0
order by 9,2,1

Position Attached to Username:

SELECT pos.name position_name, pa.position_id,fnd.user_name


FROM PER_ALL_ASSIGNMENTS_F pa, per_positions pos,per_jobs job, fnd_user fnd
WHERE pa.POSITION_ID = pos.POSITION_ID
and pa.job_ID = job.job_id
and sysdate between pa.EFFECTIVE_START_DATE
and pa.EFFECTIVE_END_DATE
and pa.primary_flag = 'Y'
and pa.assignment_type = 'E'
and pa.person_id = fnd.employee_id
and pa.PERSON_ID = (select employee_id
from fnd_user
where user_name = '&user_name'

Requistions in Process
--------------------------------------------
select --item_key,substr(item_key,1,length(item_key)),
distinct b.segment1 "PO Number",b.creation_date,c.user_name,e.segment1 item

,d.unit_price,d.quantity,d.item_description--,d.item_id--,a.activity_status
from wf_item_activity_statuses a, po_requisition_headers_all b,fnd_user c,po_requisition_lines_all

d,mtl_system_items_b e
where a.item_type='NUAMEREQ'
and Activity_status in ( 'WAITING','ERROR','NOTIFIED','DEFERRED','ACTIVE')
and b.created_by=c.user_id
and b.REQUISITION_HEADER_ID=d.requisition_header_id
--and b.segment1='21166'
and d.DESTINATION_ORGANIZATION_ID=e.organization_id
and e.inventory_item_id=d.item_id
and (substr(item_key,1,6)=to_char(b.requisition_header_id) or

substr(item_key,1,5)=to_char(b.requisition_header_id) )
order by 2 desc

--Requistion in Error.

select --item_key,substr(item_key,1,length(item_key)),
distinct b.segment1 "PO Number",b.creation_date,c.user_name,e.segment1 item

,d.unit_price,d.quantity,d.item_description--,d.item_id--,a.activity_status
from wf_item_activity_statuses a, po_requisition_headers_all b,fnd_user c,po_requisition_lines_all

d,mtl_system_items_b e
where a.item_type='NUAMEREQ'
and Activity_status = 'ERROR'
and b.created_by=c.user_id
and b.REQUISITION_HEADER_ID=d.requisition_header_id
--and b.segment1='21166'
and d.DESTINATION_ORGANIZATION_ID=e.organization_id
and e.inventory_item_id=d.item_id
and (substr(item_key,1,6)=to_char(b.requisition_header_id) or

substr(item_key,1,5)=to_char(b.requisition_header_id) )
order by 2 desc

PO Approval Gropup whith limits


SELECT h.NAME operating_unit_name,
d.NAME job_name,
cf.control_function_name document_type,
g1.control_group_name approval_group_name
FROM per_jobs d,
po_position_controls_all f1,
po_control_groups_all g1,
hr_all_organization_units h,
po_control_functions cf
WHERE 1 = 1
AND h.TYPE = 'OU'
AND h.organization_id = g1.org_id
AND d.job_id = f1.job_id
AND f1.control_group_id = g1.control_group_id
AND cf.control_function_id = f1.control_function_id
ORDER BY 1,2

select * from AME_TRANS_APPROVAL_HISTORY where transaction_id = '125864' order by row_timestamp

/************************************************************

Purpose - Query to compare the errored PO creation date


and item last update date
Version - V1.0
Date - 08-April-2009
Created By - Apps Associates

/***********************************************************/
SELECT poh.segment1 "PO#", pol.po_line_id "PO_LINE_ID",
poh.creation_date "PO_CREATION_DATE",
ias.begin_date "WF_ERROR_DATE", ias.end_date "WF_END_DATE",
mtl.segment1 "ITEM", mtl.last_update_date "ITEM_UPDATE_DATE",
mtl.organization_id, fnd.user_name "UPDATED_BY", ias.activity_status,
ias.error_name, ias.error_message, ias.error_stack
FROM wf_item_activity_statuses ias,
po_headers_all poh,
mtl_system_items mtl,
po_lines_all pol,
po_distributions_all pod,
fnd_user fnd
WHERE 1 = 1
AND ias.item_type = 'POAPPRV'
AND poh.wf_item_key = ias.item_key
AND poh.po_header_id = pol.po_header_id
AND pol.po_line_id = pod.po_line_id
AND mtl.organization_id = pod.destination_organization_id
AND mtl.inventory_item_id = pol.item_id
AND mtl.last_updated_by = fnd.user_id
AND activity_status = 'ERROR'
ORDER BY begin_date DESC

/******************************************************************/

/************************************************************
Purpose - Query to compare the errored requisition errored date
and item last update date
Version - V1.0
Date - 06-April-2009
Created By - Apps Associates

***********************************************************/

SELECT prh.segment1 "REQ#", prl.requisition_line_id "REQ_LINE_ID",


prh.creation_date "REQ_CREATION_DATE", prh.preparer_id "PREPARER ID",
pap.full_name "NAME", ias.begin_date "WF_ERROR_DATE",
ias.end_date "WF_END_DATE", mtl.segment1 "ITEM",
mtl.last_update_date "ITEM_UPDATE_DATE", mtl.organization_id,
ias.activity_status, ias.error_name, ias.error_message,
ias.error_stack
FROM wf_item_activity_statuses ias,
po_requisition_headers_all prh,
mtl_system_items mtl,
po_requisition_lines_all prl,
per_all_people_f pap
WHERE 1 = 1
AND ias.item_type = 'NUAMEREQ'
AND prh.wf_item_key = ias.item_key
AND prh.requisition_header_id = prl.requisition_header_id
AND mtl.organization_id = prl.destination_organization_id
AND mtl.inventory_item_id = prl.item_id
AND prh.preparer_id = pap.person_id
AND activity_status = 'ERROR'
AND pap.effective_end_date >= SYSDATE
union
SELECT prh.segment1 "REQ#", prl.requisition_line_id "REQ_LINE_ID",
prh.creation_date "REQ_CREATION_DATE", prh.preparer_id "PREPARER ID",
pap.full_name "NAME", ias.begin_date "WF_ERROR_DATE",
ias.end_date "WF_END_DATE", mtl.segment1 "ITEM",
mtl.last_update_date "ITEM_UPDATE_DATE", mtl.organization_id,
ias.activity_status, ias.error_name, ias.error_message,
ias.error_stack
FROM wf_item_activity_statuses ias,
po_requisition_headers_all prh,
mtl_system_items mtl,
po_requisition_lines_all prl,
per_all_people_f pap
WHERE 1 = 1
AND ias.item_type = 'NUAMEREQ'
AND prh.wf_item_key = ias.item_key
AND prh.requisition_header_id = prl.requisition_header_id
AND mtl.organization_id = prl.destination_organization_id
AND mtl.inventory_item_id = prl.item_id
AND prh.preparer_id = pap.person_id
AND activity_status = 'ERROR'
AND pap.effective_end_date < SYSDATE
order by 3 desc

DISPLAY WHAT REQUISITION AND PO ARE LINKED


(Relation with Requisition and PO )
SELECT
,r.segment1 "Req Num"
,p.segment1 "PO Num"
from
,po_headers_all p
,po_distributions_all d
,po_req_distributions_all rd
,po_requisition_lines_all rl
,po_requisition_headers_all r
WHERE
p.po_header_id = d.po_header_id and
d.req_distribution_id = rd.distribution_id and
rd.requisition_line_id = rl.requisition_line_id and
rl.requisition_header_id = r.requisition_header_id

http://rafi-oracle.blogspot.com/2009/03/quries-on-oracle-purchasing.html

INTERNAL REQUISITIONS THAT DO NOT HAVE AN ASSOCIATED INTERNAL SALES ORDER


SELECT
,RQH.SEGMENT1
,RQL.LINE_NUM
,RQL.REQUISITION_HEADER_ID
,RQL.REQUISITION_LINE_ID
,RQL.ITEM_ID
,RQL.UNIT_MEAS_LOOKUP_CODE
,RQL.UNIT_PRICE
,RQL.QUANTITY
,RQL.QUANTITY_CANCELLED
,RQL.QUANTITY_DELIVERED
,RQL.CANCEL_FLAG
,RQL.SOURCE_TYPE_CODE
,RQL.SOURCE_ORGANIZATION_ID
,RQL.DESTINATION_ORGANIZATION_ID
,RQH.TRANSFERRED_TO_OE_FLAG
FROM
,PO_REQUISITION_LINES_ALL RQL
,PO_REQUISITION_HEADERS_ALL RQH
WHERE
RQL.REQUISITION_HEADER_ID = RQH.REQUISITION_HEADER_ID and
RQL.SOURCE_TYPE_CODE = 'INVENTORY' and
RQL.SOURCE_ORGANIZATION_ID is not null and not exists
(select 'existing internal order'from OE_ORDER_LINES_ALL LIN where LIN.SOURCE_DOCUMENT_LINE_ID = RQL.REQUISITION_L
ORDER BY RQH.REQUISITION_HEADER_ID, RQL.LINE_NUM
------------------------------------------------------------------------------------------------------------
DISPLAY WHAT REQUISITION AND PO ARE LINKED
(Relation with Requisition and PO )
SELECT
,r.segment1 "Req Num"
,p.segment1 "PO Num"
from
,po_headers_all p
,po_distributions_all d
,po_req_distributions_all rd
,po_requisition_lines_all rl
,po_requisition_headers_all r
WHERE
p.po_header_id = d.po_header_id and
d.req_distribution_id = rd.distribution_id and
rd.requisition_line_id = rl.requisition_line_id and
rl.requisition_header_id = r.requisition_header_id
------------------------------------------------------------------------------------------------------------
PURCHASE REQUISITION WITHOUT PO THAT MEANS A PR HAS NOT BEEN AUTOCREATED TO PO
(Purchase Requisition without a Purchase Order)
SELECT
,prh.segment1 "PR NUM"
,trunc(prh.creation_date) "CREATED ON"
,trunc(prl.creation_date) "Line Creation Date"
,prl.line_num "Seq #"
,msi.segment1 "Item Num"
,prl.item_description "Description"
,prl.quantity "Qty"
,trunc(prl.need_by_date) "Required By"
,ppf1.full_name "REQUESTOR"
,ppf2.agent_name "BUYER"
FROM
,po.po_requisition_headers_all prh
,po.po_requisition_lines_all prl
,apps.per_people_f ppf1
,(select distinct agent_id,agent_name from apps.po_agents_v ) ppf2
,po.po_req_distributions_all prd
,inv.mtl_system_items_b msi
,po.po_line_locations_all pll
,po.po_lines_all pl
,po.po_headers_all ph
WHERE
prh.requisition_header_id = prl.requisition_header_id and
prl.requisition_line_id = prd.requisition_line_id and
ppf1.person_id = prh.preparer_id and
prh.creation_date between ppf1.effective_start_date and ppf1.effective_end_date and
ppf2.agent_id(+) = msi.buyer_id and
msi.inventory_item_id = prl.item_id and
msi.organization_id = prl.destination_organization_id and
pll.line_location_id(+) = prl.line_location_id and
pll.po_header_id = ph.po_header_id(+) and
pll.pl_line_id = pl.po_line_id(+) and
prh.authorization_status = 'APPROVED' and
pll.line_location_id is NULL and
prl.closed_code is NULL and
nvl(prl.cancel_flag,'N') <> 'Y'
ORDER BY 1,2
------------------------------------------------------------------------------------------------------------
INFORMATION FROM PR to PO
(Requisition moved from different stages till converting into PR)
SELECT DISTINCT
,u.description "Requestor"
,porh.segment1 as "Req Number"
,trunc(porh.Creation_Date) "Created On"
,pord.LAST_UPDATED_BY
,porh.Authorization_Status "Status"
,porh.Description "Description"
,poh.segment1 "PO Number"
,trunc(poh.Creation_date) "PO Creation Date"
,poh.AUTHORIZATION_STATUS "PO Status"
,trunc(poh.Approved_Date) "Approved Date"
FROM
,apps.po_headers_all poh
,apps.po_distributions_all pod
,apps.po_req_distributions_all pord
,apps.po_requisition_lines_all porl
,apps.po_requisition_headers_all porh
,apps.fnd_user u
WHERE
porh.requisition_header_id = porl.requisition_header_id and porl.requisition_line_id = pord.requisition_line_id and
pord.distribution_id = pod.req_distribution_id(+) and
pod.po_header_id = poh.po_header_id(+) and
porh.created_by = u.user_id
order by 2
------------------------------------------------------------------------------------------------------------
PO’s WHICH DOES NOT HAVE ANY PR’s
SELECT
,prh.segment1 "PR NUM"
,trunc(prh.creation_date) "CREATED ON"
,trunc(prl.creation_date) "Line Creation Date"
,prl.line_num "Seq #"
,msi.segment1 "Item Num"
,prl.item_description "Description"
,prl.quantity "Qty"
,trunc(prl.need_by_date) "Required By"
,ppf1.full_name "REQUESTOR"
,ppf2.agent_name "BUYER"
FROM
,po.po_requisition_headers_all prh
,po.po_requisition_lines_all prl
,apps.per_people_f ppf1
,(select distinct agent_id,agent_name from apps.po_agents_v ) ppf2
,po.po_req_distributions_all prd
,inv.mtl_system_items_b msi
,po.po_line_locations_all pll
,po.po_lines_all pl
,po.po_headers_all ph
WHERE
prh.requisition_header_id = prl.requisition_header_id and
prl.requisition_line_id = prd.requisition_line_id and
ppf1.person_id = prh.preparer_id and
prh.creation_date between ppf1.effective_start_date and ppf1.effective_end_date and
ppf2.agent_id(+) = msi.buyer_id and
msi.inventory_item_id = prl.item_id and
msi.organization_id = prl.destination_organization_id and
pll.line_location_id(+) = prl.line_location_id and
pll.po_header_id = ph.po_header_id(+) and
pll.po_line_id = pl.po_line_id(+) and
prh.authorization_status = 'APPROVED' and
pll.line_location_id is NULL and
prl.closed_code is NULL and
nvl(prl.cancel_flag,'N') <> 'Y'
ORDER BY 1,2
------------------------------------------------------------------------------------------------------------
ALL PO’s WITH APPROVAL, INVOICE, & PAYMENT DETAILS
SELECT
,a.org_id "ORG ID"
,E.SEGMENT1 "VENDOR NUM"
,e.vendor_name "SUPPLIER NAME"
,UPPER(e.vendor_type_lookup_code) "VENDOR TYPE"
,f.vendor_site_code "VENDOR SITE CODE"
,f.ADDRESS_LINE1 "ADDRESS"
,f.city "CITY"
,f.country "COUNTRY"
,to_char(trunc(d.CREATION_DATE)) "PO Date"
,d.segment1 "PO NUM"
,d.type_lookup_code "PO Type"
,c.quantity_ordered "QTY ORDERED"
,c.quantity_cancelled "QTY CANCELLED"
,g.item_id "ITEM ID"
,g.item_description "ITEM DESCRIPTION"
,g.unit_price "UNIT PRICE"
,(NVL(c.quantity_ordered,0)-NVL(c.quantity_cancelled,0))*NVL(g.unit_price,0) "PO Line Amount"
,(select decode(ph.approved_FLAG, 'Y', 'Approved') from po.po_headers_all ph where,ph.po_header_ID = d.po_header_id) "P
, a.invoice_type_lookup_code "INVOICE TYPE"
,a.invoice_amount "INVOICE AMOUNT"
,to_char(trunc(a.INVOICE_DATE)) "INVOICE DATE"
,a.invoice_num "INVOICE NUMBER"
,(select decode(x.MATCH_STATUS_FLAG, 'A', 'Approved') from ap.ap_invoice_distributions_all x where
,x.invoice_distribution_id = b.invoice_distribution_id) "Invoice Approved?"
,a.amount_paid
,h.amount
,h.check_id
,h.invoice_payment_id "Payment Id"
,i.check_number "Cheque Number"
,to_char(trunc(i.check_DATE)) "Payment Date"
FROM
,AP.AP_INVOICES_ALL A
,AP.AP_INVOICE_DISTRIBUTIONS_ALL B
,PO.PO_DISTRIBUTIONS_ALL C
,PO.PO_HEADERS_ALL D
,PO.PO_VENDORS E
,PO.PO_VENDOR_SITES_ALL F
,PO.PO_LINES_ALL G
,AP.AP_INVOICE_PAYMENTS_ALL H
,AP.AP_CHECKS_ALL I
WHERE
,a.invoice_id = b.invoice_id and
b.po_distribution_id = c. po_distribution_id (+) and
c.po_header_id = d.po_header_id (+) and
e.vendor_id (+) = d.VENDOR_ID and
f.vendor_site_id (+) = d.vendor_site_id and
d.po_header_id = g.po_header_id and
c.po_line_id = g.po_line_id and
a.invoice_id = h.invoice_id and
h.check_id = i.check_id and
f.vendor_site_id = i.vendor_site_id and
c.PO_HEADER_ID is not null and
a.payment_status_flag = 'Y' and
d.type_lookup_code != 'BLANKET'
------------------------------------------------------------------------------------------------------------
ALL OPEN PO'S
SELECT
,h.segment1 "PO NUM"
,h.authorization_status "STATUS"
,l.line_num "SEQ NUM"
,ll.line_location_id
,d.po_distribution_id
,h.type_lookup_code "TYPE"
FROM
,po.po_headers_all h
,po.po_lines_all l
,po.po_line_locations_all ll
,po.po_distributions_all d
WHERE
h.po_header_id = l.po_header_id and
ll.po_line_id = l.po_Line_id and
ll.line_location_id = d.line_location_id and
h.closed_date is NULL and
h.type_lookup_code not in ('QUOTATION')
------------------------------------------------------------------------------------------------------------
STEPS TO DEBUG A PURCHASE ORDER
Get po_header_id first and run each query and then analyze the data.
For better understanding this is splited into 5 major stages.
Stage 1: PO Creation
PO_HEADERS_ALL
select po_header_id from po_headers_all where segment1 =;
select * from po_headers_all where po_header_id =;
PO_LINES_ALL
select * from po_lines_all where po_header_id =;
PO_LINE_LOCATIONS_ALL
select * from po_line_locations_all where po_header_id =;
PO_DISTRIBUTIONS_ALL
select * from po_distributions_all where po_header_id =;
PO_RELEASES_ALL
SELECT * FROM po_releases_all WHERE po_header_id =;

Stage 2: Once PO is received, data is moved to respective receving tables and inventory tables
RCV_SHIPMENT_HEADERS
select * from rcv_shipment_headers where shipment_header_id in
(select shipment_header_id from rcv_shipment_lineswhere po_header_id =);
RCV_SHIPMENT_LINES
select * from rcv_shipment_lines where po_header_id =;
RCV_TRANSACTIONS
select * from rcv_transactions where po_header_id =;
RCV_ACCOUNTING_EVENTS
SELECT * FROM rcv_Accounting_Events WHERE rcv_transaction_id IN
(select transaction_id from rcv_transactionswhere po_header_id =);
RCV_RECEIVING_SUB_LEDGER
select * from rcv_receiving_sub_ledger where rcv_transaction_id IN
(select transaction_id from rcv_transactions where po_header_id =);
RCV_SUB_LEDGER_DETAILS
select * from rcv_sub_ledger_detailswhere rcv_transaction_id IN
(select transaction_id from rcv_transactions where po_header_id =);
MTL_MATERIAL_TRANSACTIONS
select * from mtl_material_transactions where transaction_source_id =;
MTL_TRANSACTION_ACCOUNTS
select * from mtl_transaction_accounts where transaction_id IN
(select transaction_id from mtl_material_transactions where transaction_source_id =);

Stage 3: Invoicing details


AP_INVOICE_DISTRIBUTIONS_ALL
select * from ap_invoice_distributions_all where po_distribution_id in
( select po_distribution_id from po_distributions_all where po_header_id =);
AP_INVOICES_ALL
select * from ap_invoices_all where invoice_id in
(select invoice_id from ap_invoice_distributions_all where po_distribution_id in( select po_distribution_id from po_distribut

Stage 4 : Mostly there is tie up with Project related PO


PA_EXPENDITURE_ITEMS_ALL
select * from pa_expenditure_items_all peia where peia.orig_transaction_reference IN
(select to_char(transaction_id) from mtl_material_transactions where transaction_source_id = );

Stage 5 : General Ledger


Prompt 17. GL_BC_PACKETS ..This is for encumbrances
SELECT * FROM gl_bc_packets WHERE reference2 IN (’‘);
GL_INTERFACE
select * from gl_interface gli where user_je_source_name =’Purchasing’
and gl_sl_link_table =’RSL’ and reference21=’PO’ and exists
(select 1 from rcv_receiving_sub_ledger rrsl where gli.reference22 =RRSL.reference2 and GLI.reference23 =RRSL.reference3
GL_IMPORT_REFERENCES
SELECT *FROM gl_import_references GLIR WHERE reference_1=’PO’ AND gl_sl_link_table =’RSL’AND EXISTS
( SELECT 1 FROM rcv_receiving_sub_ledger RRSLWHERE GLIR.reference_2 =RRSL.reference2AND GLIR.reference_3 =RRSL.ref
(select transaction_id from rcv_transactions where po_header_id =))

A single Query covering P2P life Cycle


SELECT
A.ORG_ID "ORG ID",
E.VENDOR_NAME "VENDOR NAME",
UPPER(E.VENDOR_TYPE_LOOKUP_CODE) "VENDOR TYPE",
F.VENDOR_SITE_CODE "VENDOR SITE",
F.ADDRESS_LINE1 "ADDRESS",
F.CITY "CITY",
F.COUNTRY "COUNTRY",
TO_CHAR(TRUNC(D.CREATION_DATE)) "PO DATE",
D.SEGMENT1 "PO NUMBER",
D.TYPE_LOOKUP_CODE "PO TYPE",
C.QUANTITY_ORDERED "QTY ORDERED",
C.QUANTITY_CANCELLED "QTY CANCALLED",
G.ITEM_DESCRIPTION "ITEM DESCRIPTION",
G.UNIT_PRICE "UNIT PRICE",
(NVL(C.QUANTITY_ORDERED,0)-NVL(C.QUANTITY_CANCELLED,0))*NVL(G.UNIT_PRICE,0) "PO Line Amount",
(SELECT
DECODE(PH.APPROVED_FLAG, 'Y', 'Approved')
FROM PO.PO_HEADERS_ALL PH
WHERE PH.PO_HEADER_ID = D.PO_HEADER_ID) "PO STATUS",
A.INVOICE_TYPE_LOOKUP_CODE "INVOICE TYPE",
A.INVOICE_AMOUNT "INVOICE AMOUNT",
TO_CHAR(TRUNC(A.INVOICE_DATE)) "INVOICE DATE",
A.INVOICE_NUM "INVOICE NUMBER",
(SELECT
DECODE(X.MATCH_STATUS_FLAG, 'A', 'Approved')
FROM AP.AP_INVOICE_DISTRIBUTIONS_ALL X
WHERE X.INVOICE_DISTRIBUTION_ID = B.INVOICE_DISTRIBUTION_ID)"Invoice Approved?",
A.AMOUNT_PAID,
H.AMOUNT,
I.CHECK_NUMBER "CHEQUE NUMBER",
TO_CHAR(TRUNC(I.CHECK_DATE)) "PAYMENT DATE"
FROM AP.AP_INVOICES_ALL A,
AP.AP_INVOICE_DISTRIBUTIONS_ALL B,
PO.PO_DISTRIBUTIONS_ALL C,
PO.PO_HEADERS_ALL D,
PO.PO_VENDORS E,
PO.PO_VENDOR_SITES_ALL F,
PO.PO_LINES_ALL G,
AP.AP_INVOICE_PAYMENTS_ALL H,
AP.AP_CHECKS_ALL I
WHERE A.INVOICE_ID = B.INVOICE_ID
AND B.PO_DISTRIBUTION_ID = C. PO_DISTRIBUTION_ID (+)
AND C.PO_HEADER_ID = D.PO_HEADER_ID (+)
AND E.VENDOR_ID (+) = D.VENDOR_ID
AND F.VENDOR_SITE_ID (+) = D.VENDOR_SITE_ID
AND D.PO_HEADER_ID = G.PO_HEADER_ID
AND C.PO_LINE_ID = G.PO_LINE_ID
AND A.INVOICE_ID = H.INVOICE_ID
AND H.CHECK_ID = I.CHECK_ID
AND F.VENDOR_SITE_ID = I.VENDOR_SITE_ID
AND C.PO_HEADER_ID IS NOT NULL
AND A.PAYMENT_STATUS_FLAG = 'Y'
AND D.TYPE_LOOKUP_CODE != 'BLANKET';
select * from po_position_controls_all where job_id = 18069

select * from po_control_groups_all

select * from po_control_functions

CHECKS' --ACCOUNTING_EVENT_ID = 77429


role "Forwarded From", begin_date, end_date, action_argument "Forwarded To" from wf_routing_rules where SYSDATE between BEGIN_D

ype, poah.object_sub_type_code sub_type,


ype, poah.object_sub_type_code sub_type,
PO creation date
requisition errored date
LINE_ID = RQL.REQUISITION_LINE_ID and LIN.SOURCE_DOCUMENT_TYPE_ID = 10)

Prompt 1. po_headers_all
select * from po_headers_all
where po_header_id =&&po_header_id;

Prompt 2. po_lines_all
select * from po_lines_all
where po_header_id =&&po_header_id;

Prompt 3. po_line_locations_all
select * from po_line_locations_all
where po_header_id =&&po_header_id;

Prompt 4. po_distributions_all
select * from po_distributions_all
where po_header_id =&&po_header_id;

Prompt 5. po_releases_all
SELECT * FROM po_releases_all
WHERE po_header_id =&&po_header_id;

/*-----------------------------------------------------------------
Section : B.
Data from Receving tables and inventory tables
-------------------------------------------------------------------*/

Prompt 6. rcv_shipment_headers
select * from rcv_shipment_headers
where shipment_header_id in
(select shipment_header_id from rcv_shipment_lines
where po_header_id =&&po_header_id );

Prompt 7. rcv_shipment_lines
select * from rcv_shipment_lines
where po_header_id =&&po_header_id;

Prompt 8. rcv_transactions
select * from rcv_transactions
where po_header_id =&&po_header_id;

Prompt 9. rcv_Accounting_Events from 11i10 Onwards


SELECT * FROM rcv_Accounting_Events
WHERE rcv_transaction_id IN
(select transaction_id from rcv_transactions
where po_header_id =&&po_header_id);

Prompt 10. rcv_receiving_sub_ledger


select * from rcv_receiving_sub_ledger
where rcv_transaction_id in
(select transaction_id from rcv_transactions
where po_header_id =&&po_header_id);

Prompt 11. rcv_sub_ledger_details


select * from rcv_sub_ledger_details
where rcv_transaction_id in
(select transaction_id from rcv_transactions
where po_header_id =&&po_header_id);

Prompt 12. mtl_material_transactions


select * from mtl_material_transactions
where transaction_source_id = &&po_header_id;

Prompt 13. mtl_transaction_accounts


select * from mtl_transaction_accounts
where transaction_id in
( select transaction_id from mtl_material_transactions
where transaction_source_id = &&po_header_id );

/*-----------------------------------------------------------------
Section : C.
Invoicing details.
Note : Pls provide the details of following queries if invo
data only if the issue is related to the calculation of
quisition_line_id and Accrual amount or issue with the data in POXXRVDR,POX
(Any Accrual reports)
-------------------------------------------------------------------*/

Prompt 14. ap_invoice_distributions_all


select * from ap_invoice_distributions_all
where po_distribution_id in
( select po_distribution_id from po_distributions_all
where po_header_id =&&po_header_id );

Prompt 15. ap_invoices_all


select * from ap_invoices_all
where invoice_id in
(select invoice_id from ap_invoice_distributions_all
where po_distribution_id in
( select po_distribution_id from po_distributions_all
where po_header_id =&&po_header_id ));

/*-----------------------------------------------------------------
Section : D.
Projects data
Note : Pls provide details if issue is related to the cost
transferred to projects for Inventory and receiving.
-------------------------------------------------------------------*/
Prompt 16. pa_expenditure_items_all
select *
from pa_expenditure_items_all peia
where peia.orig_transaction_reference in
( select to_char(transaction_id) from mtl_material_tran
where transaction_source_id = &&po_header_id );

-- one more query required from RRSL to PA

/*-----------------------------------------------------------------
Section : E.
Encumbrances Data
Note : Pls provide details if issue is related to the Encum
Amount mismatch for the PO.
-------------------------------------------------------------------*/
Prompt 17. gl_bc_packets
SELECT *
FROM gl_bc_packets
WHERE reference2 IN ('&&po_header_id');

/*-----------------------------------------------------------------
Section : F.
GL data
Note : Pls furnish following details only if issue is related
to the GL Transfer of receiving transactions.
-----------------------------------------------------------------*/
Prompt 18. GL_INTERFACE
SELECT *
FROM GL_INTERFACE GLI
WHERE user_je_source_name ='Purchasing'
AND gl_sl_link_table ='RSL'
AND reference21='PO'
AND EXISTS
( SELECT 1
FROM rcv_receiving_sub_ledger RRSL
WHERE GLI.reference22 =RRSL.reference2
AND GLI.reference23 =RRSL.reference3
AND GLI.reference24 =RRSL.reference4
AND RRSL.rcv_transaction_id in
(select transaction_id from rcv_transactions
eader_ID = d.po_header_id) "PO Approved?" where po_header_id =&&po_header_id));

Prompt 19. gl_import_references


SELECT *
FROM gl_import_references GLIR
WHERE reference_1='PO'
AND gl_sl_link_table ='RSL'
AND EXISTS
( SELECT 1
FROM rcv_receiving_sub_ledger RRSL
WHERE GLIR.reference_2 =RRSL.reference2
AND GLIR.reference_3 =RRSL.reference3
AND GLIR.reference_4 =RRSL.reference4
AND RRSL.rcv_transaction_id in
(select transaction_id from rcv_transactions
where po_header_id =&&po_header_id));
ribution_id from po_distributions_all where po_header_id =));

eference23 =RRSL.reference3AND GLI.reference24 =RRSL.reference4AND RRSL.rcv_transaction_id in(select transaction_id from rcv_tran

D GLIR.reference_3 =RRSL.reference3 AND GLIR.reference_4 =RRSL.reference4AND RRSL.rcv_transaction_id in


es where SYSDATE between BEGIN_DATE-1 and NVL(END_DATE,sysdate+1) order by rule_id;
=&&po_header_id;

=&&po_header_id;

_locations_all
=&&po_header_id;

ributions_all
=&&po_header_id;

=&&po_header_id;

------------------------------------------

ables and inventory tables


-----------------------------------------*/

ent_headers
pment_headers

ader_id from rcv_shipment_lines


=&&po_header_id );

pment_lines
=&&po_header_id;
=&&po_header_id;

nting_Events from 11i10 Onwards


ccounting_Events

d from rcv_transactions
=&&po_header_id);

ving_sub_ledger
eiving_sub_ledger

d from rcv_transactions
=&&po_header_id);

edger_details
_ledger_details

d from rcv_transactions
=&&po_header_id);

erial_transactions
terial_transactions
urce_id = &&po_header_id;

action_accounts
nsaction_accounts

d from mtl_material_transactions
urce_id = &&po_header_id );

------------------------------------------

e details of following queries if invoicing


is related to the calculation of
sue with the data in POXXRVDR,POXPORRA

-----------------------------------------*/

e_distributions_all
ice_distributions_all

on_id from po_distributions_all


=&&po_header_id );

m ap_invoice_distributions_all
on_id from po_distributions_all
=&&po_header_id ));

------------------------------------------

tails if issue is related to the cost


ts for Inventory and receiving.
-----------------------------------------*/
diture_items_all

_items_all peia
saction_reference in
saction_id) from mtl_material_transactions
urce_id = &&po_header_id );

quired from RRSL to PA

------------------------------------------

tails if issue is related to the Encumbrance

-----------------------------------------*/

('&&po_header_id');

------------------------------------------

owing details only if issue is related


receiving transactions.
---------------------------------------*/

ce_name ='Purchasing'

sub_ledger RRSL
e22 =RRSL.reference2
=RRSL.reference3
=RRSL.reference4

d from rcv_transactions
=&&po_header_id));

_references

rences GLIR

sub_ledger RRSL
ce_2 =RRSL.reference2
3 =RRSL.reference3
4 =RRSL.reference4

d from rcv_transactions
=&&po_header_id));
select transaction_id from rcv_transactionswhere po_header_id ));
Status Populated Tables Column(status) Value

Entered oe_order_headers_all open_flag Y

oe_order_lines_all

oe_price_adjustments
oe_order_price_attribs
oe_order_holds_all

Booked oe_order_headers_all Booked_flag Y


wsh_delivery_details Released_status R

Pick
Released wsh_delivery_details Released_status S
wsh_picking_batches

(Fully) mtl_reservations
mtl_material_transactio
ns_temp
mtl_txn_request_headers
mtl_txn_request_lines
(Partial) wsh_delivery_details S
B

wsh_new_deliveries name
wsh_delivery_assignments

Pick
Confirmed wsh_delivery_details Released_status Y

Ship
Confirmed wsh_delivery_details Released_status C
mtl_material_transactions
wsh_new_deliveries C

oe_order_lines_all Shipped_quantity
wsh_delivery_legs

oe_order_headers_all open_flag N

Autoinvoice wsh_delivery_details Released_status I


ra_interface_lines_all
ra_customer_trx_all
ra_customer_trx_lines_all

WF scripts doc id 183643.1

Query to find the transactions against this Sales Order

select rcta.trx_number "Transaction"


, rctta.name "Trans Type"
, RCTA.CT_REFERENCE "Reference"
, rcta.CREATION_DATE "Created"
, fu.USER_NAME "Created By"
, fcp.user_concurrent_program_name "Created by CC Program"
, rcta.BATCH_ID
, rcta.REQUEST_ID
, rcta.INTERFACE_HEADER_CONTEXT "Created From"
, rcta.CREATED_FROM "CC/Form"
, rcta.PRINTING_ORIGINAL_DATE "Orig Print Date"
from ra_customer_trx_all rcta
, fnd_concurrent_programs_vl fcp
, fnd_concurrent_programs_vl fcp1
, RA_CUST_TRX_TYPES_ALL rctta
, fnd_user fu
where
RCTA.CT_REFERENCE = '20001731' ( give order no)
and fcp.CONCURRENT_PROGRAM_ID (+) = rcta.PROGRAM_ID
and fcp1.CONCURRENT_PROGRAM_NAME (+) = rcta.
and rctta.CUST_TRX_TYPE_ID = rcta.CUST_TRX_TYPE_ID
and rctta.ORG_ID = rcta.ORG_ID
and fu.USER_ID = rcta.CREATED_BY
order by rcta.trx_number

select * from oe_order_holds_all where header_id = 755934


select * from apps.OE_HOLD_sources_all where hold_source_id

select * from OE_HOLD_definitions where hold_id in (1

select * from oe_line_sets where line_id in ( 1163708

Finding the Order line release status

SELECT DECODE(RELEASED_STATUS,'Y','PICKED','S','PICKED'
WHERE SOURCE_CODE = 'OE' AND SOURCE_LINE_ID = &line_id
Description/transactions Others

Ship to / Bill to (Order Type) / Price List /


1 record created in header table Item(Line Type)
After Entering / booking -- Proces Order API will
Lines for particular records be called - This will take care of holds etc
After Awaiting Shipping - Visible Demand Flag is
When discount gets applied set to Yes
If line has price attributes then populated
If any hold applied for order like credit check etc.

Scheduling will happen -->.1 Soft Reservation 2.


MTL Demand record will be inserted (This is
input for Planning) -->3. Depending on the ATP
Order booked. rules it will give the Schedule Ship Date
Ready to release Pick Release API / Pick Confirm API
No records in wsh_delivery_assignments and
wsh_new_deliveries

Released to Warehouse (Line has been


released to Inventory for processing) Move Order (Creation - Transaction)
After batch is created for pick release.
This is only soft reservations.
No physical movement of stock

No records in mtl_material_transactions

Released to warehouse.
Backordered
Line failed to be allocated in Inventory
if Auto-Create is Yes then data populated.
deliveries get assigned

Hard Reservations. Picked the stock.


Physical movement of stock
Line has been picked and staged by Inventory
Subinventory to staging area. Packing slip.

Y To C:Shipped ;Delivery Note get printed Interface Trip Stop--Sales Order Issue
Delivery assigned to trip stop Transaction in Material Transaction and
quantity will be decreased from staged reservation is releived
On the ship confirm form, check Ship all box
If Defer Interface is checked I.e its deferred then
OM & inventory not updated.
If Defer Interface is not checked.: Shipped
get populated.
1 leg is called as 1 trip.
1 Pickup & drop up stop for each trip.
147
If all the lines get shipped then only flag N

Need to run workflow background process.


Data will be populated after wkfw process.
After running Autoinvoice Master Program for
specific batch transaction tables get populated

Cancelled

Created by CC Program"

ated From"

Print Date"

e order no)
rcta.PROGRAM_ID
= rcta.CREATED_FROM
ST_TRX_TYPE_ID

er_id = 755934
e hold_source_id in ( 179401 , 179402 , 179403 )

d_id in (1,1181,1201)

( 1163708 , 1162719)

'S','PICKED','B','PICKED','NOT PICKED') FROM WSH_DELIVERY_DETAILS


= &line_id
Query
select * from MTL_INTERCOMPANY_PARAMETERS_V where SHIP_ORGANIZATION_NAME like 'Austra%'
select * MTL_INTERCOMPANY_PARAMETERS_V
select max(order_number) from oe_order_headers_all where org_id=912

select * from oe_order_headers_all where org_id=912


select * from org_organization_definitions

select hr.business_group_id,hr.ORGANIZATION_ID,hr.name,hr.LEGAL_ENTITY_ID,
hr.SET_OF_BOOKS_ID,gl.CHART_OF_ACCOUNTS_ID
from gl_sets_of_books gl,hr_operating_units hr
where gl.set_of_books_id=hr.set_of_books_id

select * from wsh_delivery_details where organization_id=4160 and serial_number is not null


select * from mtl_system_items where inventory_item_id=198

Select * from dba_views where view_name like 'BCIWSH_FG_AVAIL_ONHANDS_V'

select * from oe_order_headers_all where order_number=75001141


select * from oe_order_lines_all where header_id= 6354017
select * from wsh_delivery_details where source_header_id= 6354017
select * from wsh_new_deliveries where delivery_id = 12041579

select * from RA_CUSTOMER_TRX_LINES_ALL where CUSTOMER_TRX_ID = 968746


Select * from ra_rules --- for accounting rule and invoicing rule definitions
select * from ra_cust_trx_types_all
select * from ra_customer_trx_all where ct_reference = '186205'
select * from v$database
Discounts : select * from oe_price_adjustments where header_id = '758957'

To see the Inventory accounting periods : select * from org_acct_periods


select * from org_organization_definitions

Query to find all OU's BG's and LE's : select * from hr_all_organization_units

user having which responsibilities ; select * from fnd_responsibility_vl , select * from apps.FND_USER_RESP_GROUPS

Query to find the WF activities as in front end


select execution_time,
to_char(ias.begin_date,'DD-MON-RR HH24:MI:SS') begin_date,
ap.display_name||'/'||ac.display_name Activity,
ias.activity_status Status,
ias.activity_result_code Result,
ias.assigned_user ass_User
from wf_item_activity_statuses ias,
wf_process_activities pa,
wf_activities_vl ac,
wf_activities_vl ap,
wf_items i
where ias.item_type = 'POAPPRV'
and ias.item_key = '120298-264181'
and ias.process_activity = pa.instance_id
and pa.activity_name = ac.name
and pa.activity_item_type = ac.item_type
and pa.process_name = ap.name
and pa.process_item_type = ap.item_type
and pa.process_version = ap.version
and i.item_type = 'POAPPRV'
and i.item_key = ias.item_key
and i.begin_date >= ac.begin_date
and i.begin_date < nvl(ac.end_date, i.begin_date+1)
union all
select execution_time,
to_char(ias.begin_date,'DD-MON-RR HH24:MI:SS') begin_date,
ap.display_name||'/'||ac.display_name Activity,
ias.activity_status Status,
ias.activity_result_code Result,
ias.assigned_user ass_User
from wf_item_activity_statuses_h ias,
wf_process_activities pa,
wf_activities_vl ac,
wf_activities_vl ap,
wf_items i
where ias.item_type = 'POAPPRV'
and ias.item_key = '120298-264181'
and ias.process_activity = pa.instance_id
and pa.activity_name = ac.name
and pa.activity_item_type = ac.item_type
and pa.process_name = ap.name
and pa.process_item_type = ap.item_type
and pa.process_version = ap.version
and i.item_type = 'POAPPRV'
and i.item_key = ias.item_key
and i.begin_date >= ac.begin_date
and i.begin_date < nvl(ac.end_date, i.begin_date+1)
order by 2,1

Query showing the Error in WF

select ac.display_name Activity,


ias.activity_result_code Result,
ias.error_name ERROR_NAME,
ias.error_message ERROR_MESSAGE,
ias.error_stack ERROR_STACK
from wf_item_activity_statuses ias,
wf_process_activities pa,
wf_activities_vl ac,
wf_activities_vl ap,
wf_items i
where ias.item_type = 'OEOH'
and ias.item_key = '730077'
and ias.activity_status = 'ERROR'
and ias.process_activity = pa.instance_id
and pa.activity_name = ac.name
and pa.activity_item_type = ac.item_type
and pa.process_name = ap.name
and pa.process_item_type = ap.item_type
and pa.process_version = ap.version
and i.item_type = 'OEOH'
and i.item_key = ias.item_key
and i.begin_date >= ac.begin_date
and i.begin_date < nvl(ac.end_date, i.begin_date+1)
order by ias.execution_time

select * from wf_item_attribute_values where item_key = '771627'

Query to find mapping between segment name and the value set -
SELECT fifsv.segment_name, fifsv.segment_num, fifsv.application_column_name, fifsv.flex_value_set_id
--------------------------------
We can get the defined values by using flex_value_set_id for specific segments as-
select * from fnd_flex_values where flex_value_set_id = 1005635

To Check Open inventory Periods


SELECT summary.organization_id organization_id,
ood.organization_code organization_code,
ood.organization_name organization_name,
periods.period_name period_name,
periods.OPEN_FLAG ,periods.PERIOD_CLOSE_DATE ,
periods.period_year period_year,
periods.period_start_date period_start_date,
periods.schedule_close_date schedule_close_date,
summary.secondary_inventory sub_inv, summary.inventory_value VALUE
FROM mtl_period_summary summary,
org_acct_periods periods,
org_organization_definitions ood
WHERE summary.organization_id = periods.organization_id
AND summary.organization_id = ood.organization_id
AND summary.acct_period_id = periods.acct_period_id
AND periods.period_close_date IS NOT NULL
AND summary.inventory_type = 1
Details
Intercompany Relations
Intercompany Relations
Latest Order

All in One Ou
All OU / INV Etc

ALL OU/LE/BG Etc

To find the SQl for the View

apps.FND_USER_RESP_GROUPS
n_name, fifsv.flex_value_set_id, fif.application_table_name, fif.id_flex_code flex_code, fif.id_flex_name flex_name F
flex_name flex_name FROM fnd_id_flex_segments_vl fifsv, fnd_id_flexs fif WHERE fifsv.id_flex_code = fif.id_flex_co
sv.id_flex_code = fif.id_flex_code
SYSADMIN & HRMS
Query to find the responsibilities of a user

select RESPONSIBILITY_NAME from apps.fnd_user_resp_groups_direct ur,fnd_responsibility_vl rv


where ur.RESPONSIBILITY_ID=rv.RESPONSIBILITY_ID and ur.user_id=19228

Query to find the cost center assigned to an employee

SELECT * FROM PAY_COST_ALLOCATIONS_F WHERE assignment_id = 63801

2. SELECT * FROM PAY_COST_ALLOCATION_KEYFLEX WHERE COST_ALLOCATION_KEYFLEX_ID = 150

Patches & Bugs

SELECT * FROM ad_bugs

SELECT * FROM ad_applied_patches

Query to find when a user has logged in and logged out : select * from fnd_logins

Query to find the details of Concurrent Program

select * from fnd_concurrent_requests where request_id = 7755802

select * from fnd_concurrent_programs_tl where concurrent_program_id = 20428

Emp Supervisor Heirarchy


SELECT f.person_id person_id, f.effective_start_date,
f.effective_end_date,f.employee_number, f.full_name employee_name, f.email_address,
f2.full_name manager_name1, f3.full_name manager_name2,
f4.full_name manager_name3, f5.full_name manager_name4,
f6.full_name manager_name5,
f7.full_name manager_name6
FROM per_all_people_f f,
per_assignments_f pera,
per_all_people_f f2,
per_all_people_f f3,
per_assignments_f pera1,
per_all_people_f f4,
per_assignments_f pera2,
per_all_people_f f5,
per_assignments_f pera3,
per_all_people_f f6,
per_assignments_f pera4,
per_all_people_f f7,
per_assignments_f pera5,
per_all_people_f f8,

Page 52
SYSADMIN & HRMS
per_assignments_f pera6
WHERE 1 = 1
AND NVL (pera.supervisor_id, -99) = NVL (f2.person_id(+), -99)
AND NVL (f.person_id, 1) = NVL (pera.person_id(+), 1)
and f.person_id = &person_id -- Pass person_id
AND NVL (pera.effective_start_date, SYSDATE) <= SYSDATE
AND NVL (pera.effective_end_date, SYSDATE + 1) > SYSDATE
AND NVL (f.effective_start_date, SYSDATE) <= SYSDATE
AND NVL (f.effective_end_date, SYSDATE + 1) > SYSDATE
AND NVL (f2.effective_start_date, SYSDATE) <= SYSDATE
AND NVL (f2.effective_end_date, SYSDATE + 1) > SYSDATE
AND NVL (f3.effective_start_date, SYSDATE) <= SYSDATE
AND NVL (f3.effective_end_date, SYSDATE + 1) > SYSDATE
AND NVL (f2.person_id, 1) = NVL (pera1.person_id(+), 1)
AND NVL (pera1.supervisor_id, -99) = NVL (f3.person_id(+), -99)
AND NVL (pera1.effective_start_date, SYSDATE) <= SYSDATE
AND NVL (pera1.effective_end_date, SYSDATE + 1) > SYSDATE
------cond for lvl 3
AND NVL (f4.effective_start_date, SYSDATE) <= SYSDATE
AND NVL (f4.effective_end_date, SYSDATE + 1) > SYSDATE
AND NVL (f3.person_id, 1) = NVL (pera2.person_id(+), 1)
AND NVL (pera2.supervisor_id, -99) = NVL (f4.person_id(+), -99)
AND NVL (pera2.effective_start_date, SYSDATE) <= SYSDATE
AND NVL (pera2.effective_end_date, SYSDATE + 1) > SYSDATE
AND NVL (f3.person_id, 1) = NVL (pera2.person_id, 1)
AND NVL (pera2.supervisor_id, -99) = NVL (f4.person_id, -99)
------cond for lvl 4
AND NVL (f5.effective_start_date, SYSDATE) <= SYSDATE
AND NVL (f5.effective_end_date, SYSDATE + 1) > SYSDATE
AND f4.person_id = pera3.person_id(+)
AND NVL (pera3.supervisor_id, -99) = NVL (f5.person_id(+), -99)
AND NVL (pera3.effective_start_date, SYSDATE) <= SYSDATE
AND NVL (pera3.effective_end_date, SYSDATE + 1) > SYSDATE
AND NVL (f4.person_id, -1) = NVL (pera3.person_id, -1)
AND NVL (pera3.supervisor_id, -99) = NVL (f5.person_id, -99)
------cond for lvl 5
AND NVL (f6.effective_start_date, SYSDATE) <= SYSDATE
AND NVL (f6.effective_end_date, SYSDATE + 1) > SYSDATE
AND NVL (f5.person_id, 1) = NVL (pera4.person_id(+), 1)
AND NVL (pera4.supervisor_id, -99) = NVL (f6.person_id(+), -99)
AND NVL (pera4.effective_start_date, SYSDATE) <= SYSDATE
AND NVL (pera4.effective_end_date, SYSDATE + 1) > SYSDATE
AND NVL (f5.person_id, 1) = NVL (pera4.person_id, 1)
AND NVL (pera4.supervisor_id, -99) = NVL (f6.person_id, -99)
-----cond for lvl VI
AND NVL (f7.effective_start_date, SYSDATE) <= SYSDATE
AND NVL (f7.effective_end_date, SYSDATE + 1) > SYSDATE
AND f6.person_id = pera5.person_id(+)
AND NVL (pera5.supervisor_id, -99) = NVL (f7.person_id(+), -99)

Page 53
SYSADMIN & HRMS
AND NVL (pera5.effective_start_date, SYSDATE) <= SYSDATE
AND NVL (pera5.effective_end_date, SYSDATE + 1) > SYSDATE
AND NVL (f6.person_id, 1) = NVL (pera5.person_id, 1)
AND NVL (pera5.supervisor_id, -99) = NVL (f7.person_id, -99)
-----cond for lvl VII
AND NVL (f8.effective_start_date, SYSDATE) <= SYSDATE
AND NVL (f8.effective_end_date, SYSDATE + 1) > SYSDATE
AND NVL (f7.person_id, -99) = NVL (pera6.person_id(+), -99)
AND NVL (pera6.supervisor_id, -99) = NVL (f8.person_id(+), -99)
AND NVL (pera6.effective_start_date, SYSDATE) <= SYSDATE
AND NVL (pera6.effective_end_date, SYSDATE + 1) > SYSDATE
AND NVL (f7.person_id, 1) = NVL (pera6.person_id, 1)
AND NVL (pera6.supervisor_id, -99) = NVL (f8.person_id, -99)
Responsibilities of a user
SELECT
fu.user_name
,fu.email_address
,fu.end_date fu_end_date
,papf.employee_number
,papf.full_name employee_name
,pbg.NAME business_group
,fa.application_id
,fa.application_short_name
,frt.responsibility_id
,frt.responsibility_name
,furgd.start_date fu_resp_start_date
,furgd.end_date fu_resp_end_date
FROM
fnd_application fa
,fnd_responsibility_tl frt
,fnd_responsibility fr
,apps.fnd_user_resp_groups_direct furgd
,fnd_user fu
,per_all_assignments_f paaf
,per_all_people_f papf
,gl_code_combinations gcc
,per_business_groups pbg
WHERE
1=1
and fa.application_id = frt.application_id
AND frt.responsibility_id = fr.responsibility_id
--AND resp.VERSION = 'W' -- Self Service Web applications Value
--and frt.RESPONSIBILITY_NAME like '%NUAN Japan%Setu%'
AND NVL (fr.end_date, SYSDATE + 1) > TRUNC (SYSDATE)
AND fr.responsibility_id = furgd.responsibility_id
AND NVL (furgd.end_date, SYSDATE + 1) > TRUNC (SYSDATE)
AND furgd.user_id = fu.user_id
AND NVL (fu.end_date, SYSDATE + 1) > TRUNC (SYSDATE)
AND fu.user_name like '%ASHONTE_GABBART%'

Page 54
SYSADMIN & HRMS
AND fu.employee_id = papf.person_id
AND TRUNC (SYSDATE) BETWEEN TRUNC (papf.effective_start_date)
AND TRUNC (NVL (papf.effective_end_date, SYSDATE))
AND papf.business_group_id = pbg.business_group_id
and trunc(sysdate) between paaf.EFFECTIVE_START_DATE and paaf.EFFECTIVE_END_DATE
and papf.PERSON_ID=paaf.PERSON_ID
and trunc(sysdate) between papf.EFFECTIVE_START_DATE and papf.EFFECTIVE_END_DATE
and gcc.code_combination_id=paaf.DEFAULT_CODE_COMB_ID
--and gcc.segment1 in ('86')
and paaf.ASSIGNMENT_NUMBER is not null

Max length of values in a column


select max(length(tax_code)) from oe_order_lines_all

Below is the query to get audit details like Last Logon Time and Last Logout Time of Responsibilities for particular User.

Query1

SELECT fl.user_id, fu.user_name, frt.responsibility_name,


MAX (flr.start_time) "Last Logon Time At Resp",
MAX (flr.end_time) "Last Logout Time At Resp",
fu.last_logon_date "Last Logon Time At Application"
FROM fnd_login_responsibilities flr,
fnd_responsibility_tl frt,
fnd_logins fl,
fnd_user fu
WHERE 1 = 1
--AND frt.responsibility_name LIKE 'NUAN US Inventory Inquiry'
AND fu.user_name LIKE 'AAOFFSHORE'
AND frt.responsibility_id = flr.responsibility_id
AND flr.login_id = fl.login_id
AND fl.user_id = fu.user_id
GROUP BY fl.user_id, fu.user_name, fu.last_logon_date,
frt.responsibility_name
ORDER BY 5 DESC

Below is the query to get audit details like Unsuccessful Login Time for particular User in the Oracle Applications

Query2

Page 55
SYSADMIN & HRMS

SELECT fu.user_id, fu.user_name, fl.attempt_time


FROM fnd_unsuccessful_logins fl, fnd_user fu
WHERE fl.user_id = fu.user_id
ORDER BY fu.user_id DESC

Page 56
SYSADMIN & HRMS

d = 63801

ION_KEYFLEX_ID = 150

Page 57
SYSADMIN & HRMS

sponsibilities for particular User.

n the Oracle Applications

Page 58
OM Queries
Query to find the Holds on an Order Header

SELECT oh.header_id hdr_id, oh.line_id line, hd.hold_id, hd.NAME hold_name,


hd.item_type, hd.activity_name activity, oh.creation_date held_date,
oe_holds_pvt.user_name (oh.created_by) held_by, hs.hold_until_date,
DECODE (hs.hold_entity_code,
'S', 'Ship To',
'B', 'Bill To',
'I', 'Item',
'W', 'Warehouse',
'O', 'Order',
'C', 'Customer',
hs.hold_entity_code
) entity_code,
hs.hold_entity_id,
DECODE (hs.hold_entity_code2,
'S', 'Ship To',
'B', 'Bill To',
'I', 'Item',
'W', 'Warehouse',
'O', 'Order',
'C', 'Customer',
hs.hold_entity_code2
) entity_code2,
hs.hold_entity_id2, oh.released_flag
FROM oe_order_holds_all oh, oe_hold_sources_all hs, oe_hold_definitions hd
WHERE oh.hold_source_id = hs.hold_source_id
AND oh.hold_source_id = hs.hold_source_id
AND hd.hold_id = hs.hold_id
AND oh.header_id = &order_header_id --pass header_id

I. Business Purpose: Develop a query which lists the orders which are on hold from the last (no of days to be entered by the

Fields:
Order Date
Order Number
Order Type (Name)
Order Item
Date of Hold
Reason of Hold
Hold by
Days of Hold

ANSWER:

Page 59
OM Queries
SELECT oh.ordered_date, oh.order_number, oh.order_category_code "Order Type",
ol.ordered_item, holds.creation_date "Date of Hold",
hdef.description "Reason of Hold",
hdef.created_by "Hold by",
months_between(SYSDATE,holds.creation_date) "Days of hold"
FROM oe_order_lines_all ol,
oe_order_headers_all oh,
oe_order_holds_all holds,
oe_hold_definitions hdef
WHERE ol.header_id = oh.header_id
AND oh.header_id = holds.header_id
AND hdef.created_by = holds.created_by;

II. Business Purpose: Develop a query to list all the un booked sales orders…(show relevant fields).

ANSWER:

SELECT oh.ordered_date,oh.flow_status_code "Order Status",


oh.order_type_id, oh.order_category_code,
party.party_name,oh.created_by,oh.request_date,
oh.creation_date,oh.booked_date,oh.order_firmed_date,
oh.transactional_curr_code,oh.payment_term_id,
wdd.source_header_type_id,wdd.source_header_type_name,
wdd.inventory_item_id,wdd.item_description,wdd.requested_quantity,
wdd.requested_quantity_UOM,wdd.released_status,
ca.cust_account_id "CustomerNumber",party.party_name "Customer Name"
FROM oe_order_headers_all oh,
wsh_delivery_details wdd,
hz_parties party,
hz_cust_accounts_all ca
WHERE wdd.source_header_number=oh.order_number
AND oh.sold_to_org_id=ca.cust_account_id
AND party.party_id=ca.party_id
AND oh.flow_status_code like 'ENTERED';

III. Business Purpose: List all the Orders which are Backordered
 
Fields:
Order Number
Customer Number
Customer Name
Order Type (Name)
Status
Date of Order
Item Number
Description

Page 60
OM Queries
ANSWER:

SELECT wdd.source_header_number "Order Number",


party.party_name "Customer Name",
ca.cust_account_id "CustomerNumber",
wdd.source_header_type_name "Order Type",
wdd.released_status "Status",
oh.ordered_date,
oh.request_date,
oh.creation_date,
wdd.inventory_item_id "Item Number",
wdd.item_description
FROM oe_order_headers_all oh
JOIN hz_cust_accounts_all ca
ON oh.sold_to_org_id = ca.cust_account_id
JOIN hz_parties party
ON party.party_id=ca.party_id
JOIN wsh_delivery_details wdd
ON wdd.source_header_number=oh.order_number
WHERE wdd.released_status='B';

IV. Business Purpose: Develop a query to list all the orders which are ready for shipping
 
Fields:
Sales Order Number
Sales Order Date
Customer Name
Pick Slip Number
Order Status
Sub inventory
Move Order Number

ANSWER:

SELECT oh.header_id "Sales Order Number",


oh.ordered_date,
oh.sold_to_org_id,
party.party_name "Customer Name",
mtll.pick_slip_number,
wdd.subinventory,
ol.flow_status_code,
wdd.subinventory,
mtlh.request_number move_order_num
FROM oe_order_headers_all oh,
oe_order_lines_all ol,
wsh_delivery_details wdd,
hz_cust_accounts_all ca,
hz_parties party,

Page 61
OM Queries
mtl_txn_request_lines mtll,
mtl_txn_request_headers mtlh
WHERE oh.header_id = ol.header_id
AND wdd.org_id = oh.org_id
AND oh.sold_to_org_id = ca.cust_account_id
AND party.party_id=ca.party_id
AND wdd.move_order_line_id =mtll.line_id
AND mtll.header_id = mtlh.header_id
AND ol.flow_status_code='AWAITING_SHIPPING';

select * from oe_order_holds_all where header_id = 755934

select * from apps.OE_HOLD_sources_all where hold_source_id in ( 179401 , 179402

select * from OE_HOLD_definitions where hold_id in (1,1181,1201)

select * from oe_line_sets where line_id in ( 1163708 , 1162719)


Select * from OE_HOLD_AUTHORIZATIONS-- To check what responsibilites are authorized to appl

select * from oe_sets where header_id =

To restrict o/p to one org

HOLD Authorizations
select b.responsibility_name , a.responsibility_id , a.START_DATE_ACTIVE ,
c.hold_id , c.DESCRIPTION
from oe_hold_authorizations a , fnd_responsibility_tl b , oe_hold_definitions c
where a.responsibility_id = b.responsibility_id
and c.hold_id = a.hold_id
and b.responsibility_name like 'NUAN%US%MLB%Order%Manager'

Query to check error in child WF


SELECT i.item_key, i.item_type
FROM wf_items i
WHERE i.item_type = 'WFERROR' –'OMERROR'
AND i.parent_item_type = 'OEOH'
AND i.parent_item_key = 859384 –header_id

Sets on Order

SELECT OLS.LINE_ID, l.flow_status_code , OLS.SET_ID , OST.SET_NAME , OST.SET_TYPE


FROM OE_LINE_SETS OLS, OE_SETS OST, oe_order_lines_all l

Page 62
OM Queries
WHERE OLS.LINE_ID = l.line_id
AND OLS.SET_ID = OST.SET_ID
--AND OST.SET_TYPE = 'FULFILLMENT_SET'
and l.header_id = 1005745
order by ols.set_id, ols.line_id;

Page 63
OM Queries

hold_name,
held_date,

initions hd

ass header_id

last (no of days to be entered by the user) .The query should list all the basic details and the reason for hold.

Page 64
OM Queries

179401 , 179402 , 179403 )

lites are authorized to apply and release holds

E_ACTIVE , a.END_DATE_ACTIVE, a.authorized_action_code , c.name ,

d_definitions c

ME , OST.SET_TYPE

Page 65
Metalink Imp Doc ID's
Diagnostic Scripts

ORDER MANAGEMENT - DIAGNOSTICS LIBRARY Doc ID: 741642.1

OM WF scripts doc id 183643.1

How to Diagnose Purchasing Document Approval Routing Doc ID: 603232.1

Reset a PO To Incomplete/Requires Reapproval For Isolated Cases : 390023.1

Manufacturing Transaction Diagnostics - FUNCTIONAL USER SQL INVESTIGATION and REPAIR


Doc ID: 801794.1 ( Imp SQL queries and scripts for checking period end process etc.. )

Procurement WF 374428.1

Oracle Order Management Suite White Papers Doc id 113492.1

Serial Number FAQ Doc ID: 417875.1

Internal Sales Order Cycle In Order Management Doc ID: 744481.1

Setup Instructions For Internal Sales Orders Across Operating Units Doc ID: 403786.1

What Are The Basic Steps Of The Purchasing Receipt Accrual Period-End Process? Doc ID

Brief Overview of Receipt Accounting Doc ID: 563100.1

FAQ on Period End Accruals and Uninvoiced Receipt Report Doc ID: 453579.1

ORDER MANAGEMENT SUITE - DATA FIX SCRIPT PATCH LIBRARY Doc ID: 398822.1

Tom's Top Inventory FAQ Notes 2008 Doc ID: 605044.1

Note 568012.1 - FAQ: Inventory Standard Datafixes

How To Check Onhand / Serial Number Setup? Doc ID: 330284.1

AR Transaction Workbench FAQ 10.7 & 11.5 Doc ID: 220026.1

FAQ: Inventory Standard Datafixes Doc ID: 568012.1

https://support.oracle.com/CSP/main/article?cmd=show&id=113492.1&type=NOT

How To Diagnose A Problem In The Item Catalog [ID 382592.1]

Page 66
Metalink Imp Doc ID's

Also check if the user is setup for Category or Item-Source Realms. This restricts the items available for a user to fin

Self service toolkit: iProcurement [ID 131595.1]


iProcurement Setup 11i: Oracle Internet Procurement Functional Setup [ID 134168.1]

http://kutuboracle.blogspot.com/2009/12/how-to-diagnose-purchasing-document.html

Page 67
Metalink Imp Doc ID's

rocess? Doc ID: 467584.1

Doc ID: 398822.1

OM Documents

Page 68
Metalink Imp Doc ID's

the items available for a user to find. For additional information see Note 332414.1 about Realm useage, and Note 109497.1

up [ID 134168.1]

Page 69
Metalink Imp Doc ID's

age, and Note 109497.1 for Item Frequently Asked Questions.

Page 70
Scripts
Script to re-inserted record into interface
/*
* Please run the script on TEST instance first, if satisfied then run on PRODUCTION Instance.
* Oracle Corp is NOT responsible if directly run on PRODUCTION Instance without running on TEST instance.
* This script is NOT a generic script, It is very scpecific for recommended/Problematic Sales Order.
*/

SET SERVEROUTPUT ON SIZE 100000;


SET LINESIZE 175
SET VERIFY OFF

DECLARE
L_LINE_ID NUMBER;
L_FILE_VAL VARCHAR2(1000);
L_RESULT_OUT VARCHAR2(90);
L_RETURN_STATUS VARCHAR2(300);
ERR_MSG VARCHAR2(1000);
L_ORG NUMBER;
L_HEADER_ID NUMBER;
L_COUNT NUMBER;
l_counter NUMBER;
x_msg_count number;
x_msg_data Varchar2(2000);
x_msg_index number;

CURSOR cur_rec IS
select line_id
from oe_order_lines_all
where line_id in ( '1168355' , '1168356' );

BEGIN
OE_DEBUG_PUB.DEBUG_ON;
OE_DEBUG_PUB.INITIALIZE;
L_FILE_VAL := OE_DEBUG_PUB.SET_DEBUG_MODE('FILE');
OE_DEBUG_PUB.SETDEBUGLEVEL(5);
-- DBMS_OUTPUT.PUT_LINE('.');
DBMS_OUTPUT.PUT_LINE(' .... Log File Name and Location :- '||OE_DEBUG_PUB.G_DIR||'/'||OE_DEBUG_PUB.G_FILE
-- DBMS_OUTPUT.PUT_LINE('.');
OPEN cur_rec;

LOOP

FETCH cur_rec INTO l_line_id;

EXIT WHEN cur_rec%NOTFOUND;

Page 71
Scripts
SELECT count(*) into l_counter from RA_CUSTOMER_TRX_LINES_ALL
where line_type = 'LINE'
and interface_line_context = 'ORDER ENTRY'
and interface_line_attribute6 = l_line_id;

IF(l_counter = 0) THEN
SELECT count(*) into l_counter from RA_INTERFACE_LINES_ALL
where line_type = 'LINE'
and interface_line_context = 'ORDER ENTRY'
and interface_line_attribute6 = l_line_id;
END IF;

IF(l_counter = 0) THEN
dbms_output.put_line('Putting Line into Interface Table: ' || l_line_id);

SELECT L.ORG_ID, HEADER_ID INTO L_ORG, L_HEADER_ID FROM OE_ORDER_LINES_ALL L WHERE


--OE_DEBUG_PUB.ADD(' ramising: l_org at line level = ' || L_ORG);

begin
-- DBMS_OUTPUT.PUT_LINE(' executing fnd_client_info.set_org_context().... ');
OE_DEBUG_PUB.ADD('ramising:- executing fnd_client_info.set_org_context().... ');
FND_CLIENT_INFO.SET_ORG_CONTEXT(L_ORG);
exception
when others then
-- DBMS_OUTPUT.PUT_LINE(' Errors in executing fnd_client_info.set_org_context().... '|| SQLERRM );
OE_DEBUG_PUB.ADD('ramising:- Errors in executing fnd_client_info.set_org_context().... '|| SQLERRM );
null;
end;

begin
-- DBMS_OUTPUT.PUT_LINE(' executing MO_GLOBAL.set_policy_context().... ');
OE_DEBUG_PUB.ADD('ramising:- executing MO_GLOBAL.set_policy_context().... ');
MO_GLOBAL.set_policy_context('S', L_ORG);
exception
when others then
-- DBMS_OUTPUT.PUT_LINE(' Errors in executing MO_GLOBAL.set_policy_context().... '|| SQLERRM );
OE_DEBUG_PUB.ADD('ramising:- Errors in executing MO_GLOBAL.set_policy_context().... '|| SQLERRM );
null;
end;

UPDATE OE_ORDER_LINES_ALL
SET INVOICED_QUANTITY = 0, INVOICE_INTERFACE_STATUS_CODE = NULL, OPEN_FLAG = 'Y' , FLOW
WHERE LINE_ID = L_LINE_ID;
-- COMMIT;

UPDATE OE_PRICE_ADJUSTMENTS
SET INVOICED_FLAG='N'
WHERE LINE_ID = L_LINE_ID

Page 72
Scripts
AND INVOICED_FLAG='Y';

/*
DELETE FROM RA_INTERFACE_LINES_ALL
WHERE INTERFACE_LINE_ATTRIBUTE1= ( select to_char(order_number) from oe_order_headers_all where header_id
*/

DELETE FROM RA_INTERFACE_LINES_ALL


WHERE INTERFACE_LINE_ATTRIBUTE6 = to_char(L_LINE_ID)
and INTERFACE_LINE_CONTEXT = 'ORDER ENTRY'
and sales_order_line IS NOT NULL ;

DELETE FROM RA_INTERFACE_SALESCREDITS_ALL


WHERE INTERFACE_LINE_ATTRIBUTE6=to_char(L_LINE_ID);

OE_INVOICE_PUB.INTERFACE_LINE(L_LINE_ID,'OEOL',L_RESULT_OUT, L_RETURN_STATUS);
OE_DEBUG_PUB.ADD('ramising:- after calling interface_line() L_RESULT_OUT: '||L_RESULT_OUT||' L_R

UPDATE OE_ORDER_LINES_ALL
SET FLOW_STATUS_CODE = 'CLOSED',OPEN_FLAG='N'
WHERE LINE_ID = L_LINE_ID;
OE_DEBUG_PUB.ADD(' ramising: updated oe_order_lines_all table .... ');

SELECT NVL(COUNT(*),0) INTO L_COUNT FROM RA_INTERFACE_LINES_ALL


WHERE INTERFACE_LINE_ATTRIBUTE6 = L_LINE_ID
and INTERFACE_LINE_CONTEXT = 'ORDER ENTRY'
and sales_order_line IS NOT NULL ;
OE_DEBUG_PUB.ADD('ramising: count() from ra_i/face table ... ' || L_COUNT);

IF L_COUNT > 0 THEN


-- DBMS_OUTPUT.PUT_LINE(' Pls perform COMMIT.... ');
-- DBMS_OUTPUT.PUT_LINE(' Pls run the Auto Invoice Concurrent Program.... ');
OE_DEBUG_PUB.ADD('ramising:- Line Successfully sent to AR interface tables.');
ELSE
-- DBMS_OUTPUT.PUT_LINE(' Pls perform ROLLBACK .... ');
-- DBMS_OUTPUT.PUT_LINE('.');
x_msg_count := OE_MSG_PUB.Count_Msg;
dbms_output.put_line(' no. of OE messages logged are :'|| x_msg_count);
oe_debug_pub.add(' ramising: no. of OE messages logged are :'||x_msg_count);
if x_msg_count > 0 then
for k in 1 .. x_msg_count loop
x_msg_data := oe_msg_pub.get( p_msg_index => k, p_encoded => 'F');
oe_debug_pub.add(substr(x_msg_data,1,255));
oe_debug_pub.add(substr(x_msg_data,255,510));
oe_debug_pub.add(substr(x_msg_data,510,length(x_msg_data)));
dbms_output.put_line(' Error msg from OE Stack: ' ||substr(x_msg_data,1,200));
end loop;
end if;

Page 73
Scripts
-- rollback;
-- DBMS_OUTPUT.PUT_LINE('.');
-- DBMS_OUTPUT.PUT_LINE(' Pls check the debug file for this line_id ( '|| L_LINE_ID ||' ) ... ');
OE_DEBUG_PUB.ADD('ramising:- Pls check the debug file for this line_id ( '|| L_LINE_ID ||' ) ... ');

END IF;
-- DBMS_OUTPUT.PUT_LINE('.');
ELSE
dbms_o
END IF;

END LOOP;

CLOSE cur_rec;

EXCEPTION
WHEN OTHERS THEN
oe_debug_pub.add(' ramising: in exception block.... ');
x_msg_count := OE_MSG_PUB.Count_Msg;
-- dbms_output.put_line(' no. of OE messages logged are :'|| x_msg_count);
oe_debug_pub.add(' ramising: no. of OE messages logged are :'||x_msg_count);
if x_msg_count > 0 then
for k in 1 .. x_msg_count loop
x_msg_data := oe_msg_pub.get( p_msg_index => k, p_encoded => 'F');
oe_debug_pub.add(substr(x_msg_data,1,255));
oe_debug_pub.add(substr(x_msg_data,255,510));
oe_debug_pub.add(substr(x_msg_data,510,length(x_msg_data)));
-- dbms_output.put_line(' Getting Error msg Stack: ' ||substr(x_msg_data,1,200));
end loop;
end if;

ERR_MSG := SQLERRM;
-- DBMS_OUTPUT.PUT_LINE('.');
OE_DEBUG_PUB.ADD('ERROR: Pls Rollback As Following Error Ocurred:- ');
-- DBMS_OUTPUT.PUT_LINE('. ');
DBMS_OUTPUT.PUT_LINE('. '||SQLERRM);
-- DBMS_OUTPUT.PUT_LINE('. ');
OE_DEBUG_PUB.ADD(ERR_MSG);
end;
/
SET SERVEROUTPUT OFF;
PROMPT =============================================================
PROMPT Do COMMIT; if no error reported else do ROLLBACK;
PROMPT =============================================================

Page 74
Scripts

ning on TEST instance.

.G_DIR||'/'||OE_DEBUG_PUB.G_FILE);

Page 75
Scripts

OE_ORDER_LINES_ALL L WHERE L.LINE_ID = L_LINE_ID;

rg_context().... '|| SQLERRM );


et_org_context().... '|| SQLERRM );

context().... ');

_policy_context().... '|| SQLERRM );


t_policy_context().... '|| SQLERRM );

E = NULL, OPEN_FLAG = 'Y' , FLOW_STATUS_CODE = NULL, LAST_UPDATE_DATE = SYSDATE

Page 76
Scripts

_order_headers_all where header_id = L_HEADER_ID );

UT, L_RETURN_STATUS);
T_OUT: '||L_RESULT_OUT||' L_RETURN_STATUS: '|| L_RETURN_STATUS);

data,1,200));

Page 77
Scripts

'|| L_LINE_ID ||' ) ... ');


( '|| L_LINE_ID ||' ) ... ');

Page 78
IB SC
Instance # of an Order
select * from csi_item_instances
where last_oe_order_line_id in (
select line_id
from oe_order_lines_all ool,oe_order_headers_all ooh
where ooh.order_number='71038447'
and ooh.header_id=ool.header_id)

select * from oks_k_order_details where ORDER_LINE_ID1 = 1195914

select * from okc_k_headers_b where id = '294500' -- enter csr_id

Page 79
FAQ's
FAQ: Entering Purchase Orders Doc ID: 216824.1

FAQ: PO Control Actions Doc ID: 225217.1

What Are The Basic Steps Of The Purchasing Receipt Accrual Period-End Process? Doc ID

FAQ: Enter Receipts and Receiving Transactions Doc ID: 209995.1

What Are the Receiving Defaulting Rules and Where Are they Set? Doc ID: 567980.1

FAQ - Receiving Doc ID: 135385.1

Purchase Order Matching Frequently Asked Questions (FAQ's) Doc ID: 213480.1

TCA Parties FAQ Doc ID: 220383.1 Type: FAQ

Customer FAQ 11i Doc ID: 219938.1

How To Match An Invoice To A Receipt Doc ID: 204312.1

Page 80
FAQ's

Process? Doc ID: 467584.1

Page 81
PO API
Note: 215276.1 - What API will Cancel an Existing Standard Purchase Order

How to use the PO Cancel API - PO_Document_Control_PUB [ID 833925.1]

Page 82
fndload
http://oracle.anilpassi.com/oracle-fndload-script-examples.html

Page 83
Conversions
http://erpschools.com/Apps/oracle-applications/articles/General/Interfaces-and-Conversions-in-Oracle-Applications/index.aspx

Page 84
Conversions
ions-in-Oracle-Applications/index.aspx

Page 85

Você também pode gostar