1 Package hr_kflex_utility AUTHID CURRENT_USER as
2 /* $Header: hrkfutil.pkh 120.2 2009/12/15 14:13:16 brsinha noship $ */
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 -- p_person_id No number The person id
231 --
232 -- Post Success:
233 -- The procedure writes the three profile options
234 --
235 -- Post Failure:
236 --
237 --
238 -- Access Status:
239 -- Private - For Internal Development Use Only
240 --
241 -- {End Of Comments}
242 --
243 procedure set_profiles
244 (p_business_group_id in per_all_assignments_f.business_group_id%type default hr_api.g_number
245 ,p_assignment_id in per_all_assignments_f.assignment_id%type default null
246 ,p_organization_id in per_all_assignments_f.organization_id%type default null
247 ,p_location_id in per_all_assignments_f.location_id%type default null
248 ,p_person_id in per_all_assignments_f.person_id%type default null
249 );
250 --
251 --
252 -- ----------------------------------------------------------------------------
253 -- |----------------------------- set_session_date ---------------------------|
254 -- ----------------------------------------------------------------------------
255 --
256 -- {Start Of Comments}
257 --
258 -- Description:
259 -- This procedure sets the session date in fnd_sessions if it is not already
260 -- set for this session, and sets the session id parameter. If fnd_sessions
261 -- has already been set then no data is written and p_session_id is set to
262 -- be -1.
263 --
264 -- Note, at the end of the api, you must call unset_session_date to clear the
265 -- table if applicable.
266 --
267 -- Prerequisites:
268 --
269 -- In Parameters:
270 -- Name Reqd Type Description
271 -- ==== ==== ==== ===========
272 -- p_effective_date Yes Date The effective date
273 --
274 -- Post Success:
275 -- The procedure populates fnd_sessions as appropriate
276 --
277 -- Post Failure:
278 --
279 --
280 -- Access Status:
281 -- Private - For Internal Development Use Only
282 --
283 -- {End Of Comments}
284 --
285 procedure set_session_date
286 (p_effective_date in date
287 ,p_session_id out nocopy number
288 );
289 --
290 --
291 -- ----------------------------------------------------------------------------
292 -- |---------------------------- unset_session_date --------------------------|
293 -- ----------------------------------------------------------------------------
294 --
295 -- {Start Of Comments}
296 --
297 -- Description:
298 -- If a sessionid is passed in the coresponding row is deleted from
299 -- fnd_sessions. If p_session_id =-1 then no deletion is atempted.
300 --
301 -- Prerequisites:
302 --
303 -- In Parameters:
304 -- Name Reqd Type Description
305 -- ==== ==== ==== ===========
306 -- p_session_id Yes number The session id
307 --
308 -- Post Success:
309 -- The procedure deleted from fnd_sessions as appropriate
310 --
311 -- Post Failure:
312 --
313 --
314 -- Access Status:
315 -- Private - For Internal Development Use Only
316 --
317 -- {End Of Comments}
318 --
319 procedure unset_session_date
320 (p_session_id in number
321 );
322 --
323 -- ----------------------------------------------------------------------------
324 -- |---------------------------- set_session_language_code--------------------|
325 -- ----------------------------------------------------------------------------
326 --
327 -- {Start Of Comments}
328 --
329 -- Description:
330 -- Set the session language from the language code and clears the
331 -- key flex cache
332 --
333 -- Prerequisites:
334 --
335 -- In Parameters:
336 -- Name Reqd Type Description
337 -- ==== ==== ==== ===========
338 -- p_language_code Yes varchar2 the Two digit language code
339 --
340 -- Post Success:
341 -- userenv('LANG') is set to language code
342 --
343 -- Post Failure:
344 -- user session language is not changed
345 --
346 --
347 -- Access Status:
348 -- Public - For Internal Development Use Only
349 --
350 -- {End Of Comments}
351 --
352 procedure set_session_language_code
353 ( p_language_code in fnd_languages.language_code%TYPE
354 );
355 --
356 -- ----------------------------------------------------------------------------
357 -- |---------------------------- set_session_nls_language --------------------|
358 -- ----------------------------------------------------------------------------
359 --
360 -- {Start Of Comments}
361 --
362 -- Description:
363 -- Set the session language from the nls language and clears the
364 -- key flex cache
365 --
366 -- Prerequisites:
367 --
368 -- In Parameters:
369 -- Name Reqd Type Description
370 -- ==== ==== ==== ===========
371 -- p_nls_language Yes varchar2 The nls language (NOT the 2 letter language code)
372 --
373 -- Post Success:
374 -- userev('LANG') is set to language code derived from nls language
375 --
376 -- Post Failure:
377 -- user session language is not changed
378 --
379 --
380 -- Access Status:
381 -- Public - For Internal Development Use Only
382 --
383 -- {End Of Comments}
384 --
385 procedure set_session_nls_language
386 ( p_nls_language in fnd_languages.nls_language%TYPE
387 );
388 end hr_kflex_utility;