[Home] [Help]
PACKAGE BODY: APPS.PO_CUSTOMERS_SV
Source
1 PACKAGE BODY PO_CUSTOMERS_SV as
2 /* $Header: POXRQCUB.pls 120.3 2011/08/02 06:30:04 uchennam ship $ */
3 /*========================== po_customers_sv ============================*/
4 /*===========================================================================
5
6 PROCEDURE NAME: get_cust_details
7
8 ===========================================================================*/
9
10 PROCEDURE get_cust_details(x_deliver_to_location_id IN NUMBER,
11 x_customer_id IN OUT NOCOPY NUMBER,
12 x_address_id IN OUT NOCOPY NUMBER,
13 x_site_use_id IN OUT NOCOPY NUMBER,
14 x_source_org_id IN NUMBER DEFAULT NULL) IS
15
16 x_progress VARCHAR2(3) := NULL;
17
18 BEGIN
19
20 x_progress := '010';
21 if (x_source_org_id is not null ) then
22 SELECT pola.customer_id,
23 pola.address_id,
24 pola.site_use_id
25 INTO x_customer_id,
26 x_address_id,
27 x_site_use_id
28 FROM po_location_associations_all pola,
29 org_organization_definitions org
30 WHERE pola.location_id = x_deliver_to_location_id
31 AND org.organization_id= x_source_org_id -- bug 5028505
32 AND org.operating_unit= pola.org_id; -- bug 5028505
33
34 else
35 SELECT pola.customer_id,
36 pola.address_id,
37 pola.site_use_id
38 INTO x_customer_id,
39 x_address_id,
40 x_site_use_id
41 FROM po_location_associations pola
42 WHERE pola.location_id = x_deliver_to_location_id;
43 end if;
44
45 EXCEPTION
46 WHEN NO_DATA_FOUND THEN
47 x_customer_id := null;
48 x_address_id := null;
49 x_site_use_id := null;
50 --Bug 12801184 Added below exception
51 WHEN TOO_MANY_ROWS THEN
52 x_customer_id := null;
53 x_address_id := null;
54 x_site_use_id := null;
55
56 WHEN OTHERS THEN
57 po_message_s.sql_error('get_cust_details', x_progress, sqlcode);
58 RAISE;
59
60 END get_cust_details;
61
62 END po_customers_sv;