DBA Data[Home] [Help]

PACKAGE BODY: APPS.OE_HEADER_ADJ_SECURITY

Source


1 PACKAGE BODY OE_Header_Adj_Security AS
2 /* $Header: OEXXHADB.pls 115.18 2004/06/22 18:38:57 jvicenti ship $ */
3 
4 
5 --  Global constant holding the package name
6 
7 G_PKG_NAME                    CONSTANT VARCHAR2(30) := 'OE_Header_Adj_Security';
8 
9 g_header_id                   NUMBER := FND_API.G_MISS_NUM;
10 
11 -- LOCAL PROCEDURES
12 
13 FUNCTION Is_Op_Constrained
14 ( p_operation           IN VARCHAR2
15  , p_column_name         IN VARCHAR2 DEFAULT NULL
16  , p_record       IN OE_AK_HEADER_PRCADJS_V%ROWTYPE
17 , x_on_operation_action OUT NOCOPY NUMBER
18 
19 ) RETURN NUMBER IS
20 l_constraint_id	NUMBER;
21 l_grp	NUMBER;
22 l_result		NUMBER;
23 l_constrained_column	VARCHAR2(30);
24 l_audit_trail_enabled VARCHAR2(1) := OE_SYS_PARAMETERS.VALUE('AUDIT_TRAIL_ENABLE_FLAG');
25 l_code_level varchar2(6) := OE_CODE_CONTROL.GET_CODE_RELEASE_LEVEL;
26 l_order_booked_flag   VARCHAR2(1);
27 
28 CURSOR IS_ORDER_BOOKED(x_header_id NUMBER) IS
29        SELECT NVL(BOOKED_FLAG,'N')
30        FROM   OE_ORDER_HEADERS_ALL
31        WHERE  HEADER_ID = x_header_id;
32 
33 l_transaction_phase_code VARCHAR2(30);
34 --
35 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
36 --
37 BEGIN
38 
39 -- Bug 1755817: if header adjustment belongs to a different order, then
40 -- clear the cached results so that the cache is reset for
41 -- the new order
42 IF p_record.header_id <> g_header_id THEN
43    OE_PC_Constraints_Admin_Pvt.Clear_Cached_Results;
44    g_header_id := p_record.header_id;
45 END IF;
46 
47 IF l_code_level >= '110510' THEN
48    OE_Order_Cache.Load_Order_Header(p_record.header_id);
49    l_transaction_phase_code := oe_order_cache.g_header_rec.transaction_phase_code;
50 END IF;
51 
52 l_result := OE_PC_Constraints_Admin_PVT.Is_OP_constrained
53     ( p_responsibility_id     => nvl(fnd_global.resp_id, -1)
54     , p_application_id          => nvl(fnd_global.resp_appl_id,-1) --added for bug3631547
55     , p_operation   => p_operation
56     , p_qualifier_attribute => l_transaction_phase_code
57     , p_entity_id   => OE_PC_GLOBALS.G_ENTITY_HEADER_ADJ
58     , p_column_name => p_column_name
59     , p_check_all_cols_constraint  => g_check_all_cols_constraint
60     , p_is_caller_defaulting  => g_is_caller_defaulting
61     , p_use_cached_results    => 'Y'
62     , x_constraint_id    => l_constraint_id
63     , x_constraining_conditions_grp     => l_grp
64     , x_on_operation_action   => x_on_operation_action
65     );
66 
67 if l_result = OE_PC_GLOBALS.YES then
68 
69     IF g_check_all_cols_constraint = 'Y'
70        AND (p_operation = OE_PC_GLOBALS.UPDATE_OP
71             OR p_operation = OE_PC_GLOBALS.CREATE_OP)
72        AND x_on_operation_action = 0
73        AND p_column_name IS NOT NULL THEN
74         SELECT column_name
75         INTO l_constrained_column
76         FROM oe_pc_constraints
77         WHERE constraint_id = l_constraint_id;
78         if l_constrained_column is null then
79             RAISE FND_API.G_EXC_ERROR;
80         end if;
81     END IF;
82 
83 elsif l_result = OE_PC_GLOBALS.ERROR then
84 
85     raise FND_API.G_EXC_UNEXPECTED_ERROR;
86 
87 end if;
88 
89 g_check_all_cols_constraint := 'N';
90 
91 /* Start Versioning */
92 IF l_code_level >= '110510' AND
93   ( p_column_name = 'TRANSACTION_PHASE_CODE' OR
94     x_on_operation_action IN (.1,.2))THEN
95    OE_Versioning_Util.Check_Security(p_column_name => p_column_name,
96                    p_on_operation_action => x_on_operation_action);
97 END IF;
98 /* End Versioning */
99 
100 /* Start AuditTrail */
101 -- Code level should be OM-H and
102 -- Audit Trail Enabled
103 IF g_is_caller_defaulting = 'N' THEN
104 IF l_code_level >= '110508' and nvl(l_audit_trail_enabled,'D') <> 'D' and
105       nvl(l_transaction_phase_code,'F') = 'F' and
106       not OE_GLOBALS.G_HEADER_CREATED THEN
107    IF l_audit_trail_enabled = 'B' THEN  -- capture only for booked orders
108       OPEN IS_ORDER_BOOKED (p_record.header_id);
109       FETCH IS_ORDER_BOOKED INTO l_order_booked_flag;
110       CLOSE IS_ORDER_BOOKED;
111       IF l_order_booked_flag = 'Y' THEN
112          IF l_result = OE_PC_GLOBALS.YES THEN
113             IF x_on_operation_action = 1 THEN
114                -- set OUT result to NOT CONSTRAINED
115                IF l_debug_level  > 0 THEN
116                    oe_debug_pub.add(  'HEADER ADJUSTMENTS SECURITY - SETTING REQUIRES REASON TO TRUE' , 5 ) ;
117                END IF;
118                OE_GLOBALS.G_AUDIT_REASON_RQD_FLAG := 'Y';
119                OE_GLOBALS.G_AUDIT_HISTORY_RQD_FLAG := 'N';
120             ELSIF x_on_operation_action = 2 THEN
121                -- set OUT result to NOT CONSTRAINED
122                IF OE_GLOBALS.G_AUDIT_REASON_RQD_FLAG <> 'Y' then
123                   IF l_debug_level  > 0 THEN
124                       oe_debug_pub.add(  'HEADER ADJUSTMENTS SECURITY - SETTING REQUIRES HISTORY TO TRUE' , 5 ) ;
125                   END IF;
126 	          OE_GLOBALS.G_AUDIT_HISTORY_RQD_FLAG := 'Y';
127                END IF;
128             END IF;
129          END IF;
130       END IF;
131    ELSE -- capture audit trail for all orders
132       IF l_result = OE_PC_GLOBALS.YES THEN
133          IF x_on_operation_action = 1 THEN
134             -- set OUT result to NOT CONSTRAINED
135             IF l_debug_level  > 0 THEN
136                 oe_debug_pub.add(  'HEADER ADJUSTMENTS SECURITY - SETTING REQUIRES REASON TO TRUE' , 5 ) ;
137             END IF;
138             OE_GLOBALS.G_AUDIT_REASON_RQD_FLAG := 'Y';
139             OE_GLOBALS.G_AUDIT_HISTORY_RQD_FLAG := 'N';
140          ELSIF x_on_operation_action = 2 THEN
141             -- set OUT result to NOT CONSTRAINED
142             IF OE_GLOBALS.G_AUDIT_REASON_RQD_FLAG <> 'Y' then
143                IF l_debug_level  > 0 THEN
144                    oe_debug_pub.add(  'HEADER ADJUSTMENTS SECURITY - SETTING REQUIRES HISTORY TO TRUE' , 5 ) ;
145                END IF;
146 	       OE_GLOBALS.G_AUDIT_HISTORY_RQD_FLAG := 'Y';
147             END IF;
148          END IF;
149       END IF;
150    END IF;
151 END IF;
152 END IF;
153 /* End AuditTrail */
154 IF x_on_operation_action > 0 THEN
155    l_result := OE_PC_GLOBALS.NO;
156 END IF;
157 
158 RETURN l_result;
159 
160 END Is_Op_Constrained;
161 
162 
163 -- PUBLIC PROCEDURES
164 
165 
166 FUNCTION ATTRIBUTE1
167 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
168 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
169 , x_on_operation_action OUT NOCOPY NUMBER
170 
171 ) RETURN NUMBER
172 IS
173 l_result 	NUMBER;
174 --
175 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
176 --
177 BEGIN
178 
179     l_result := Is_OP_constrained
180         (p_operation	=> p_operation
181         ,p_column_name	=> 'ATTRIBUTE1'
182         ,p_record	=> p_record
183         ,x_on_operation_action	=> x_on_operation_action
184         );
185 
186 RETURN(l_result);
187 
188 END ATTRIBUTE1;
189 
190 
191 FUNCTION ATTRIBUTE10
192 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
193 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
194 , x_on_operation_action OUT NOCOPY NUMBER
195 
196 ) RETURN NUMBER
197 IS
198 l_result 	NUMBER;
199 --
200 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
201 --
202 BEGIN
203 
204     l_result := Is_OP_constrained
205         (p_operation	=> p_operation
206         ,p_column_name	=> 'ATTRIBUTE10'
207         ,p_record	=> p_record
208         ,x_on_operation_action	=> x_on_operation_action
209         );
210 
211 RETURN(l_result);
212 
213 END ATTRIBUTE10;
214 
215 
216 FUNCTION ATTRIBUTE11
217 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
218 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
219 , x_on_operation_action OUT NOCOPY NUMBER
220 
221 ) RETURN NUMBER
222 IS
223 l_result 	NUMBER;
224 --
225 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
226 --
227 BEGIN
228 
229     l_result := Is_OP_constrained
230         (p_operation	=> p_operation
231         ,p_column_name	=> 'ATTRIBUTE11'
232         ,p_record	=> p_record
233         ,x_on_operation_action	=> x_on_operation_action
234         );
235 
236 RETURN(l_result);
237 
238 END ATTRIBUTE11;
239 
240 
241 FUNCTION ATTRIBUTE12
242 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
243 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
244 , x_on_operation_action OUT NOCOPY NUMBER
245 
246 ) RETURN NUMBER
247 IS
248 l_result 	NUMBER;
249 --
250 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
251 --
252 BEGIN
253 
254     l_result := Is_OP_constrained
255         (p_operation	=> p_operation
256         ,p_column_name	=> 'ATTRIBUTE12'
257         ,p_record	=> p_record
258         ,x_on_operation_action	=> x_on_operation_action
259         );
260 
261 RETURN(l_result);
262 
263 END ATTRIBUTE12;
264 
265 
266 FUNCTION ATTRIBUTE13
267 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
268 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
269 , x_on_operation_action OUT NOCOPY NUMBER
270 
271 ) RETURN NUMBER
272 IS
273 l_result 	NUMBER;
274 --
275 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
276 --
277 BEGIN
278 
279     l_result := Is_OP_constrained
280         (p_operation	=> p_operation
281         ,p_column_name	=> 'ATTRIBUTE13'
282         ,p_record	=> p_record
283         ,x_on_operation_action	=> x_on_operation_action
284         );
285 
286 RETURN(l_result);
287 
288 END ATTRIBUTE13;
289 
290 
291 FUNCTION ATTRIBUTE14
292 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
293 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
294 , x_on_operation_action OUT NOCOPY NUMBER
295 
296 ) RETURN NUMBER
297 IS
298 l_result 	NUMBER;
299 --
300 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
301 --
302 BEGIN
303 
304     l_result := Is_OP_constrained
305         (p_operation	=> p_operation
306         ,p_column_name	=> 'ATTRIBUTE14'
307         ,p_record	=> p_record
308         ,x_on_operation_action	=> x_on_operation_action
309         );
310 
311 RETURN(l_result);
312 
313 END ATTRIBUTE14;
314 
315 
316 FUNCTION ATTRIBUTE15
317 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
318 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
319 , x_on_operation_action OUT NOCOPY NUMBER
320 
321 ) RETURN NUMBER
322 IS
323 l_result 	NUMBER;
324 --
325 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
326 --
327 BEGIN
328 
329     l_result := Is_OP_constrained
330         (p_operation	=> p_operation
331         ,p_column_name	=> 'ATTRIBUTE15'
332         ,p_record	=> p_record
333         ,x_on_operation_action	=> x_on_operation_action
334         );
335 
336 RETURN(l_result);
337 
338 END ATTRIBUTE15;
339 
340 
341 FUNCTION ATTRIBUTE2
342 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
343 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
344 , x_on_operation_action OUT NOCOPY NUMBER
345 
346 ) RETURN NUMBER
347 IS
348 l_result 	NUMBER;
349 --
350 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
351 --
352 BEGIN
353 
354     l_result := Is_OP_constrained
355         (p_operation	=> p_operation
356         ,p_column_name	=> 'ATTRIBUTE2'
357         ,p_record	=> p_record
358         ,x_on_operation_action	=> x_on_operation_action
359         );
360 
361 RETURN(l_result);
362 
363 END ATTRIBUTE2;
364 
365 
366 FUNCTION ATTRIBUTE3
367 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
368 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
369 , x_on_operation_action OUT NOCOPY NUMBER
370 
371 ) RETURN NUMBER
372 IS
373 l_result 	NUMBER;
374 --
375 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
376 --
377 BEGIN
378 
379     l_result := Is_OP_constrained
380         (p_operation	=> p_operation
381         ,p_column_name	=> 'ATTRIBUTE3'
382         ,p_record	=> p_record
383         ,x_on_operation_action	=> x_on_operation_action
384         );
385 
386 RETURN(l_result);
387 
388 END ATTRIBUTE3;
389 
390 
391 FUNCTION ATTRIBUTE4
392 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
393 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
394 , x_on_operation_action OUT NOCOPY NUMBER
395 
396 ) RETURN NUMBER
397 IS
398 l_result 	NUMBER;
399 --
400 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
401 --
402 BEGIN
403 
404     l_result := Is_OP_constrained
405         (p_operation	=> p_operation
406         ,p_column_name	=> 'ATTRIBUTE4'
407         ,p_record	=> p_record
408         ,x_on_operation_action	=> x_on_operation_action
409         );
410 
411 RETURN(l_result);
412 
413 END ATTRIBUTE4;
414 
415 
416 FUNCTION ATTRIBUTE5
417 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
418 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
419 , x_on_operation_action OUT NOCOPY NUMBER
420 
421 ) RETURN NUMBER
422 IS
423 l_result 	NUMBER;
424 --
425 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
426 --
427 BEGIN
428 
429     l_result := Is_OP_constrained
430         (p_operation	=> p_operation
431         ,p_column_name	=> 'ATTRIBUTE5'
432         ,p_record	=> p_record
433         ,x_on_operation_action	=> x_on_operation_action
434         );
435 
436 RETURN(l_result);
437 
438 END ATTRIBUTE5;
439 
440 
441 FUNCTION ATTRIBUTE6
442 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
443 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
444 , x_on_operation_action OUT NOCOPY NUMBER
445 
446 ) RETURN NUMBER
447 IS
448 l_result 	NUMBER;
449 --
450 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
451 --
452 BEGIN
453 
454     l_result := Is_OP_constrained
455         (p_operation	=> p_operation
456         ,p_column_name	=> 'ATTRIBUTE6'
457         ,p_record	=> p_record
458         ,x_on_operation_action	=> x_on_operation_action
459         );
460 
461 RETURN(l_result);
462 
463 END ATTRIBUTE6;
464 
465 
466 FUNCTION ATTRIBUTE7
467 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
468 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
469 , x_on_operation_action OUT NOCOPY NUMBER
470 
471 ) RETURN NUMBER
472 IS
473 l_result 	NUMBER;
474 --
475 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
476 --
477 BEGIN
478 
479     l_result := Is_OP_constrained
480         (p_operation	=> p_operation
481         ,p_column_name	=> 'ATTRIBUTE7'
482         ,p_record	=> p_record
483         ,x_on_operation_action	=> x_on_operation_action
484         );
485 
486 RETURN(l_result);
487 
488 END ATTRIBUTE7;
489 
490 
491 FUNCTION ATTRIBUTE8
492 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
493 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
494 , x_on_operation_action OUT NOCOPY NUMBER
495 
496 ) RETURN NUMBER
497 IS
498 l_result 	NUMBER;
499 --
500 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
501 --
502 BEGIN
503 
504     l_result := Is_OP_constrained
505         (p_operation	=> p_operation
506         ,p_column_name	=> 'ATTRIBUTE8'
507         ,p_record	=> p_record
508         ,x_on_operation_action	=> x_on_operation_action
509         );
510 
511 RETURN(l_result);
512 
513 END ATTRIBUTE8;
514 
515 
516 FUNCTION ATTRIBUTE9
517 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
518 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
519 , x_on_operation_action OUT NOCOPY NUMBER
520 
521 ) RETURN NUMBER
522 IS
523 l_result 	NUMBER;
524 --
525 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
526 --
527 BEGIN
528 
529     l_result := Is_OP_constrained
530         (p_operation	=> p_operation
531         ,p_column_name	=> 'ATTRIBUTE9'
532         ,p_record	=> p_record
533         ,x_on_operation_action	=> x_on_operation_action
534         );
535 
536 RETURN(l_result);
537 
538 END ATTRIBUTE9;
539 
540 
541 FUNCTION AUTOMATIC
542 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
543 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
544 , x_on_operation_action OUT NOCOPY NUMBER
545 
546 ) RETURN NUMBER
547 IS
548 l_result 	NUMBER;
549 --
550 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
551 --
552 BEGIN
553 
554     l_result := Is_OP_constrained
555         (p_operation	=> p_operation
556         ,p_column_name	=> 'AUTOMATIC_FLAG'
557         ,p_record	=> p_record
558         ,x_on_operation_action	=> x_on_operation_action
559         );
560 
561 RETURN(l_result);
562 
563 END AUTOMATIC;
564 
565 
566 FUNCTION CONTEXT
567 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
568 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
569 , x_on_operation_action OUT NOCOPY NUMBER
570 
571 ) RETURN NUMBER
572 IS
573 l_result 	NUMBER;
574 --
575 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
576 --
577 BEGIN
578 
579     l_result := Is_OP_constrained
580         (p_operation	=> p_operation
581         ,p_column_name	=> 'CONTEXT'
582         ,p_record	=> p_record
583         ,x_on_operation_action	=> x_on_operation_action
584         );
585 
586 RETURN(l_result);
587 
588 END CONTEXT;
589 
590 
591 FUNCTION CREATED_BY
592 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
593 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
594 , x_on_operation_action OUT NOCOPY NUMBER
595 
596 ) RETURN NUMBER
597 IS
598 l_result 	NUMBER;
599 --
600 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
601 --
602 BEGIN
603 
604     l_result := Is_OP_constrained
605         (p_operation	=> p_operation
606         ,p_column_name	=> 'CREATED_BY'
607         ,p_record	=> p_record
608         ,x_on_operation_action	=> x_on_operation_action
609         );
610 
611 RETURN(l_result);
612 
613 END CREATED_BY;
614 
615 
616 FUNCTION CREATION_DATE
617 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
618 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
619 , x_on_operation_action OUT NOCOPY NUMBER
620 
621 ) RETURN NUMBER
622 IS
623 l_result 	NUMBER;
624 --
625 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
626 --
627 BEGIN
628 
629     l_result := Is_OP_constrained
630         (p_operation	=> p_operation
631         ,p_column_name	=> 'CREATION_DATE'
632         ,p_record	=> p_record
633         ,x_on_operation_action	=> x_on_operation_action
634         );
635 
636 RETURN(l_result);
637 
638 END CREATION_DATE;
639 
640 
641 FUNCTION DISCOUNT
642 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
643 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
644 , x_on_operation_action OUT NOCOPY NUMBER
645 
646 ) RETURN NUMBER
647 IS
648 l_result 	NUMBER;
649 --
650 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
651 --
652 BEGIN
653 
654     l_result := Is_OP_constrained
655         (p_operation	=> p_operation
656         ,p_column_name	=> 'DISCOUNT_ID'
657         ,p_record	=> p_record
658         ,x_on_operation_action	=> x_on_operation_action
659         );
660 
661 RETURN(l_result);
662 
663 END DISCOUNT;
664 
665 FUNCTION OPERAND
666 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
667 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
668 , x_on_operation_action OUT NOCOPY NUMBER
669 
670 ) RETURN NUMBER
671 IS
672 l_result 	NUMBER;
673 --
674 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
675 --
676 BEGIN
677 
678     l_result := Is_OP_constrained
679         (p_operation	=> p_operation
680         ,p_column_name	=> 'OPERAND'
681         ,p_record	=> p_record
682         ,x_on_operation_action	=> x_on_operation_action
683         );
684 
685 RETURN(l_result);
686 
687 END OPERAND;
688 
689 FUNCTION DISCOUNT_LINE
690 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
691 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
692 , x_on_operation_action OUT NOCOPY NUMBER
693 
694 ) RETURN NUMBER
695 IS
696 l_result 	NUMBER;
697 --
698 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
699 --
700 BEGIN
701 
702     l_result := Is_OP_constrained
703         (p_operation	=> p_operation
704         ,p_column_name	=> 'DISCOUNT_LINE_ID'
705         ,p_record	=> p_record
706         ,x_on_operation_action	=> x_on_operation_action
707         );
708 
709 RETURN(l_result);
710 
711 END DISCOUNT_LINE;
712 
713 
714 FUNCTION HEADER
715 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
716 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
717 , x_on_operation_action OUT NOCOPY NUMBER
718 
719 ) RETURN NUMBER
720 IS
721 l_result 	NUMBER;
722 --
723 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
724 --
725 BEGIN
726 
727     l_result := Is_OP_constrained
728         (p_operation	=> p_operation
729         ,p_column_name	=> 'HEADER_ID'
730         ,p_record	=> p_record
731         ,x_on_operation_action	=> x_on_operation_action
732         );
733 
734 RETURN(l_result);
735 
736 END HEADER;
737 
738 
739 FUNCTION LAST_UPDATED_BY
740 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
741 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
742 , x_on_operation_action OUT NOCOPY NUMBER
743 
744 ) RETURN NUMBER
745 IS
746 l_result 	NUMBER;
747 --
748 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
749 --
750 BEGIN
751 
752     l_result := Is_OP_constrained
753         (p_operation	=> p_operation
754         ,p_column_name	=> 'LAST_UPDATED_BY'
755         ,p_record	=> p_record
756         ,x_on_operation_action	=> x_on_operation_action
757         );
758 
759 RETURN(l_result);
760 
761 END LAST_UPDATED_BY;
762 
763 
764 FUNCTION LAST_UPDATE_DATE
765 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
766 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
767 , x_on_operation_action OUT NOCOPY NUMBER
768 
769 ) RETURN NUMBER
770 IS
771 l_result 	NUMBER;
772 --
773 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
774 --
775 BEGIN
776 
777     l_result := Is_OP_constrained
778         (p_operation	=> p_operation
779         ,p_column_name	=> 'LAST_UPDATE_DATE'
780         ,p_record	=> p_record
781         ,x_on_operation_action	=> x_on_operation_action
782         );
783 
784 RETURN(l_result);
785 
786 END LAST_UPDATE_DATE;
787 
788 
789 FUNCTION LAST_UPDATE_LOGIN
790 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
791 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
792 , x_on_operation_action OUT NOCOPY NUMBER
793 
794 ) RETURN NUMBER
795 IS
796 l_result 	NUMBER;
797 --
798 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
799 --
800 BEGIN
801 
802     l_result := Is_OP_constrained
803         (p_operation	=> p_operation
804         ,p_column_name	=> 'LAST_UPDATE_LOGIN'
805         ,p_record	=> p_record
806         ,x_on_operation_action	=> x_on_operation_action
807         );
808 
809 RETURN(l_result);
810 
811 END LAST_UPDATE_LOGIN;
812 
813 
814 FUNCTION LINE
815 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
816 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
817 , x_on_operation_action OUT NOCOPY NUMBER
818 
819 ) RETURN NUMBER
820 IS
821 l_result 	NUMBER;
822 --
823 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
824 --
825 BEGIN
826 
827     l_result := Is_OP_constrained
828         (p_operation	=> p_operation
829         ,p_column_name	=> 'LINE_ID'
830         ,p_record	=> p_record
831         ,x_on_operation_action	=> x_on_operation_action
832         );
833 
834 RETURN(l_result);
835 
836 END LINE;
837 
838 
839 FUNCTION PERCENT
840 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
841 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
842 , x_on_operation_action OUT NOCOPY NUMBER
843 
844 ) RETURN NUMBER
845 IS
846 l_result 	NUMBER;
847 --
848 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
849 --
850 BEGIN
851 
852     l_result := Is_OP_constrained
853         (p_operation	=> p_operation
854         ,p_column_name	=> 'PERCENT'
855         ,p_record	=> p_record
856         ,x_on_operation_action	=> x_on_operation_action
857         );
858 
859 RETURN(l_result);
860 
861 END PERCENT;
862 
863 
864 FUNCTION PRICE_ADJUSTMENT
865 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
866 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
867 , x_on_operation_action OUT NOCOPY NUMBER
868 
869 ) RETURN NUMBER
870 IS
871 l_result 	NUMBER;
872 --
873 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
874 --
875 BEGIN
876 
877     l_result := Is_OP_constrained
878         (p_operation	=> p_operation
879         ,p_column_name	=> 'PRICE_ADJUSTMENT_ID'
880         ,p_record	=> p_record
881         ,x_on_operation_action	=> x_on_operation_action
882         );
883 
884 RETURN(l_result);
885 
886 END PRICE_ADJUSTMENT;
887 
888 
889 FUNCTION PROGRAM_APPLICATION
890 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
891 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
892 , x_on_operation_action OUT NOCOPY NUMBER
893 
894 ) RETURN NUMBER
895 IS
896 l_result 	NUMBER;
897 --
898 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
899 --
900 BEGIN
901 
902     l_result := Is_OP_constrained
903         (p_operation	=> p_operation
904         ,p_column_name	=> 'PROGRAM_APPLICATION_ID'
905         ,p_record	=> p_record
906         ,x_on_operation_action	=> x_on_operation_action
907         );
908 
909 RETURN(l_result);
910 
911 END PROGRAM_APPLICATION;
912 
913 
914 FUNCTION PROGRAM
915 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
916 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
917 , x_on_operation_action OUT NOCOPY NUMBER
918 
919 ) RETURN NUMBER
920 IS
921 l_result 	NUMBER;
922 --
923 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
924 --
925 BEGIN
926 
927     l_result := Is_OP_constrained
928         (p_operation	=> p_operation
929         ,p_column_name	=> 'PROGRAM_ID'
930         ,p_record	=> p_record
931         ,x_on_operation_action	=> x_on_operation_action
932         );
933 
934 RETURN(l_result);
935 
936 END PROGRAM;
937 
938 
939 FUNCTION PROGRAM_UPDATE_DATE
940 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
941 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
942 , x_on_operation_action OUT NOCOPY NUMBER
943 
944 ) RETURN NUMBER
945 IS
946 l_result 	NUMBER;
947 --
948 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
949 --
950 BEGIN
951 
952     l_result := Is_OP_constrained
953         (p_operation	=> p_operation
954         ,p_column_name	=> 'PROGRAM_UPDATE_DATE'
955         ,p_record	=> p_record
956         ,x_on_operation_action	=> x_on_operation_action
957         );
958 
959 RETURN(l_result);
960 
961 END PROGRAM_UPDATE_DATE;
962 
963 
964 FUNCTION REQUEST
965 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
966 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
967 , x_on_operation_action OUT NOCOPY NUMBER
968 
969 ) RETURN NUMBER
970 IS
971 l_result 	NUMBER;
972 --
973 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
974 --
975 BEGIN
976 
977     l_result := Is_OP_constrained
978         (p_operation	=> p_operation
979         ,p_column_name	=> 'REQUEST_ID'
980         ,p_record	=> p_record
981         ,x_on_operation_action	=> x_on_operation_action
982         );
983 
984 RETURN(l_result);
985 
986 END REQUEST;
987 
988 
989 FUNCTION list_header
990 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
991 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
992 , x_on_operation_action OUT NOCOPY NUMBER
993 
994 ) RETURN NUMBER
995 IS
996 l_result 	NUMBER;
997 --
998 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
999 --
1000 BEGIN
1001 
1002     l_result := Is_OP_constrained
1003         (p_operation	=> p_operation
1004         ,p_column_name	=> 'LIST_HEADER_ID'
1005 	   ,p_record	=> p_record
1006         ,x_on_operation_action	=> x_on_operation_action
1007         );
1008 
1009 RETURN(l_result);
1010 
1011 END list_header;
1012 
1013 FUNCTION list_line
1014 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
1015 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
1016 , x_on_operation_action OUT NOCOPY NUMBER
1017 
1018 ) RETURN NUMBER
1019 IS
1020 l_result 	NUMBER;
1021 --
1022 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1023 --
1024 BEGIN
1025 
1026     l_result := Is_OP_constrained
1027         (p_operation	=> p_operation
1028         ,p_column_name	=> 'LIST_LINE_ID'
1029 	   ,p_record	=> p_record
1030         ,x_on_operation_action	=> x_on_operation_action
1031         );
1032 
1033 RETURN(l_result);
1034 
1035 END list_line;
1036 
1037 FUNCTION line_type_code
1038 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
1039 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
1040 , x_on_operation_action OUT NOCOPY NUMBER
1041 
1042 ) RETURN NUMBER
1043 IS
1044 l_result 	NUMBER;
1045 --
1046 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1047 --
1048 BEGIN
1049 
1050     l_result := Is_OP_constrained
1051         (p_operation	=> p_operation
1052         ,p_column_name	=> 'LIST_LINE_TYPE_CODE'
1053 	   ,p_record	=> p_record
1054         ,x_on_operation_action	=> x_on_operation_action
1055         );
1056 
1057 RETURN(l_result);
1058 
1059 END line_type_code;
1060 
1061 FUNCTION modifier_mechanism
1062 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
1063 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
1064 , x_on_operation_action OUT NOCOPY NUMBER
1065 
1066 ) RETURN NUMBER
1067 IS
1068 l_result 	NUMBER;
1069 --
1070 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1071 --
1072 BEGIN
1073 
1074     l_result := Is_OP_constrained
1075         (p_operation	=> p_operation
1076         ,p_column_name	=> 'MODIFIER_MECHANISM_TYPE_CODE'
1077 	   ,p_record	=> p_record
1078         ,x_on_operation_action	=> x_on_operation_action
1079         );
1080 
1081 RETURN(l_result);
1082 
1083 END modifier_mechanism;
1084 
1085 FUNCTION modified_from
1086 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
1087 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
1088 , x_on_operation_action OUT NOCOPY NUMBER
1089 
1090 ) RETURN NUMBER
1091 IS
1092 l_result 	NUMBER;
1093 --
1094 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1095 --
1096 BEGIN
1097 
1098     l_result := Is_OP_constrained
1099         (p_operation	=> p_operation
1100         ,p_column_name	=> 'MODIFIED_FROM'
1101 	   ,p_record	=> p_record
1102         ,x_on_operation_action	=> x_on_operation_action
1103         );
1104 
1105 RETURN(l_result);
1106 
1107 END modified_from;
1108 
1109 FUNCTION modified_to
1110 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
1111 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
1112 , x_on_operation_action OUT NOCOPY NUMBER
1113 
1114 ) RETURN NUMBER
1115 IS
1116 l_result 	NUMBER;
1117 --
1118 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1119 --
1120 BEGIN
1121 
1122     l_result := Is_OP_constrained
1123         (p_operation	=> p_operation
1124         ,p_column_name	=> 'MODIFIED_TO'
1125 	   ,p_record	=> p_record
1126         ,x_on_operation_action	=> x_on_operation_action
1127         );
1128 
1129 RETURN(l_result);
1130 
1131 END modified_to;
1132 
1133 FUNCTION updated_flag
1134 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
1135 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
1136 , x_on_operation_action OUT NOCOPY NUMBER
1137 
1138 ) RETURN NUMBER
1139 IS
1140 l_result 	NUMBER;
1141 --
1142 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1143 --
1144 BEGIN
1145 
1146     l_result := Is_OP_constrained
1147         (p_operation	=> p_operation
1148         ,p_column_name	=> 'UPDATED_FLAG'
1149 	   ,p_record	=> p_record
1150         ,x_on_operation_action	=> x_on_operation_action
1151         );
1152 
1153 RETURN(l_result);
1154 
1155 END updated_flag;
1156 
1157 FUNCTION update_allowed
1158 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
1159 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
1160 , x_on_operation_action OUT NOCOPY NUMBER
1161 
1162 ) RETURN NUMBER
1163 IS
1164 l_result 	NUMBER;
1165 --
1166 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1167 --
1168 BEGIN
1169 
1170     l_result := Is_OP_constrained
1171         (p_operation	=> p_operation
1172         ,p_column_name	=> 'UPDATE_ALLOWED'
1173 	   ,p_record	=> p_record
1174         ,x_on_operation_action	=> x_on_operation_action
1175         );
1176 
1177 RETURN(l_result);
1178 
1179 END update_allowed;
1180 
1181 FUNCTION applied_flag
1182 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
1183 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
1184 , x_on_operation_action OUT NOCOPY NUMBER
1185 
1186 ) RETURN NUMBER
1187 IS
1188 l_result 	NUMBER;
1189 --
1190 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1191 --
1192 BEGIN
1193 
1194     l_result := Is_OP_constrained
1195         (p_operation	=> p_operation
1196         ,p_column_name	=> 'APPLIED_FLAG'
1197 	   ,p_record	=> p_record
1198         ,x_on_operation_action	=> x_on_operation_action
1199         );
1200 
1201 RETURN(l_result);
1202 
1203 END applied_flag;
1204 
1205 FUNCTION change_code
1206 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
1207 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
1208 , x_on_operation_action OUT NOCOPY NUMBER
1209 
1210 ) RETURN NUMBER
1211 IS
1212 l_result 	NUMBER;
1213 --
1214 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1215 --
1216 BEGIN
1217 
1218     l_result := Is_OP_constrained
1219         (p_operation	=> p_operation
1220         ,p_column_name	=> 'CHANGE_REASON_CODE'
1221 	   ,p_record	=> p_record
1222         ,x_on_operation_action	=> x_on_operation_action
1223         );
1224 
1225 RETURN(l_result);
1226 
1227 END change_code;
1228 
1229 FUNCTION change_text
1230 (   p_operation                     IN  VARCHAR2 DEFAULT OE_PC_GLOBALS.UPDATE_OP
1231 ,   p_record                        IN  OE_AK_HEADER_PRCADJS_V%ROWTYPE
1232 , x_on_operation_action OUT NOCOPY NUMBER
1233 
1234 ) RETURN NUMBER
1235 IS
1236 l_result 	NUMBER;
1237 --
1238 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1239 --
1240 BEGIN
1241 
1242     l_result := Is_OP_constrained
1243         (p_operation	=> p_operation
1244         ,p_column_name	=> 'CHANGE_REASON_TEXT'
1245 	   ,p_record	=> p_record
1246         ,x_on_operation_action	=> x_on_operation_action
1247         );
1248 
1249 RETURN(l_result);
1250 
1251 END change_text;
1252 
1253 PROCEDURE Entity
1254 (   p_HEADER_ADJ_rec                IN  OE_Order_PUB.HEADER_ADJ_Rec_Type
1255 , x_result OUT NOCOPY NUMBER
1256 
1257 , x_return_status OUT NOCOPY VARCHAR2
1258 
1259 ) IS
1260 l_operation	VARCHAR2(1);
1261 l_on_operation_action	NUMBER;
1262 l_rowtype_rec	OE_AK_HEADER_PRCADJS_V%ROWTYPE;
1263 --
1264 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1265 --
1266 BEGIN
1267 
1268 IF l_debug_level  > 0 THEN
1269     oe_debug_pub.add(  'ENTER OE_HEADER_ADJ_SECURITY.ENTITY' , 1 ) ;
1270 END IF;
1271 
1272 -- Initializing return status to SUCCESS
1273 x_return_status := FND_API.G_RET_STS_SUCCESS;
1274 
1275 IF p_HEADER_ADJ_rec.operation = OE_GLOBALS.G_OPR_CREATE THEN
1276     l_operation := OE_PC_GLOBALS.CREATE_OP;
1277 ELSIF p_HEADER_ADJ_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN
1278     l_operation := OE_PC_GLOBALS.UPDATE_OP;
1279 ELSIF p_HEADER_ADJ_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
1280     l_operation := OE_PC_GLOBALS.DELETE_OP;
1281 ELSE
1282     IF l_debug_level  > 0 THEN
1283         oe_debug_pub.add(  'INVALID OPERATION' , 1 ) ;
1284     END IF;
1285     RAISE FND_API.G_EXC_ERROR;
1286 END IF;
1287 
1288 OE_Header_Adj_Util.API_Rec_To_Rowtype_Rec(p_HEADER_ADJ_rec
1289 								, l_rowtype_rec);
1290 
1291 --Initialize security global record
1292 OE_HEADER_ADJ_SECURITY.g_record := l_rowtype_rec;
1293 
1294 x_result := Is_OP_constrained
1295     (p_operation	=> l_operation
1296     ,p_record	=> l_rowtype_rec
1297     ,x_on_operation_action	=> l_on_operation_action
1298     );
1299 
1300 IF l_debug_level  > 0 THEN
1301     oe_debug_pub.add(  'EXIT OE_HEADER_ADJ_SECURITY.ENTITY' , 1 ) ;
1302 END IF;
1303 
1304 EXCEPTION
1305     WHEN OTHERS THEN
1306     x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1307     IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1308         OE_MSG_PUB.Add_Exc_Msg
1309         (   G_PKG_NAME
1310         ,   'Entity'
1311         );
1312     END IF;
1313 
1314 END Entity;
1315 
1316 
1317 PROCEDURE Attributes
1318 (   p_HEADER_ADJ_rec                IN  OE_Order_PUB.HEADER_ADJ_Rec_Type
1319 ,   p_old_HEADER_ADJ_rec            IN  OE_Order_PUB.HEADER_ADJ_Rec_Type := OE_Order_PUB.G_MISS_HEADER_ADJ_REC
1320 , x_result OUT NOCOPY NUMBER
1321 
1322 , x_return_status OUT NOCOPY VARCHAR2
1323 
1324 ) IS
1325 l_operation	VARCHAR2(1);
1326 l_on_operation_action  NUMBER;
1327 l_result		NUMBER;
1328 l_rowtype_rec	OE_AK_HEADER_PRCADJS_V%ROWTYPE;
1329 l_column_name	VARCHAR2(30);
1330 l_check_all_cols_constraint VARCHAR2(1);
1331 --
1332 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1333 --
1334 BEGIN
1335 IF l_debug_level  > 0 THEN
1336     oe_debug_pub.add(  'ENTER OE_HEADER_ADJ_SECURITY.ATTRIBUTES' , 1 ) ;
1337 END IF;
1338 
1339 -- Initializing return status to SUCCESS
1340 x_return_status := FND_API.G_RET_STS_SUCCESS;
1341 
1342 -- Initializing out result to NOT CONSTRAINED
1343 x_result := OE_PC_GLOBALS.NO;
1344 
1345  -- Get the operation code to be passed to the security framework API
1346 IF p_HEADER_ADJ_rec.operation = OE_GLOBALS.G_OPR_CREATE THEN
1347     l_operation := OE_PC_GLOBALS.CREATE_OP;
1348     -- Bug 1755817: if there are no attribute-specific insert
1349     -- constraints, then no need to go further. Entity level
1350     -- security check for CREATE will be called again from
1351     -- process order after defaulting.
1352     IF NOT OE_PC_Constraints_Admin_PVT.Check_On_Insert_Exists
1353            (p_entity_id   => OE_PC_GLOBALS.G_ENTITY_HEADER_ADJ
1354            ,p_responsibility_id     => nvl(fnd_global.resp_id, -1)
1355            ,p_application_id        => nvl(fnd_global.resp_appl_id,-1) --added for bug3631547
1356            )
1357     THEN
1358        RETURN;
1359     END IF;
1360 ELSIF p_HEADER_ADJ_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN
1361     l_operation := OE_PC_GLOBALS.UPDATE_OP;
1362 ELSE
1363     IF l_debug_level  > 0 THEN
1364         oe_debug_pub.add(  'INVALID OPERATION' , 1 ) ;
1365     END IF;
1366     RAISE FND_API.G_EXC_ERROR;
1367 END IF;
1368 
1369 OE_Header_Adj_Util.API_Rec_To_Rowtype_Rec(p_HEADER_ADJ_rec
1370 								, l_rowtype_rec);
1371 
1372 --Initialize security global record
1373 OE_HEADER_ADJ_SECURITY.g_record := l_rowtype_rec;
1374 
1375 -- Compare the new and old entity records and
1376 -- check constraints for all the changed attributes.
1377 
1378     IF p_header_adj_rec.automatic_flag = FND_API.G_MISS_CHAR THEN NULL;
1379     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.automatic_flag,p_old_header_adj_rec.automatic_flag) THEN
1380 
1381         l_result := AUTOMATIC
1382             (p_operation        => l_operation
1383             ,p_record   => l_rowtype_rec
1384             ,x_on_operation_action => l_on_operation_action
1385             );
1386 
1387         IF l_result = OE_PC_GLOBALS.YES THEN
1388             -- set OUT result to CONSTRAINED
1389             x_result := OE_PC_GLOBALS.YES;
1390         END IF;
1391 
1392     END IF;
1393 
1394     IF p_header_adj_rec.discount_id = FND_API.G_MISS_NUM THEN NULL;
1395     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.discount_id,p_old_header_adj_rec.discount_id) THEN
1396 
1397         l_result := DISCOUNT
1398             (p_operation        => l_operation
1399             ,p_record   => l_rowtype_rec
1400             ,x_on_operation_action => l_on_operation_action
1401             );
1402 
1403         IF l_result = OE_PC_GLOBALS.YES THEN
1404             -- set OUT result to CONSTRAINED
1405             x_result := OE_PC_GLOBALS.YES;
1406         END IF;
1407 
1408     END IF;
1409 
1410     IF p_header_adj_rec.operand = FND_API.G_MISS_NUM THEN NULL;
1411     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.operand,p_old_header_adj_rec.operand) THEN
1412 
1413         l_result := OPERAND
1414             (p_operation        => l_operation
1415             ,p_record   => l_rowtype_rec
1416             ,x_on_operation_action => l_on_operation_action
1417             );
1418 
1419         IF l_result = OE_PC_GLOBALS.YES THEN
1420             -- set OUT result to CONSTRAINED
1421             x_result := OE_PC_GLOBALS.YES;
1422         END IF;
1423 
1424     END IF;
1425 
1426     IF p_header_adj_rec.discount_line_id = FND_API.G_MISS_NUM THEN NULL;
1427     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.discount_line_id,p_old_header_adj_rec.discount_line_id) THEN
1428 
1429         l_result := DISCOUNT_LINE
1430             (p_operation        => l_operation
1431             ,p_record   => l_rowtype_rec
1432             ,x_on_operation_action => l_on_operation_action
1433             );
1434 
1435         IF l_result = OE_PC_GLOBALS.YES THEN
1436             -- set OUT result to CONSTRAINED
1437             x_result := OE_PC_GLOBALS.YES;
1438         END IF;
1439 
1440     END IF;
1441 
1442     IF p_header_adj_rec.percent = FND_API.G_MISS_NUM THEN NULL;
1443     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.percent,p_old_header_adj_rec.percent) THEN
1444 
1445         l_result := PERCENT
1446             (p_operation        => l_operation
1447             ,p_record   => l_rowtype_rec
1448             ,x_on_operation_action => l_on_operation_action
1449             );
1450 
1451         IF l_result = OE_PC_GLOBALS.YES THEN
1452             -- set OUT result to CONSTRAINED
1453             x_result := OE_PC_GLOBALS.YES;
1454         END IF;
1455 
1456     END IF;
1457 
1458     IF p_header_adj_rec.request_id = FND_API.G_MISS_NUM THEN NULL;
1459     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.request_id,p_old_header_adj_rec.request_id) THEN
1460 
1461         l_result := REQUEST
1462             (p_operation        => l_operation
1463             ,p_record   => l_rowtype_rec
1464             ,x_on_operation_action => l_on_operation_action
1465             );
1466 
1467         IF l_result = OE_PC_GLOBALS.YES THEN
1468             -- set OUT result to CONSTRAINED
1469             x_result := OE_PC_GLOBALS.YES;
1470         END IF;
1471 
1472     END IF;
1473 
1474 
1475     -- BEGIN: CHECK FOR CONSTRAINTS ON DESC FLEXFIELD ATTRIBUTES
1476     -- Bug 2003823:
1477     -- If profile indicates that generic update constraints (e.g. seeded
1478     -- closed order condition) should not be checked for DFF, then
1479     -- set the global to 'N'.
1480     -- Also, store the current value of global in a local variable and
1481     -- re-set it after DFF check. If DFF were the only fields being
1482     -- updated and profile was set to 'N', global at the end should
1483     -- be re-set to 'Y' - this indicates to process order that no
1484     -- constrainable attributes were updated and thus, it would
1485     -- suppress entity level security check also.
1486     IF OE_PC_GLOBALS.G_CHECK_UPDATE_ALL_FOR_DFF = 'N' THEN
1487        l_check_all_cols_constraint := g_check_all_cols_constraint;
1488        g_check_all_cols_constraint := 'N';
1489     END IF;
1490 
1491     IF p_header_adj_rec.context = FND_API.G_MISS_CHAR THEN NULL;
1492     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.context,p_old_header_adj_rec.context) THEN
1493 
1494         l_result := CONTEXT
1495             (p_operation        => l_operation
1496             ,p_record   => l_rowtype_rec
1497             ,x_on_operation_action => l_on_operation_action
1498             );
1499 
1500         IF l_result = OE_PC_GLOBALS.YES THEN
1501             -- set OUT result to CONSTRAINED
1502             x_result := OE_PC_GLOBALS.YES;
1503         END IF;
1504 
1505     END IF;
1506 
1507     IF p_header_adj_rec.attribute1 = FND_API.G_MISS_CHAR THEN NULL;
1508     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.attribute1,p_old_header_adj_rec.attribute1) THEN
1509 
1510         l_result := ATTRIBUTE1
1511             (p_operation        => l_operation
1512             ,p_record   => l_rowtype_rec
1513             ,x_on_operation_action => l_on_operation_action
1514             );
1515 
1516         IF l_result = OE_PC_GLOBALS.YES THEN
1517             -- set OUT result to CONSTRAINED
1518             x_result := OE_PC_GLOBALS.YES;
1519         END IF;
1520 
1521     END IF;
1522 
1523     IF p_header_adj_rec.attribute10 = FND_API.G_MISS_CHAR THEN NULL;
1524     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.attribute10,p_old_header_adj_rec.attribute10) THEN
1525 
1526         l_result := ATTRIBUTE10
1527             (p_operation        => l_operation
1528             ,p_record   => l_rowtype_rec
1529             ,x_on_operation_action => l_on_operation_action
1530             );
1531 
1532         IF l_result = OE_PC_GLOBALS.YES THEN
1533             -- set OUT result to CONSTRAINED
1534             x_result := OE_PC_GLOBALS.YES;
1535         END IF;
1536 
1537     END IF;
1538 
1539     IF p_header_adj_rec.attribute11 = FND_API.G_MISS_CHAR THEN NULL;
1540     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.attribute11,p_old_header_adj_rec.attribute11) THEN
1541 
1542         l_result := ATTRIBUTE11
1543             (p_operation        => l_operation
1544             ,p_record   => l_rowtype_rec
1545             ,x_on_operation_action => l_on_operation_action
1546             );
1547 
1548         IF l_result = OE_PC_GLOBALS.YES THEN
1549             -- set OUT result to CONSTRAINED
1550             x_result := OE_PC_GLOBALS.YES;
1551         END IF;
1552 
1553     END IF;
1554 
1555     IF p_header_adj_rec.attribute12 = FND_API.G_MISS_CHAR THEN NULL;
1556     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.attribute12,p_old_header_adj_rec.attribute12) THEN
1557 
1558         l_result := ATTRIBUTE12
1559             (p_operation        => l_operation
1560             ,p_record   => l_rowtype_rec
1561             ,x_on_operation_action => l_on_operation_action
1562             );
1563 
1564         IF l_result = OE_PC_GLOBALS.YES THEN
1565             -- set OUT result to CONSTRAINED
1566             x_result := OE_PC_GLOBALS.YES;
1567         END IF;
1568 
1569     END IF;
1570 
1571     IF p_header_adj_rec.attribute13 = FND_API.G_MISS_CHAR THEN NULL;
1572     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.attribute13,p_old_header_adj_rec.attribute13) THEN
1573 
1574         l_result := ATTRIBUTE13
1575             (p_operation        => l_operation
1576             ,p_record   => l_rowtype_rec
1577             ,x_on_operation_action => l_on_operation_action
1578             );
1579 
1580         IF l_result = OE_PC_GLOBALS.YES THEN
1581             -- set OUT result to CONSTRAINED
1582             x_result := OE_PC_GLOBALS.YES;
1583         END IF;
1584 
1585     END IF;
1586 
1587     IF p_header_adj_rec.attribute14 = FND_API.G_MISS_CHAR THEN NULL;
1588     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.attribute14,p_old_header_adj_rec.attribute14) THEN
1589 
1590         l_result := ATTRIBUTE14
1591             (p_operation        => l_operation
1592             ,p_record   => l_rowtype_rec
1593             ,x_on_operation_action => l_on_operation_action
1594             );
1595 
1596         IF l_result = OE_PC_GLOBALS.YES THEN
1597             -- set OUT result to CONSTRAINED
1598             x_result := OE_PC_GLOBALS.YES;
1599         END IF;
1600 
1601     END IF;
1602 
1603     IF p_header_adj_rec.attribute15 = FND_API.G_MISS_CHAR THEN NULL;
1604     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.attribute15,p_old_header_adj_rec.attribute15) THEN
1605 
1606         l_result := ATTRIBUTE15
1607             (p_operation        => l_operation
1608             ,p_record   => l_rowtype_rec
1609             ,x_on_operation_action => l_on_operation_action
1610             );
1611 
1612         IF l_result = OE_PC_GLOBALS.YES THEN
1613             -- set OUT result to CONSTRAINED
1614             x_result := OE_PC_GLOBALS.YES;
1615         END IF;
1616 
1617     END IF;
1618 
1619     IF p_header_adj_rec.attribute2 = FND_API.G_MISS_CHAR THEN NULL;
1620     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.attribute2,p_old_header_adj_rec.attribute2) THEN
1621 
1622         l_result := ATTRIBUTE2
1623             (p_operation        => l_operation
1624             ,p_record   => l_rowtype_rec
1625             ,x_on_operation_action => l_on_operation_action
1626             );
1627 
1628         IF l_result = OE_PC_GLOBALS.YES THEN
1629             -- set OUT result to CONSTRAINED
1630             x_result := OE_PC_GLOBALS.YES;
1631         END IF;
1632 
1633     END IF;
1634 
1635     IF p_header_adj_rec.attribute3 = FND_API.G_MISS_CHAR THEN NULL;
1636     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.attribute3,p_old_header_adj_rec.attribute3) THEN
1637 
1638         l_result := ATTRIBUTE3
1639             (p_operation        => l_operation
1640             ,p_record   => l_rowtype_rec
1641             ,x_on_operation_action => l_on_operation_action
1642             );
1643 
1644         IF l_result = OE_PC_GLOBALS.YES THEN
1645             -- set OUT result to CONSTRAINED
1646             x_result := OE_PC_GLOBALS.YES;
1647         END IF;
1648 
1649     END IF;
1650 
1651     IF p_header_adj_rec.attribute4 = FND_API.G_MISS_CHAR THEN NULL;
1652     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.attribute4,p_old_header_adj_rec.attribute4) THEN
1653 
1654         l_result := ATTRIBUTE4
1655             (p_operation        => l_operation
1656             ,p_record   => l_rowtype_rec
1657             ,x_on_operation_action => l_on_operation_action
1658             );
1659 
1660         IF l_result = OE_PC_GLOBALS.YES THEN
1661             -- set OUT result to CONSTRAINED
1662             x_result := OE_PC_GLOBALS.YES;
1663         END IF;
1664 
1665     END IF;
1666 
1667     IF p_header_adj_rec.attribute5 = FND_API.G_MISS_CHAR THEN NULL;
1668     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.attribute5,p_old_header_adj_rec.attribute5) THEN
1669 
1670         l_result := ATTRIBUTE5
1671             (p_operation        => l_operation
1672             ,p_record   => l_rowtype_rec
1673             ,x_on_operation_action => l_on_operation_action
1674             );
1675 
1676         IF l_result = OE_PC_GLOBALS.YES THEN
1677             -- set OUT result to CONSTRAINED
1678             x_result := OE_PC_GLOBALS.YES;
1679         END IF;
1680 
1681     END IF;
1682 
1683     IF p_header_adj_rec.attribute6 = FND_API.G_MISS_CHAR THEN NULL;
1684     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.attribute6,p_old_header_adj_rec.attribute6) THEN
1685 
1686         l_result := ATTRIBUTE6
1687             (p_operation        => l_operation
1688             ,p_record   => l_rowtype_rec
1689             ,x_on_operation_action => l_on_operation_action
1690             );
1691 
1692         IF l_result = OE_PC_GLOBALS.YES THEN
1693             -- set OUT result to CONSTRAINED
1694             x_result := OE_PC_GLOBALS.YES;
1695         END IF;
1696 
1697     END IF;
1698 
1699     IF p_header_adj_rec.attribute7 = FND_API.G_MISS_CHAR THEN NULL;
1700     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.attribute7,p_old_header_adj_rec.attribute7) THEN
1701 
1702         l_result := ATTRIBUTE7
1703             (p_operation        => l_operation
1704             ,p_record   => l_rowtype_rec
1705             ,x_on_operation_action => l_on_operation_action
1706             );
1707 
1708         IF l_result = OE_PC_GLOBALS.YES THEN
1709             -- set OUT result to CONSTRAINED
1710             x_result := OE_PC_GLOBALS.YES;
1711         END IF;
1712 
1713     END IF;
1714 
1715     IF p_header_adj_rec.attribute8 = FND_API.G_MISS_CHAR THEN NULL;
1716     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.attribute8,p_old_header_adj_rec.attribute8) THEN
1717 
1718         l_result := ATTRIBUTE8
1719             (p_operation        => l_operation
1720             ,p_record   => l_rowtype_rec
1721             ,x_on_operation_action => l_on_operation_action
1722             );
1723 
1724         IF l_result = OE_PC_GLOBALS.YES THEN
1725             -- set OUT result to CONSTRAINED
1726             x_result := OE_PC_GLOBALS.YES;
1727         END IF;
1728 
1729     END IF;
1730 
1731     IF p_header_adj_rec.attribute9 = FND_API.G_MISS_CHAR THEN NULL;
1732     ELSIF NOT OE_GLOBALS.EQUAL(p_header_adj_rec.attribute9,p_old_header_adj_rec.attribute9) THEN
1733 
1734         l_result := ATTRIBUTE9
1735             (p_operation        => l_operation
1736             ,p_record   => l_rowtype_rec
1737             ,x_on_operation_action => l_on_operation_action
1738             );
1739 
1740         IF l_result = OE_PC_GLOBALS.YES THEN
1741             -- set OUT result to CONSTRAINED
1742             x_result := OE_PC_GLOBALS.YES;
1743         END IF;
1744 
1745     END IF;
1746 
1747     IF OE_PC_GLOBALS.G_CHECK_UPDATE_ALL_FOR_DFF = 'N' THEN
1748        IF l_debug_level  > 0 THEN
1749            oe_debug_pub.add(  'SETTING CHECK ALL COLS CONSTRAINT TO:'||L_CHECK_ALL_COLS_CONSTRAINT ) ;
1750        END IF;
1751        g_check_all_cols_constraint := l_check_all_cols_constraint;
1752     END IF;
1753 
1754     -- END: CHECK FOR CONSTRAINTS ON DESC FLEXFIELD ATTRIBUTES
1755     -- NOTE: Please add constraints check for new attributes before the
1756     -- descriptive flexfield attributes check.
1757 
1758 IF l_debug_level  > 0 THEN
1759     oe_debug_pub.add(  'EXIT OE_HEADER_ADJ_SECURITY.ATTRIBUTES' , 1 ) ;
1760 END IF;
1761 
1762 EXCEPTION
1763     WHEN FND_API.G_EXC_ERROR THEN
1764     x_return_status := FND_API.G_RET_STS_ERROR;
1765     WHEN OTHERS THEN
1766     x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1767     IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1768         OE_MSG_PUB.Add_Exc_Msg
1769         (   G_PKG_NAME
1770         ,   'Attributes'
1771         );
1772     END IF;
1773 
1774 END Attributes;
1775 
1776 END OE_Header_Adj_Security;