DBA Data[Home] [Help]

PACKAGE BODY: APPS.HZ_GEO_STRUCTURE_PUB_UIW

Source


1 PACKAGE BODY HZ_GEO_STRUCTURE_PUB_UIW AS
2 /*$Header: ARHGSTWB.pls 120.1 2005/08/26 15:22:27 dmmehta noship $ */
3 
4 /**
5  * PROCEDURE create_geography_type
6  *
7  * DESCRIPTION
8  *     Creates Geography type.
9  *
10  * EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
11  *
12  * ARGUMENTS
13  *   IN:
14  *     p_init_msg_list                Initialize message stack if it is set to
15  *                                    FND_API.G_TRUE. Default is FND_API.G_FALSE.
16  *     p_geography_type_rec           Geography type record.
17  *   IN/OUT:
18  *   OUT:
19  *     x_return_status                Return status after the call. The status can
20  *                                    be FND_API.G_RET_STS_SUCCESS (success),
21  *                                    FND_API.G_RET_STS_ERROR (error),
22  *                                    FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
23  *     x_msg_count                    Number of messages in message stack.
24  *     x_msg_data                     Message text if x_msg_count is 1.
25  *
26  * NOTES
27  *
28  * MODIFICATION HISTORY
29  *
30  *   06-28-2005    Kate Shan        o Created.
31  *
32  */
33 
34 PROCEDURE create_geography_type (
35     p_init_msg_list             IN         VARCHAR2 := FND_API.G_FALSE,
36     p_geography_type_rec        IN         GEOGRAPHY_TYPE_REC_TYPE,
37     x_return_status             OUT   NOCOPY     VARCHAR2,
38     x_msg_count                 OUT   NOCOPY     NUMBER,
39     x_msg_data                  OUT   NOCOPY     VARCHAR2
40 ) AS
41   l_geography_type_rec HZ_GEOGRAPHY_STRUCTURE_PUB.GEOGRAPHY_TYPE_REC_TYPE;
42 BEGIN
43   l_geography_type_rec.geography_type := p_geography_type_rec.geography_type;
44   l_geography_type_rec.geography_type_name := p_geography_type_rec.geography_type_name;
45   l_geography_type_rec.created_by_module := p_geography_type_rec.created_by_module;
46   l_geography_type_rec.application_id := p_geography_type_rec.application_id;
47 
48   HZ_GEOGRAPHY_STRUCTURE_PUB.create_geography_type (
49     p_init_msg_list => p_init_msg_list,
50     p_geography_type_rec => l_geography_type_rec,
51     x_return_status => x_return_status,
52     x_msg_count => x_msg_count,
53     x_msg_data => x_msg_data);
54 
55 END;
56 
57 /**
58  * PROCEDURE create_geo_structure
59  *
60  * DESCRIPTION
61  *     Creates Geography Structure.
62  *
63  * EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
64  *
65  * ARGUMENTS
66  *   IN:
67  *     p_init_msg_list                Initialize message stack if it is set to
68  *                                    FND_API.G_TRUE. Default is FND_API.G_FALSE.
69  *     p_geo_structure_rec            Geography structure type record.
70 
71  *   IN/OUT:
72  *   OUT:
73  *     x_return_status                Return status after the call. The status can
74  *                                    be FND_API.G_RET_STS_SUCCESS (success),
75  *                                    FND_API.G_RET_STS_ERROR (error),
76  *                                    FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
77  *     x_msg_count                    Number of messages in message stack.
78  *     x_msg_data                     Message text if x_msg_count is 1.
79  *
80  * NOTES
81  *
82  * MODIFICATION HISTORY
83  *
84  *   06-28-2005    Kate Shan        o Created.
85  *
86  */
87 
88 
89 PROCEDURE create_geo_structure(
90     p_init_msg_list             	  IN         VARCHAR2 := FND_API.G_FALSE,
91     p_geo_structure_rec                   IN         GEO_STRUCTURE_REC_TYPE,
92     x_return_status             	  OUT  NOCOPY      VARCHAR2,
93     x_msg_count                 	  OUT  NOCOPY      NUMBER,
94     x_msg_data                  	  OUT  NOCOPY      VARCHAR2
95 ) AS
96   l_geo_structure_rec HZ_GEOGRAPHY_STRUCTURE_PUB.GEO_STRUCTURE_REC_TYPE;
97 BEGIN
98 
99   l_geo_structure_rec.geography_id         := p_geo_structure_rec.geography_id;
100   l_geo_structure_rec.geography_type       := p_geo_structure_rec.geography_type;
101   l_geo_structure_rec.parent_geography_type:= p_geo_structure_rec.parent_geography_type;
102   l_geo_structure_rec.created_by_module    := p_geo_structure_rec.created_by_module;
103   l_geo_structure_rec.application_id       := p_geo_structure_rec.application_id;
104 
105   HZ_GEOGRAPHY_STRUCTURE_PUB.create_geo_structure(
106     p_init_msg_list     => p_init_msg_list,
107     p_geo_structure_rec => l_geo_structure_rec,
108     x_return_status     => x_return_status,
109     x_msg_count         => x_msg_count,
110     x_msg_data          => x_msg_data);
111 
112 END;
113 
114 
115 /**
116  * PROCEDURE delete_geo_structure
117  *
118  * DESCRIPTION
119  *     Deletes the row in the structure. Disables the relationship_type if it is not used by any other structure.
120  *
121  * EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
122  *
123  * ARGUMENTS
124  *   IN:
125  *     p_init_msg_list                Initialize message stack if it is set to
126  *                                    FND_API.G_TRUE. Default is FND_API.G_FALSE.
127  *     p_geo_structure_rec            Geography structure type record.
128 
129  *   IN/OUT:
130  *
131  *   OUT:
132  *     x_return_status                Return status after the call. The status can
133  *                                    be FND_API.G_RET_STS_SUCCESS (success),
134  *                                    FND_API.G_RET_STS_ERROR (error),
135  *                                    FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
136  *     x_msg_count                    Number of messages in message stack.
137  *     x_msg_data                     Message text if x_msg_count is 1.
138  *
139  * NOTES
140  *
141  * MODIFICATION HISTORY
142  *
143  *   06-28-2005    Kate Shan        o Created.
144  *
145  */
146 
147  PROCEDURE delete_geo_structure(
148     p_init_msg_list             	  IN         VARCHAR2 := FND_API.G_FALSE,
149     p_geography_id                        IN         NUMBER,
150     p_geography_type                      IN         VARCHAR2,
151     p_parent_geography_type               IN         VARCHAR2,
152     x_return_status             	  OUT  NOCOPY      VARCHAR2,
153     x_msg_count                 	  OUT  NOCOPY      NUMBER,
154     x_msg_data                  	  OUT  NOCOPY      VARCHAR2
155     ) AS
156 BEGIN
157   HZ_GEOGRAPHY_STRUCTURE_PUB.delete_geo_structure(
158     p_init_msg_list           => p_init_msg_list,
159     p_geography_id            => p_geography_id,
160     p_geography_type          => p_geography_type,
161     p_parent_geography_type   => p_parent_geography_type,
162     x_return_status           => x_return_status,
163     x_msg_count               => x_msg_count,
164     x_msg_data                => x_msg_data);
165 
166 END;
167 
168 /**
169  * PROCEDURE create_geography_rel_type
170  *
171  * DESCRIPTION
172  *     Creates Geography Relationship type.
173  *
174  * EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
175  *
176  * ARGUMENTS
177  *   IN:
178  *     p_init_msg_list                Initialize message stack if it is set to
179  *                                    FND_API.G_TRUE. Default is FND_API.G_FALSE.
180  *     p_geography_rel_type_rec       Geography Relationship type record.
181  *   IN/OUT:
182  *   OUT:
183  *     x_return_status                Return status after the call. The status can
184  *                                    be FND_API.G_RET_STS_SUCCESS (success),
185  *                                    FND_API.G_RET_STS_ERROR (error),
186  *                                    FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
187  *     x_msg_count                    Number of messages in message stack.
188  *     x_msg_data                     Message text if x_msg_count is 1.
189  *
190  * NOTES
191  *
192  * MODIFICATION HISTORY
193  *
194  *   06-28-2005    Kate Shan        o Created.
195  *
196  */
197 
198  PROCEDURE create_geo_rel_type(
199     p_init_msg_list             	  IN         VARCHAR2 := FND_API.G_FALSE,
200     p_geo_rel_type_rec                    IN         GEO_REL_TYPE_REC_TYPE,
201     x_relationship_type_id                OUT   NOCOPY     NUMBER,
202     x_return_status             	  OUT   NOCOPY     VARCHAR2,
203     x_msg_count                 	  OUT   NOCOPY     NUMBER,
204     x_msg_data                  	  OUT   NOCOPY     VARCHAR2
205  )AS
206  l_geo_rel_type_rec HZ_GEOGRAPHY_STRUCTURE_PUB.GEO_REL_TYPE_REC_TYPE;
207 BEGIN
208   l_geo_rel_type_rec.geography_type        := p_geo_rel_type_rec.geography_type ;
209   l_geo_rel_type_rec.parent_geography_type := p_geo_rel_type_rec.parent_geography_type ;
210   l_geo_rel_type_rec.status                := p_geo_rel_type_rec.status ;
211   l_geo_rel_type_rec.created_by_module     := p_geo_rel_type_rec.created_by_module ;
212   l_geo_rel_type_rec.application_id        := p_geo_rel_type_rec.application_id ;
213 
214   HZ_GEOGRAPHY_STRUCTURE_PUB.create_geo_rel_type(
215     p_init_msg_list             => p_init_msg_list,
216     p_geo_rel_type_rec          => l_geo_rel_type_rec,
217     x_relationship_type_id      => x_relationship_type_id,
218     x_return_status             => x_return_status,
219     x_msg_count                 => x_msg_count,
220     x_msg_data                  => x_msg_data);
221 
222 END;
223 
224 
225  /**
226  * PROCEDURE create_zone_type
227  *
228  * DESCRIPTION
229  *     Creates Zone Type.
230  *
231  * EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
232  *
233  * ARGUMENTS
234  *   IN:
235  *     p_init_msg_list                Initialize message stack if it is set to
236  *                                    FND_API.G_TRUE. Default is FND_API.G_FALSE.
237  *     p_zone_type_rec                Zone_type type record.
238  *     included_geography_type        incl_geo_type_tbl_type,
239  *   IN/OUT:
240  *   OUT:
241  *
242  *     x_return_status                Return status after the call. The status can
243  *                                    be FND_API.G_RET_STS_SUCCESS (success),
244  *                                    FND_API.G_RET_STS_ERROR (error),
245  *                                    FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
246  *     x_msg_count                    Number of messages in message stack.
247  *     x_msg_data                     Message text if x_msg_count is 1.
248  *
249  * NOTES
250  *
251  * MODIFICATION HISTORY
252  *     06-28-2005    Kate Shan        o Created.
253  *
254  */
255 
256 PROCEDURE create_zone_type(
257     p_init_msg_list             IN         VARCHAR2 := FND_API.G_FALSE,
258     p_zone_type_rec             IN         ZONE_TYPE_REC_TYPE,
259     p_included_geography_type   IN         INCL_GEO_TYPE_TBL_TYPE,
260     x_return_status             OUT   NOCOPY     VARCHAR2,
261     x_msg_count                 OUT   NOCOPY     NUMBER,
262     x_msg_data                  OUT   NOCOPY     VARCHAR2
263 )AS
264   l_zone_type_rec HZ_GEOGRAPHY_STRUCTURE_PUB.ZONE_TYPE_REC_TYPE;
265 BEGIN
266 
267    FOR i in 1 .. p_included_geography_type.count LOOP
268      l_zone_type_rec.included_geography_type(i) := p_included_geography_type(i);
269    END LOOP;
270 
271    l_zone_type_rec.geography_type  := p_zone_type_rec.geography_type;
272    l_zone_type_rec.geography_type_name := p_zone_type_rec.geography_type_name;
273    l_zone_type_rec.geography_use := p_zone_type_rec.geography_use;
274    l_zone_type_rec.limited_by_geography_id := p_zone_type_rec.limited_by_geography_id;
275    l_zone_type_rec.postal_code_range_flag := p_zone_type_rec.postal_code_range_flag;
276    l_zone_type_rec.created_by_module := p_zone_type_rec.created_by_module;
277    l_zone_type_rec.application_id := p_zone_type_rec.application_id;
278 
279    HZ_GEOGRAPHY_STRUCTURE_PUB.create_zone_type(
280      p_init_msg_list           => p_init_msg_list,
281      p_zone_type_rec           => l_zone_type_rec,
282      x_return_status           => x_return_status,
283      x_msg_count               => x_msg_count,
284      x_msg_data                => x_msg_data);
285 
286 END;
287 
288 
289 
290 /**
291  * PROCEDURE update_zone_type
292  *
293  * DESCRIPTION
294  *     Updates zone type.
295  *
296  * EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
297  *
298  * ARGUMENTS
299  *   IN:
300  *     p_init_msg_list                Initialize message stack if it is set to
301  *                                    FND_API.G_TRUE. Default is FND_API.G_FALSE.
302  *     p_geographytype                Geography type.
303  *     p_limited_by_geography_id
304  *     p_postal_code_range_flag
305  *   IN/OUT:
306  *     p_object_version_number        object version number of the row being updated
307  *   OUT:
308  *     x_return_status                Return status after the call. The status can
309  *                                    be FND_API.G_RET_STS_SUCCESS (success),
310  *                                    FND_API.G_RET_STS_ERROR (error),
311  *                                    FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
312  *     x_msg_count                    Number of messages in message stack.
313  *     x_msg_data                     Message text if x_msg_count is 1.
314  *
315  * NOTES
316  *
317  * MODIFICATION HISTORY
318  *
319  *   06-28-2005    Kate Shan        o Created.
320  *
321  */
322 
323  PROCEDURE update_zone_type(
324     p_init_msg_list             	  IN         VARCHAR2 := FND_API.G_FALSE,
325     p_zone_type_rec                       IN         ZONE_TYPE_REC_TYPE,
326     p_included_geography_type   IN         INCL_GEO_TYPE_TBL_TYPE,
327     p_object_version_number    		  IN OUT NOCOPY  NUMBER,
328     x_return_status             	  OUT  NOCOPY      VARCHAR2,
329     x_msg_count                 	  OUT  NOCOPY      NUMBER,
330     x_msg_data                  	  OUT  NOCOPY      VARCHAR2
331  )AS
332 l_zone_type_rec HZ_GEOGRAPHY_STRUCTURE_PUB.ZONE_TYPE_REC_TYPE;
333 
334 BEGIN
335    FOR i in 1 .. p_included_geography_type.count LOOP
336      l_zone_type_rec.included_geography_type(i) := p_included_geography_type(i);
337    END LOOP;
338 
339    l_zone_type_rec.geography_type  := p_zone_type_rec.geography_type;
340    l_zone_type_rec.geography_type_name := p_zone_type_rec.geography_type_name;
341    l_zone_type_rec.geography_use := p_zone_type_rec.geography_use;
342    l_zone_type_rec.limited_by_geography_id := p_zone_type_rec.limited_by_geography_id;
343    l_zone_type_rec.postal_code_range_flag := p_zone_type_rec.postal_code_range_flag;
344    l_zone_type_rec.created_by_module := p_zone_type_rec.created_by_module;
345    l_zone_type_rec.application_id := p_zone_type_rec.application_id;
346 
347   HZ_GEOGRAPHY_STRUCTURE_PUB.update_zone_type(
348     p_init_msg_list           => p_init_msg_list,
349     p_zone_type_rec           => l_zone_type_rec,
350     p_object_version_number   => p_object_version_number,
351     x_return_status           => x_return_status,
352     x_msg_count               => x_msg_count,
353     x_msg_data                => x_msg_data);
354 END;
355 
356 END HZ_GEO_STRUCTURE_PUB_UIW;