Friday, 24 January 2014

PO TABLES and LINKS

SELECT * FROM PO_REQUISITION_HEADERS_ALL WHERE SEGMENT1='14822'

SELECT * FROM PO_REQUISITION_LINES_ALL WHERE REQUISITION_HEADER_ID=182129

SELECT * FROM PO_REQ_DISTRIBUTIONS_ALL WHERE REQUISITION_LINE_ID=209330

SELECT * FROM PO_HEADERS_ALL WHERE SEGMENT1='R12' AND TYPE_LOOKUP_CODE='RFQ'

SELECT * FROM PO_LINES_ALL WHERE PO_HEADER_ID=111628

SELECT * FROM PO_LINE_LOCATIONS_ALL WHERE PO_LINE_ID=174467

SELECT * FROM PO_HEADERS_ALL WHERE SEGMENT1='R12'------YPE_LOOKUP_CODE='QUATATIONS'

SELECT * FROM PO_LINES_ALL WHERE PO_HEADER_ID=111629

SELECT * FROM PO_LINE_LOCATIONS_ALL WHERE PO_LINE_ID=174468

SELECT * FROM PO_HEADERS_ALL WHERE SEGMENT1='6821'

SELECT * FROM PO_LINES_ALL WHERE PO_HEADER_ID=111630

SELECT * FROM PO_LINE_LOCATIONS_ALL WHERE PO_LINE_ID=174469

SELECT * FROM PO_DISTRIBUTIONS_ALL WHERE LINE_LOCATION_ID=265780

SELECT * FROM RCV_SHIPMENT_HEADERS WHERE RECEIPT_NUM='24121'

SELECT * FROM RCV_SHIPMENT_LINES WHERE SHIPMENT_HEADER_ID=4834293

SELECT * FROM RCV_TRANSACTIONS WHERE SHIPMENT_LINE_ID=4824861

---------------AUTO CREATE----------FUNCTION----------------------

SELECT * FROM PO_REQUISITION_HEADERS_ALL WHERE SEGMENT1='14823'

SELECT * FROM PO_REQUISITION_LINES_ALL WHERE REQUISITION_HEADER_ID=182130

SELECT * FROM PO_REQ_DISTRIBUTIONS_ALL WHERE REQUISITION_LINE_ID=209331


SELECT ASP.VENDOR_NAME
  FROM PO_HEADERS_aLL PHA,
       AP_SUPPLIERS ASP
 WHERE ASP.VENDOR_ID = PHA.VENDOR_ID
   AND PHA.SEGMENT1 = '6884'
  
  
================================


SELECT MSIB.SEGMENT1 ITEM
  FROM MTL_SYSTEM_ITEMS_B MSIB,
       PO_HEADERS_ALL PHA,
       PO_LINES_ALL PLA,
       PO_LINE_LOCATIONS_ALL PLLA
 WHERE MSIB.INVENTORY_ITEM_ID = PLA.ITEM_ID
   AND MSIB.ORGANIZATION_ID = PLLA.SHIP_TO_ORGANIZATION_ID
   AND PHA.PO_HEADER_ID = PLA.PO_HEADER_ID
   AND PLA.PO_LINE_ID = PLLA.PO_LINE_ID
   AND PHA.SEGMENT1 = '6884'
  
  
===========================================


SELECT PRHA.SEGMENT1 REQ_NUMBER
  FROM PO_REQUISITION_HEADERS_ALL PRHA,
       PO_REQUISITION_LINES_ALL PRLA,
       PO_REQ_DISTRIBUTIONS_ALL PRDA,
       PO_HEADERS_ALL PHA   ,
       PO_LINES_ALL PLA,
       PO_LINE_LOCATIONS_ALL PLLA,
       PO_DISTRIBUTIONS_ALL PDA
 WHERE PRHA.REQUISITION_HEADER_ID = PRLA.REQUISITION_HEADER_ID
   AND PRLA.REQUISITION_LINE_ID = PRDA.REQUISITION_LINE_ID
   AND PRDA.DISTRIBUTION_ID = PDA.REQ_DISTRIBUTION_ID
   AND PHA.PO_HEADER_ID = PLA.PO_HEADER_ID
   AND PLA.PO_LINE_ID = PLLA.PO_LINE_ID
   AND PLLA.LINE_LOCATION_ID = PDA.LINE_LOCATION_ID
   AND PHA.SEGMENT1 = '6884'

=====================================

SELECT RSH.RECEIPT_NUM
  FROM PO_HEADERS_ALL PHA   ,
       PO_LINES_ALL PLA,
       PO_LINE_LOCATIONS_ALL PLLA,
       PO_DISTRIBUTIONS_ALL PDA,
       RCV_SHIPMENT_HEADERS RSH,
       RCV_SHIPMENT_LINES RSL
 WHERE PHA.PO_HEADER_ID = PLA.PO_HEADER_ID
   AND PLA.PO_LINE_ID = PLLA.PO_LINE_ID
   AND PLLA.LINE_LOCATION_ID = PDA.LINE_LOCATION_ID
   AND PHA.PO_HEADER_ID = RSL.PO_HEADER_ID
   AND PLA.PO_LINE_ID = RSL.PO_LINE_ID
   AND PLLA.LINE_LOCATION_ID = RSL.PO_LINE_LOCATION_ID
   AND PLLA.SHIP_TO_ORGANIZATION_ID = RSL.TO_ORGANIZATION_ID
   AND PDA.PO_DISTRIBUTION_ID = RSL.PO_DISTRIBUTION_ID
   AND RSH.SHIPMENT_HEADER_ID = RSL.SHIPMENT_HEADER_ID
   AND PHA.SEGMENT1 = '6884'  

========================================

SELECT PAPF.FULL_NAME BUYER_NAME
  FROM PER_ALL_PEOPLE_F PAPF,
       PO_HEADERS_ALL PHA
 WHERE PAPF.PERSON_ID = PHA.AGENT_ID
   AND TRUNC(SYSDATE) BETWEEN PAPF.EFFECTIVE_START_DATE AND PAPF.EFFECTIVE_END_DATE
   AND PHA.SEGMENT1 = '6884'    

No comments:

Post a Comment