TCA Query: Customer Party Site and Address by Location in Oracle R12

Customer addresses in Oracle EBS R12 live in the Trading Community Architecture (TCA). The chain is: site use (HZ_CUST_SITE_USES_ALL, Bill To or Ship To) → account site (HZ_CUST_ACCT_SITES_ALL, per operating unit) → party site (HZ_PARTY_SITES) → location (HZ_LOCATIONS, the actual address), with the customer name on HZ_PARTIES. The query below walks that chain for given location IDs.

SQL: customer and site for a location

SELECT 
  hp.party_name, 
  party_site_number, 
  hl.address1 
FROM 
  apps.hz_cust_site_uses_all hcs, 
  apps.hz_cust_acct_sites_all hca, 
  apps.hz_party_sites hps, 
  apps.hz_parties hp, 
  apps.hz_locations hl, 
  apps.hr_operating_units hou 
WHERE 
  1 = 1 
  AND hcs.cust_acct_site_id = hca.cust_acct_site_id 
  AND hca.party_site_id = hps.party_site_id 
  AND hps.party_id = hp.party_id 
  AND hps.location_id = hl.location_id 
  AND hca.org_id = hou.organization_id 
  and hl.location_id in (575131, 575155);

Variations

  • Filter on hp.party_name, hps.party_site_number or hcs.site_use_id instead of location ID.
  • Add hcs.site_use_code (BILL_TO, SHIP_TO) and hcs.location to see the site purpose and its name.
  • Join HZ_CUST_ACCOUNTS on hca.cust_account_id for the account number.

How are customer addresses stored in Oracle R12 TCA?

The address is in HZ_LOCATIONS, linked to the party through HZ_PARTY_SITES, to the customer account through HZ_CUST_ACCT_SITES_ALL and to purposes like Bill To and Ship To through HZ_CUST_SITE_USES_ALL.

What is the difference between a party site and an account site?

A party site is an address of the party, shared across operating units. An account site is that address used by a customer account in one operating unit.

Related queries

Related posts: Upload your own post and refer it anywhere anytime:

Leave a Comment