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