Friday, February 3, 2012

Oralce Sales Order Header Details

Below is the Query to get the sales order header details, which includes customer information.


*************************************************************************************


SELECT   ooh.order_number,
         hp.party_name customer_name,
         hca.account_number customer_number,
         hl.address1,
         hl.address2,
         hl.city,
         hl.state,
         hl.postal_code,
         hl.country,
         hl.province,
         hl.county
  FROM   oe_order_headers_all ooh,
         hz_cust_site_uses_all hcsu,
         hz_cust_acct_sites_all hcas,
         hz_party_sites hps,
         hz_locations hl,
         hz_parties hp,
         hz_cust_accounts hca
 WHERE   ooh.invoice_to_org_id = hcsu.site_use_id
         AND  hcsu.cust_acct_site_id = hcas.cust_acct_site_id
         AND hcas.party_site_id = hps.party_site_id
         AND  hps.location_id = hl.location_id
         AND  hps.party_id = hp.party_id
         AND  hp.party_id = hca.party_id
         AND  order_number = :p_order_number;


*************************************************************************************


Let me know, if any questions.


Thanks, ...





9 comments: