DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_SG_ORG_INFO_LEG_HOOK

Source


4    g_package      VARCHAR2(25);
1 PACKAGE BODY per_sg_org_info_leg_hook AS
2 /* $Header: pesglhoi.pkb 120.0 2011/03/29 00:08:55 jalin noship $ */
3 
5    g_debug        BOOLEAN;
6    g_token_name   char_tab_type;
7    g_token_value  char_tab_type;
8    g_message_name VARCHAR2(30);
9 
10  --------------------------------------------------------------------------
11 -- Name           : CHECK_RECORD_EXISTS                                 --
12 -- Type           : Procedure                                           --
13 -- Access         : Private                                             --
14 -- Description    : Procedure is the driver procedure for the validation--
15 --                  of the Organizaition Information data for the       --
16 --                  context SG_MULTI_CSN.                               --
17 -- Parameters     :                                                     --
18 --             IN :       p_org_information_id   IN NUMBER              --
19 --                        p_org_info_type_code   IN VARCHAR2            --
20 --                        p_org_information1     IN VARCHAR2            --
21 --------------------------------------------------------------------------
22 
23 PROCEDURE check_record_exists(p_org_information_id   IN NUMBER
24                              ,p_organization_id      IN NUMBER
25                              ,p_org_info_type_code   IN VARCHAR2
26                              ,p_org_information1     IN VARCHAR2
27 			     )
28 AS
29 
30     l_csn_count NUMBER;
31     l_fut_date  DATE;
32 
33     CURSOR csr_check_csn
34     IS
35       SELECT count(org_information_id)
36       FROM hr_organization_information
37       WHERE org_information_context= 'SG_LEGAL_ENTITY'
38         AND org_information10 = p_org_information1
39        AND organization_id = p_organization_id
40        AND (org_information_id  <> p_org_information_id
41             OR p_org_information_id IS NULL);
42 
43     CURSOR csr_check_csn_multi
44     IS
45       SELECT count(org_information_id)
46       FROM hr_organization_information
47       WHERE org_information_context= 'SG_MULTI_CSN'
48         AND org_information1 = p_org_information1
49        AND organization_id = p_organization_id
53 
50        AND (org_information_id  <> p_org_information_id
51             OR p_org_information_id IS NULL);
52 
54     l_procedure  VARCHAR2(100);
55 
56 BEGIN
57 
58    l_procedure := g_package || 'check_record_exists';
59    g_debug := hr_utility.debug_enabled;
60    g_debug := TRUE;
61 
62    hr_utility.set_location('Entering ' || l_procedure,10);
63 
64    IF p_org_info_type_code = 'SG_MULTI_CSN' THEN
65 
66       IF g_debug THEN
67          hr_utility.trace('Checking CSN has been entered in SG Legal Entity');
68       END IF;
69 
70       OPEN  csr_check_csn;
71       FETCH csr_check_csn INTO l_csn_count;
72       CLOSE csr_check_csn;
73 
74       IF l_csn_count > 0 THEN
75 
76         IF g_debug THEN
77            hr_utility.trace('CSN has been entered in SG Legal Entity');
78         END IF;
79 
80         hr_utility.set_message(801,'HR_78428_SG_CSN_ENT_LE');
81         hr_utility.raise_error;
82 
83       END IF;
84 
85 
86       IF g_debug THEN
87          hr_utility.trace('Ended Checking CSN has been entered in SG Legal Entity');
88       END IF;
89 
90       l_csn_count := 0;
91       IF g_debug THEN
92          hr_utility.trace('Checking CSN has been entered duplicate');
93       END IF;
94 
95       OPEN  csr_check_csn_multi;
96       FETCH csr_check_csn_multi INTO l_csn_count;
97       CLOSE csr_check_csn_multi;
98 
99       IF l_csn_count > 0 THEN
100 
101         IF g_debug THEN
102            hr_utility.trace('CSN has been entered duplicate');
103         END IF;
104 
105         hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
106         hr_utility.raise_error;
107 
108       END IF;
109 
110 
111       IF g_debug THEN
112          hr_utility.trace('Ended Checking CSN has been entered duplicate');
113       END IF;
114 
115 
116    END IF;
117 
118    hr_utility.set_location('Leaving ' || l_procedure,30);
119 
120 END  check_record_exists;
121 
122 --------------------------------------------------------------------------
123 -- Name           : CHECK_VALID_CSN                                 --
124 -- Type           : Procedure                                           --
125 -- Access         : Private                                             --
126 -- Description    : Procedure is the driver procedure for the validation--
127 --                  of the Organizaition Information data for the       --
128 --                  context SG_LEGAL_ENTITY                             --
129 -- Parameters     :                                                     --
130 --             IN :       p_org_information_id   IN NUMBER              --
131 --                        p_org_info_type_code   IN VARCHAR2            --
132 --                        p_org_information10    IN VARCHAR2 csn        --
133 --                        p_org_information15    IN VARCHAR2 er_payer_id--
134 --                        p_org_information3     IN VARCHAR2 er_cpf_category    --
135 --------------------------------------------------------------------------
136 
137 PROCEDURE check_valid_csn(p_org_information_id   IN NUMBER
138                              ,p_organization_id      IN NUMBER
139                              ,p_org_info_type_code   IN VARCHAR2
140                              ,p_org_information10    IN VARCHAR2
141                              ,p_org_information3     IN VARCHAR2
142                              ,p_org_information15    IN VARCHAR2
143                  )
144 AS
145 
146     l_return        varchar2(1);
147 
148     l_procedure  VARCHAR2(100);
149 
150 BEGIN
151 
152    l_procedure := g_package || 'check_valid_csn';
153    g_debug := hr_utility.debug_enabled;
154    g_debug := TRUE;
155 
156    hr_utility.set_location('Entering ' || l_procedure,10);
157 
158    IF p_org_info_type_code = 'SG_LEGAL_ENTITY' THEN
159 
160       IF g_debug THEN
161          hr_utility.trace('Checking correct CSN format of Legal Entity');
162       END IF;
163 
164       l_return := pay_sg_cpfline.check_cpf_number(p_org_information10
165                                               ,p_org_information3
166                                               ,p_org_information15);
167       IF l_return = 'N' THEN
168 
169         IF g_debug THEN
170            hr_utility.trace('CSN format of Legal Entity is incorrect');
171         END IF;
172 
173         hr_utility.set_message(801,'HR_78427_SG_INVALID_CSN');
174         hr_utility.raise_error;
175 
176       END IF;
177    END IF;
178 
179    hr_utility.set_location('Leaving ' || l_procedure,30);
180 
181 END  check_valid_csn;
182 
183 --------------------------------------------------------------------------
184 -- Name           : CHECK_VALID_CSN_MULTI                               --
185 -- Type           : Procedure                                           --
186 -- Access         : Private                                             --
187 -- Description    : Procedure is the driver procedure for the validation--
188 --                  of the Organizaition Information data for the       --
189 --                  context SG_LEGAL_ENTITY                             --
190 -- Parameters     :                                                     --
191 --             IN :       p_org_information_id   IN NUMBER              --
192 --                        p_org_info_type_code   IN VARCHAR2            --
193 --                        p_org_information1     IN VARCHAR2   csn     --
197                              ,p_organization_id      IN NUMBER
194 --------------------------------------------------------------------------
195 
196 PROCEDURE check_valid_csn_multi(p_org_information_id   IN NUMBER
198                              ,p_org_info_type_code   IN VARCHAR2
199                              ,p_org_information1     IN VARCHAR2
200                  )
201 AS
202 
203       l_return        varchar2(1);
204       l_cpf_category  varchar2(20);
205       l_payer_id      varchar2(20);
206 
207 
208     CURSOR csr_get_payer_id_category
209     IS
210       SELECT org_information3,
211              org_information15
212       FROM hr_organization_information
213       WHERE org_information_context= 'SG_LEGAL_ENTITY'
214        AND organization_id = p_organization_id;
215 
216     l_procedure  VARCHAR2(100);
217 
218 BEGIN
219 
220    l_procedure := g_package || 'check_valid_csn_multi';
221    g_debug := hr_utility.debug_enabled;
222    g_debug := TRUE;
223 
224    hr_utility.set_location('Entering ' || l_procedure,10);
225 
226    IF p_org_info_type_code = 'SG_MULTI_CSN' THEN
227 
228       IF g_debug THEN
229          hr_utility.trace('Checking if CSN format of Multi CSN is correct');
230       END IF;
231 
232       OPEN  csr_get_payer_id_category;
233       FETCH csr_get_payer_id_category INTO l_cpf_category,l_payer_id;
234       CLOSE csr_get_payer_id_category;
235 
236       l_return := pay_sg_cpfline.check_cpf_number(p_org_information1
237                                               ,l_cpf_category
238                                               ,l_payer_id);
239       IF l_return = 'N' THEN
240 
241         IF g_debug THEN
242           hr_utility.trace('CSN format of Multi CSN is incorrect');
243         END IF;
244 
245         hr_utility.set_message(801,'HR_78427_SG_INVALID_CSN');
246         hr_utility.raise_error;
247 
248       END IF;
249 
250    END IF;
251 
252    hr_utility.set_location('Leaving ' || l_procedure,30);
253 
254 END  check_valid_csn_multi;
255 
256 
257 
258 --------------------------------------------------------------------------
259 -- Name           : check_sg_org_info_internal                          --
260 -- Type           : Procedure                                           --
261 -- Access         : Private                                             --
262 -- Description    : Internal Proc  to be called from the Org Info Hook  --
263 -- Parameters     :                                                     --
264 --             IN :       p_effective_date         IN DATE              --
265 --                        p_organization_id        IN NUMBER            --
266 --                        p_org_info_type_code     IN VARCHAR2          --
267 --		          p_org_information1..20   IN VARCHAR2          --
268 --------------------------------------------------------------------------
269 PROCEDURE check_sg_org_internal
270         (p_org_info_type_code IN VARCHAR2 --Organization Information type
271         ,p_org_information_id IN NUMBER   --Organization Information ID
272         ,p_organization_id    IN NUMBER   --Organization ID
273         ,p_org_information1   IN VARCHAR2
274         ,p_org_information2   IN VARCHAR2
275         ,p_org_information3   IN VARCHAR2
276         ,p_org_information4   IN VARCHAR2
277         ,p_org_information5   IN VARCHAR2
278         ,p_org_information6   IN VARCHAR2
279         ,p_org_information7   IN VARCHAR2
280         ,p_org_information8   IN VARCHAR2
281         ,p_org_information9   IN VARCHAR2
282         ,p_org_information10  IN VARCHAR2
283         ,p_org_information11  IN VARCHAR2
284         ,p_org_information12  IN VARCHAR2
285         ,p_org_information13  IN VARCHAR2
286         ,p_org_information14  IN VARCHAR2
287         ,p_org_information15  IN VARCHAR2
288         ,p_org_information16  IN VARCHAR2
289         ,p_org_information17  IN VARCHAR2
290         ,p_org_information18  IN VARCHAR2
291         ,p_org_information19  IN VARCHAR2
292         ,p_org_information20  IN VARCHAR2
293         ,p_message_name       OUT NOCOPY VARCHAR2
294         ,p_token_name         OUT NOCOPY char_tab_type
295         ,p_token_value        OUT NOCOPY char_tab_type
296         )
297 IS
298 
299    l_procedure   VARCHAR2(100);
300    l_start_date  DATE;
301    l_end_date    DATE;
302 
303 BEGIN
304 
305   l_procedure := g_package || 'check_sg_org_internal';
306   g_debug := hr_utility.debug_enabled;
307 
308   hr_utility.set_location('Entering ' || l_procedure,10);
309 
310   IF p_org_info_type_code = 'SG_MULTI_CSN' THEN
311 
312        check_record_exists(p_org_information_id   => p_org_information_id
313                           ,p_organization_id      => p_organization_id
314                           ,p_org_info_type_code   => p_org_info_type_code
315                           ,p_org_information1     => p_org_information1
316 			  );
317 
318        check_valid_csn_multi(p_org_information_id   => p_org_information_id
319                             ,p_organization_id      => p_organization_id
320                             ,p_org_info_type_code   => p_org_info_type_code
321                             ,p_org_information1    => p_org_information1
322               );
323 
324 
325   END IF;
326 
327   IF p_org_info_type_code = 'SG_LEGAL_ENTITY' THEN
328 
329        check_valid_csn(p_org_information_id   => p_org_information_id
330                       ,p_organization_id      => p_organization_id
331                       ,p_org_info_type_code   => p_org_info_type_code
335               );
332                       ,p_org_information10    => p_org_information10
333                       ,p_org_information3     => p_org_information3
334                       ,p_org_information15    => p_org_information15
336 
337   END IF;
338 
339   hr_utility.set_location('Leaving ' || l_procedure,10);
340 
341 END check_sg_org_internal;
342 
343 --------------------------------------------------------------------------
344 -- Name           : check_sg_org_info_type_create                       --
345 -- Type           : Procedure                                           --
346 -- Access         : Public                                              --
347 -- Description    : Main Procedure to be called from the Org Info Hook  --
348 -- Parameters     :                                                     --
349 --             IN :       p_effective_date         IN DATE              --
350 --                        p_organization_id        IN NUMBER            --
351 --                        p_org_info_type_code     IN VARCHAR2          --
352 --		          p_org_information1..20   IN VARCHAR2          --
353 --------------------------------------------------------------------------
354 PROCEDURE check_sg_org_info_type_create
355         (p_org_info_type_code IN VARCHAR2 --Organization Information type
356         ,p_organization_id    IN NUMBER   --Organization ID
357         ,p_org_information1   IN VARCHAR2
358         ,p_org_information2   IN VARCHAR2
359         ,p_org_information3   IN VARCHAR2
360         ,p_org_information4   IN VARCHAR2
361         ,p_org_information5   IN VARCHAR2
362         ,p_org_information6   IN VARCHAR2
363         ,p_org_information7   IN VARCHAR2
364         ,p_org_information8   IN VARCHAR2
365         ,p_org_information9   IN VARCHAR2
366         ,p_org_information10  IN VARCHAR2
367         ,p_org_information11  IN VARCHAR2
368         ,p_org_information12  IN VARCHAR2
369         ,p_org_information13  IN VARCHAR2
370         ,p_org_information14  IN VARCHAR2
371         ,p_org_information15  IN VARCHAR2
372         ,p_org_information16  IN VARCHAR2
373         ,p_org_information17  IN VARCHAR2
374         ,p_org_information18  IN VARCHAR2
375         ,p_org_information19  IN VARCHAR2
376         ,p_org_information20  IN VARCHAR2
377         )
378 IS
379 
380       l_procedure         VARCHAR2(100);
381 
382 BEGIN
383         l_procedure := g_package || 'check_sg_org_info_type_create';
384         g_debug := hr_utility.debug_enabled;
385 
386         hr_utility.set_location('Entering ' || l_procedure,10);
387 
388 	-- Call check_sg_org_internal
389         check_sg_org_internal
390         (p_org_info_type_code => p_org_info_type_code
391         ,p_org_information_id => NULL
392         ,p_organization_id    => p_organization_id
393         ,p_org_information1   => p_org_information1
394         ,p_org_information2   => p_org_information2
395         ,p_org_information3   => p_org_information3
396         ,p_org_information4   => p_org_information4
397         ,p_org_information5   => p_org_information5
398         ,p_org_information6   => p_org_information6
399         ,p_org_information7   => p_org_information7
400         ,p_org_information8   => p_org_information8
401         ,p_org_information9   => p_org_information9
402         ,p_org_information10  => p_org_information10
403         ,p_org_information11  => p_org_information11
404         ,p_org_information12  => p_org_information12
405         ,p_org_information13  => p_org_information13
406         ,p_org_information14  => p_org_information14
407         ,p_org_information15  => p_org_information15
408         ,p_org_information16  => p_org_information16
409         ,p_org_information17  => p_org_information17
410         ,p_org_information18  => p_org_information18
411         ,p_org_information19  => p_org_information19
412         ,p_org_information20  => p_org_information20
413         ,p_message_name       => g_message_name
414         ,p_token_name         => g_token_name
415         ,p_token_value        => g_token_value
416         );
417 
418         hr_utility.set_location(l_procedure,20);
419 
420 	    IF g_debug THEN
421 	      hr_utility.trace('Message => ' || g_message_name);
422 	    END IF;
423 
424         raise_message(800
425                      ,g_message_name
426                      ,g_token_name
427                      ,g_token_value);
428 
429         hr_utility.set_location('Leaving ' || l_procedure,20);
430 
431 END CHECK_SG_ORG_INFO_TYPE_CREATE;
432 
433 --------------------------------------------------------------------------
434 -- Name           : check_sg_org_info_type_update                       --
435 -- Type           : Procedure                                           --
436 -- Access         : Public                                              --
437 -- Description    : Main Procedure to be called from the Org Info Hook  --
438 -- Parameters     :                                                     --
439 --             IN :       p_effective_date         IN DATE              --
440 --                        p_organization_id        IN NUMBER            --
441 --                        p_org_info_type_code     IN VARCHAR2          --
442 --		          p_org_information1..20   IN VARCHAR2          --
443 --------------------------------------------------------------------------
444 PROCEDURE CHECK_SG_ORG_INFO_TYPE_UPDATE
445         (p_org_info_type_code IN VARCHAR2 --Organization Information type
446         ,p_org_information_id IN NUMBER   --Organization Information ID
447         ,p_org_information1   IN VARCHAR2
448         ,p_org_information2   IN VARCHAR2
449         ,p_org_information3   IN VARCHAR2
450         ,p_org_information4   IN VARCHAR2
454         ,p_org_information8   IN VARCHAR2
451         ,p_org_information5   IN VARCHAR2
452         ,p_org_information6   IN VARCHAR2
453         ,p_org_information7   IN VARCHAR2
455         ,p_org_information9   IN VARCHAR2
456         ,p_org_information10  IN VARCHAR2
457         ,p_org_information11  IN VARCHAR2
458         ,p_org_information12  IN VARCHAR2
459         ,p_org_information13  IN VARCHAR2
460         ,p_org_information14  IN VARCHAR2
461         ,p_org_information15  IN VARCHAR2
462         ,p_org_information16  IN VARCHAR2
463         ,p_org_information17  IN VARCHAR2
464         ,p_org_information18  IN VARCHAR2
468 IS
465         ,p_org_information19  IN VARCHAR2
466         ,p_org_information20  IN VARCHAR2
467         )
469       l_organization_id   NUMBER;
470       l_procedure         VARCHAR2(100);
471       l_org_information1  VARCHAR2(150);
472       l_org_information2  VARCHAR2(150);
473       l_org_information3  VARCHAR2(150);
474       l_org_information4  VARCHAR2(150);
475       l_org_information5  VARCHAR2(150);
476       l_org_information6  VARCHAR2(150);
477       l_org_information7  VARCHAR2(150);
478       l_org_information8  VARCHAR2(150);
479       l_org_information9  VARCHAR2(150);
480       l_org_information10 VARCHAR2(150);
481       l_org_information11 VARCHAR2(150);
482       l_org_information12 VARCHAR2(150);
483       l_org_information13 VARCHAR2(150);
484       l_org_information14 VARCHAR2(150);
485       l_org_information15 VARCHAR2(150);
486       l_org_information16 VARCHAR2(150);
487       l_org_information17 VARCHAR2(150);
488       l_org_information18 VARCHAR2(150);
489       l_org_information19 VARCHAR2(150);
490       l_org_information20 VARCHAR2(150);
491 
492       CURSOR csr_org_info
493       IS
494         SELECT organization_id
495 	      ,org_information1
496 	      ,org_information2
497 	      ,org_information3
498 	      ,org_information4
499 	      ,org_information5
500 	      ,org_information6
501 	      ,org_information7
502 	      ,org_information8
503 	      ,org_information9
504 	      ,org_information10
505 	      ,org_information11
506 	      ,org_information12
507 	      ,org_information13
508 	      ,org_information14
509 	      ,org_information15
510 	      ,org_information16
511 	      ,org_information17
512 	      ,org_information18
513 	      ,org_information19
514 	      ,org_information20
515 	FROM  hr_organization_information
516 	WHERE org_information_id = p_org_information_id;
517 
518 BEGIN
519 
520        l_procedure := g_package || 'check_sg_org_info_type_update';
521        g_debug := hr_utility.debug_enabled;
522 
523        hr_utility.set_location('Entering ' || l_procedure,10);
524 
525        OPEN csr_org_info;
526        FETCH csr_org_info
527        INTO l_organization_id
528            ,l_org_information1
529            ,l_org_information2
530            ,l_org_information3
531            ,l_org_information4
532            ,l_org_information5
533            ,l_org_information6
534            ,l_org_information7
535            ,l_org_information8
536            ,l_org_information9
537            ,l_org_information10
538            ,l_org_information11
539            ,l_org_information12
540            ,l_org_information13
541            ,l_org_information14
542            ,l_org_information15
543            ,l_org_information16
544            ,l_org_information17
545            ,l_org_information18
546            ,l_org_information19
547            ,l_org_information20 ;
548        CLOSE csr_org_info;
549 
550        IF NVL(p_org_information1,'X') <> hr_api.g_varchar2 THEN
551           l_org_information1 := p_org_information1;
552        END IF;
553        IF NVL(p_org_information2,'X') <> hr_api.g_varchar2 THEN
554           l_org_information2 := p_org_information2;
555        END IF;
556        IF NVL(p_org_information3,'X') <> hr_api.g_varchar2 THEN
557           l_org_information3 := p_org_information3;
558        END IF;
559        IF NVL(p_org_information4,'X') <> hr_api.g_varchar2 THEN
560           l_org_information4 := p_org_information4;
561        END IF;
562        IF NVL(p_org_information5,'X') <> hr_api.g_varchar2 THEN
563           l_org_information5 := p_org_information5;
564        END IF;
565        IF NVL(p_org_information6,'X') <> hr_api.g_varchar2 THEN
566           l_org_information6 := p_org_information6;
567        END IF;
568        IF NVL(p_org_information7,'X') <> hr_api.g_varchar2 THEN
572           l_org_information8 := p_org_information8;
569           l_org_information7 := p_org_information7;
570        END IF;
571        IF NVL(p_org_information8,'X') <> hr_api.g_varchar2 THEN
573        END IF;
574        IF NVL(p_org_information9,'X') <> hr_api.g_varchar2 THEN
575           l_org_information9 := p_org_information9;
576        END IF;
577        IF NVL(p_org_information10,'X') <> hr_api.g_varchar2 THEN
578           l_org_information10 := p_org_information10;
579        END IF;
580        IF NVL(p_org_information11,'X') <> hr_api.g_varchar2 THEN
581           l_org_information11 := p_org_information11;
582        END IF;
583        IF NVL(p_org_information12,'X') <> hr_api.g_varchar2 THEN
584           l_org_information12 := p_org_information12;
585        END IF;
586        IF NVL(p_org_information13,'X') <> hr_api.g_varchar2 THEN
587           l_org_information13 := p_org_information13;
588        END IF;
589        IF NVL(p_org_information14,'X') <> hr_api.g_varchar2 THEN
590           l_org_information14 := p_org_information14;
591        END IF;
592        IF NVL(p_org_information15,'X') <> hr_api.g_varchar2 THEN
593           l_org_information15 := p_org_information15;
594        END IF;
595        IF NVL(p_org_information16,'X') <> hr_api.g_varchar2 THEN
596           l_org_information16 := p_org_information16;
597        END IF;
598        IF NVL(p_org_information17,'X') <> hr_api.g_varchar2 THEN
599           l_org_information17 := p_org_information17;
600        END IF;
601        IF NVL(p_org_information18,'X') <> hr_api.g_varchar2 THEN
602           l_org_information18 := p_org_information18;
603        END IF;
604        IF NVL(p_org_information19,'X') <> hr_api.g_varchar2 THEN
605           l_org_information19 := p_org_information19;
606        END IF;
607        IF NVL(p_org_information20,'X') <> hr_api.g_varchar2 THEN
608           l_org_information20 := p_org_information20;
609        END IF;
610 
611        -- Call check_sg_org_internal
612        check_sg_org_internal
613         (p_org_info_type_code => p_org_info_type_code
614         ,p_org_information_id => p_org_information_id
615         ,p_organization_id    => l_organization_id
616         ,p_org_information1   => l_org_information1
617         ,p_org_information2   => l_org_information2
618         ,p_org_information3   => l_org_information3
619         ,p_org_information4   => l_org_information4
620         ,p_org_information5   => l_org_information5
621         ,p_org_information6   => l_org_information6
622         ,p_org_information7   => l_org_information7
623         ,p_org_information8   => l_org_information8
624         ,p_org_information9   => l_org_information9
625         ,p_org_information10  => l_org_information10
626         ,p_org_information11  => l_org_information11
627         ,p_org_information12  => l_org_information12
628         ,p_org_information13  => l_org_information13
629         ,p_org_information14  => l_org_information14
630         ,p_org_information15  => l_org_information15
631         ,p_org_information16  => l_org_information16
632         ,p_org_information17  => l_org_information17
633         ,p_org_information18  => l_org_information18
634         ,p_org_information19  => l_org_information19
635         ,p_org_information20  => l_org_information20
636         ,p_message_name       => g_message_name
637         ,p_token_name         => g_token_name
638         ,p_token_value        => g_token_value
639         );
640 
641 	    hr_utility.set_location(l_procedure,20);
642 
643         raise_message(800
644                      ,g_message_name
645                      ,g_token_name
646                      ,g_token_value);
647 
648         hr_utility.set_location('Leaving ' || l_procedure,30);
649 
650 END CHECK_SG_ORG_INFO_TYPE_UPDATE;
651 
652 --------------------------------------------------------------------------
653 --                                                                      --
654 -- Name           : RAISE_MESSAGE                                       --
655 -- Type           : PROCEDURE                                           --
656 -- Access         : Public                                              --
657 -- Description    : Procedure to raise the error message                --
658 --                                                                      --
659 -- Parameters     :                                                     --
660 --             IN : p_application_id      NUMBER                        --
661 --                  p_message_name        VARCHAR2                      --
662 --                  p_token_name          CHAR_TAB_TYPE                 --
663 --                  p_token_value         CHAR_TAB_TYPE                 --
664 --                                                                      --
665 --------------------------------------------------------------------------
666 PROCEDURE raise_message(p_application_id IN NUMBER
667               ,p_message_name IN VARCHAR2
668               ,p_token_name   IN OUT NOCOPY char_tab_type
669               ,p_token_value  IN OUT NOCOPY char_tab_type
670               )IS
671          cnt NUMBER;
672 BEGIN
673 
674     IF p_message_name IS NOT NULL AND p_message_name <> 'SUCCESS' THEN
675        cnt:= p_token_name.count;
676        hr_utility.set_message(p_application_id, p_message_name);
677        FOR i IN 1..cnt
678        LOOP
679            hr_utility.set_message_token(p_token_name(i),p_token_value(i));
680        END LOOP;
681        hr_utility.raise_error;
682     END IF;
683 
684 END raise_message;
685 
686 
687 BEGIN
688 
689     g_package := 'per_sg_org_info_leg_hook.';
690 
691 END per_sg_org_info_leg_hook;