Friday, January 5, 2018

P2P Cycle - Base Table



















 YouTube Videos

https://www.youtube.com/channel/UCWFJCCCLUY0sgLrBsJQtjiw?view_as=subscriber



1. CREATE ITEM AND TYPE IS FINISHED GOODS
=========================================

select * from  MTL_SYSTEM_ITEMS_B where  SEGMENT1='CDM1'
--INVENTORY_ITEM_ID=238205


2. Interface ITEM for requisition,
===================================
   Submit the concurrent program "Min-max planning report" and data is populate the interface table.
  
select * from  po_requisitions_interface_all   where  ITEM_ID=238205

select * from  hr_operating_units where  name='Vision Operations'


3. Submit "Requisition Import" to import requisition and delete the records from interface table.
================================================================================

select * from  po_requisition_headers_all where  REQUISITION_HEADER_ID=537803

select * from  po_requisition_lines_all where  request_id=7477416 and org_id=204 and ITEM_ID=238205

select * from  po_req_distributions_all where  REQUISITION_LINE_ID=587239

select * from  gl_code_combinations_kfv where  code_combination_id=13401
-- charge account -- 01-000-1410-0000-000


4. Purchasing department received the Requistion from Inventory peoples
   Purchasing department prepare RFQ to send the supplier quote
   ============================================================
  
   select * from  PO_HEADERS_ALL where  SEGMENT1='308' AND ORG_ID=204 AND TYPE_LOOKUP_CODE='RFQ'
  
   select * from  PO_LINES_ALL where  PO_HEADER_ID=299875
  
   select * from  PO_LINE_LOCATIONS_ALL where  PO_LINE_ID=371230
  
   select * from  ORG_ORGANIZATION_DEFINITIONS where  ORGANIZATION_ID=207
  
   --- Going to request the Quoate from the suppliers
  
   select * from  po_rfq_vendors where  PO_HEADER_ID=299875
  
5. Print the RFQ and sent to suppliers
   Submit "Printed RFQ Report (XML)"
   =================================
  
   supplier sent the Quote and enter into the system  
 
   select * from  PO_HEADERS_ALL where  SEGMENT1='503' AND ORG_ID=204 AND TYPE_LOOKUP_CODE='QUOTATION'
  
   select * from  PO_LINES_ALL where  PO_HEADER_ID=299876
  
   select * from  PO_LINE_LOCATIONS_ALL where  PO_LINE_ID=371231 --9.7
  
   ---
  
   select * from  PO_HEADERS_ALL where  SEGMENT1='504' AND ORG_ID=204 AND TYPE_LOOKUP_CODE='QUOTATION'
  
   select * from  PO_LINES_ALL where  PO_HEADER_ID=299877
  
   select * from  PO_LINE_LOCATIONS_ALL where  PO_LINE_ID=371232 --9.6
  

6. CREATE PO AMONG SELECTED SUPPLIERS
======================================

  
   select * from  PO_HEADERS_ALL where  SEGMENT1='6576' AND ORG_ID=204 AND TYPE_LOOKUP_CODE='STANDARD'
  
   select * from  PO_LINES_ALL where  PO_HEADER_ID=299878
  
   select * from  PO_LINE_LOCATIONS_ALL where  PO_LINE_ID=371233
  

7. CREATE RECEIPTS IN INVENTORY TEAM, NO AMOUNT DETAILS PRESENT
================================================================


RECEIPT# 23698

select * from  RCV_SHIPMENT_HEADERS where  RECEIPT_NUM='23698'

select * from  RCV_SHIPMENT_LINES where  SHIPMENT_HEADER_ID=7714324

select * from  RCV_TRANSACTIONS  where  SHIPMENT_HEADER_ID=7714324

select * from  MTL_MATERIAL_TRANSACTIONS where INVENTORY_ITEM_ID=238205

select * from  MTL_MATERIAL_TRANSACTIONS where  RCV_TRANSACTION_ID IN (7712354,
7712355
)

INCREASED ONHAND QUANTITIES
===========================

select * from  MTL_ONHAND_QUANTITIES_DETAIL where INVENTORY_ITEM_ID=238205

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

8. CREATE AP INVOICES
====================


select * from  AP_INVOICES_ALL where  INVOICE_NUM='6576-INV'

select * from  AP_INVOICE_LINES_ALL where  INVOICE_ID=566060

select ACCOUNTING_EVENT_ID from  AP_INVOICE_DISTRIBUTIONS_ALL where  INVOICE_ID=566060

select * from  AP_PAYMENT_SCHEDULES_ALL where  INVOICE_ID=566060 --AMOUNT_REMAINING  PAYMENT_STATUS_FLAG

SLA
===

select * from  XLA_EVENTS where  EVENT_ID=6197566

select * from  XLA_AE_HEADERS where  EVENT_ID=6197566

select * from  XLA_AE_LINES where  AE_HEADER_ID=8109566

select * from  GL_INTERFACE

select * from  XLA.XLA_TRANSACTION_ENTITIES where  SOURCE_ID_INT_1=566060

select * from  GL_IMPORT_REFERENCES where  (gl_sl_link_table,gl_sl_link_id) IN (select gl_sl_link_table,gl_sl_link_id from  XLA_AE_LINES where  AE_HEADER_ID=8109566)

select * from  GL_JE_BATCHES where  JE_BATCH_ID=5350730

select * from  GL_JE_HEADERS where  JE_BATCH_ID=5350730

select * from  GL_JE_LINES where  JE_HEADER_ID=7104873



PAYMENTS IS DONE
================

select * from  AP_INVOICES_ALL where  INVOICE_NUM='6576-INV'  -- AMOUNT PAID

select * from  AP_PAYMENT_SCHEDULES_ALL where  INVOICE_ID=566060 --AMOUNT_REMAINING  PAYMENT_STATUS_FLAG

select * from  AP_INVOICE_PAYMENTS_ALL where  INVOICE_ID=566060
--ACCOUNTING-EVENT_ID=6197567

select * from  AP_CHECKS_ALL where  CHECK_ID=161702 AND CHECK_NUMBER='95004' -- -PAYMENT_ID

select * from  IBY_PAYMENTS_ALL where  PAYMENT_PROCESS_REQUEST_NAME='Quick Payment: ID=161702' -- PAYMENT AND SUPPLIER INFORMATIONS
-- PAYMENT_INSTRUCTION_ID
-- PAYMENT_SERVICE_REQUEST_ID

select * from  IBY_DOCS_PAYABLE_ALL where  PAYMENT_SERVICE_REQUEST_ID=31444 -- INVOICE INFORMATIONS
--- CALLING_APP_DOC_UNIQUE_REF2 INVOICE ID

select * from  IBY_PAY_INSTRUCTIONS_ALL where  PAYMENT_INSTRUCTION_ID=70474

select * from  AP_PAYMENT_HISTORY_ALL  where  CHECK_ID=161702
--ACCOUNTING_EVENT_ID

SLA
===

select * from  XLA_EVENTS where  EVENT_ID=6197567

select * from  XLA_AE_HEADERS where  EVENT_ID=6197567

select * from  XLA_AE_LINES where  AE_HEADER_ID=8109567

select * from  GL_INTERFACE

select * from  XLA.XLA_TRANSACTION_ENTITIES where ENTITY_ID=6126421-- SOURCE_ID_INT_1=104837
--TRANSACTION_NUMBER IS CHECKNUMBER

select * from  GL_IMPORT_REFERENCES where  (gl_sl_link_table,gl_sl_link_id) IN (select gl_sl_link_table,gl_sl_link_id from  XLA_AE_LINES where  AE_HEADER_ID=8109567)

select * from  GL_JE_BATCHES where  JE_BATCH_ID=5350732

select * from  GL_JE_HEADERS where  JE_BATCH_ID=5350730

select * from  GL_JE_LINES where  JE_HEADER_ID=7104873


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





Thursday, January 4, 2018

SQL Query to find Status of GL ,PO, INV Accounting Periods

The following SQL may be used to check for valid periods applicable to GL and PO:

SELECT sob.name "Set of Books",
       fnd.product_code "Porduct Code",
       ps.PERIOD_NAME "Period Name",
       ps.START_DATE "Period Start Date",
       ps.END_DATE "Period End Date",
       decode(ps.closing_status,
              'O',
              'O - Open',
              'N',
              'N - Never Opened',
              'F',
              'F - Future Enterable',
              'C',
              'C - Closed',
              'Unknown') "Period Status"
  FROM gl_period_statuses ps, GL_SETS_OF_BOOKS sob, FND_APPLICATION_VL fnd
 WHERE ps.application_id in (101, 201) -- GL & PO
   and sob.SET_OF_BOOKS_ID = ps.SET_OF_BOOKS_ID
   and fnd.application_id = ps.application_id
   AND ps.adjustment_period_flag = 'N'
   AND (trunc(sysdate) -- Comment line if a a date other than SYSDATE is being tested.
       --AND ('01-APR-2011' -- Uncomment line if a date other than SYSDATE is being tested.
       BETWEEN trunc(ps.start_date) AND trunc(ps.end_date))
order by ps.SET_OF_BOOKS_ID,fnd.product_code, ps.start_date;


The following SQL may be used to check for valid periods applicable to INV:

SELECT mp.organization_id "Organization ID",
       mp.ORGANIZATION_CODE "Organization Code",
       ood.ORGANIZATION_NAME "Organization Name",
       oap.period_name "Period Name",
       oap.period_start_date "Start Date",
       oap.PERIOD_CLOSE_DATE "Closed Date",
       oap.schedule_close_date "Scheduled Close",
       decode(oap.open_flag,
              'P',
              'P - Period Close is processing',
              'N',
              'N - Period Close process is completed',
              'Y',
              'Y - Period is open if Closed Date is NULL',
              'Unknown') "Period Status"
  FROM org_acct_periods             oap,
       org_organization_definitions ood,
       mtl_parameters               mp
 WHERE oap.organization_id = mp.organization_id
   AND mp.organization_id = ood.organization_id(+)
   AND (trunc(sysdate) -- Comment line if a a date other than SYSDATE is being tested.
       --AND ('01-APR-2011' -- Uncomment line if a date other than SYSDATE is being tested.
       BETWEEN trunc(oap.period_start_date) AND
       trunc(oap.schedule_close_date))
 ORDER BY mp.organization_id, oap.period_start_date;

-- If Period Status is 'Y' and Closed Date is not NULL then the closing of the INV period failed.


Source: Metalink Doc ID 1317136.1

Monday, December 25, 2017

WebADI Integrator Content Interface Details

SELECT biv.application_id
       ,biv.integrator_code
       ,biv.user_name
       ,bib.interface_code,lo.LAYOUT_CODE,
       (select user_name from BNE_LAYOUTS_TL where LAYOUT_CODE=lo.LAYOUT_CODE) layoutname,
       (select user_name from BNE_CONTENTS_TL where content_code=cont.content_code) contentname,
       cont.content_code,
       cont.param_list_code,
       cont.content_class,(SELECT QUERY FROM BNE_STORED_SQL WHERE CONTENT_CODE=CONT.CONTENT_CODE)QUERY
   FROM bne_integrators_vl biv
       ,bne_interfaces_b   bib,
       BNE_LAYOUTS_B lo,
       BNE_CONTENTS_b cont
  WHERE 1=1-- upper(user_name) like '%CHP_TEST_FAB%'
    AND bib.integrator_code = biv.integrator_code
    and lo.integrator_code = biv.integrator_code
    and cont.integrator_code = biv.integrator_code   
    and cont.integrator_code ='DPP_OUTBOUND_INTG'

Table Lock - Query in Oracle APPS

 SELECT client_identifier,        module,        action,        s.*   FROM v$session s  WHERE sid IN (SELECT session_id                  FRO...