This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Distribution and Manufacturing Commonly used tables
Anil Kumar R V04/08/2023Interfaces
Inv Po OmItems Po Ordersmtl_system_items_b po_headers_all oe_order_headers_allmtl_item_revisions po_lines_all oe_transaction_types_allItem Categories po_line_locations_all OE_ORDER_LINES_HISTORY
mtl_categories_b PO_HEADERS_ARCHIVE and PO_LINES_ARCHIVE (PO revisions)mtl_category_sets_b po_distributions_all oe_order_lines_allmtl_item_categories Buyers AgreementsItem Costs po_agents oe_agreements_bcst_item_costs Document and Line Types Order Sourcescst_cost_types po_document_types_all_b oe_order_sourcesOrganization po_line_types_b Transaction typeshr_all_organization_units Releases oe_transaction_types_all / tlorg_organization_definitions po_releases_all Pricinghr_locations_all Requisitions qp_list_headers_bmtl_parameters po_requisition_headers_all qp_list_linesTransactions po_requisition_lines_all qp_pricing_attributes , oe_price_adjustmentsmtl_material_transactions po_req_distributions_all Shippingmtl_transaction_types Vendors wsh_new_deliveriesSubinventories po_vendors wsh_delivery_detailsmtl_secondary_inventories po_vendor_sites_all wsh_delivery_assignmentsLot and Serial Numbers po_vendor_contacts WSH_PACKED_CONTAINERSmtl_serial_numbers Receiving wsh_picking_batchesmtl_lot_numbers rcv_transactions WSH_SERIAL_NUMBERS ( shipped sl no's)Location and On Hand Qty rcv_shipment_headersmtl_item_locations rcv_shipment_lines ( expected receipts)mtl_onhand_quantities
Requisitions Interface Order Importpo_requisitions_interface_all oe_headers_iface_all
AR AR_VAT_TAX_ALL_BAR_CASH_RECEIPTS_ALLAR_CASH_RECEIPT_HISTORY_ALLAR_AGING_BUCKETSAR_AGING_BUCKET_LINES_BAR_MISC_CASH_DISTRIBUTIONS_ALLAR_RECEIVABLES_TRX_ALL
GLGL_DAILY_RATES_INTERFACEGL_INTERCOMPANY_ACCTS_VGL_INTERFACE_CONTROLGL_INTERFACE_GROUPS_VGL_INTERFACE_HISTORYGL_INTERFACE_SOURCES_VGL_INTERFACEJE_SOURCE_NAME.STATUSSET_OF_BOOKS_IDUSER_JE_SOURCE_NAMEUSER_JE_CATEGORY_NAMEACCOUNTING_DATECURRENCY_CODEDo Not Enter any valueTRANSACTION_DATEJE_BATCH_IDJE_HEADER_IDJE_LINE_NUMCHART_OF_ACCOUNTS_IDValidations• Set of books• Period name• Source name• Journal entry name• Currency code• Category name• Actual flag
Distribution and Manufacturing Commonly used tables
Anil Kumar R V04/08/2023Interfaces
• Encumbrance type ID• User conversion type• Accounting date• Budget version ID• Reversal period GL_BUDGET_INTERFACEGL_BUDGET_INTERIM
FND SRWINIT sets your profile option values and allows OracleApplication Object Library user exits to detect that they have beencalled by an Oracle Reports program. FND SRWINIT also allows yourreport to use the correct organization automatically. FND SRWEXITensures that all the memory allocated for Oracle Application ObjectLibrary 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 ReportsCancelled Orders ReportReturns by Reason ReportCancelled Orders Reasons Detail ReportOrders by Item ReportUnbooked Orders Report
FND FLEXIDVAL are used to display flex field information like prompt, value etc with dynamic query
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_EVENT_ID = 77429
Approval Groups : po_control_groups , po_control_rules
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_date, end_date, action_argument "Forwarded To" from wf_routing_rules where SYSDATE between BEGIN_DATE-1 and NVL(END_DATE,sysdate+1) order by rule_id;
/ 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
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_type_code sub_type, 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_statusfrom wf_item_activity_statuses a, po_requisition_headers_all b,fnd_user c,po_requisition_lines_all
d,mtl_system_items_b ewhere a.item_type='NUAMEREQ'and Activity_status in ( 'WAITING','ERROR','NOTIFIED','DEFERRED','ACTIVE')and b.created_by=c.user_idand b.REQUISITION_HEADER_ID=d.requisition_header_id--and b.segment1='21166'and d.DESTINATION_ORGANIZATION_ID=e.organization_idand e.inventory_item_id=d.item_idand (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_statusfrom wf_item_activity_statuses a, po_requisition_headers_all b,fnd_user c,po_requisition_lines_all
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_idORDER BY 1,2
select * from AME_TRANS_APPROVAL_HISTORY where transaction_id = '125864' order by row_timestamp
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 dateVersion - V1.0Date - 06-April-2009Created By - Apps Associates
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 >= SYSDATEunion 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,
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
INTERNAL REQUISITIONS THAT DO NOT HAVE AN ASSOCIATED INTERNAL SALES ORDERSELECT,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_FLAGFROM,PO_REQUISITION_LINES_ALL RQL
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 rWHEREp.po_header_id = d.po_header_id andd.req_distribution_id = rd.distribution_id andrd.requisition_line_id = rl.requisition_line_id andrl.requisition_header_id = r.requisition_header_id
,PO_REQUISITION_HEADERS_ALL RQHWHERERQL.REQUISITION_HEADER_ID = RQH.REQUISITION_HEADER_ID andRQL.SOURCE_TYPE_CODE = 'INVENTORY' andRQL.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_LINE_ID and LIN.SOURCE_DOCUMENT_TYPE_ID = 10)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 rWHEREp.po_header_id = d.po_header_id andd.req_distribution_id = rd.distribution_id andrd.requisition_line_id = rl.requisition_line_id andrl.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 phWHEREprh.requisition_header_id = prl.requisition_header_id and
prl.requisition_line_id = prd.requisition_line_id andppf1.person_id = prh.preparer_id andprh.creation_date between ppf1.effective_start_date and ppf1.effective_end_date andppf2.agent_id(+) = msi.buyer_id andmsi.inventory_item_id = prl.item_id andmsi.organization_id = prl.destination_organization_id andpll.line_location_id(+) = prl.line_location_id andpll.po_header_id = ph.po_header_id(+) andpll.pl_line_id = pl.po_line_id(+) andprh.authorization_status = 'APPROVED' andpll.line_location_id is NULL andprl.closed_code is NULL andnvl(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 uWHEREporh.requisition_header_id = porl.requisition_header_id and porl.requisition_line_id = pord.requisition_line_id andpord.distribution_id = pod.req_distribution_id(+) andpod.po_header_id = poh.po_header_id(+) andporh.created_by = u.user_idorder by 2------------------------------------------------------------------------------------------------------------PO’s WHICH DOES NOT HAVE ANY PR’sSELECT,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 phWHEREprh.requisition_header_id = prl.requisition_header_id andprl.requisition_line_id = prd.requisition_line_id andppf1.person_id = prh.preparer_id andprh.creation_date between ppf1.effective_start_date and ppf1.effective_end_date andppf2.agent_id(+) = msi.buyer_id andmsi.inventory_item_id = prl.item_id andmsi.organization_id = prl.destination_organization_id andpll.line_location_id(+) = prl.line_location_id andpll.po_header_id = ph.po_header_id(+) andpll.po_line_id = pl.po_line_id(+) andprh.authorization_status = 'APPROVED' andpll.line_location_id is NULL andprl.closed_code is NULL andnvl(prl.cancel_flag,'N') <> 'Y'ORDER BY 1,2------------------------------------------------------------------------------------------------------------ALL PO’s WITH APPROVAL, INVOICE, & PAYMENT DETAILSSELECT,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"
,po.po_distributions_all dWHEREh.po_header_id = l.po_header_id andll.po_line_id = l.po_Line_id andll.line_location_id = d.line_location_id andh.closed_date is NULL andh.type_lookup_code not in ('QUOTATION')------------------------------------------------------------------------------------------------------------ STEPS TO DEBUG A PURCHASE ORDERGet 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 CreationPO_HEADERS_ALLselect po_header_id from po_headers_all where segment1 =;select * from po_headers_all where po_header_id =;PO_LINES_ALLselect * from po_lines_all where po_header_id =;PO_LINE_LOCATIONS_ALLselect * from po_line_locations_all where po_header_id =;PO_DISTRIBUTIONS_ALL select * from po_distributions_all where po_header_id =;PO_RELEASES_ALLSELECT * FROM po_releases_all WHERE po_header_id =;
Stage 2: Once PO is received, data is moved to respective receving tables and inventory tablesRCV_SHIPMENT_HEADERSselect * from rcv_shipment_headers where shipment_header_id in(select shipment_header_id from rcv_shipment_lineswhere po_header_id =);RCV_SHIPMENT_LINESselect * from rcv_shipment_lines where po_header_id =;RCV_TRANSACTIONSselect * from rcv_transactions where po_header_id =;RCV_ACCOUNTING_EVENTSSELECT * FROM rcv_Accounting_Events WHERE rcv_transaction_id IN(select transaction_id from rcv_transactionswhere po_header_id =);RCV_RECEIVING_SUB_LEDGERselect * from rcv_receiving_sub_ledger where rcv_transaction_id IN(select transaction_id from rcv_transactions where po_header_id =);RCV_SUB_LEDGER_DETAILSselect * from rcv_sub_ledger_detailswhere rcv_transaction_id IN(select transaction_id from rcv_transactions where po_header_id =);MTL_MATERIAL_TRANSACTIONSselect * 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 detailsAP_INVOICE_DISTRIBUTIONS_ALLselect * from ap_invoice_distributions_all where po_distribution_id in
( select po_distribution_id from po_distributions_all where po_header_id =);AP_INVOICES_ALLselect * 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 =));
Stage 4 : Mostly there is tie up with Project related POPA_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 LedgerPrompt 17. GL_BC_PACKETS ..This is for encumbrancesSELECT * 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.reference3AND GLI.reference24 =RRSL.reference4AND RRSL.rcv_transaction_id in(select transaction_id from rcv_transactionswhere po_header_id ));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.reference3 AND GLIR.reference_4 =RRSL.reference4AND RRSL.rcv_transaction_id in(select transaction_id from rcv_transactions where po_header_id =))
SELECTA.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",(SELECTDECODE(PH.APPROVED_FLAG, 'Y', 'Approved')FROM PO.PO_HEADERS_ALL PHWHERE 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 * 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 RCV_SHIPMENT_HEADERS WHERE RECEIPT_NUM = '9616' AND SHIP_TO_ORG_ID = 207
select * from AP_ACCOUNTING_EVENTS_ALL WHERE source_id = 63253 and source_table = 'AP_INVOICES'
select * from AP_ACCOUNTING_EVENTS_ALL WHERE source_id = 28599 and source_table = 'AP_CHECKS' --ACCOUNTING_EVENT_ID = 77429
select * from po_position_controls_all where job_id = 18069
select * from po_control_groups_all
select * from po_control_functions
The following query can be used to determine which Routing Rules are active: select rule_id, role "Forwarded From", begin_date, end_date, action_argument "Forwarded To" from wf_routing_rules where SYSDATE between BEGIN_DATE-1 and NVL(END_DATE,sysdate+1) order by rule_id;
from wf_item_activity_statuses a, po_requisition_headers_all b,fnd_user c,po_requisition_lines_all
from wf_item_activity_statuses a, po_requisition_headers_all b,fnd_user c,po_requisition_lines_all
select * from AME_TRANS_APPROVAL_HISTORY where transaction_id = '125864' order by row_timestamp
- Query to compare the errored PO creation date
- Query to compare the errored requisition errored date
(select 'existing internal order'from OE_ORDER_LINES_ALL LIN where LIN.SOURCE_DOCUMENT_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 invoicing data only if the issue is related to the calculation of
porh.requisition_header_id = porl.requisition_header_id and porl.requisition_line_id = pord.requisition_line_id and Accrual amount or issue with the data in POXXRVDR,POXPORRA (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_transactions 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 Encumbrance 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
,(select decode(ph.approved_FLAG, 'Y', 'Approved') from po.po_headers_all ph where,ph.po_header_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
,(select decode(x.MATCH_STATUS_FLAG, 'A', 'Approved') from ap.ap_invoice_distributions_all x where 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));
(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 =));
(select to_char(transaction_id) from mtl_material_transactions where transaction_source_id = );
(select 1 from rcv_receiving_sub_ledger rrsl where gli.reference22 =RRSL.reference2 and GLI.reference23 =RRSL.reference3AND GLI.reference24 =RRSL.reference4AND RRSL.rcv_transaction_id in(select transaction_id from rcv_transactionswhere po_header_id ));
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.reference3 AND GLIR.reference_4 =RRSL.reference4AND RRSL.rcv_transaction_id in
(NVL(C.QUANTITY_ORDERED,0)-NVL(C.QUANTITY_CANCELLED,0))*NVL(G.UNIT_PRICE,0) "PO Line Amount",
The following query can be used to determine which Routing Rules are active: select rule_id, role "Forwarded From", begin_date, end_date, action_argument "Forwarded To" from wf_routing_rules where SYSDATE between BEGIN_DATE-1 and NVL(END_DATE,sysdate+1) order by rule_id;
where po_header_id =&&po_header_id;
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;
SELECT * FROM po_releases_all WHERE po_header_id =&&po_header_id;
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;
select * from rcv_transactions where po_header_id =&&po_header_id;
Prompt 9. rcv_Accounting_Events from 11i10 Onwards SELECT * FROM rcv_Accounting_Events
(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
(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
(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
( select transaction_id from mtl_material_transactions where transaction_source_id = &&po_header_id );
Note : Pls provide the details of following queries if invoicing data only if the issue is related to the calculation of Accrual amount or issue with the data in POXXRVDR,POXPORRA
Note : Pls provide details if issue is related to the cost transferred to projects for Inventory and receiving. -------------------------------------------------------------------*/ Prompt 16. pa_expenditure_items_all
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 = &&po_header_id );
Note : Pls provide details if issue is related to the Encumbrance Amount mismatch for the PO. -------------------------------------------------------------------*/
Note : Pls furnish following details only if issue is related to the GL Transfer of receiving transactions. -----------------------------------------------------------------*/
WHERE user_je_source_name ='Purchasing'
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
where po_header_id =&&po_header_id));
Prompt 19. gl_import_references
FROM gl_import_references GLIR
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));
(select 1 from rcv_receiving_sub_ledger rrsl where gli.reference22 =RRSL.reference2 and GLI.reference23 =RRSL.reference3AND GLI.reference24 =RRSL.reference4AND RRSL.rcv_transaction_id in(select transaction_id from rcv_transactionswhere po_header_id ));
( SELECT 1 FROM rcv_receiving_sub_ledger RRSLWHERE GLIR.reference_2 =RRSL.reference2AND GLIR.reference_3 =RRSL.reference3 AND GLIR.reference_4 =RRSL.reference4AND RRSL.rcv_transaction_id in
The following query can be used to determine which Routing Rules are active: select rule_id, role "Forwarded From", begin_date, end_date, action_argument "Forwarded To" from wf_routing_rules where SYSDATE between BEGIN_DATE-1 and NVL(END_DATE,sysdate+1) order by rule_id;
select * from oe_order_holds_all where header_id = 755934
Finding the Order line release status
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
SELECT DECODE(RELEASED_STATUS,'Y','PICKED','S','PICKED'WHERE SOURCE_CODE = 'OE' AND SOURCE_LINE_ID = &line_id
Description/transactions Others
1 record created in header table
Lines for particular records
When discount gets appliedIf line has price attributes then populatedIf any hold applied for order like credit check etc.
Order booked.Ready to release Pick Release API / Pick Confirm APINo records in wsh_delivery_assignments andwsh_new_deliveries
Move Order (Creation - Transaction)After batch is created for pick release.
No records in mtl_material_transactions
Released to warehouse.Backordered Line failed to be allocated in Inventoryif Auto-Create is Yes then data populated.deliveries get assigned
Line has been picked and staged by InventorySubinventory to staging area. Packing slip.
On the ship confirm form, check Ship all boxIf Defer Interface is checked I.e its deferred thenOM & inventory not updated.If Defer Interface is not checked.: Shippedget populated.
Ship to / Bill to (Order Type) / Price List / Item(Line Type)After Entering / booking -- Proces Order API will be called - This will take care of holds etcAfter Awaiting Shipping - Visible Demand Flag is set to Yes
Scheduling will happen -->.1 Soft Reservation 2. MTL Demand record will be inserted (This is input for Planning) -->3. Depending on the ATP rules it will give the Schedule Ship Date
Released to Warehouse (Line has been released to Inventory for processing)
This is only soft reservations. No physical movement of stock
Hard Reservations. Picked the stock. Physical movement of stock
Y To C:Shipped ;Delivery Note get printed Delivery assigned to trip stopquantity will be decreased from staged
Interface Trip Stop--Sales Order Issue Transaction in Material Transaction and reservation is releived
1 leg is called as 1 trip.1 Pickup & drop up stop for each trip.
147If 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 forspecific batch transaction tables get populated
Cancelled
"Created by CC Program"
"Created From"
"Orig Print Date"
'20001731' ( give order no) rcta.PROGRAM_ID = rcta.CREATED_FROM
CUST_TRX_TYPE_ID
header_id = 755934
where hold_source_id in ( 179401 , 179402 , 179403 )
hold_id in (1,1181,1201)
( 1163708 , 1162719)
'S','PICKED','B','PICKED','NOT PICKED') FROM WSH_DELIVERY_DETAILS SOURCE_LINE_ID = &line_id
Queryselect * from MTL_INTERCOMPANY_PARAMETERS_V where SHIP_ORGANIZATION_NAME like 'Austra%select * MTL_INTERCOMPANY_PARAMETERS_Vselect max(order_number) from oe_order_headers_all where org_id=912
select * from oe_order_headers_all where org_id=912select * from org_organization_definitions
Select * from dba_views where view_name like 'BCIWSH_FG_AVAIL_ONHANDS_V'
select * from oe_order_headers_all where order_number=75001141select * from oe_order_lines_all where header_id= 6354017 select * from wsh_delivery_details where source_header_id= 6354017select * from wsh_new_deliveries where delivery_id = 12041579
Select * from ra_rules --- for accounting rule and invoicing rule definitions
select * from v$database
select * from org_organization_definitions
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,
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 hrwhere gl.set_of_books_id=hr.set_of_books_idselect * from wsh_delivery_details where organization_id=4160 and serial_number is not nullselect * from mtl_system_items where inventory_item_id=198
select * from RA_CUSTOMER_TRX_LINES_ALL where CUSTOMER_TRX_ID = 968746
select * from ra_cust_trx_types_allselect * from ra_customer_trx_all where ct_reference = '186205'
Discounts : select * from oe_price_adjustments where header_id = '758957'
To see the Inventory accounting periods : select * from org_acct_periods
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
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
from wf_item_activity_statuses ias, wf_process_activities pa,
wf_items i
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, fif.application_table_name, fif.id_flex_code flex_code, fif.id_flex_name flex_name FROM fnd_id_flex_segments_vl fifsv, fnd_id_flexs fif WHERE fifsv.id_flex_code = fif.id_flex_code--------------------------------
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'
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
AND summary.acct_period_id = periods.acct_period_idAND periods.period_close_date IS NOT NULLAND summary.inventory_type = 1
DetailsIntercompany RelationsIntercompany RelationsLatest Order
All in One OuAll OU / INV Etc
ALL OU/LE/BG Etc
To find the SQl for the View
; select * from fnd_responsibility_vl , select * from apps.FND_USER_RESP_GROUPS
SELECT fifsv.segment_name, fifsv.segment_num, fifsv.application_column_name, fifsv.flex_value_set_id, fif.application_table_name, fif.id_flex_code flex_code, fif.id_flex_name flex_name FROM fnd_id_flex_segments_vl fifsv, fnd_id_flexs fif WHERE fifsv.id_flex_code = fif.id_flex_code
SELECT fifsv.segment_name, fifsv.segment_num, fifsv.application_column_name, fifsv.flex_value_set_id, fif.application_table_name, fif.id_flex_code flex_code, fif.id_flex_name flex_name FROM fnd_id_flex_segments_vl fifsv, fnd_id_flexs fif WHERE fifsv.id_flex_code = fif.id_flex_code
SELECT fifsv.segment_name, fifsv.segment_num, fifsv.application_column_name, fifsv.flex_value_set_id, fif.application_table_name, fif.id_flex_code flex_code, fif.id_flex_name flex_name FROM fnd_id_flex_segments_vl fifsv, fnd_id_flexs fif WHERE fifsv.id_flex_code = fif.id_flex_code
SYSADMIN & HRMS
Page 56
Query to find the responsibilities of a user
select RESPONSIBILITY_NAME from apps.fnd_user_resp_groups_direct ur,fnd_responsibility_vl rvwhere 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
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
Query to find when a user has logged in and logged out : select * from fnd_logins
SYSADMIN & HRMS
Page 57
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)
SYSADMIN & HRMS
Page 58
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 userSELECT 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_dateFROM 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 pbgWHERE 1=1and fa.application_id = frt.application_idAND 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_idAND NVL (furgd.end_date, SYSDATE + 1) > TRUNC (SYSDATE)AND furgd.user_id = fu.user_idAND NVL (fu.end_date, SYSDATE + 1) > TRUNC (SYSDATE)AND fu.user_name like '%ASHONTE_GABBART%'
SYSADMIN & HRMS
Page 59
AND fu.employee_id = papf.person_idAND TRUNC (SYSDATE) BETWEEN TRUNC (papf.effective_start_date)AND TRUNC (NVL (papf.effective_end_date, SYSDATE))AND papf.business_group_id = pbg.business_group_idand trunc(sysdate) between paaf.EFFECTIVE_START_DATE and paaf.EFFECTIVE_END_DATEand papf.PERSON_ID=paaf.PERSON_IDand trunc(sysdate) between papf.EFFECTIVE_START_DATE and papf.EFFECTIVE_END_DATEand 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
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_idGROUP BY fl.user_id, fu.user_name, fu.last_logon_date, frt.responsibility_nameORDER BY 5 DESC
Below is the query to get audit details like Unsuccessful Login Time for particular User in the Oracle Applications
Query2
select max(length(tax_code)) from oe_order_lines_all
SYSADMIN & HRMS
Page 60
SELECT fu.user_id, fu.user_name, fl.attempt_time FROM fnd_unsuccessful_logins fl, fnd_user fu WHERE fl.user_id = fu.user_idORDER BY fu.user_id DESC
SYSADMIN & HRMS
Page 61
SELECT * FROM PAY_COST_ALLOCATIONS_F WHERE assignment_id = 63801
2. SELECT * FROM PAY_COST_ALLOCATION_KEYFLEX WHERE COST_ALLOCATION_KEYFLEX_ID = 150
SYSADMIN & HRMS
Page 62
Below is the query to get audit details like Last Logon Time and Last Logout Time of Responsibilities for particular User.
Below is the query to get audit details like Unsuccessful Login Time for particular User in the Oracle Applications
OM Queries
Page 63
Query to find the Holds on an Order Header
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 user) .The query should list all the basic details and the reason for hold.
Fields:Order DateOrder NumberOrder Type (Name)Order ItemDate of HoldReason of HoldHold byDays of Hold
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_numberAND oh.sold_to_org_id=ca.cust_account_idAND party.party_id=ca.party_idAND oh.flow_status_code like 'ENTERED';
III. Business Purpose: List all the Orders which are Backordered
Fields:Order Number Customer NumberCustomer NameOrder Type (Name)StatusDate of OrderItem NumberDescription
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 NumberSales Order DateCustomer NamePick Slip NumberOrder StatusSub inventoryMove Order Number
ANSWER:
SELECT oh.header_id "Sales Order Number", oh.ordered_date, oh.sold_to_org_id,
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';
To restrict o/p to one org
HOLD Authorizations
Query to check error in child WFSELECT 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 * 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 apply and release holds
select * from oe_sets where header_id =
select b.responsibility_name , a.responsibility_id , a.START_DATE_ACTIVE ,c.hold_id , c.DESCRIPTIONfrom 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_idand b.responsibility_name like 'NUAN%US%MLB%Order%Manager'
WHERE OLS.LINE_ID = l.line_idAND OLS.SET_ID = OST.SET_ID
and l.header_id = 1005745order by ols.set_id, ols.line_id;
OM Queries
Page 68
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 user) .The query should list all the basic details and the reason for hold.
NAME hold_name,creation_date held_date,
oe_hold_definitions hd
--pass header_id
OM Queries
Page 69
179401 , 179402 , 179403 )
To check what responsibilites are authorized to apply and release holds
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
Also check if the user is setup for Category or Item-Source Realms. This restricts the items available for a user to find. For additional information see
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: 467584.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
Metalink Imp Doc ID's
Page 73
iProcurement Setup 11i: Oracle Internet Procurement Functional Setup [ID 134168.1]
Realms. This restricts the items available for a user to find. For additional information see Note 332414.1
Metalink Imp Doc ID's
Page 74
. This restricts the items available for a user to find. For additional information see Note 332414.1 about Realm useage, and Note 109497.1 for Item Frequently Asked Questions.
Metalink Imp Doc ID's
Page 75
for Item Frequently Asked Questions.
Scripts
Page 76
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 175SET 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;
Scripts
Page 77
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 L.LINE_ID = L_LINE_ID; --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_PRICE_ADJUSTMENTS SET INVOICED_FLAG='N' WHERE LINE_ID = L_LINE_ID
Scripts
Page 78
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 = L_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_RETURN_STATUS: '|| L_RETURN_STATUS); 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;
Scripts
Page 79
-- 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 =============================================================
Scripts
Page 80
* Oracle Corp is NOT responsible if directly run on PRODUCTION Instance without running on TEST instance.
DBMS_OUTPUT.PUT_LINE(' .... Log File Name and Location :- '||OE_DEBUG_PUB.G_DIR||'/'||OE_DEBUG_PUB.G_FILE);
Scripts
Page 81
SELECT L.ORG_ID, HEADER_ID INTO L_ORG, L_HEADER_ID FROM OE_ORDER_LINES_ALL L WHERE L.LINE_ID = L_LINE_ID;
-- 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 );
dbms_output.put_line(' Error msg from OE Stack: ' ||substr(x_msg_data,1,200));
Scripts
Page 83
-- 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 ||' ) ... ');
IB SC
Page 84
Instance # of an Orderselect * from csi_item_instanceswhere last_oe_order_line_id in (select line_id from oe_order_lines_all ool,oe_order_headers_all oohwhere 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
FAQ's
Page 85
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?
FAQ: Enter Receipts and Receiving Transactions Doc ID: 209995.1
What Are the Receiving Defaulting Rules and Where Are they Set?
FAQ - Receiving Doc ID: 135385.1
Purchase Order Matching Frequently Asked Questions (FAQ's) Doc ID
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
FAQ's
Page 86
What Are The Basic Steps Of The Purchasing Receipt Accrual Period-End Process? Doc ID: 467584.1
What Are the Receiving Defaulting Rules and Where Are they Set? Doc ID: 567980.1
Purchase Order Matching Frequently Asked Questions (FAQ's) Doc ID: 213480.1
PO API
Page 87
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]