1 PACKAGE BODY pos_hz_party_site_bo_tbl_pkg AS
2 /*$Header: POSSPPASB.pls 120.1 2010/11/25 12:12:07 puppulur noship $ */
3 /*
4 * This package contains the private APIs for logical party site.
5 * @rep:scope private
6 * @rep:product HZ
7 * @rep:displayname party site
8 * @rep:category BUSINESS_ENTITY HZ_PARTIE_SITES
9 * @rep:lifecycle active
10 * @rep:doccd 115hztig.pdf party site Get APIs
11 */
12
13 --------------------------------------
14 --
15 -- PROCEDURE get_party_site_bo
16 --
17 -- DESCRIPTION
18 -- Get a logical party site.
19 --
20 -- EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
21 --
22 -- ARGUMENTS
23 -- IN:
24 -- p_init_msg_list Initialize message stack if it is set to FND_API.G_TRUE. Default is FND_API.G_FALSE.
25 -- p_party_id party ID.
26 -- p_party_site_id party site ID. If this id is not passed in, multiple site objects will be returned.
27 -- p_party_site_os party site orig system.
28 -- p_party_site_osr party site orig system reference.
29 --
30 -- OUT:
31 -- x_party_site_objs Logical party site records.
32 -- x_return_status Return status after the call. The status can
33 -- be fnd_api.g_ret_sts_success (success),
34 -- fnd_api.g_ret_sts_error (error),
35 -- FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
36 -- x_msg_count Number of messages in message stack.
37 -- x_msg_data Message text if x_msg_count is 1.
38 --
39 -- NOTES
40 --
41 -- MODIFICATION HISTORY
42 --
43 --
44 -- 1-JUNE-2005 AWU Created.
45 --
46
47 /*
48 The Get party site API Procedure is a retrieval service that returns a full party site business object.
49 The user identifies a particular party site business object using the TCA identifier and/or
50 the object Source System information. Upon proper validation of the object,
51 the full party site business object is returned. The object consists of all data included within
52 the party site business object, at all embedded levels. This includes the set of all data stored
53 in the TCA tables for each embedded entity.
54
55 To retrieve the appropriate embedded business objects within the party site business object,
56 the Get procedure calls the equivalent procedure for the following embedded objects:
57
58 Embedded BO Mandatory Multiple Logical API Procedure Comments
59 Phone N Y get_phone_bos
60 Telex N Y get_telex_bos
61 Email N Y get_email_bos
62 Web N Y get_web_bos
63
64 To retrieve the appropriate embedded entities within the party site business object,
65 the Get procedure returns all records for the particular party site from these TCA entity tables:
66
67 Embedded TCA Entity Mandatory Multiple TCA Table Entities
68
69 Location Y N HZ_LOCATIONS
70 Party Site Y N HZ_PARTY_SITES
71 Party Site Use N Y HZ_PARTY_SITE_USES
72 Contact Preference N Y HZ_CONTACT_PREFERENCES
73 */
74
75 PROCEDURE get_party_site_bos(p_party_id IN NUMBER,
76 x_party_site_objs OUT NOCOPY pos_hz_party_site_bo_tbl,
77 x_return_status OUT NOCOPY VARCHAR2,
78 x_msg_count OUT NOCOPY NUMBER,
79 x_msg_data OUT NOCOPY VARCHAR2) IS
80
81 l_debug_prefix VARCHAR2(30) := '';
82 BEGIN
83 SELECT pos_hz_party_site_bo(NULL, -- COMMON_OBJ_ID
84 ps.party_site_id,
85 NULL, --PS.ORIG_SYSTEM,
86 NULL, --PS.ORIG_SYSTEM_REFERENCE,
87 hz_extract_bo_util_pvt.get_parent_object_type('HZ_PARTIES',
88 ps.party_id),
89 ps.party_id,
90 ps.party_site_number,
91 ps.mailstop,
92 ps.identifying_address_flag,
93 ps.status,
94 ps.party_site_name,
95 ps.attribute_category,
96 ps.attribute1,
97 ps.attribute2,
98 ps.attribute3,
99 ps.attribute4,
100 ps.attribute5,
101 ps.attribute6,
102 ps.attribute7,
103 ps.attribute8,
104 ps.attribute9,
105 ps.attribute10,
106 ps.attribute11,
107 ps.attribute12,
108 ps.attribute13,
109 ps.attribute14,
110 ps.attribute15,
111 ps.attribute16,
112 ps.attribute17,
113 ps.attribute18,
114 ps.attribute19,
115 ps.attribute20,
116 ps.language,
117 ps.addressee,
118 ps.program_update_date,
119 ps.created_by_module,
120 hz_extract_bo_util_pvt.get_user_name(ps.created_by),
121 ps.creation_date,
122 ps.last_update_date,
123 hz_extract_bo_util_pvt.get_user_name(ps.last_updated_by),
124 ps.actual_content_source,
125 ps.global_location_number,
126 pos_supplier_uda_bo_pkg.get_uda_for_supplier_site(p_party_id,
127 ps.party_site_id,
128 NULL,
129 'SUPP_ADDR_LEVEL')) BULK COLLECT
130 INTO x_party_site_objs
131 FROM hz_party_sites ps
132 WHERE party_id = p_party_id;
133
134 --Commented by BVAMSI on 07/Oct/2010 as it is already handled in the above Select query
135 /*
136 FOR i IN x_party_site_objs.first .. x_party_site_objs.last LOOP
137 IF x_party_site_objs(i).party_site_id = 451801 THEN
138 NULL;
139 END IF;
140 x_party_site_objs(i).p_pos_supp_uda_obj_tbl := pos_supplier_uda_bo_pkg.get_uda_for_supplier_site(p_party_id,
141 x_party_site_objs(i)
142 .party_site_id,
143 NULL,
144 'SUPP_ADDR_LEVEL');
145
146 END LOOP;
147 */
148 -- Comment by BVAMSI Ends here
149
150 EXCEPTION
151 WHEN fnd_api.g_exc_error THEN
152
153 x_return_status := fnd_api.g_ret_sts_error;
154 fnd_msg_pub.count_and_get(p_count => x_msg_count,
155 p_data => x_msg_data);
156 WHEN fnd_api.g_exc_unexpected_error THEN
157
158 x_return_status := fnd_api.g_ret_sts_unexp_error;
159 fnd_msg_pub.count_and_get(p_count => x_msg_count,
160 p_data => x_msg_data);
161 WHEN OTHERS THEN
162
163 x_return_status := fnd_api.g_ret_sts_unexp_error;
164
165 fnd_msg_pub.count_and_get(p_count => x_msg_count,
166 p_data => x_msg_data);
167
168 END;
169
170 END pos_hz_party_site_bo_tbl_pkg;