DBA Data[Home] [Help]

PACKAGE: APPS.HR_KFLEX_UTILITY

Source


1 Package hr_kflex_utility AUTHID CURRENT_USER as
2 /* $Header: hrkfutil.pkh 115.9 2003/01/09 11:58:38 pmfletch ship $ */
3 --
4 -- Package Variables
5 --
6 -- -------------------------------------------------------------------------
7 -- | create varray for ignore key flex field validation
8 -- -------------------------------------------------------------------------
9 --
10 type l_ignore_kfcode_varray is varray(12) of varchar2(30);
11 procedure create_ignore_kf_validation(p_rec in l_ignore_kfcode_varray);
12 --
13 ----------------------------------------------------------------------------
14 -- | check ignore array with key flex currently being processed
15 ----------------------------------------------------------------------------
16 --
17 function check_ignore_varray(p_structure in varchar2) return boolean;
18 --
19 ----------------------------------------------------------------------------
20 -- | clear varray
21 ----------------------------------------------------------------------------
22 --
23 procedure remove_ignore_kf_validation;
24 --
25 -- ----------------------------------------------------------------------------
26 -- |------------------------ ins_or_sel_keyflex_comb -------------------------|
27 -- ----------------------------------------------------------------------------
28 --
29 -- {Start Of Comments}
30 --
31 -- Description:
32 --   This public procedure can be called by any api/business process which
33 --   involves the insert of key flexfield details for a given entity.
34 --
35 --   This procedure will accept populated key flex segment values in two forms :
36 --
37 --   Parameter form    : Each segment is passed in individually as p_segment1-30
38 --   Concatenated form : All segment are passed in together as one concatenated
39 --                       string of values. The segments in the string are
40 --                       arranged in segment display order
41 --
42 -- Prerequisites:
43 --   A valid id_flex_code    (flex structure code)
44 --   A valid id_flex_num     (flex structure number)
45 --   A valid appl_short_name (application short name)
46 --
47 -- In Parameters:
48 --   Name                  Reqd Type     Description
49 --   ====                  ==== ====     ===========
50 --   p_segment1 - 30       No   varchar2 Flex segments for relevant key
51 --                                       flexfield
52 --   p_concat_segments_in  No   varchar2 Flex segments in a concatenated string
53 --                                       presorted in segment display order
54 --   p_flex_num            Yes  number   The structure number for the relevant
55 --                                       key flexfield.
56 --   p_flex_code           Yes  varchar2 The id_flex_code of the relevant key
57 --                                       flexfield structure
58 --
59 --
60 -- Post Success:
61 --   The procedure calls check_segment_combination which returns the
62 --   relevant CCID for the key flexfield.
63 --
64 -- Post Failure:
65 --   The process raises an error and stops execution.
66 --
67 -- Access Status:
68 --   Private - For Internal Development Use Only
69 --
70 -- {End Of Comments}
71 --
72 procedure ins_or_sel_keyflex_comb
73 -- Flex structure definition details
74   (p_appl_short_name               in     fnd_application.application_short_name%TYPE
75   ,p_flex_code                     in     fnd_id_flex_segments.id_flex_code%TYPE
76   ,p_flex_num                      in     number
77 -- Individual parameter interface
78   ,p_segment1                      in     varchar2 default null
79   ,p_segment2                      in     varchar2 default null
80   ,p_segment3                      in     varchar2 default null
81   ,p_segment4                      in     varchar2 default null
82   ,p_segment5                      in     varchar2 default null
83   ,p_segment6                      in     varchar2 default null
84   ,p_segment7                      in     varchar2 default null
85   ,p_segment8                      in     varchar2 default null
86   ,p_segment9                      in     varchar2 default null
87   ,p_segment10                     in     varchar2 default null
88   ,p_segment11                     in     varchar2 default null
89   ,p_segment12                     in     varchar2 default null
90   ,p_segment13                     in     varchar2 default null
91   ,p_segment14                     in     varchar2 default null
92   ,p_segment15                     in     varchar2 default null
93   ,p_segment16                     in     varchar2 default null
94   ,p_segment17                     in     varchar2 default null
95   ,p_segment18                     in     varchar2 default null
96   ,p_segment19                     in     varchar2 default null
97   ,p_segment20                     in     varchar2 default null
98   ,p_segment21                     in     varchar2 default null
99   ,p_segment22                     in     varchar2 default null
100   ,p_segment23                     in     varchar2 default null
101   ,p_segment24                     in     varchar2 default null
102   ,p_segment25                     in     varchar2 default null
103   ,p_segment26                     in     varchar2 default null
104   ,p_segment27                     in     varchar2 default null
105   ,p_segment28                     in     varchar2 default null
106   ,p_segment29                     in     varchar2 default null
107   ,p_segment30                     in     varchar2 default null
108 -- Concatenated string interface
109   ,p_concat_segments_in            in     varchar2 default null
110 -- Code combination id and Concatenated segment string passed out
111   ,p_ccid                          out nocopy    number
112   ,p_concat_segments_out           out nocopy    varchar2
113   );
114 --
115 -- ----------------------------------------------------------------------------
116 -- |------------------------- upd_or_sel_keyflex_comb ------------------------|
117 -- ----------------------------------------------------------------------------
118 --
119 -- {Start Of Comments}
120 --
121 -- Description:
122 --   This public procedure can be called by any api/business process which
123 --   involves the update key flexfield details for a given entity.
124 --
125 --   It takes the CCID of the key flexfield definition and then
126 --   calls an AOL routine to convert the segment combination into a PLSQL
127 --   table. The contents of the table are then compared against the IN parameters
128 --   (i.e. the segment values) of the calling business process and a new table
129 --   is created which may contain updated segment values. Finally, a call is
130 --   made to check_segment_combination which will create a new segment
131 --   combination if required.
132 --
133 -- Prerequisites:
134 --   A valid key flexfield combination
135 --   A valid id_flex_code    (flex structure code)
136 --   A valid id_flex_num     (flex structure number)
137 --   A valid appl_short_name (application short name)
138 --
139 -- In Parameters:
140 --   Name                  Reqd Type     Description
141 --   ====                  ==== ====     ===========
142 --   p_ccid                Yes* number   The CCID of the key flexfield code
143 --                                       combination
144 --                                       *only req'd for parameter interface
145 --   p_segment1 - 30       No   varchar2 Flex segments for key flexfield
146 --   p_concat_segments_in  No   varchar2 Flex segments in a concatenated string
147 --                                       presorted in segment display order
148 --   p_flex_code           Yes  varchar2 The id_flex_code of the relevant key
149 --                                       flexfield structure
150 --   p_flex_num            Yes  number   The structure number for the key
151 --                                       flexfield structure
152 --
153 -- Post Success:
154 --   The procedure calls check_segment_combination which returns the
155 --   relevant CCID for the key flexfield (i.e. if segment values were
156 --   updated).
157 --
158 -- Post Failure:
159 --   The process raises an error and stops execution.
160 --
161 -- Access Status:
162 --   Private - For Internal Development Use Only
163 --
164 -- {End Of Comments}
165 --
166 procedure upd_or_sel_keyflex_comb
167 -- Flex structure definition details
168   (p_appl_short_name               in     fnd_application.application_short_name%TYPE
169   ,p_flex_code                     in     fnd_id_flex_segments.id_flex_code%TYPE
170   ,p_flex_num                      in     number
171 -- Individual parameter interface
172   ,p_segment1                      in     varchar2 default hr_api.g_varchar2
173   ,p_segment2                      in     varchar2 default hr_api.g_varchar2
174   ,p_segment3                      in     varchar2 default hr_api.g_varchar2
175   ,p_segment4                      in     varchar2 default hr_api.g_varchar2
176   ,p_segment5                      in     varchar2 default hr_api.g_varchar2
177   ,p_segment6                      in     varchar2 default hr_api.g_varchar2
178   ,p_segment7                      in     varchar2 default hr_api.g_varchar2
179   ,p_segment8                      in     varchar2 default hr_api.g_varchar2
180   ,p_segment9                      in     varchar2 default hr_api.g_varchar2
181   ,p_segment10                     in     varchar2 default hr_api.g_varchar2
182   ,p_segment11                     in     varchar2 default hr_api.g_varchar2
183   ,p_segment12                     in     varchar2 default hr_api.g_varchar2
184   ,p_segment13                     in     varchar2 default hr_api.g_varchar2
185   ,p_segment14                     in     varchar2 default hr_api.g_varchar2
186   ,p_segment15                     in     varchar2 default hr_api.g_varchar2
187   ,p_segment16                     in     varchar2 default hr_api.g_varchar2
188   ,p_segment17                     in     varchar2 default hr_api.g_varchar2
189   ,p_segment18                     in     varchar2 default hr_api.g_varchar2
190   ,p_segment19                     in     varchar2 default hr_api.g_varchar2
191   ,p_segment20                     in     varchar2 default hr_api.g_varchar2
192   ,p_segment21                     in     varchar2 default hr_api.g_varchar2
193   ,p_segment22                     in     varchar2 default hr_api.g_varchar2
194   ,p_segment23                     in     varchar2 default hr_api.g_varchar2
195   ,p_segment24                     in     varchar2 default hr_api.g_varchar2
196   ,p_segment25                     in     varchar2 default hr_api.g_varchar2
197   ,p_segment26                     in     varchar2 default hr_api.g_varchar2
198   ,p_segment27                     in     varchar2 default hr_api.g_varchar2
199   ,p_segment28                     in     varchar2 default hr_api.g_varchar2
200   ,p_segment29                     in     varchar2 default hr_api.g_varchar2
201   ,p_segment30                     in     varchar2 default hr_api.g_varchar2
202 -- Concatenated string interface
203   ,p_concat_segments_in            in     varchar2 default null
204 -- Code combination passed in and returned
205   ,p_ccid                          in out nocopy number
206 -- Concatenated segment string passed out
207   ,p_concat_segments_out           out nocopy    varchar2
208   );
209 --
210 --
211 -- ----------------------------------------------------------------------------
212 -- |------------------------------ set_profiles ------------------------------|
213 -- ----------------------------------------------------------------------------
214 --
215 -- {Start Of Comments}
216 --
217 -- Description:
218 --   This procedure sets the PER_ASSIGNMENT_ID, PER_BUSINESS_GROUP_ID,
219 --   PER_ORGANIZATION_ID and PER_LOCATION_ID profiles.
220 --
221 -- Prerequisites:
222 --
223 -- In Parameters:
224 --   Name                  Reqd Type     Description
225 --   ====                  ==== ====     ===========
226 --   p_business_group_id   No   number   The business group id
227 --   p_assignment_id       No   number   The assignment id
228 --   p_organization_id     No   number   The organization id
229 --   p_location_id         No   number   The location id
230 --
231 -- Post Success:
232 --   The procedure writes the three profile options
233 --
234 -- Post Failure:
235 --
236 --
237 -- Access Status:
238 --   Private - For Internal Development Use Only
239 --
240 -- {End Of Comments}
241 --
242 procedure set_profiles
243 (p_business_group_id in     per_all_assignments_f.business_group_id%type default hr_api.g_number
244 ,p_assignment_id     in     per_all_assignments_f.assignment_id%type     default null
245 ,p_organization_id   in     per_all_assignments_f.organization_id%type   default null
246 ,p_location_id       in     per_all_assignments_f.location_id%type       default null
247 );
248 --
249 --
250 -- ----------------------------------------------------------------------------
251 -- |----------------------------- set_session_date ---------------------------|
252 -- ----------------------------------------------------------------------------
253 --
254 -- {Start Of Comments}
255 --
256 -- Description:
257 --   This procedure sets the session date in fnd_sessions if it is not already
258 --   set for this session, and sets the session id parameter. If fnd_sessions
259 --   has already been set then no data is written and p_session_id is set to
260 --   be -1.
261 --
262 --   Note, at the end of the api, you must call unset_session_date to clear the
263 --   table if applicable.
264 --
265 -- Prerequisites:
266 --
267 -- In Parameters:
268 --   Name                  Reqd Type     Description
269 --   ====                  ==== ====     ===========
270 --   p_effective_date      Yes  Date     The effective date
271 --
272 -- Post Success:
273 --   The procedure populates fnd_sessions as appropriate
274 --
275 -- Post Failure:
276 --
277 --
278 -- Access Status:
279 --   Private - For Internal Development Use Only
280 --
281 -- {End Of Comments}
282 --
283 procedure set_session_date
284 (p_effective_date        in     date
285 ,p_session_id               out nocopy number
286 );
287 --
288 --
289 -- ----------------------------------------------------------------------------
290 -- |---------------------------- unset_session_date --------------------------|
291 -- ----------------------------------------------------------------------------
292 --
293 -- {Start Of Comments}
294 --
295 -- Description:
296 --   If a sessionid is passed in the coresponding row is deleted from
297 --   fnd_sessions. If p_session_id =-1 then no deletion is atempted.
298 --
299 -- Prerequisites:
300 --
301 -- In Parameters:
302 --   Name                  Reqd Type     Description
303 --   ====                  ==== ====     ===========
304 --   p_session_id          Yes  number   The session id
305 --
306 -- Post Success:
307 --   The procedure deleted from fnd_sessions as appropriate
308 --
309 -- Post Failure:
310 --
311 --
312 -- Access Status:
313 --   Private - For Internal Development Use Only
314 --
315 -- {End Of Comments}
316 --
317 procedure unset_session_date
318 (p_session_id            in      number
319 );
320 --
321 -- ----------------------------------------------------------------------------
322 -- |---------------------------- set_session_language_code--------------------|
323 -- ----------------------------------------------------------------------------
324 --
325 -- {Start Of Comments}
326 --
327 -- Description:
328 --   Set the session language from the language code and clears the
329 --   key flex cache
330 --
331 -- Prerequisites:
332 --
333 -- In Parameters:
334 --   Name                  Reqd Type     Description
335 --   ====                  ==== ====     ===========
336 --   p_language_code       Yes  varchar2 the Two digit language code
337 --
338 -- Post Success:
339 -- userenv('LANG') is set to language code
340 --
341 -- Post Failure:
342 -- user session language is not changed
343 --
344 --
345 -- Access Status:
346 --   Public  - For Internal Development Use Only
347 --
348 -- {End Of Comments}
349 --
350 procedure set_session_language_code
351   ( p_language_code      in     fnd_languages.language_code%TYPE
352   );
353 --
354 -- ----------------------------------------------------------------------------
355 -- |---------------------------- set_session_nls_language --------------------|
356 -- ----------------------------------------------------------------------------
357 --
358 -- {Start Of Comments}
359 --
360 -- Description:
361 --   Set the session language from the nls language and clears the
362 --   key flex cache
363 --
364 -- Prerequisites:
365 --
366 -- In Parameters:
367 --   Name                  Reqd Type     Description
368 --   ====                  ==== ====     ===========
369 --   p_nls_language        Yes  varchar2 The nls language (NOT the 2 letter language code)
370 --
371 -- Post Success:
372 -- userev('LANG') is set to language code derived from nls language
373 --
374 -- Post Failure:
375 -- user session language is not changed
376 --
377 --
378 -- Access Status:
379 --   Public  - For Internal Development Use Only
380 --
381 -- {End Of Comments}
382 --
383 procedure set_session_nls_language
384   ( p_nls_language       in     fnd_languages.nls_language%TYPE
385   );
386 end hr_kflex_utility;