DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_USER_ROWS_PKG

Source


1 PACKAGE BODY PAY_USER_ROWS_PKG AS
2 /* $Header: pyusr01t.pkb 120.1 2005/07/29 05:09:07 shisriva noship $ */
3 
4 --
5 g_dummy	number(1);	-- Dummy for cursor returns which are not needed
6 g_user_table_id number(9); -- For validating translation;
7 g_business_group_id number(15); -- For validating translation;
8 g_legislation_code varchar2(150); -- For validating translation;
9 --
10 --
11 -- Overloaded check_unique procedure to accept p_validation_start_date and
12 -- p_validation_end_date to check the uniquness of row_low_range_or_name
13 -- only in validation range.Bug No 3734910.
14 --
15 procedure check_unique ( p_rowid                 in varchar2,
16                          p_user_table_id         in number,
17                          p_user_row_id           in number,
18                          p_row_low_range_or_name in varchar2,
19                          p_business_group_id     in number ,
20 			 p_validation_start_date in date ,
21 			 p_validation_end_date   in date) is
22 
23 cursor c1 is
24   select '1'
25   from   pay_user_rows_f  usr
26   where  usr.user_table_id                = p_user_table_id
27   and    upper(usr.row_low_range_or_name) = upper(p_row_low_range_or_name)
28   and    ( p_rowid is null
29 	  or ( p_rowid is not null and usr.user_row_id <> p_user_row_id ) )
30   and    ((usr.effective_start_date between p_validation_start_date and p_validation_end_date)
31            or (usr.effective_end_date between p_validation_start_date and p_validation_end_date)
32 	   or (usr.effective_start_date < p_validation_start_date and usr.effective_end_date > p_validation_end_date))
33   and    ( usr.business_group_id is null
34           or ( usr.business_group_id = p_business_group_id ) );
35  l_dummy varchar2(255) ;
36 begin
37 --
38 
39      open c1 ;
40      fetch c1 into l_dummy ;
41      if  c1%found
42      then close c1 ;
43           fnd_message.set_name( 'PAY' , 'PAY_7884_USER_TABLE_UNIQUE' ) ;
44           fnd_message.raise_error ;
45      end if ;
46      close c1 ;
47 end  check_unique;
48 
49 
50 
51 procedure check_unique ( p_rowid                 in varchar2,
52                          p_user_table_id         in number,
53                          p_user_row_id           in number,
54                          p_row_low_range_or_name in varchar2,
55                          p_business_group_id     in number ) is
56 --
57 --  JBARKER, bug #2608226
58 --  changed following cursor to reference table instead of view pay_user_rows
59 --  to remove date comparison
60 --
61 cursor c1 is
62   select '1'
63   from   pay_user_rows_f  usr
64   where  usr.user_table_id                = p_user_table_id
65   and    upper(usr.row_low_range_or_name) = upper(p_row_low_range_or_name)
66   and    ( p_rowid is null
67 	  or ( p_rowid is not null and usr.user_row_id <> p_user_row_id ) )
68   and    ( usr.business_group_id is null
69           or ( usr.business_group_id = p_business_group_id ) );
70  l_dummy varchar2(255) ;
71 begin
72 --
73 
74      open c1 ;
75      fetch c1 into l_dummy ;
76      if  c1%found
77      then close c1 ;
78           fnd_message.set_name( 'PAY' , 'PAY_7884_USER_TABLE_UNIQUE' ) ;
79           fnd_message.raise_error ;
80      end if ;
81      close c1 ;
82 end  check_unique;
83 --
84 
85 --
86 -- Overloaded check_overlap procedure to accept p_validation_start_date and
87 -- p_validation_end_date to check for overlapping ranges which lie in the
88 -- validation range.Bug No 3734910.
89 --
90 
91 procedure check_overlap (p_rowid                 in varchar2,
92                          p_user_table_id         in number,
93                          p_user_row_id           in number,
94                          p_row_low_range_or_name in varchar2,
95                          p_row_high_range        in varchar2,
96                          p_business_group_id     in number,
97 			 p_validation_start_date in date,
98 			 p_validation_end_date   in date) is
99 --
100 cursor csr_row_overlap is
101   select '1'
102   from   pay_user_rows_f usr
103   where  usr.user_table_id = p_user_table_id
104   and    (usr.business_group_id is null
105   or     (usr.business_group_id = p_business_group_id))
106   and    ((usr.effective_start_date between p_validation_start_date and p_validation_end_date)
107            or (usr.effective_end_date between p_validation_start_date and p_validation_end_date)
108 	   or (usr.effective_start_date < p_validation_start_date and usr.effective_end_date > p_validation_end_date))
109   and    (p_rowid is null
110   or     (p_rowid is not null
111   and    usr.user_row_id <> p_user_row_id))
112   and    (fnd_number.canonical_to_number(p_row_low_range_or_name) between
113           fnd_number.canonical_to_number(usr.row_low_range_or_name) and fnd_number.canonical_to_number(usr.row_high_range)
114   or     (fnd_number.canonical_to_number(p_row_high_range) between
115           fnd_number.canonical_to_number(usr.row_low_range_or_name) and fnd_number.canonical_to_number(usr.row_high_range))
116   or     (fnd_number.canonical_to_number(usr.row_low_range_or_name) > fnd_number.canonical_to_number(p_row_low_range_or_name)
117      and fnd_number.canonical_to_number(usr.row_high_range) < fnd_number.canonical_to_number(p_row_high_range))
118   );
119 --
120 l_dummy varchar2(1);
121 --
122 begin
123 --
124 /*  Procedure is only called for Range comparisons which must be Numbers */
125   open  csr_row_overlap;
126   fetch csr_row_overlap into l_dummy;
127   if csr_row_overlap%found then
128     close csr_row_overlap;
129     fnd_message.set_name('PER','PER_34003_USER_ROW_OVERLAP');
130     fnd_message.raise_error;
131   end if;
132   close csr_row_overlap;
133 
134 end check_overlap;
135 --
136 
137 
138 
139 procedure check_overlap (p_rowid                 in varchar2,
140                          p_user_table_id         in number,
141                          p_user_row_id           in number,
142                          p_row_low_range_or_name in varchar2,
143                          p_row_high_range        in varchar2,
144                          p_business_group_id     in number) is
145 --
146 cursor csr_row_overlap is
147   select '1'
148   from   pay_user_rows usr
149   where  usr.user_table_id = p_user_table_id
150   and    (usr.business_group_id is null
151   or     (usr.business_group_id = p_business_group_id))
152   and    (p_rowid is null
153   or     (p_rowid is not null
154   and    usr.user_row_id <> p_user_row_id))
155   and    (fnd_number.canonical_to_number(p_row_low_range_or_name) between
156           fnd_number.canonical_to_number(usr.row_low_range_or_name) and fnd_number.canonical_to_number(usr.row_high_range)
157   or     (fnd_number.canonical_to_number(p_row_high_range) between
158           fnd_number.canonical_to_number(usr.row_low_range_or_name) and fnd_number.canonical_to_number(usr.row_high_range)));
159 --
160 l_dummy varchar2(1);
161 --
162 begin
163 --
164 /*  Procedure is only called for Range comparisons which must be Numbers */
165   open  csr_row_overlap;
166   fetch csr_row_overlap into l_dummy;
167   if csr_row_overlap%found then
168     close csr_row_overlap;
169     fnd_message.set_name('PER','PER_34003_USER_ROW_OVERLAP');
170     fnd_message.raise_error;
171   end if;
172   close csr_row_overlap;
173 
174 end check_overlap;
175 --
176 function range_end_date (p_user_table_id         in number,
177                          p_effective_start_date  in date,
178                          p_row_low_range_or_name in varchar2,
179                          p_row_high_range        in varchar2,
180                          p_business_group_id     in number)return date is
181 --
182 cursor csr_new_end_date is
183   select (min(usr.effective_start_date)-1)
184   from   pay_user_rows_f usr
185   where  usr.user_table_id = p_user_table_id
186   and    (usr.business_group_id is null
187   or     (usr.business_group_id = p_business_group_id))
188   and    usr.effective_start_date > p_effective_start_date
189   and    ((upper(lpad(p_row_low_range_or_name,80,'0')) between
190          upper(lpad(usr.row_low_range_or_name,80,'0')) and upper(lpad(nvl(usr.row_high_range,usr.row_low_range_or_name),80,'0')))
191   or     (upper(lpad(nvl(p_row_high_range,p_row_low_range_or_name),80,'0')) between
192          upper(lpad(usr.row_low_range_or_name,80,'0')) and upper(lpad(nvl(usr.row_high_range,usr.row_low_range_or_name),80,'0')))
193   or     (upper(lpad(usr.row_low_range_or_name,80,'0')) between
194          upper(lpad(p_row_low_range_or_name,80,'0')) and upper(lpad(nvl(p_row_high_range,p_row_low_range_or_name),80,'0')))
195   or     (upper(lpad(nvl(usr.row_high_range,usr.row_low_range_or_name),80,'0')) between
196          upper(lpad(p_row_low_range_or_name,80,'0')) and upper(lpad(nvl(p_row_high_range,p_row_low_range_or_name),80,'0'))));
197 --
198 l_eed date;
199 --
200 begin
201 --
202   open  csr_new_end_date;
203   fetch csr_new_end_date into l_eed;
204   if l_eed is null then
205     l_eed := hr_api.g_eot;
206   end if;
207   close csr_new_end_date;
208 --
209 return(l_eed);
210 --
211 end range_end_date;
212 --
213 function match_end_date(p_user_table_id         in number,
214                         p_effective_start_date  in date,
215                         p_row_low_range_or_name in varchar2,
216                         p_business_group_id     in number) return date is
217 --
218 cursor csr_new_match_end is
219   select (min(usr.effective_start_date)-1)
220   from   pay_user_rows_f usr
221   where  usr.user_table_id = p_user_table_id
222   and    (usr.business_group_id is null
223   or     (usr.business_group_id = p_business_group_id))
224   and    usr.effective_start_date > p_effective_start_date
225   and    upper(usr.row_low_range_or_name) = upper(p_row_low_range_or_name);
226 --
227 l_eed date;
228 --
229 begin
230 --
231   open  csr_new_match_end;
232   fetch csr_new_match_end into l_eed;
233   if l_eed is null then
234     l_eed := hr_api.g_eot;
235   end if;
236   close csr_new_match_end;
237 --
238 return(l_eed);
239 --
240 end match_end_date;
241 
242 
243 
244 --
245 -- Overloaded future_ranges_exist procedure to accept p_validation_start_date and
246 -- p_validation_end_date to check for future ranges only in validation range.
247 -- Also accepted user_row_id parameter to distinguish other records from future
248 -- updates of the row for which this function is called.
249 -- Bug No 3734910.
250 --
251 
252 function future_ranges_exist (p_user_table_id         in number,
253                               p_effective_start_date  in date,
254                               p_row_low_range_or_name in varchar2,
255                               p_row_high_range        in varchar2,
256                               p_business_group_id     in number,
257 			      p_user_row_id           in number,
258 			      p_validation_start_date in date,
259 			      p_validation_end_date   in date)return boolean is
260 --
261 cursor csr_rows_exist is
262   select '1'
263   from   pay_user_rows_f usr
264   where  usr.user_table_id = p_user_table_id
265   and    (usr.business_group_id is null
266   or     (usr.business_group_id = p_business_group_id))
267 
268   and    (usr.effective_start_date between p_validation_start_date and p_validation_end_date)
269   and    usr.user_row_id <> p_user_row_id
270   and    ((upper(lpad(p_row_low_range_or_name,80,'0')) between
271          upper(lpad(usr.row_low_range_or_name,80,'0')) and upper(lpad(nvl(usr.row_high_range,usr.row_low_range_or_name),80,'0')))
272   or     (upper(lpad(nvl(p_row_high_range,p_row_low_range_or_name),80,'0')) between
273          upper(lpad(usr.row_low_range_or_name,80,'0')) and upper(lpad(nvl(usr.row_high_range,usr.row_low_range_or_name),80,'0')))
274   or     (upper(lpad(usr.row_low_range_or_name,80,'0')) between
275          upper(lpad(p_row_low_range_or_name,80,'0')) and upper(lpad(nvl(p_row_high_range,p_row_low_range_or_name),80,'0')))
276   or     (upper(lpad(nvl(usr.row_high_range,usr.row_low_range_or_name),80,'0')) between
277          upper(lpad(p_row_low_range_or_name,80,'0')) and upper(lpad(nvl(p_row_high_range,p_row_low_range_or_name),80,'0'))));
278 --
279 l_dummy  varchar2(1);
280 l_exists boolean;
281 --
282 begin
283 --
284   open  csr_rows_exist;
285   fetch csr_rows_exist into l_dummy;
286   l_exists := csr_rows_exist%found;
287   close csr_rows_exist;
288 --
289 return(l_exists);
290 --
291 end future_ranges_exist;
292 
293 
294 
295 
296 
297 
298 --
299 function future_ranges_exist (p_user_table_id         in number,
300                               p_effective_start_date  in date,
301                               p_row_low_range_or_name in varchar2,
302                               p_row_high_range        in varchar2,
303                               p_business_group_id     in number)return boolean is
304 --
305 cursor csr_rows_exist is
306   select '1'
307   from   pay_user_rows_f usr
308   where  usr.user_table_id = p_user_table_id
309   and    (usr.business_group_id is null
310   or     (usr.business_group_id = p_business_group_id))
311   and    usr.effective_start_date > p_effective_start_date
312   and    ((upper(lpad(p_row_low_range_or_name,80,'0')) between
313          upper(lpad(usr.row_low_range_or_name,80,'0')) and upper(lpad(nvl(usr.row_high_range,usr.row_low_range_or_name),80,'0')))
314   or     (upper(lpad(nvl(p_row_high_range,p_row_low_range_or_name),80,'0')) between
315          upper(lpad(usr.row_low_range_or_name,80,'0')) and upper(lpad(nvl(usr.row_high_range,usr.row_low_range_or_name),80,'0')))
316   or     (upper(lpad(usr.row_low_range_or_name,80,'0')) between
317          upper(lpad(p_row_low_range_or_name,80,'0')) and upper(lpad(nvl(p_row_high_range,p_row_low_range_or_name),80,'0')))
318   or     (upper(lpad(nvl(usr.row_high_range,usr.row_low_range_or_name),80,'0')) between
319          upper(lpad(p_row_low_range_or_name,80,'0')) and upper(lpad(nvl(p_row_high_range,p_row_low_range_or_name),80,'0'))));
320 --
321 l_dummy  varchar2(1);
322 l_exists boolean;
323 --
324 begin
325 --
326   open  csr_rows_exist;
327   fetch csr_rows_exist into l_dummy;
328   l_exists := csr_rows_exist%found;
329   close csr_rows_exist;
330 --
331 return(l_exists);
332 --
333 end future_ranges_exist;
334 
335 
336 --
337 function future_matches_exist(p_user_table_id         in number,
338                               p_effective_start_date  in date,
339                               p_row_low_range_or_name in varchar2,
340 			      p_business_group_id     in number) return boolean is
341 --
342 cursor csr_matches_exist is
343   select '1'
344   from   pay_user_rows_f usr
345   where  usr.user_table_id = p_user_table_id
346   and    (usr.business_group_id is null
347   or     (usr.business_group_id = p_business_group_id))
348   and    usr.effective_start_date > p_effective_start_date
349   and    upper(usr.row_low_range_or_name) = upper(p_row_low_range_or_name);
350 --
351 l_dummy  varchar2(1);
352 l_exists boolean;
353 --
354 begin
355 --
356   open  csr_matches_exist;
357   fetch csr_matches_exist into l_dummy;
358   l_exists := csr_matches_exist%found;
359   close csr_matches_exist;
360 --
361 return(l_exists);
362 --
363 end future_matches_exist;
364 
365 
366 
367 
368 --
369 procedure get_seq ( p_user_row_id in out NOCOPY number ) is
370   cursor c1 is
371       select pay_user_rows_s.nextval
372       from   dual  ;
373 begin
374 --
375    open c1 ;
376    fetch c1 into p_user_row_id ;
377    close c1 ;
378 --
379 end get_seq ;
380 --
381 procedure pre_insert ( p_rowid                 in 		varchar2,
382                        p_user_table_id         in 		number,
383                        p_row_low_range_or_name in 		varchar2,
384 		       p_user_row_id           in out 	NOCOPY 	number,
385                        p_business_group_id     in 		number,
386 		       p_ghr_installed	       in 		varchar2 default 'N') is
387 begin
388 --
389   if ( p_ghr_installed = 'N' ) then
390   --
391   --  if GHR product component not installed then
392   --  check value is unique
393   --
394     check_unique( p_rowid                 => p_rowid,
395 		  p_user_table_id         => p_user_table_id,
396 		  p_user_row_id           => p_user_row_id,
397 		  p_row_low_range_or_name => p_row_low_range_or_name,
398                   p_business_group_id     => p_business_group_id ) ;
399   end if;
400 --
401    get_seq( p_user_row_id => p_user_row_id ) ;
402 --
403 end pre_insert ;
404 --
405 --  Checks whether the given delete is allowed.
406 procedure check_delete_row ( p_user_row_id           in number,
407 			     p_validation_start_date in date,
408 			     p_dt_delete_mode        in varchar2 ) is
409 --
410 --  Check for DATE EFFECTIVE DELETE
414 procedure check_dt_delete_row ( p_user_row_id           in number ,
411 --  Check there are no column instances which end
412 --  after the validation start date
413 --
415 	                        p_validation_start_date in date ) is
416 cursor c1 is
417    select null
418    from   pay_user_column_instances_f
419    where  user_row_id         = p_user_row_id
420    and    effective_end_date >= p_validation_start_date  ;
421 l_dummy varchar2(1) ;
422 begin
423    open c1 ;
424    fetch c1 into l_dummy ;
425    if c1%found then
426        close c1 ;
427        fnd_message.set_name( 'PAY', 'PAY_6982_USERTAB_END_VALUES' ) ;
428        fnd_message.raise_error ;
429    end if ;
430    close c1 ;
431 end check_dt_delete_row ;
432 --
433 --  Check for ZAP DELETE.
434 --  Check there are no column instances
435 --
436 procedure check_dt_zap_row ( p_user_row_id in number )  is
437 cursor c1 is
438    select null
439    from   pay_user_column_instances_f
440    where  user_row_id = p_user_row_id ;
441 l_dummy varchar2(1) ;
442 begin
443    open c1 ;
444    fetch c1 into l_dummy ;
445    if c1%found then
446        close c1 ;
447        fnd_message.set_name( 'PAY', 'HR_6980_USERTAB_VALUES_FIRST' ) ;
448        fnd_message.set_token( 'ROWCOL' , 'row' ) ;
449        fnd_message.raise_error ;
450    end if ;
451    close c1 ;
452 end check_dt_zap_row ;
453 --
454 -- MAIN PROCEDURE
455 --
456 begin
457 --
458   if p_dt_delete_mode = 'ZAP' then
459        check_dt_zap_row ( p_user_row_id ) ;
460   elsif p_dt_delete_mode = 'DELETE' then
461        check_dt_delete_row( p_user_row_id , p_validation_start_date ) ;
462   else
463        app_exception.invalid_argument('pay_user_rows_pkg.check_delete_row',
464 				      'p_dt_delete_mode',
465 				       p_dt_delete_mode ) ;
466   end if ;
467 --
468 end check_delete_row ;
469 --
470 --For MLS-----------------------------------------------------------------------
471 procedure ADD_LANGUAGE
472 is
473 begin
474   delete from PAY_USER_ROWS_F_TL T
475   where not exists
476     (select NULL
477      from PAY_USER_ROWS_F B
478      where B.USER_ROW_ID = T.USER_ROW_ID
479     );
480   update PAY_USER_ROWS_F_TL T
481   set (ROW_LOW_RANGE_OR_NAME) =
482   (select B.ROW_LOW_RANGE_OR_NAME
483    from PAY_USER_ROWS_F_TL B
484    where B.USER_ROW_ID = T.USER_ROW_ID
485    and B.LANGUAGE = T.SOURCE_LANG)
486   where (T.USER_ROW_ID,T.LANGUAGE) in
487   (select SUBT.USER_ROW_ID,SUBT.LANGUAGE
488     from PAY_USER_ROWS_F_TL SUBB, PAY_USER_ROWS_F_TL SUBT
489     where SUBB.USER_ROW_ID = SUBT.USER_ROW_ID
490     and SUBB.LANGUAGE = SUBT.SOURCE_LANG
491     and (SUBB.ROW_LOW_RANGE_OR_NAME <> SUBT.ROW_LOW_RANGE_OR_NAME
492   ));
493  insert into PAY_USER_ROWS_F_TL (
494     USER_ROW_ID,
495     ROW_LOW_RANGE_OR_NAME,
496     LAST_UPDATE_DATE,
497     LAST_UPDATED_BY,
498     LAST_UPDATE_LOGIN,
499     CREATED_BY,
500     CREATION_DATE,
501     LANGUAGE,
502     SOURCE_LANG
503   ) select
504     B.USER_ROW_ID,
505     B.ROW_LOW_RANGE_OR_NAME,
506     B.LAST_UPDATE_DATE,
507     B.LAST_UPDATED_BY,
508     B.LAST_UPDATE_LOGIN,
509     B.CREATED_BY,
510     B.CREATION_DATE,
511     L.LANGUAGE_CODE,
512     B.SOURCE_LANG
513   from PAY_USER_ROWS_F_TL B, FND_LANGUAGES L
514   where L.INSTALLED_FLAG in ('I', 'B')
515   and B.LANGUAGE = userenv('LANG')
516   and not exists
517     (select NULL
518     from PAY_USER_ROWS_F_TL T
519     where T.USER_ROW_ID = B.USER_ROW_ID
520     and T.LANGUAGE = L.LANGUAGE_CODE);
521 end ADD_LANGUAGE;
522 --
523 procedure TRANSLATE_ROW (
524    X_B_ROW_LOW_RANGE_OR_NAME in VARCHAR2,
525    X_B_LEGISLATION_CODE in VARCHAR2,
526    X_ROW_LOW_RANGE_OR_NAME in VARCHAR2,
527    X_OWNER in VARCHAR2
528 ) is
529 begin
530   UPDATE PAY_USER_ROWS_F_TL
531     SET ROW_LOW_RANGE_OR_NAME = nvl(X_ROW_LOW_RANGE_OR_NAME,ROW_LOW_RANGE_OR_NAME),
532         last_update_date = SYSDATE,
533         last_updated_by = decode(x_owner,'SEED',1,0),
534         last_update_login = 0,
535         source_lang = userenv('LANG')
536   WHERE userenv('LANG') IN (language,source_lang)
537     AND USER_ROW_ID in
538         (select USER_ROW_ID
539            from PAY_USER_ROWS_F
540           where nvl(ROW_LOW_RANGE_OR_NAME,'~null~')=nvl(X_B_ROW_LOW_RANGE_OR_NAME,'~null~')
541             and nvl(LEGISLATION_CODE,'~null~') = nvl(X_B_LEGISLATION_CODE,'~null~')
542             and BUSINESS_GROUP_ID is NULL);
543   if (sql%notfound) then
544   null;
545   end if;
546 end TRANSLATE_ROW;
547 --
548 --
549 PROCEDURE set_translation_globals(p_business_group_id IN NUMBER,
550                 		  p_legislation_code IN VARCHAR2,
551                                   p_user_table_id IN NUMBER) IS
552 BEGIN
553    g_business_group_id := p_business_group_id;
554    g_legislation_code := p_legislation_code;
555    g_user_table_id := p_user_table_id;
556 END;
557 --
558 procedure validate_translation(user_row_id	NUMBER,
559 			       language		VARCHAR2,
560 			       row_low_range_or_name	VARCHAR2,
561 			       p_business_group_id IN NUMBER DEFAULT NULL,
562 			       p_legislation_code IN VARCHAR2 DEFAULT NULL) IS
563 /*
564 
565 This procedure fails if a user_row translation is already present in
566 the table for a given language.  Otherwise, no action is performed.  It is
567 used to ensure uniqueness of translated user_row names.
568 
569 */
570 
571 --
572 -- This cursor implements the validation we require,
573 -- and expects that the various package globals are set before
577 cursor c_translation(p_language IN VARCHAR2,
574 -- the call to this procedure is made.  This is done from the
575 -- user-named trigger 'TRANSLATIONS' in the form
576 --
578                      p_row_low_range_or_name IN VARCHAR2,
579                      p_user_row_id IN NUMBER,
580                      p_user_table_id IN NUMBER,
581                      p_bus_grp_id IN NUMBER,
582 		     p_leg_code IN varchar2)  IS
583        select '1'
584 	from   pay_user_rows_f pur,
585 	       pay_user_rows_f_tl urt
586 	where  upper(urt.row_low_range_or_name) = upper(p_row_low_range_or_name)
587 	AND   pur.user_row_id = urt.user_row_id
588 	AND   (urt.user_row_id <> p_user_row_id OR p_user_row_id IS NULL)
589 	AND   pur.user_table_id   = p_user_table_id
590         AND   urt.language = p_language
591 	AND   (nvl(pur.business_group_id,-1) = nvl(p_bus_grp_id,-1) OR p_bus_grp_id IS NULL)
592 	AND   (nvl(pur.LEGISLATION_CODE,'~null~') = nvl(p_leg_code,'~null~') OR p_leg_code IS NULL);
593 
594        l_package_name VARCHAR2(80);
595        l_business_group_id NUMBER;
596        l_legislation_code VARCHAR2(150);
597 
598 
599 BEGIN
600    l_package_name  := 'PAY_user_rowS_PKG.VALIDATE_TRANSLATION';
601    l_business_group_id := p_business_group_id;
602    l_legislation_code  := p_legislation_code;
603    hr_utility.set_location (l_package_name,10);
604    OPEN c_translation(language, row_low_range_or_name,user_row_id,g_user_table_id,
605 		     l_business_group_id,l_legislation_code);
606       	hr_utility.set_location (l_package_name,50);
607        FETCH c_translation INTO g_dummy;
608 
609        IF c_translation%NOTFOUND THEN
610       	hr_utility.set_location (l_package_name,60);
611 	  CLOSE c_translation;
612        ELSE
613       	hr_utility.set_location (l_package_name,70);
614 	  CLOSE c_translation;
615 	  fnd_message.set_name('PAY','HR_TRANSLATION_EXISTS');
616 	  fnd_message.raise_error;
617        END IF;
618       	hr_utility.set_location ('Leaving:'||l_package_name,80);
619 END validate_translation;
620 --
621 --
622 
623 --------------------------------------------------------------------------
624 --
625 END PAY_USER_ROWS_PKG;