1 PACKAGE BODY PO_REQUISITION_LINES_PKG7 as
2 /* $Header: POXRIL7B.pls 120.0.12020000.2 2013/02/11 00:08:50 vegajula ship $ */
3 c_log_head CONSTANT VARCHAR2(40) := 'po.plsql.PO_REQUISITION_LINES_PKG7.';
4 g_fnd_debug CONSTANT VARCHAR2(1) := NVL(FND_PROFILE.VALUE('AFLOG_ENABLED'),'N');
5
6 PROCEDURE Lock2_Row(X_Rowid VARCHAR2,
7 X_Research_Agent_Id NUMBER,
8 X_On_Line_Flag VARCHAR2,
9 X_Wip_Entity_Id NUMBER,
10 X_Wip_Line_Id NUMBER,
11 X_Wip_Repetitive_Schedule_Id NUMBER,
12 X_Wip_Operation_Seq_Num NUMBER,
13 X_Wip_Resource_Seq_Num NUMBER,
14 X_Attribute_Category VARCHAR2,
15 X_Destination_Context VARCHAR2,
16 X_Inventory_Source_Context VARCHAR2,
17 X_Vendor_Source_Context VARCHAR2,
18 X_Attribute1 VARCHAR2,
19 X_Attribute2 VARCHAR2,
20 X_Attribute3 VARCHAR2,
21 X_Attribute4 VARCHAR2,
22 X_Attribute5 VARCHAR2,
23 X_Attribute6 VARCHAR2
24 ) IS
25
26 CURSOR C IS
27 SELECT *
28 FROM PO_REQUISITION_LINES
29 WHERE rowid = X_Rowid
30 FOR UPDATE of Requisition_Line_Id NOWAIT;
31
32 Recinfo C%ROWTYPE;
33 --For debugging Purposes.
34 l_api_name CONSTANT VARCHAR2(30) := 'Lock2_Row';
35 BEGIN
36 OPEN C;
37 FETCH C INTO Recinfo;
38 if (C%NOTFOUND) then
39 CLOSE C;
40 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
41 APP_EXCEPTION.Raise_Exception;
42 end if;
43 CLOSE C;
44
45 if (
46
47 ( (Recinfo.research_agent_id = X_Research_Agent_Id)
48 OR ( (Recinfo.research_agent_id IS NULL)
49 AND (X_Research_Agent_Id IS NULL)))
50 AND ( (TRIM(Recinfo.on_line_flag) = TRIM(X_On_Line_Flag))
51 OR ( (TRIM(Recinfo.on_line_flag) IS NULL)
52 AND (TRIM(X_On_Line_Flag) IS NULL)))
53 AND ( (Recinfo.wip_entity_id = X_Wip_Entity_Id)
54 OR ( (Recinfo.wip_entity_id IS NULL)
55 AND (X_Wip_Entity_Id IS NULL)))
56 AND ( (Recinfo.wip_line_id = X_Wip_Line_Id)
57 OR ( (Recinfo.wip_line_id IS NULL)
58 AND (X_Wip_Line_Id IS NULL)))
59 AND ( (Recinfo.wip_repetitive_schedule_id = X_Wip_Repetitive_Schedule_Id)
60 OR ( (Recinfo.wip_repetitive_schedule_id IS NULL)
61 AND (X_Wip_Repetitive_Schedule_Id IS NULL)))
62 AND ( (Recinfo.wip_operation_seq_num = X_Wip_Operation_Seq_Num)
63 OR ( (Recinfo.wip_operation_seq_num IS NULL)
64 AND (X_Wip_Operation_Seq_Num IS NULL)))
65 AND ( (Recinfo.wip_resource_seq_num = X_Wip_Resource_Seq_Num)
66 OR ( (Recinfo.wip_resource_seq_num IS NULL)
67 AND (X_Wip_Resource_Seq_Num IS NULL)))
68 AND ( (TRIM(Recinfo.attribute_category) = TRIM(X_Attribute_Category))
69 OR ( (TRIM(Recinfo.attribute_category) IS NULL)
70 AND (TRIM(X_Attribute_Category) IS NULL)))
71 AND ( (TRIM(Recinfo.destination_context) = TRIM(X_Destination_Context))
72 OR ( (TRIM(Recinfo.destination_context) IS NULL)
73 AND (TRIM(X_Destination_Context) IS NULL)))
74 AND ( (TRIM(Recinfo.inventory_source_context) = TRIM(X_Inventory_Source_Context))
75 OR ( (TRIM(Recinfo.inventory_source_context) IS NULL)
76 AND (TRIM(X_Inventory_Source_Context) IS NULL)))
77 AND ( (TRIM(Recinfo.vendor_source_context) = TRIM(X_Vendor_Source_Context))
78 OR ( (TRIM(Recinfo.vendor_source_context) IS NULL)
79 AND (TRIM(X_Vendor_Source_Context) IS NULL)))
80 AND ( (TRIM(Recinfo.attribute1) = TRIM(X_Attribute1))
81 OR ( (TRIM(Recinfo.attribute1) IS NULL)
82 AND (TRIM(X_Attribute1) IS NULL)))
83 AND ( (TRIM(Recinfo.attribute2) = TRIM(X_Attribute2))
84 OR ( (TRIM(Recinfo.attribute2) IS NULL)
85 AND (TRIM(X_Attribute2) IS NULL)))
86 AND ( (TRIM(Recinfo.attribute3) = TRIM(X_Attribute3))
87 OR ( (TRIM(Recinfo.attribute3) IS NULL)
88 AND (TRIM(X_Attribute3) IS NULL)))
89 AND ( (TRIM(Recinfo.attribute4) = TRIM(X_Attribute4))
90 OR ( (TRIM(Recinfo.attribute4) IS NULL)
91 AND (TRIM(X_Attribute4) IS NULL)))
92 AND ( (TRIM(Recinfo.attribute5) = TRIM(X_Attribute5))
93 OR ( (TRIM(Recinfo.attribute5) IS NULL)
94 AND (TRIM(X_Attribute5) IS NULL)))
95 AND ( (TRIM(Recinfo.attribute6) = TRIM(X_Attribute6))
96 OR ( (TRIM(Recinfo.attribute6) IS NULL)
97 AND (TRIM(X_Attribute6) IS NULL)))
98 ) then
99 return;
100 else
101 -- Logging Infra: Procedure level
102 IF (g_fnd_debug = 'Y' ) THEN
103 if (nvl(X_Research_Agent_Id, -999 ) <> nvl(Recinfo.Research_Agent_Id, -999 ) ) then
104 FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Research_Agent_Id '||X_Research_Agent_Id ||' Database Research_Agent_Id '||Recinfo.Research_Agent_Id);
105 end if;
106 if (nvl(X_On_Line_Flag,'-999') <> nvl(Recinfo.On_Line_Flag,'-999') ) then
107 FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_On_Line_Flag '||X_On_Line_Flag ||' Database On_Line_Flag '||Recinfo.On_Line_Flag);
108 end if;
109 if (nvl(X_Wip_Entity_Id, -999 ) <> nvl(Recinfo.Wip_Entity_Id, -999 ) ) then
110 FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Wip_Entity_Id '||X_Wip_Entity_Id ||' Database Wip_Entity_Id '||Recinfo.Wip_Entity_Id);
111 end if;
112 if (nvl(X_Wip_Line_Id, -999 ) <> nvl(Recinfo.Wip_Line_Id, -999 ) ) then
113 FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Wip_Line_Id '||X_Wip_Line_Id ||' Database Wip_Line_Id '||Recinfo.Wip_Line_Id);
114 end if;
115 if (nvl(X_Wip_Repetitive_Schedule_Id, -999 ) <> nvl(Recinfo.Wip_Repetitive_Schedule_Id, -999 ) ) then
116 FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Wip_Repetitive_Schedule_Id '||X_Wip_Repetitive_Schedule_Id ||' Database Wip_Repetitive_Schedule_Id '||Recinfo.Wip_Repetitive_Schedule_Id);
117 end if;
118 if (nvl(X_Wip_Operation_Seq_Num, -999 ) <> nvl(Recinfo.Wip_Operation_Seq_Num, -999 ) ) then
119 FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Wip_Operation_Seq_Num '||X_Wip_Operation_Seq_Num ||' Database Wip_Operation_Seq_Num '||Recinfo.Wip_Operation_Seq_Num);
120 end if;
121 if (nvl(X_Wip_Resource_Seq_Num, -999 ) <> nvl(Recinfo.Wip_Resource_Seq_Num, -999 ) ) then
122 FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Wip_Resource_Seq_Num '||X_Wip_Resource_Seq_Num ||' Database Wip_Resource_Seq_Num '||Recinfo.Wip_Resource_Seq_Num);
123 end if;
124 if (nvl(X_Attribute_Category,'-999') <> nvl(Recinfo.Attribute_Category,'-999') ) then
125 FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Attribute_Category '||X_Attribute_Category ||' Database Attribute_Category '||Recinfo.Attribute_Category);
126 end if;
127 if (nvl(X_Destination_Context,'-999') <> nvl(Recinfo.Destination_Context,'-999') ) then
128 FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Destination_Context '||X_Destination_Context ||' Database Destination_Context '||Recinfo.Destination_Context);
129 end if;
130 if (nvl(X_Inventory_Source_Context,'-999') <> nvl(Recinfo.Inventory_Source_Context,'-999') ) then
131 FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Inventory_Source_Context '||X_Inventory_Source_Context ||' Database Inventory_Source_Context '||Recinfo.Inventory_Source_Context);
132 end if;
133 if (nvl(X_Vendor_Source_Context,'-999') <> nvl(Recinfo.Vendor_Source_Context,'-999') ) then
134 FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Vendor_Source_Context '||X_Vendor_Source_Context ||' Database Vendor_Source_Context '||Recinfo.Vendor_Source_Context);
135 end if;
136 if (nvl(X_Attribute1,'-999') <> nvl(Recinfo.Attribute1,'-999') ) then
137 FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Attribute1 '||X_Attribute1 ||' Database Attribute1 '||Recinfo.Attribute1);
138 end if;
139 if (nvl(X_Attribute2,'-999') <> nvl(Recinfo.Attribute2,'-999') ) then
140 FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Attribute2 '||X_Attribute2 ||' Database Attribute2 '||Recinfo.Attribute2);
141 end if;
142 if (nvl(X_Attribute3,'-999') <> nvl(Recinfo.Attribute3,'-999') ) then
143 FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Attribute3 '||X_Attribute3 ||' Database Attribute3 '||Recinfo.Attribute3);
144 end if;
145 if (nvl(X_Attribute4,'-999') <> nvl(Recinfo.Attribute4,'-999') ) then
146 FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Attribute4 '||X_Attribute4 ||' Database Attribute4 '||Recinfo.Attribute4);
147 end if;
148 if (nvl(X_Attribute5,'-999') <> nvl(Recinfo.Attribute5,'-999') ) then
149 FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Attribute5 '||X_Attribute5 ||' Database Attribute5 '||Recinfo.Attribute5);
150 end if;
151 if (nvl(X_Attribute6,'-999') <> nvl(Recinfo.Attribute6,'-999') ) then
152 FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Attribute6 '||X_Attribute6 ||' Database Attribute6 '||Recinfo.Attribute6);
153 end if;
154
155
156 END IF;
157
158 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
159 APP_EXCEPTION.RAISE_EXCEPTION;
160 end if;
161
162 END Lock2_Row;
163
164 END PO_REQUISITION_LINES_PKG7;