Query to get item on hand by org wise

Wednesday, November 10, 2021

Query to get Order Bill to & Ship to Address for a customer

 Below is the reference query for the Bill to & Ship to customer and address details 


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

SELECT hl.ADDRESS1,
hl.ADDRESS2,
hl.CITY,
hl.POSTAL_CODE,
(
SELECT territory_short_name
FROM fnd_territories_tl
WHERE territory_code = hl.country
AND LANGUAGE = 'US'
) country,
hzp.party_id,
hzp.party_name,
hzp.party_number
FROM 
doo_order_addresses doa,
hz_party_sites hps,
doo_headers_all dha,
hz_locations hl,
hz_parties hzp
WHERE 
doa.HEADER_ID = 300000010340672   -------Please pass header of an Order
AND doa.ADDRESS_USE_TYPE = 'SHIP_TO' ------this is for ship to, if you need bill to please replace SHIP_TO With BILL_TO
AND doa.party_site_id = hps.party_site_id
AND hps.location_id = hl.location_id
AND hzp.party_id = dha.sold_to_party_id
AND dha.header_id = doa.header_id

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




No comments:

Post a Comment