DBA Data[Home] [Help]

PACKAGE BODY: APPS.CN_SFP_GROUP_UTIL_PVT_W

Source


1 package body cn_sfp_group_util_pvt_w as
2   /* $Header: cnwsfgrb.pls 115.0 2003/08/19 20:50:22 sbadami noship $ */
3   rosetta_g_mistake_date date := to_date('01/01/+4713', 'MM/DD/SYYYY');
4   rosetta_g_miss_date date := to_date('01/01/-4712', 'MM/DD/SYYYY');
5 
6   -- this is to workaround the JDBC bug regarding IN DATE of value GMiss
7   function rosetta_g_miss_date_in_map(d date) return date as
8   begin
9     if d = rosetta_g_mistake_date then return fnd_api.g_miss_date; end if;
10     return d;
11   end;
12 
13   procedure rosetta_table_copy_in_p1(t out nocopy cn_sfp_group_util_pvt.srprole_tbl_type, a0 JTF_NUMBER_TABLE
14     , a1 JTF_NUMBER_TABLE
15     , a2 JTF_VARCHAR2_TABLE_100
16     ) as
17     ddindx binary_integer; indx binary_integer;
18   begin
19   if a0 is not null and a0.count > 0 then
20       if a0.count > 0 then
21         indx := a0.first;
22         ddindx := 1;
23         while true loop
24           t(ddindx).srp_role_id := a0(indx);
25           t(ddindx).comp_group_id := a1(indx);
26           t(ddindx).org_code := a2(indx);
27           ddindx := ddindx+1;
28           if a0.last =indx
29             then exit;
30           end if;
31           indx := a0.next(indx);
32         end loop;
33       end if;
34    end if;
35   end rosetta_table_copy_in_p1;
36   procedure rosetta_table_copy_out_p1(t cn_sfp_group_util_pvt.srprole_tbl_type, a0 out nocopy JTF_NUMBER_TABLE
37     , a1 out nocopy JTF_NUMBER_TABLE
38     , a2 out nocopy JTF_VARCHAR2_TABLE_100
39     ) as
40     ddindx binary_integer; indx binary_integer;
41   begin
42   if t is null or t.count = 0 then
43     a0 := JTF_NUMBER_TABLE();
44     a1 := JTF_NUMBER_TABLE();
45     a2 := JTF_VARCHAR2_TABLE_100();
46   else
47       a0 := JTF_NUMBER_TABLE();
48       a1 := JTF_NUMBER_TABLE();
49       a2 := JTF_VARCHAR2_TABLE_100();
50       if t.count > 0 then
51         a0.extend(t.count);
52         a1.extend(t.count);
53         a2.extend(t.count);
54         ddindx := t.first;
55         indx := 1;
56         while true loop
57           a0(indx) := t(ddindx).srp_role_id;
58           a1(indx) := t(ddindx).comp_group_id;
59           a2(indx) := t(ddindx).org_code;
60           indx := indx+1;
61           if t.last =ddindx
62             then exit;
63           end if;
64           ddindx := t.next(ddindx);
65         end loop;
66       end if;
67    end if;
68   end rosetta_table_copy_out_p1;
69 
70   procedure rosetta_table_copy_in_p3(t out nocopy cn_sfp_group_util_pvt.grporg_tbl_type, a0 JTF_VARCHAR2_TABLE_100
71     , a1 JTF_VARCHAR2_TABLE_100
72     ) as
73     ddindx binary_integer; indx binary_integer;
74   begin
75   if a0 is not null and a0.count > 0 then
76       if a0.count > 0 then
77         indx := a0.first;
78         ddindx := 1;
79         while true loop
80           t(ddindx).org_code := a0(indx);
81           t(ddindx).org_meaning := a1(indx);
82           ddindx := ddindx+1;
83           if a0.last =indx
84             then exit;
85           end if;
86           indx := a0.next(indx);
87         end loop;
88       end if;
89    end if;
90   end rosetta_table_copy_in_p3;
91   procedure rosetta_table_copy_out_p3(t cn_sfp_group_util_pvt.grporg_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_100
92     , a1 out nocopy JTF_VARCHAR2_TABLE_100
93     ) as
94     ddindx binary_integer; indx binary_integer;
95   begin
96   if t is null or t.count = 0 then
97     a0 := JTF_VARCHAR2_TABLE_100();
98     a1 := JTF_VARCHAR2_TABLE_100();
99   else
100       a0 := JTF_VARCHAR2_TABLE_100();
101       a1 := JTF_VARCHAR2_TABLE_100();
102       if t.count > 0 then
103         a0.extend(t.count);
104         a1.extend(t.count);
105         ddindx := t.first;
106         indx := 1;
107         while true loop
108           a0(indx) := t(ddindx).org_code;
109           a1(indx) := t(ddindx).org_meaning;
110           indx := indx+1;
111           if t.last =ddindx
112             then exit;
113           end if;
114           ddindx := t.next(ddindx);
115         end loop;
116       end if;
117    end if;
118   end rosetta_table_copy_out_p3;
119 
120   procedure rosetta_table_copy_in_p4(t out nocopy cn_sfp_group_util_pvt.grpnum_tbl_type, a0 JTF_NUMBER_TABLE) as
121     ddindx binary_integer; indx binary_integer;
122   begin
123   if a0 is not null and a0.count > 0 then
124       if a0.count > 0 then
125         indx := a0.first;
126         ddindx := 1;
127         while true loop
128           t(ddindx) := a0(indx);
129           ddindx := ddindx+1;
130           if a0.last =indx
131             then exit;
132           end if;
133           indx := a0.next(indx);
134         end loop;
135       end if;
136    end if;
137   end rosetta_table_copy_in_p4;
138   procedure rosetta_table_copy_out_p4(t cn_sfp_group_util_pvt.grpnum_tbl_type, a0 out nocopy JTF_NUMBER_TABLE) as
139     ddindx binary_integer; indx binary_integer;
140   begin
141   if t is null or t.count = 0 then
142     a0 := JTF_NUMBER_TABLE();
143   else
144       a0 := JTF_NUMBER_TABLE();
145       if t.count > 0 then
146         a0.extend(t.count);
147         ddindx := t.first;
148         indx := 1;
149         while true loop
150           a0(indx) := t(ddindx);
151           indx := indx+1;
152           if t.last =ddindx
153             then exit;
154           end if;
155           ddindx := t.next(ddindx);
156         end loop;
157       end if;
158    end if;
159   end rosetta_table_copy_out_p4;
160 
161   procedure get_descendant_groups(p_api_version  NUMBER
162     , p_init_msg_list  VARCHAR2
163     , p_commit  VARCHAR2
164     , p_validation_level  NUMBER
165     , p_selected_groups JTF_NUMBER_TABLE
166     , p_effective_date  date
167     , x_descendant_groups out nocopy JTF_NUMBER_TABLE
168     , x_return_status out nocopy  VARCHAR2
169     , x_msg_count out nocopy  NUMBER
170     , x_msg_data out nocopy  VARCHAR2
171   )
172 
173   as
174     ddp_selected_groups cn_sfp_group_util_pvt.grpnum_tbl_type;
175     ddp_effective_date date;
176     ddx_descendant_groups cn_sfp_group_util_pvt.grpnum_tbl_type;
177     ddindx binary_integer; indx binary_integer;
178   begin
179 
180     -- copy data to the local IN or IN-OUT args, if any
181 
182 
183 
184 
185     cn_sfp_group_util_pvt_w.rosetta_table_copy_in_p4(ddp_selected_groups, p_selected_groups);
186 
187     ddp_effective_date := rosetta_g_miss_date_in_map(p_effective_date);
188 
189 
190 
191 
192 
193     -- here's the delegated call to the old PL/SQL routine
194     cn_sfp_group_util_pvt.get_descendant_groups(p_api_version,
195       p_init_msg_list,
196       p_commit,
197       p_validation_level,
198       ddp_selected_groups,
199       ddp_effective_date,
200       ddx_descendant_groups,
201       x_return_status,
202       x_msg_count,
203       x_msg_data);
204 
205     -- copy data back from the local variables to OUT or IN-OUT args, if any
206 
207 
208 
209 
210 
211 
212     cn_sfp_group_util_pvt_w.rosetta_table_copy_out_p4(ddx_descendant_groups, x_descendant_groups);
213 
214 
215 
216   end;
217 
218   procedure get_salesrep_roles(p_api_version  NUMBER
219     , p_init_msg_list  VARCHAR2
220     , p_commit  VARCHAR2
221     , p_validation_level  NUMBER
222     , p_selected_groups JTF_NUMBER_TABLE
223     , p_status  VARCHAR2
224     , p_effective_date  date
225     , p7_a0 out nocopy JTF_NUMBER_TABLE
226     , p7_a1 out nocopy JTF_NUMBER_TABLE
227     , p7_a2 out nocopy JTF_VARCHAR2_TABLE_100
228     , x_return_status out nocopy  VARCHAR2
229     , x_msg_count out nocopy  NUMBER
230     , x_msg_data out nocopy  VARCHAR2
231   )
232 
233   as
234     ddp_selected_groups cn_sfp_group_util_pvt.grpnum_tbl_type;
235     ddp_effective_date date;
236     ddx_salesrep_roles cn_sfp_group_util_pvt.srprole_tbl_type;
237     ddindx binary_integer; indx binary_integer;
238   begin
239 
240     -- copy data to the local IN or IN-OUT args, if any
241 
242 
243 
244 
245     cn_sfp_group_util_pvt_w.rosetta_table_copy_in_p4(ddp_selected_groups, p_selected_groups);
246 
247 
248     ddp_effective_date := rosetta_g_miss_date_in_map(p_effective_date);
249 
250 
251 
252 
253 
254     -- here's the delegated call to the old PL/SQL routine
255     cn_sfp_group_util_pvt.get_salesrep_roles(p_api_version,
256       p_init_msg_list,
257       p_commit,
258       p_validation_level,
259       ddp_selected_groups,
260       p_status,
261       ddp_effective_date,
262       ddx_salesrep_roles,
263       x_return_status,
264       x_msg_count,
265       x_msg_data);
266 
267     -- copy data back from the local variables to OUT or IN-OUT args, if any
268 
269 
270 
271 
272 
273 
274 
275     cn_sfp_group_util_pvt_w.rosetta_table_copy_out_p1(ddx_salesrep_roles, p7_a0
276       , p7_a1
277       , p7_a2
278       );
279 
280 
281 
282   end;
283 
284   procedure get_grp_organization_access(p_api_version  NUMBER
285     , p_init_msg_list  VARCHAR2
286     , p_commit  VARCHAR2
287     , p_validation_level  NUMBER
288     , p_comp_group_id  NUMBER
289     , p_effective_date  date
290     , p6_a0 out nocopy JTF_VARCHAR2_TABLE_100
291     , p6_a1 out nocopy JTF_VARCHAR2_TABLE_100
292     , p7_a0 out nocopy JTF_VARCHAR2_TABLE_100
293     , p7_a1 out nocopy JTF_VARCHAR2_TABLE_100
294     , p8_a0 out nocopy JTF_VARCHAR2_TABLE_100
295     , p8_a1 out nocopy JTF_VARCHAR2_TABLE_100
296     , p9_a0 out nocopy JTF_VARCHAR2_TABLE_100
297     , p9_a1 out nocopy JTF_VARCHAR2_TABLE_100
298     , x_return_status out nocopy  VARCHAR2
299     , x_msg_count out nocopy  NUMBER
300     , x_msg_data out nocopy  VARCHAR2
301   )
302 
303   as
304     ddp_effective_date date;
305     ddx_updview_organization cn_sfp_group_util_pvt.grporg_tbl_type;
306     ddx_upd_organization cn_sfp_group_util_pvt.grporg_tbl_type;
307     ddx_view_organization cn_sfp_group_util_pvt.grporg_tbl_type;
308     ddx_noview_organization cn_sfp_group_util_pvt.grporg_tbl_type;
309     ddindx binary_integer; indx binary_integer;
310   begin
311 
312     -- copy data to the local IN or IN-OUT args, if any
313 
314 
315 
316 
317 
318     ddp_effective_date := rosetta_g_miss_date_in_map(p_effective_date);
319 
320 
321 
322 
323 
324 
325 
326 
327     -- here's the delegated call to the old PL/SQL routine
328     cn_sfp_group_util_pvt.get_grp_organization_access(p_api_version,
329       p_init_msg_list,
330       p_commit,
331       p_validation_level,
332       p_comp_group_id,
333       ddp_effective_date,
334       ddx_updview_organization,
335       ddx_upd_organization,
336       ddx_view_organization,
337       ddx_noview_organization,
338       x_return_status,
339       x_msg_count,
340       x_msg_data);
341 
342     -- copy data back from the local variables to OUT or IN-OUT args, if any
343 
344 
345 
346 
347 
348 
349     cn_sfp_group_util_pvt_w.rosetta_table_copy_out_p3(ddx_updview_organization, p6_a0
350       , p6_a1
351       );
352 
353     cn_sfp_group_util_pvt_w.rosetta_table_copy_out_p3(ddx_upd_organization, p7_a0
354       , p7_a1
355       );
356 
357     cn_sfp_group_util_pvt_w.rosetta_table_copy_out_p3(ddx_view_organization, p8_a0
358       , p8_a1
359       );
360 
361     cn_sfp_group_util_pvt_w.rosetta_table_copy_out_p3(ddx_noview_organization, p9_a0
362       , p9_a1
363       );
364 
365 
366 
367   end;
368 
369 end cn_sfp_group_util_pvt_w;