DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_HEADERS_PKG_S1

Source


1 PACKAGE BODY PO_HEADERS_PKG_S1 as
2 /* $Header: POXP2PHB.pls 120.3.12020000.2 2013/02/10 22:27:04 vegajula ship $ */
3 
4 -- Read the profile option that enables/disables the debug log
5 g_fnd_debug CONSTANT VARCHAR2(1) := NVL(FND_PROFILE.VALUE('AFLOG_ENABLED'),'N');
6 
7 g_module_prefix CONSTANT VARCHAR2(50) := 'po.plsql.PO_HEADERS_PKG_S1.';
8 
9 
10 /*===========================================================================
11 
12   PROCEDURE NAME:	Lock_Row()
13 
14 ===========================================================================*/
15 
16   PROCEDURE Lock_Row(X_Rowid                            VARCHAR2,
17                      X_Po_Header_Id                     NUMBER,
18                      X_Agent_Id                         NUMBER,
19                      X_Type_Lookup_Code                 VARCHAR2,
20                      X_Segment1                         VARCHAR2,
21                      X_Summary_Flag                     VARCHAR2,
22                      X_Enabled_Flag                     VARCHAR2,
23                      X_Segment2                         VARCHAR2,
24                      X_Segment3                         VARCHAR2,
25                      X_Segment4                         VARCHAR2,
26                      X_Segment5                         VARCHAR2,
27                      X_Start_Date_Active                DATE,
28                      X_End_Date_Active                  DATE,
29                      X_Vendor_Id                        NUMBER,
30                      X_Vendor_Site_Id                   NUMBER,
31                      X_Vendor_Contact_Id                NUMBER,
32                      X_Ship_To_Location_Id              NUMBER,
33                      X_Bill_To_Location_Id              NUMBER,
34                      X_Terms_Id                         NUMBER,
35                      X_Ship_Via_Lookup_Code             VARCHAR2,
36                      X_Fob_Lookup_Code                  VARCHAR2,
37                      X_Pay_On_Code                      VARCHAR2,
38                      X_Freight_Terms_Lookup_Code        VARCHAR2,
39                      X_Status_Lookup_Code               VARCHAR2,
40                      X_Currency_Code                    VARCHAR2,
41                      X_Rate_Type                        VARCHAR2,
42                      X_Rate_Date                        DATE,
43                      X_Rate                             NUMBER,
44                      X_From_Header_Id                   NUMBER,
45                      X_From_Type_Lookup_Code            VARCHAR2,
46                      X_Start_Date                       DATE,
47                      X_End_Date                         DATE,
48                      X_Blanket_Total_Amount             NUMBER,
49                      X_Authorization_Status             VARCHAR2,
50                      X_Revision_Num                     NUMBER,
51 -- Bug 902976, zxzhang, 10/04/99
52 -- Change REVISED_DATE from VarChar(25) to Date.
53 --                   X_Revised_Date                     VARCHAR2,
54                      X_Revised_Date                     DATE,
55                      X_Approved_Flag                    VARCHAR2,
56                      X_Approved_Date                    DATE,
57                      X_Amount_Limit                     NUMBER,
58                      X_Min_Release_Amount               NUMBER,
59                      X_Note_To_Authorizer               VARCHAR2,
60                      X_Note_To_Vendor                   VARCHAR2,
61                      X_Note_To_Receiver                 VARCHAR2,
62                      X_Print_Count                      NUMBER,
63                      X_Printed_Date                     DATE,
64                      X_Vendor_Order_Num                 VARCHAR2,
65                      X_Confirming_Order_Flag            VARCHAR2,
66                      X_Comments                         VARCHAR2,
67                      X_Reply_Date                       DATE,
68                      X_Reply_Method_Lookup_Code         VARCHAR2,
69                      X_Rfq_Close_Date                   DATE,
70                      X_Quote_Type_Lookup_Code           VARCHAR2,
71                      X_Quotation_Class_Code             VARCHAR2,
72                      X_Quote_Warning_Delay_Unit         VARCHAR2,
73                      X_Quote_Warning_Delay              NUMBER,
74                      X_Quote_Vendor_Quote_Number        VARCHAR2,
75                      X_Acceptance_Required_Flag         VARCHAR2,
76                      X_Acceptance_Due_Date              DATE,
77                      X_Closed_Date                      DATE,
78                      X_User_Hold_Flag                   VARCHAR2,
79                      X_Approval_Required_Flag           VARCHAR2,
80                      X_Cancel_Flag                      VARCHAR2,
81                      X_Firm_Status_Lookup_Code          VARCHAR2,
82                      X_Firm_Date                        DATE,
83                      X_Frozen_Flag                      VARCHAR2,
84                      X_Attribute_Category               VARCHAR2,
85                      X_Attribute1                       VARCHAR2,
86                      X_Attribute2                       VARCHAR2,
87                      X_Attribute3                       VARCHAR2,
88                      X_Attribute4                       VARCHAR2,
89                      X_Attribute5                       VARCHAR2,
90                      X_Attribute6                       VARCHAR2,
91                      X_Attribute7                       VARCHAR2,
92                      X_Attribute8                       VARCHAR2,
93                      X_Attribute9                       VARCHAR2,
94                      X_Attribute10                      VARCHAR2,
95                      X_Attribute11                      VARCHAR2,
96                      X_Attribute12                      VARCHAR2,
97                      X_Attribute13                      VARCHAR2,
98                      X_Attribute14                      VARCHAR2,
99                      X_Attribute15                      VARCHAR2,
100                      X_Closed_Code                      VARCHAR2,
101                      X_Ussgl_Transaction_Code           VARCHAR2,
102                      X_Government_Context               VARCHAR2,
103                      X_Supply_Agreement_flag            VARCHAR2,
104                      X_Global_Agreement_Flag            VARCHAR2,
105                      X_Price_Update_Tolerance           NUMBER,
106                      X_Global_Attribute_Category        VARCHAR2,
107                      X_Global_Attribute1                VARCHAR2,
108                      X_Global_Attribute2                VARCHAR2,
109                      X_Global_Attribute3                VARCHAR2,
110                      X_Global_Attribute4                VARCHAR2,
111                      X_Global_Attribute5                VARCHAR2,
112                      X_Global_Attribute6                VARCHAR2,
113                      X_Global_Attribute7                VARCHAR2,
114                      X_Global_Attribute8                VARCHAR2,
115                      X_Global_Attribute9                VARCHAR2,
116                      X_Global_Attribute10               VARCHAR2,
117                      X_Global_Attribute11               VARCHAR2,
118                      X_Global_Attribute12               VARCHAR2,
119                      X_Global_Attribute13               VARCHAR2,
120                      X_Global_Attribute14               VARCHAR2,
121                      X_Global_Attribute15               VARCHAR2,
122                      X_Global_Attribute16               VARCHAR2,
123                      X_Global_Attribute17               VARCHAR2,
124                      X_Global_Attribute18               VARCHAR2,
125                      X_Global_Attribute19               VARCHAR2,
126                      X_Global_Attribute20               VARCHAR2,
127                      x_new_print_count       OUT NOCOPY NUMBER,
128                      x_new_printed_date      OUT NOCOPY DATE,
129                      p_shipping_control      IN         VARCHAR2    -- <INBOUND LOGISTICS FPJ>
130                     ,p_conterms_exist_flag   IN         VARCHAR2    -- <CONTERMS FPJ>
131                     ,p_encumbrance_required_flag IN VARCHAR2 --<ENCUMBRANCE FPJ>
132   ) IS
136         WHERE  rowid = X_Rowid
133     CURSOR C IS
134         SELECT *
135         FROM   PO_HEADERS
137         FOR UPDATE of Po_Header_Id NOWAIT;
138     Recinfo C%ROWTYPE;
139 	l_api_name CONSTANT VARCHAR2(30) := 'Lock_Row';
140   BEGIN
141     OPEN C;
142     FETCH C INTO Recinfo;
143     if (C%NOTFOUND) then
144       CLOSE C;
145       IF (g_fnd_debug = 'Y') THEN
146           IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_ERROR) THEN
147             FND_LOG.string(FND_LOG.level_error, g_module_prefix || 'lock_row.000',
148                          'Cursor failed with rowid = ' || nvl(x_rowid,'null'));
149           END IF;
150       END IF;
151       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
152       APP_EXCEPTION.Raise_Exception;
153     end if;
154     CLOSE C;
155 /* Bug 2032728. Modified the lock row procedures for headers to compare truncated
156                 dates so that the time stamp is not compared as the time stamp
157                 was causing the problem.
158 */
159     if (
160 
161                (Recinfo.po_header_id = X_Po_Header_Id)
162            AND (Recinfo.agent_id = X_Agent_Id)
163            AND (TRIM(Recinfo.type_lookup_code) = TRIM(X_Type_Lookup_Code))
164            AND (TRIM(Recinfo.segment1) = TRIM(X_Segment1))
165            AND (TRIM(Recinfo.summary_flag) = TRIM(X_Summary_Flag))
166            AND (TRIM(Recinfo.enabled_flag) = TRIM(X_Enabled_Flag))
167            AND (   (TRIM(Recinfo.segment2) = TRIM(X_Segment2))
168                 OR ((TRIM(Recinfo.segment2) IS NULL)
169                     AND (TRIM(X_Segment2) IS NULL)))
170            AND (   (TRIM(Recinfo.segment3) =TRIM( X_Segment3))
171                 OR (    (TRIM(Recinfo.segment3) IS NULL)
172                     AND (TRIM(X_Segment3) IS NULL)))
173            AND (   (TRIM(Recinfo.segment4) = TRIM(X_Segment4))
174                 OR (    (TRIM(Recinfo.segment4) IS NULL)
175                     AND (TRIM(X_Segment4) IS NULL)))
176            AND (   (TRIM(Recinfo.segment5) = TRIM(X_Segment5))
177                 OR (    (TRIM(Recinfo.segment5) IS NULL)
178                     AND (TRIM(X_Segment5) IS NULL)))
179            AND (   (trunc(Recinfo.start_date_active) = trunc(X_Start_Date_Active))
180                 OR (    (Recinfo.start_date_active IS NULL)
181                     AND (X_Start_Date_Active IS NULL)))
182            AND (   (trunc(Recinfo.end_date_active) = trunc(X_End_Date_Active))
183                 OR (    (Recinfo.end_date_active IS NULL)
184                     AND (X_End_Date_Active IS NULL)))
185            AND (   (Recinfo.vendor_id = X_Vendor_Id)
186                 OR (    (Recinfo.vendor_id IS NULL)
187                     AND (X_Vendor_Id IS NULL)))
188            AND (   (Recinfo.vendor_site_id = X_Vendor_Site_Id)
189                 OR (    (Recinfo.vendor_site_id IS NULL)
190                     AND (X_Vendor_Site_Id IS NULL)))
191            AND (   (Recinfo.vendor_contact_id = X_Vendor_Contact_Id)
192                 OR (    (Recinfo.vendor_contact_id IS NULL)
193                     AND (X_Vendor_Contact_Id IS NULL)))
194            AND (   (Recinfo.ship_to_location_id = X_Ship_To_Location_Id)
195                 OR (    (Recinfo.ship_to_location_id IS NULL)
196                     AND (X_Ship_To_Location_Id IS NULL)))
197            AND (   (Recinfo.bill_to_location_id = X_Bill_To_Location_Id)
198                 OR (    (Recinfo.bill_to_location_id IS NULL)
199                     AND (X_Bill_To_Location_Id IS NULL)))
200            AND (   (Recinfo.terms_id = X_Terms_Id)
201                 OR (    (Recinfo.terms_id IS NULL)
202                     AND (X_Terms_Id IS NULL)))
203            AND (   (TRIM(Recinfo.ship_via_lookup_code) = TRIM(X_Ship_Via_Lookup_Code))
204                 OR (    (TRIM(Recinfo.ship_via_lookup_code) IS NULL)
205                     AND (TRIM(X_Ship_Via_Lookup_Code) IS NULL)))
206            AND (   (TRIM(Recinfo.fob_lookup_code) = TRIM(X_Fob_Lookup_Code))
207                 OR (    (TRIM(Recinfo.fob_lookup_code) IS NULL)
208                     AND (TRIM(X_Fob_Lookup_Code) IS NULL)))
209            AND (   (TRIM(Recinfo.pay_on_code) = TRIM(X_Pay_On_Code))
210                 OR (    (TRIM(Recinfo.pay_on_code) IS NULL)
211                     AND (TRIM(X_Pay_On_Code) IS NULL)))
212            AND (   (TRIM(Recinfo.freight_terms_lookup_code) = TRIM(X_Freight_Terms_Lookup_Code))
213                 OR (    (TRIM(Recinfo.freight_terms_lookup_code) IS NULL)
214                     AND (TRIM(X_Freight_Terms_Lookup_Code) IS NULL)))
215            AND (   (TRIM(Recinfo.status_lookup_code) = TRIM(X_Status_Lookup_Code))
216                 OR (    (TRIM(Recinfo.status_lookup_code) IS NULL)
217                     AND (TRIM(X_Status_Lookup_Code) IS NULL)))
218            AND (   (TRIM(Recinfo.currency_code) = TRIM(X_Currency_Code))
219                 OR (    (TRIM(Recinfo.currency_code) IS NULL)
220                     AND (TRIM(X_Currency_Code) IS NULL)))
221            AND (   (TRIM(Recinfo.rate_type) = TRIM(X_Rate_Type))
222                 OR (    (TRIM(Recinfo.rate_type) IS NULL)
223                     AND (TRIM(X_Rate_Type) IS NULL)))
224            AND (   (trunc(Recinfo.rate_date) = trunc(X_Rate_Date))
225                 OR (    (Recinfo.rate_date IS NULL)
226                     AND (X_Rate_Date IS NULL)))
227            AND (   (Recinfo.rate = X_Rate)
228                 OR (    (Recinfo.rate IS NULL)
229                     AND (X_Rate IS NULL)))
230            AND (   (Recinfo.from_header_id = X_From_Header_Id)
231                 OR (    (Recinfo.from_header_id IS NULL)
232                     AND (X_From_Header_Id IS NULL)))
233            AND (   (TRIM(Recinfo.from_type_lookup_code) = TRIM(X_From_Type_Lookup_Code))
234                 OR (    (TRIM(Recinfo.from_type_lookup_code) IS NULL)
235                     AND (TRIM(X_From_Type_Lookup_Code) IS NULL)))
236            AND (   (trunc(Recinfo.start_date) = trunc(X_Start_Date))
237                 OR (    (Recinfo.start_date IS NULL)
241                     AND (X_End_Date IS NULL)))
238                     AND (X_Start_Date IS NULL)))
239            AND (   (trunc(Recinfo.end_date) = trunc(X_End_Date))
240                 OR (    (Recinfo.end_date IS NULL)
242            AND (   (Recinfo.blanket_total_amount = X_Blanket_Total_Amount)
243                 OR (    (Recinfo.blanket_total_amount IS NULL)
244                     AND (X_Blanket_Total_Amount IS NULL)))
245            AND (   (TRIM(Recinfo.authorization_status) = TRIM(X_Authorization_Status))
246                 OR (    (TRIM(Recinfo.authorization_status) IS NULL)
247                     AND (TRIM(X_Authorization_Status) IS NULL)))
248            AND (   (Recinfo.revision_num = X_Revision_Num)
249                 OR (    (Recinfo.revision_num IS NULL)
250                     AND (X_Revision_Num IS NULL)))
251            AND (   (trunc(Recinfo.revised_date) = trunc(X_Revised_Date))
252                 OR (    (Recinfo.revised_date IS NULL)
253                     AND (X_Revised_Date IS NULL)))
254            AND (   (TRIM(Recinfo.approved_flag) = TRIM(X_Approved_Flag))
255                 OR (    (TRIM(Recinfo.approved_flag) IS NULL)
256                     AND (TRIM(X_Approved_Flag) IS NULL)))
257            AND (   (trunc(Recinfo.approved_date) = trunc(X_Approved_Date))
258                 OR (    (Recinfo.approved_date IS NULL)
259                     AND (X_Approved_Date IS NULL)))
260            AND (   (Recinfo.amount_limit = X_Amount_Limit)
261                 OR (    (Recinfo.amount_limit IS NULL)
262                     AND (X_Amount_Limit IS NULL)))
263            AND (   (Recinfo.min_release_amount = X_Min_Release_Amount)
264                 OR (    (Recinfo.min_release_amount IS NULL)
265                     AND (X_Min_Release_Amount IS NULL)))
266            AND (   (TRIM(Recinfo.note_to_authorizer) = TRIM(X_Note_To_Authorizer))
267                 OR (    (TRIM(Recinfo.note_to_authorizer) IS NULL)
268                     AND (TRIM(X_Note_To_Authorizer) IS NULL)))
269            AND (   (TRIM(Recinfo.note_to_vendor) = TRIM(X_Note_To_Vendor))
270                 OR (    (TRIM(Recinfo.note_to_vendor) IS NULL)
271                     AND (TRIM(X_Note_To_Vendor) IS NULL)))
272            AND (   (TRIM(Recinfo.note_to_receiver) = TRIM(X_Note_To_Receiver))
273                 OR (    (TRIM(Recinfo.note_to_receiver) IS NULL)
274                     AND (TRIM(X_Note_To_Receiver) IS NULL)))
275            AND (   (TRIM(Recinfo.vendor_order_num) = TRIM(X_Vendor_Order_Num))
276                 OR (    (TRIM(Recinfo.vendor_order_num) IS NULL)
277                     AND (TRIM(X_Vendor_Order_Num) IS NULL)))
278            AND (   (TRIM(Recinfo.confirming_order_flag) = TRIM(X_Confirming_Order_Flag))
279                 OR (    (TRIM(Recinfo.confirming_order_flag) IS NULL)
280                     AND (TRIM(X_Confirming_Order_Flag) IS NULL)))
281            AND (   (TRIM(Recinfo.comments) = TRIM(X_Comments))  -- Bug 3308189
282                 OR (    (TRIM(Recinfo.comments) IS NULL)
283                     AND (TRIM(X_Comments) IS NULL)))
284            AND (   (trunc(Recinfo.reply_date) = trunc(X_Reply_Date))
285                 OR (    (Recinfo.reply_date IS NULL)
286                     AND (X_Reply_Date IS NULL)))
287            AND (   (TRIM(Recinfo.reply_method_lookup_code) = TRIM(X_Reply_Method_Lookup_Code))
288                 OR (    (TRIM(Recinfo.reply_method_lookup_code) IS NULL)
289                     AND (TRIM(X_Reply_Method_Lookup_Code) IS NULL)))
290            AND (   (TRIM(Recinfo.shipping_control) = TRIM(p_shipping_control))
291                 OR (    (TRIM(Recinfo.shipping_control) IS NULL)
292                     AND (TRIM(p_shipping_control) IS NULL)))    -- <INBOUND LOGISTICS FPJ>
293 	   --<CONTERMS FPJ START>
294            AND (   (TRIM(Recinfo.conterms_exist_flag) = TRIM(p_conterms_exist_flag))
295                 OR (    (TRIM(Recinfo.conterms_exist_flag) IS NULL)
296                     AND (TRIM(p_conterms_exist_flag) IS NULL)))
297 	   -- <CONTERMS FPJ END>
298            --<ENCUMBRANCE FPJ START>
299            AND (   (TRIM(Recinfo.encumbrance_required_flag) = TRIM(p_encumbrance_required_flag))
300                 OR (    (TRIM(Recinfo.encumbrance_required_flag) IS NULL)
301                     AND (TRIM(p_encumbrance_required_flag) IS NULL)))
302            -- <ENCUMBRANCE FPJ END>
303          )  then
304 
305             if (
306                (   (trunc(Recinfo.rfq_close_date) = trunc(X_Rfq_Close_Date))
307                 OR (    (Recinfo.rfq_close_date IS NULL)
308                     AND (X_Rfq_Close_Date IS NULL)))
309            AND (   (TRIM(Recinfo.quote_type_lookup_code) = TRIM(X_Quote_Type_Lookup_Code))
310                 OR (    (TRIM(Recinfo.quote_type_lookup_code) IS NULL)
311                     AND (TRIM(X_Quote_Type_Lookup_Code) IS NULL)))
312            AND (   (TRIM(Recinfo.quotation_class_code) = TRIM(X_Quotation_Class_Code))
313                 OR (    (TRIM(Recinfo.quotation_class_code) IS NULL)
314                     AND (TRIM(X_Quotation_Class_Code) IS NULL)))
315            AND (   (TRIM(Recinfo.quote_warning_delay_unit) = TRIM(X_Quote_Warning_Delay_Unit))
316                 OR (    (TRIM(Recinfo.quote_warning_delay_unit) IS NULL)
317                     AND (TRIM(X_Quote_Warning_Delay_Unit) IS NULL)))
318            AND (   (Recinfo.quote_warning_delay = X_Quote_Warning_Delay)
319                 OR (    (Recinfo.quote_warning_delay IS NULL)
320                     AND (X_Quote_Warning_Delay IS NULL)))
321            AND (   (TRIM(Recinfo.quote_vendor_quote_number) = TRIM(X_Quote_Vendor_Quote_Number))
322                 OR (    (TRIM(Recinfo.quote_vendor_quote_number) IS NULL)
323                     AND (TRIM(X_Quote_Vendor_Quote_Number) IS NULL)))
324            AND (   (TRIM(Recinfo.acceptance_required_flag) = TRIM(X_Acceptance_Required_Flag))
325                 OR (    (TRIM(Recinfo.acceptance_required_flag) IS NULL)
326                     AND (TRIM(X_Acceptance_Required_Flag) IS NULL)))
327            AND (   (trunc(Recinfo.acceptance_due_date) = trunc(X_Acceptance_Due_Date))
328                 OR (    (Recinfo.acceptance_due_date IS NULL)
332                     AND (X_Closed_Date IS NULL)))
329                     AND (X_Acceptance_Due_Date IS NULL)))
330            AND (   (trunc(Recinfo.closed_date) = trunc(X_Closed_Date))
331                 OR (    (Recinfo.closed_date IS NULL)
333            AND (   (TRIM(Recinfo.user_hold_flag) = TRIM(X_User_Hold_Flag))
334                 OR (    (TRIM(Recinfo.user_hold_flag) IS NULL)
335                     AND (TRIM(X_User_Hold_Flag) IS NULL)))
336            AND (   (TRIM(Recinfo.approval_required_flag) = TRIM(X_Approval_Required_Flag))
337                 OR (    (TRIM(Recinfo.approval_required_flag) IS NULL)
338                     AND (TRIM(X_Approval_Required_Flag) IS NULL)))
339            AND (   (TRIM(Recinfo.cancel_flag) = TRIM(X_Cancel_Flag))
340                 OR (    (TRIM(Recinfo.cancel_flag) IS NULL)
341                     AND (TRIM(X_Cancel_Flag) IS NULL)))
342            AND (   (TRIM(Recinfo.firm_status_lookup_code) = TRIM(X_Firm_Status_Lookup_Code))
343                 OR (    (TRIM(Recinfo.firm_status_lookup_code) IS NULL)
344                     AND (TRIM(X_Firm_Status_Lookup_Code) IS NULL)))
345            AND (   (trunc(Recinfo.firm_date) = trunc(X_Firm_Date))
346                 OR (    (Recinfo.firm_date IS NULL)
347                     AND (X_Firm_Date IS NULL)))
348            AND (   (TRIM(Recinfo.frozen_flag) = TRIM(X_Frozen_Flag))
349                 OR (    (TRIM(Recinfo.frozen_flag) IS NULL)
350                     AND (TRIM(X_Frozen_Flag) IS NULL)))
351            AND (   (TRIM(Recinfo.attribute_category) = TRIM(X_Attribute_Category))
352                 OR (    (TRIM(Recinfo.attribute_category) IS NULL)
353                     AND (TRIM(X_Attribute_Category) IS NULL)))
354            AND (   (TRIM(Recinfo.attribute1) = TRIM(X_Attribute1))
355                 OR (    (TRIM(Recinfo.attribute1) IS NULL)
356                     AND (TRIM(X_Attribute1) IS NULL)))
357            AND (   (TRIM(Recinfo.attribute2) = TRIM(X_Attribute2))
358                 OR (    (TRIM(Recinfo.attribute2) IS NULL)
359                     AND (TRIM(X_Attribute2) IS NULL)))
360            AND (   (TRIM(Recinfo.attribute3) = TRIM(X_Attribute3))
361                 OR (    (TRIM(Recinfo.attribute3) IS NULL)
362                     AND (TRIM(X_Attribute3) IS NULL)))
363            AND (   (TRIM(Recinfo.attribute4) = TRIM(X_Attribute4))
364                 OR (    (TRIM(Recinfo.attribute4) IS NULL)
365                     AND (TRIM(X_Attribute4) IS NULL)))
366            AND (   (TRIM(Recinfo.attribute5) = TRIM(X_Attribute5))
367                 OR (    (TRIM(Recinfo.attribute5) IS NULL)
368                     AND (TRIM(X_Attribute5) IS NULL)))
369            AND (   (TRIM(Recinfo.attribute6) = TRIM(X_Attribute6))
370                 OR (    (TRIM(Recinfo.attribute6) IS NULL)
371                     AND (TRIM(X_Attribute6) IS NULL)))
372            AND (   (TRIM(Recinfo.attribute7) = TRIM(X_Attribute7))
373                 OR (    (TRIM(Recinfo.attribute7) IS NULL)
374                     AND (TRIM(X_Attribute7) IS NULL)))
375            AND (   (TRIM(Recinfo.attribute8) = TRIM(X_Attribute8))
376                 OR (    (TRIM(Recinfo.attribute8) IS NULL)
377                     AND (TRIM(X_Attribute8) IS NULL)))
378            AND (   (TRIM(Recinfo.attribute9) = TRIM(X_Attribute9))
379                 OR (    (TRIM(Recinfo.attribute9) IS NULL)
380                     AND (TRIM(X_Attribute9) IS NULL)))
381            AND (   (TRIM(Recinfo.attribute10) = TRIM(X_Attribute10))
382                 OR (    (TRIM(Recinfo.attribute10) IS NULL)
383                     AND (TRIM(X_Attribute10) IS NULL)))
384            AND (   (TRIM(Recinfo.attribute11) = TRIM(X_Attribute11))
385                 OR (    (TRIM(Recinfo.attribute11) IS NULL)
386                     AND (TRIM(X_Attribute11) IS NULL)))
387            AND (   (TRIM(Recinfo.attribute12) = TRIM(X_Attribute12))
388                 OR (    (TRIM(Recinfo.attribute12) IS NULL)
389                     AND (TRIM(X_Attribute12) IS NULL)))
390            AND (   (TRIM(Recinfo.attribute13) = TRIM(X_Attribute13))
391                 OR (    (TRIM(Recinfo.attribute13) IS NULL)
392                     AND (TRIM(X_Attribute13) IS NULL)))
393            AND (   (TRIM(Recinfo.attribute14) = TRIM(X_Attribute14))
394                 OR (    (TRIM(Recinfo.attribute14) IS NULL)
395                     AND (TRIM(X_Attribute14) IS NULL)))
396            AND (   (TRIM(Recinfo.attribute15) = TRIM(X_Attribute15))
397                 OR (    (TRIM(Recinfo.attribute15) IS NULL)
398                     AND (TRIM(X_Attribute15) IS NULL)))
399            AND (   (TRIM(Recinfo.closed_code) = TRIM(X_Closed_Code))
400                 OR (    (TRIM(Recinfo.closed_code) IS NULL)
401                     AND (TRIM(X_Closed_Code) IS NULL)))
402            AND (   (TRIM(Recinfo.government_context) = TRIM(X_Government_Context))
403                 OR (    (TRIM(Recinfo.government_context) IS NULL)
404                     AND (TRIM(X_Government_Context) IS NULL)))
408            AND (   (Recinfo.Price_Update_Tolerance = X_Price_Update_Tolerance)
405            AND (   (TRIM(Recinfo.Supply_Agreement_Flag) = TRIM(X_Supply_Agreement_Flag))
406                 OR (    (TRIM(Recinfo.Supply_Agreement_Flag) IS NULL)
407                     AND (TRIM(X_Supply_Agreement_Flag) IS NULL)))
409                 OR (    (Recinfo.Price_Update_Tolerance IS NULL)
410                     AND (X_Price_Update_Tolerance IS NULL)))
411            AND (   (TRIM(Recinfo.global_attribute_category) = TRIM(X_Global_Attribute_Category))
412                 OR (    (TRIM(Recinfo.global_attribute_category) IS NULL)
413                     AND (TRIM(X_Global_Attribute_Category) IS NULL)))
414            AND (   (TRIM(Recinfo.global_attribute1) = TRIM(X_Global_Attribute1))
415                 OR (    (TRIM(Recinfo.global_attribute1) IS NULL)
416                     AND (TRIM(X_Global_Attribute1) IS NULL)))
417            AND (   (TRIM(Recinfo.global_attribute2) = TRIM(X_Global_Attribute2))
418                 OR (    (TRIM(Recinfo.global_attribute2) IS NULL)
419                     AND (TRIM(X_Global_Attribute2) IS NULL)))
420            AND (   (TRIM(Recinfo.global_attribute3) = TRIM(X_Global_Attribute3))
421                 OR (    (TRIM(Recinfo.global_attribute3) IS NULL)
422                     AND (TRIM(X_Global_Attribute3) IS NULL)))
423            AND (   (TRIM(Recinfo.global_attribute4) = TRIM(X_Global_Attribute4))
424                 OR (    (TRIM(Recinfo.global_attribute4) IS NULL)
425                     AND (TRIM(X_Global_Attribute4) IS NULL)))
426            AND (   (TRIM(Recinfo.global_attribute5) = TRIM(X_Global_Attribute5))
427                 OR (    (TRIM(Recinfo.global_attribute5) IS NULL)
428                     AND (TRIM(X_Global_Attribute5) IS NULL)))
429            AND (   (TRIM(Recinfo.global_attribute6) = TRIM(X_Global_Attribute6))
430                 OR (    (TRIM(Recinfo.global_attribute6) IS NULL)
431                     AND (TRIM(X_Global_Attribute6) IS NULL)))
432            AND (   (TRIM(Recinfo.global_attribute7) = TRIM(X_Global_Attribute7))
433                 OR (    (TRIM(Recinfo.global_attribute7) IS NULL)
434                     AND (TRIM(X_Global_Attribute7) IS NULL)))
435            AND (   (TRIM(Recinfo.global_attribute8) = TRIM(X_Global_Attribute8))
436                 OR (    (TRIM(Recinfo.global_attribute8) IS NULL)
437                     AND (TRIM(X_Global_Attribute8) IS NULL)))
438            AND (   (TRIM(Recinfo.global_attribute9) = TRIM(X_Global_Attribute9))
439                 OR (    (TRIM(Recinfo.global_attribute9) IS NULL)
440                     AND (TRIM(X_Global_Attribute9) IS NULL)))
441            AND (   (TRIM(Recinfo.global_attribute10) = TRIM(X_Global_Attribute10))
442                 OR (    (TRIM(Recinfo.global_attribute10) IS NULL)
443                     AND (TRIM(X_Global_Attribute10) IS NULL)))
444            AND (   (TRIM(Recinfo.global_attribute11) = TRIM(X_Global_Attribute11))
445                 OR (    (TRIM(Recinfo.global_attribute11) IS NULL)
446                     AND (TRIM(X_Global_Attribute11) IS NULL)))
447            AND (   (TRIM(Recinfo.global_attribute12) = TRIM(X_Global_Attribute12))
448                 OR (    (TRIM(Recinfo.global_attribute12) IS NULL)
449                     AND (TRIM(X_Global_Attribute12) IS NULL)))
450            AND (   (TRIM(Recinfo.global_attribute13) = TRIM(X_Global_Attribute13))
451                 OR (    (TRIM(Recinfo.global_attribute13) IS NULL)
452                     AND (TRIM(X_Global_Attribute13) IS NULL)))
453            AND (   (TRIM(Recinfo.global_attribute14) = TRIM(X_Global_Attribute14))
454                 OR (    (TRIM(Recinfo.global_attribute14) IS NULL)
455                     AND (TRIM(X_Global_Attribute14) IS NULL)))
456            AND (   (TRIM(Recinfo.global_attribute15) = TRIM(X_Global_Attribute15))
457                 OR (    (TRIM(Recinfo.global_attribute15) IS NULL)
458                     AND (TRIM(X_Global_Attribute15) IS NULL)))
459            AND (   (TRIM(Recinfo.global_attribute16)= TRIM(X_Global_Attribute16))
460                 OR (    (TRIM(Recinfo.global_attribute16) IS NULL)
461                     AND (TRIM(X_Global_Attribute16) IS NULL)))
462            AND (   (TRIM(Recinfo.global_attribute17) = TRIM(X_Global_Attribute17))
463                 OR (    (TRIM(Recinfo.global_attribute17) IS NULL)
464                     AND (TRIM(X_Global_Attribute17) IS NULL)))
465            AND (   (TRIM(Recinfo.global_attribute18) = TRIM(X_Global_Attribute18))
466                 OR (    (TRIM(Recinfo.global_attribute18) IS NULL)
467                     AND (TRIM(X_Global_Attribute18) IS NULL)))
468            AND (   (TRIM(Recinfo.global_attribute19) = TRIM(X_Global_Attribute19))
469                 OR (    (TRIM(Recinfo.global_attribute19) IS NULL)
470                     AND (TRIM(X_Global_Attribute19) IS NULL)))
471            AND (   (TRIM(Recinfo.global_attribute20) = TRIM(X_Global_Attribute20))
472                 OR (    (TRIM(Recinfo.global_attribute20) IS NULL)
473                     AND (TRIM(X_Global_Attribute20) IS NULL)))
474             ) then
475 
476         -- Bug 2701425. If print_count and printed_date are different, then
477         -- update the new parameters with the values from the database.
478         IF (nvl(recinfo.print_count,-99) <> nvl(x_print_count,-99)) THEN
479             x_new_print_count := recinfo.print_count;
480         END IF;
481 
482         IF ((TRUNC(recinfo.printed_date) <> TRUNC(x_printed_date)) OR
483             (recinfo.printed_date IS NULL AND x_printed_date IS NOT NULL) OR
484             (recinfo.printed_date IS NOT NULL AND x_printed_date IS NULL))
485         THEN
486             x_new_printed_date := recinfo.printed_date;
487         END IF;
488 
489         return;
490     else
491 		IF (g_fnd_debug = 'Y') THEN
492         IF (NVL(X_Po_Header_Id,-999) <> NVL(Recinfo.po_header_id,-999)) THEN
493              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form po_header_id'||X_Po_Header_Id ||' Database  po_header_id '|| Recinfo.po_header_id);
494         END IF;
495         IF (NVL(X_Agent_Id,-999) <> NVL(Recinfo.agent_id,-999)) THEN
499              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form type_lookup_code '||X_Type_Lookup_Code ||' Database  type_lookup_code '||Recinfo.type_lookup_code);
496              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form agent_id'||X_Agent_Id ||' Database  agent_id '|| Recinfo.agent_id);
497         END IF;
498         IF (NVL(TRIM(X_Type_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.type_lookup_code),'-999')) THEN
500         END IF;
501         IF (NVL(TRIM(X_Segment1),'-999') <> NVL( TRIM(Recinfo.segment1),'-999')) THEN
502              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form segment1 '||X_Segment1 ||' Database  segment1 '||Recinfo.segment1);
503         END IF;
504         IF (NVL(TRIM(X_Summary_Flag),'-999') <> NVL( TRIM(Recinfo.summary_flag),'-999')) THEN
505              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form summary_flag '||X_Summary_Flag ||' Database  summary_flag '||Recinfo.summary_flag);
506         END IF;
507         IF (NVL(TRIM(X_Enabled_Flag),'-999') <> NVL( TRIM(Recinfo.enabled_flag),'-999')) THEN
508              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form enabled_flag '||X_Enabled_Flag ||' Database  enabled_flag '||Recinfo.enabled_flag);
509         END IF;
510         IF (NVL(TRIM(X_Segment2),'-999') <> NVL( TRIM(Recinfo.segment2),'-999')) THEN
511              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form segment2 '||X_Segment2 ||' Database  segment2 '||Recinfo.segment2);
512         END IF;
513         IF (NVL(TRIM(X_Segment3),'-999') <> NVL( TRIM(Recinfo.segment3),'-999')) THEN
514              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form segment3 '||X_Segment3 ||' Database  segment3 '||Recinfo.segment3);
515         END IF;
516         IF (NVL(TRIM(X_Segment4),'-999') <> NVL( TRIM(Recinfo.segment4),'-999')) THEN
517              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form segment4 '||X_Segment4 ||' Database  segment4 '||Recinfo.segment4);
518         END IF;
519         IF (NVL(TRIM(X_Segment5),'-999') <> NVL( TRIM(Recinfo.segment5),'-999')) THEN
520              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form segment5 '||X_Segment5 ||' Database  segment5 '||Recinfo.segment5);
521         END IF;
522         IF (X_Start_Date_Active <> Recinfo.start_date_active ) THEN
523               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form start_date_active '||X_Start_Date_Active ||' Database  start_date_active '||Recinfo.start_date_active);
524         END IF;
525         IF (X_End_Date_Active <> Recinfo.end_date_active ) THEN
526               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form end_date_active '||X_End_Date_Active ||' Database  end_date_active '||Recinfo.end_date_active);
527         END IF;
528         IF (NVL(X_Vendor_Id,-999) <> NVL(Recinfo.vendor_id,-999)) THEN
529              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form vendor_id'||X_Vendor_Id ||' Database  vendor_id '|| Recinfo.vendor_id);
530         END IF;
531         IF (NVL(X_Vendor_Site_Id,-999) <> NVL(Recinfo.vendor_site_id,-999)) THEN
532              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form vendor_site_id'||X_Vendor_Site_Id ||' Database  vendor_site_id '|| Recinfo.vendor_site_id);
533         END IF;
534         IF (NVL(X_Vendor_Contact_Id,-999) <> NVL(Recinfo.vendor_contact_id,-999)) THEN
535              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form vendor_contact_id'||X_Vendor_Contact_Id ||' Database  vendor_contact_id '|| Recinfo.vendor_contact_id);
536         END IF;
537         IF (NVL(X_Ship_To_Location_Id,-999) <> NVL(Recinfo.ship_to_location_id,-999)) THEN
538              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form ship_to_location_id'||X_Ship_To_Location_Id ||' Database  ship_to_location_id '|| Recinfo.ship_to_location_id);
539         END IF;
540         IF (NVL(X_Bill_To_Location_Id,-999) <> NVL(Recinfo.bill_to_location_id,-999)) THEN
541              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form bill_to_location_id'||X_Bill_To_Location_Id ||' Database  bill_to_location_id '|| Recinfo.bill_to_location_id);
542         END IF;
543         IF (NVL(X_Terms_Id,-999) <> NVL(Recinfo.terms_id,-999)) THEN
544              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form terms_id'||X_Terms_Id ||' Database  terms_id '|| Recinfo.terms_id);
545         END IF;
546         IF (NVL(TRIM(X_Ship_Via_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.ship_via_lookup_code),'-999')) THEN
547              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form ship_via_lookup_code '||X_Ship_Via_Lookup_Code ||' Database  ship_via_lookup_code '||Recinfo.ship_via_lookup_code);
548         END IF;
549         IF (NVL(TRIM(X_Fob_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.fob_lookup_code),'-999')) THEN
550              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form fob_lookup_code '||X_Fob_Lookup_Code ||' Database  fob_lookup_code '||Recinfo.fob_lookup_code);
551         END IF;
552         IF (NVL(TRIM(X_Pay_On_Code),'-999') <> NVL( TRIM(Recinfo.pay_on_code),'-999')) THEN
553              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form pay_on_code '||X_Pay_On_Code ||' Database  pay_on_code '||Recinfo.pay_on_code);
554         END IF;
555         IF (NVL(TRIM(X_Freight_Terms_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.freight_terms_lookup_code),'-999')) THEN
556              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form freight_terms_lookup_code '||X_Freight_Terms_Lookup_Code ||' Database  freight_terms_lookup_code '||Recinfo.freight_terms_lookup_code);
557         END IF;
558         IF (NVL(TRIM(X_Status_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.status_lookup_code),'-999')) THEN
559              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form status_lookup_code '||X_Status_Lookup_Code ||' Database  status_lookup_code '||Recinfo.status_lookup_code);
560         END IF;
561         IF (NVL(TRIM(X_Currency_Code),'-999') <> NVL( TRIM(Recinfo.currency_code),'-999')) THEN
565              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form rate_type '||X_Rate_Type ||' Database  rate_type '||Recinfo.rate_type);
562              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form currency_code '||X_Currency_Code ||' Database  currency_code '||Recinfo.currency_code);
563         END IF;
564         IF (NVL(TRIM(X_Rate_Type),'-999') <> NVL( TRIM(Recinfo.rate_type),'-999')) THEN
566         END IF;
567         IF (X_Rate_Date <> Recinfo.rate_date ) THEN
568               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form rate_date '||X_Rate_Date ||' Database  rate_date '||Recinfo.rate_date);
569         END IF;
570         IF (NVL(X_Rate,-999) <> NVL(Recinfo.rate,-999)) THEN
571              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form rate'||X_Rate ||' Database  rate '|| Recinfo.rate);
572         END IF;
573         IF (NVL(X_From_Header_Id,-999) <> NVL(Recinfo.from_header_id,-999)) THEN
574              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form from_header_id'||X_From_Header_Id ||' Database  from_header_id '|| Recinfo.from_header_id);
575         END IF;
576         IF (NVL(TRIM(X_From_Type_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.from_type_lookup_code),'-999')) THEN
577              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form from_type_lookup_code '||X_From_Type_Lookup_Code ||' Database  from_type_lookup_code '||Recinfo.from_type_lookup_code);
578         END IF;
579         IF (X_Start_Date <> Recinfo.start_date ) THEN
580               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form start_date '||X_Start_Date ||' Database  start_date '||Recinfo.start_date);
581         END IF;
582         IF (X_End_Date <> Recinfo.end_date ) THEN
583               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form end_date '||X_End_Date ||' Database  end_date '||Recinfo.end_date);
584         END IF;
585         IF (NVL(X_Blanket_Total_Amount,-999) <> NVL(Recinfo.blanket_total_amount,-999)) THEN
586              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form blanket_total_amount'||X_Blanket_Total_Amount ||' Database  blanket_total_amount '|| Recinfo.blanket_total_amount);
587         END IF;
588         IF (NVL(TRIM(X_Authorization_Status),'-999') <> NVL( TRIM(Recinfo.authorization_status),'-999')) THEN
589              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form authorization_status '||X_Authorization_Status ||' Database  authorization_status '||Recinfo.authorization_status);
590         END IF;
591         IF (NVL(X_Revision_Num,-999) <> NVL(Recinfo.revision_num,-999)) THEN
592              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form revision_num'||X_Revision_Num ||' Database  revision_num '|| Recinfo.revision_num);
593         END IF;
594         IF (X_Revised_Date <> Recinfo.revised_date ) THEN
595               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form revised_date '||X_Revised_Date ||' Database  revised_date '||Recinfo.revised_date);
596         END IF;
597         IF (NVL(TRIM(X_Approved_Flag),'-999') <> NVL( TRIM(Recinfo.approved_flag),'-999')) THEN
598              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form approved_flag '||X_Approved_Flag ||' Database  approved_flag '||Recinfo.approved_flag);
599         END IF;
600         IF (X_Approved_Date <> Recinfo.approved_date ) THEN
601               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form approved_date '||X_Approved_Date ||' Database  approved_date '||Recinfo.approved_date);
602         END IF;
603         IF (NVL(X_Amount_Limit,-999) <> NVL(Recinfo.amount_limit,-999)) THEN
604              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form amount_limit'||X_Amount_Limit ||' Database  amount_limit '|| Recinfo.amount_limit);
605         END IF;
606         IF (NVL(X_Min_Release_Amount,-999) <> NVL(Recinfo.min_release_amount,-999)) THEN
607              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form min_release_amount'||X_Min_Release_Amount ||' Database  min_release_amount '|| Recinfo.min_release_amount);
608         END IF;
609         IF (NVL(TRIM(X_Note_To_Authorizer),'-999') <> NVL( TRIM(Recinfo.note_to_authorizer),'-999')) THEN
610              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form note_to_authorizer '||X_Note_To_Authorizer ||' Database  note_to_authorizer '||Recinfo.note_to_authorizer);
611         END IF;
612         IF (NVL(TRIM(X_Note_To_Vendor),'-999') <> NVL( TRIM(Recinfo.note_to_vendor),'-999')) THEN
613              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form note_to_vendor '||X_Note_To_Vendor ||' Database  note_to_vendor '||Recinfo.note_to_vendor);
614         END IF;
615         IF (NVL(TRIM(X_Note_To_Receiver),'-999') <> NVL( TRIM(Recinfo.note_to_receiver),'-999')) THEN
616              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form note_to_receiver '||X_Note_To_Receiver ||' Database  note_to_receiver '||Recinfo.note_to_receiver);
617         END IF;
618         IF (NVL(TRIM(X_Vendor_Order_Num),'-999') <> NVL( TRIM(Recinfo.vendor_order_num),'-999')) THEN
619              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form vendor_order_num '||X_Vendor_Order_Num ||' Database  vendor_order_num '||Recinfo.vendor_order_num);
620         END IF;
621         IF (NVL(TRIM(X_Confirming_Order_Flag),'-999') <> NVL( TRIM(Recinfo.confirming_order_flag),'-999')) THEN
622              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form confirming_order_flag '||X_Confirming_Order_Flag ||' Database  confirming_order_flag '||Recinfo.confirming_order_flag);
623         END IF;
624         IF (NVL(TRIM(X_Comments),'-999') <> NVL( TRIM(Recinfo.comments),'-999')) THEN
625              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form comments '||X_Comments ||' Database  comments '||Recinfo.comments);
626         END IF;
627         IF (X_Reply_Date <> Recinfo.reply_date ) THEN
631              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form reply_method_lookup_code '||X_Reply_Method_Lookup_Code ||' Database  reply_method_lookup_code '||Recinfo.reply_method_lookup_code);
628               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form reply_date '||X_Reply_Date ||' Database  reply_date '||Recinfo.reply_date);
629         END IF;
630         IF (NVL(TRIM(X_Reply_Method_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.reply_method_lookup_code),'-999')) THEN
632         END IF;
633         IF (X_Rfq_Close_Date <> Recinfo.rfq_close_date ) THEN
634               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form rfq_close_date '||X_Rfq_Close_Date ||' Database  rfq_close_date '||Recinfo.rfq_close_date);
635         END IF;
636         IF (NVL(TRIM(X_Quote_Type_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.quote_type_lookup_code),'-999')) THEN
637              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form quote_type_lookup_code '||X_Quote_Type_Lookup_Code ||' Database  quote_type_lookup_code '||Recinfo.quote_type_lookup_code);
638         END IF;
639         IF (NVL(TRIM(X_Quotation_Class_Code),'-999') <> NVL( TRIM(Recinfo.quotation_class_code),'-999')) THEN
640              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form quotation_class_code '||X_Quotation_Class_Code ||' Database  quotation_class_code '||Recinfo.quotation_class_code);
641         END IF;
642         IF (NVL(TRIM(X_Quote_Warning_Delay_Unit),'-999') <> NVL( TRIM(Recinfo.quote_warning_delay_unit),'-999')) THEN
643              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form quote_warning_delay_unit '||X_Quote_Warning_Delay_Unit ||' Database  quote_warning_delay_unit '||Recinfo.quote_warning_delay_unit);
644         END IF;
645         IF (NVL(X_Quote_Warning_Delay,-999) <> NVL(Recinfo.quote_warning_delay,-999)) THEN
646              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form quote_warning_delay'||X_Quote_Warning_Delay ||' Database  quote_warning_delay '|| Recinfo.quote_warning_delay);
647         END IF;
648         IF (NVL(TRIM(X_Quote_Vendor_Quote_Number),'-999') <> NVL( TRIM(Recinfo.quote_vendor_quote_number),'-999')) THEN
649              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form quote_vendor_quote_number '||X_Quote_Vendor_Quote_Number ||' Database  quote_vendor_quote_number '||Recinfo.quote_vendor_quote_number);
650         END IF;
651         IF (NVL(TRIM(X_Acceptance_Required_Flag),'-999') <> NVL( TRIM(Recinfo.acceptance_required_flag),'-999')) THEN
652              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form acceptance_required_flag '||X_Acceptance_Required_Flag ||' Database  acceptance_required_flag '||Recinfo.acceptance_required_flag);
653         END IF;
654         IF (X_Acceptance_Due_Date <> Recinfo.acceptance_due_date ) THEN
655               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form acceptance_due_date '||X_Acceptance_Due_Date ||' Database  acceptance_due_date '||Recinfo.acceptance_due_date);
656         END IF;
657         IF (X_Closed_Date <> Recinfo.closed_date ) THEN
658               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form closed_date '||X_Closed_Date ||' Database  closed_date '||Recinfo.closed_date);
659         END IF;
660         IF (NVL(TRIM(X_User_Hold_Flag),'-999') <> NVL( TRIM(Recinfo.user_hold_flag),'-999')) THEN
661              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form user_hold_flag '||X_User_Hold_Flag ||' Database  user_hold_flag '||Recinfo.user_hold_flag);
662         END IF;
663         IF (NVL(TRIM(X_Approval_Required_Flag),'-999') <> NVL( TRIM(Recinfo.approval_required_flag),'-999')) THEN
664              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form approval_required_flag '||X_Approval_Required_Flag ||' Database  approval_required_flag '||Recinfo.approval_required_flag);
665         END IF;
666         IF (NVL(TRIM(X_Cancel_Flag),'-999') <> NVL( TRIM(Recinfo.cancel_flag),'-999')) THEN
667              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form cancel_flag '||X_Cancel_Flag ||' Database  cancel_flag '||Recinfo.cancel_flag);
668         END IF;
669         IF (NVL(TRIM(X_Firm_Status_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.firm_status_lookup_code),'-999')) THEN
670              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form firm_status_lookup_code '||X_Firm_Status_Lookup_Code ||' Database  firm_status_lookup_code '||Recinfo.firm_status_lookup_code);
671         END IF;
672         IF (X_Firm_Date <> Recinfo.firm_date ) THEN
673               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form firm_date '||X_Firm_Date ||' Database  firm_date '||Recinfo.firm_date);
674         END IF;
675         IF (NVL(TRIM(X_Frozen_Flag),'-999') <> NVL( TRIM(Recinfo.frozen_flag),'-999')) THEN
676              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form frozen_flag '||X_Frozen_Flag ||' Database  frozen_flag '||Recinfo.frozen_flag);
677         END IF;
678         IF (NVL(TRIM(X_Attribute_Category),'-999') <> NVL( TRIM(Recinfo.attribute_category),'-999')) THEN
679              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute_category '||X_Attribute_Category ||' Database  attribute_category '||Recinfo.attribute_category);
680         END IF;
681         IF (NVL(TRIM(X_Attribute1),'-999') <> NVL( TRIM(Recinfo.attribute1),'-999')) THEN
682              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute1 '||X_Attribute1 ||' Database  attribute1 '||Recinfo.attribute1);
683         END IF;
684         IF (NVL(TRIM(X_Attribute2),'-999') <> NVL( TRIM(Recinfo.attribute2),'-999')) THEN
685              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute2 '||X_Attribute2 ||' Database  attribute2 '||Recinfo.attribute2);
686         END IF;
687         IF (NVL(TRIM(X_Attribute3),'-999') <> NVL( TRIM(Recinfo.attribute3),'-999')) THEN
688              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute3 '||X_Attribute3 ||' Database  attribute3 '||Recinfo.attribute3);
689         END IF;
693         IF (NVL(TRIM(X_Attribute5),'-999') <> NVL( TRIM(Recinfo.attribute5),'-999')) THEN
690         IF (NVL(TRIM(X_Attribute4),'-999') <> NVL( TRIM(Recinfo.attribute4),'-999')) THEN
691              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute4 '||X_Attribute4 ||' Database  attribute4 '||Recinfo.attribute4);
692         END IF;
694              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute5 '||X_Attribute5 ||' Database  attribute5 '||Recinfo.attribute5);
695         END IF;
696         IF (NVL(TRIM(X_Attribute6),'-999') <> NVL( TRIM(Recinfo.attribute6),'-999')) THEN
697              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute6 '||X_Attribute6 ||' Database  attribute6 '||Recinfo.attribute6);
698         END IF;
699         IF (NVL(TRIM(X_Attribute7),'-999') <> NVL( TRIM(Recinfo.attribute7),'-999')) THEN
700              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute7 '||X_Attribute7 ||' Database  attribute7 '||Recinfo.attribute7);
701         END IF;
702         IF (NVL(TRIM(X_Attribute8),'-999') <> NVL( TRIM(Recinfo.attribute8),'-999')) THEN
703              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute8 '||X_Attribute8 ||' Database  attribute8 '||Recinfo.attribute8);
704         END IF;
705         IF (NVL(TRIM(X_Attribute9),'-999') <> NVL( TRIM(Recinfo.attribute9),'-999')) THEN
706              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute9 '||X_Attribute9 ||' Database  attribute9 '||Recinfo.attribute9);
707         END IF;
708         IF (NVL(TRIM(X_Attribute10),'-999') <> NVL( TRIM(Recinfo.attribute10),'-999')) THEN
709              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute10 '||X_Attribute10 ||' Database  attribute10 '||Recinfo.attribute10);
710         END IF;
711         IF (NVL(TRIM(X_Attribute11),'-999') <> NVL( TRIM(Recinfo.attribute11),'-999')) THEN
712              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute11 '||X_Attribute11 ||' Database  attribute11 '||Recinfo.attribute11);
713         END IF;
714         IF (NVL(TRIM(X_Attribute12),'-999') <> NVL( TRIM(Recinfo.attribute12),'-999')) THEN
715              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute12 '||X_Attribute12 ||' Database  attribute12 '||Recinfo.attribute12);
716         END IF;
717         IF (NVL(TRIM(X_Attribute13),'-999') <> NVL( TRIM(Recinfo.attribute13),'-999')) THEN
718              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute13 '||X_Attribute13 ||' Database  attribute13 '||Recinfo.attribute13);
719         END IF;
720         IF (NVL(TRIM(X_Attribute14),'-999') <> NVL( TRIM(Recinfo.attribute14),'-999')) THEN
721              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute14 '||X_Attribute14 ||' Database  attribute14 '||Recinfo.attribute14);
722         END IF;
723         IF (NVL(TRIM(X_Attribute15),'-999') <> NVL( TRIM(Recinfo.attribute15),'-999')) THEN
724              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute15 '||X_Attribute15 ||' Database  attribute15 '||Recinfo.attribute15);
725         END IF;
726         IF (NVL(TRIM(X_Closed_Code),'-999') <> NVL( TRIM(Recinfo.closed_code),'-999')) THEN
727              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form closed_code '||X_Closed_Code ||' Database  closed_code '||Recinfo.closed_code);
728         END IF;
729         IF (NVL(TRIM(X_Government_Context),'-999') <> NVL( TRIM(Recinfo.government_context),'-999')) THEN
730              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form government_context '||X_Government_Context ||' Database  government_context '||Recinfo.government_context);
731         END IF;
732         IF (NVL(TRIM(X_Supply_Agreement_flag),'-999') <> NVL( TRIM(Recinfo.supply_agreement_flag),'-999')) THEN
733              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form supply_agreement_flag '||X_Supply_Agreement_flag ||' Database  supply_agreement_flag '||Recinfo.supply_agreement_flag);
734         END IF;
735         IF (NVL(X_Price_Update_Tolerance,-999) <> NVL(Recinfo.price_update_tolerance,-999)) THEN
736              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form price_update_tolerance'||X_Price_Update_Tolerance ||' Database  price_update_tolerance '|| Recinfo.price_update_tolerance);
737         END IF;
738         IF (NVL(TRIM(X_Global_Attribute_Category),'-999') <> NVL( TRIM(Recinfo.global_attribute_category),'-999')) THEN
739              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute_category '||X_Global_Attribute_Category ||' Database  global_attribute_category '||Recinfo.global_attribute_category);
740         END IF;
741         IF (NVL(TRIM(X_Global_Attribute1),'-999') <> NVL( TRIM(Recinfo.global_attribute1),'-999')) THEN
742              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute1 '||X_Global_Attribute1 ||' Database  global_attribute1 '||Recinfo.global_attribute1);
743         END IF;
744         IF (NVL(TRIM(X_Global_Attribute2),'-999') <> NVL( TRIM(Recinfo.global_attribute2),'-999')) THEN
745              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute2 '||X_Global_Attribute2 ||' Database  global_attribute2 '||Recinfo.global_attribute2);
746         END IF;
747         IF (NVL(TRIM(X_Global_Attribute3),'-999') <> NVL( TRIM(Recinfo.global_attribute3),'-999')) THEN
748              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute3 '||X_Global_Attribute3 ||' Database  global_attribute3 '||Recinfo.global_attribute3);
749         END IF;
750         IF (NVL(TRIM(X_Global_Attribute4),'-999') <> NVL( TRIM(Recinfo.global_attribute4),'-999')) THEN
751              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute4 '||X_Global_Attribute4 ||' Database  global_attribute4 '||Recinfo.global_attribute4);
752         END IF;
753         IF (NVL(TRIM(X_Global_Attribute5),'-999') <> NVL( TRIM(Recinfo.global_attribute5),'-999')) THEN
757              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute6 '||X_Global_Attribute6 ||' Database  global_attribute6 '||Recinfo.global_attribute6);
754              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute5 '||X_Global_Attribute5 ||' Database  global_attribute5 '||Recinfo.global_attribute5);
755         END IF;
756         IF (NVL(TRIM(X_Global_Attribute6),'-999') <> NVL( TRIM(Recinfo.global_attribute6),'-999')) THEN
758         END IF;
759         IF (NVL(TRIM(X_Global_Attribute7),'-999') <> NVL( TRIM(Recinfo.global_attribute7),'-999')) THEN
760              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute7 '||X_Global_Attribute7 ||' Database  global_attribute7 '||Recinfo.global_attribute7);
761         END IF;
762         IF (NVL(TRIM(X_Global_Attribute8),'-999') <> NVL( TRIM(Recinfo.global_attribute8),'-999')) THEN
763              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute8 '||X_Global_Attribute8 ||' Database  global_attribute8 '||Recinfo.global_attribute8);
764         END IF;
765         IF (NVL(TRIM(X_Global_Attribute9),'-999') <> NVL( TRIM(Recinfo.global_attribute9),'-999')) THEN
766              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute9 '||X_Global_Attribute9 ||' Database  global_attribute9 '||Recinfo.global_attribute9);
767         END IF;
768         IF (NVL(TRIM(X_Global_Attribute10),'-999') <> NVL( TRIM(Recinfo.global_attribute10),'-999')) THEN
769              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute10 '||X_Global_Attribute10 ||' Database  global_attribute10 '||Recinfo.global_attribute10);
770         END IF;
771         IF (NVL(TRIM(X_Global_Attribute11),'-999') <> NVL( TRIM(Recinfo.global_attribute11),'-999')) THEN
772              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute11 '||X_Global_Attribute11 ||' Database  global_attribute11 '||Recinfo.global_attribute11);
773         END IF;
774         IF (NVL(TRIM(X_Global_Attribute12),'-999') <> NVL( TRIM(Recinfo.global_attribute12),'-999')) THEN
775              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute12 '||X_Global_Attribute12 ||' Database  global_attribute12 '||Recinfo.global_attribute12);
776         END IF;
777         IF (NVL(TRIM(X_Global_Attribute13),'-999') <> NVL( TRIM(Recinfo.global_attribute13),'-999')) THEN
778              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute13 '||X_Global_Attribute13 ||' Database  global_attribute13 '||Recinfo.global_attribute13);
779         END IF;
780         IF (NVL(TRIM(X_Global_Attribute14),'-999') <> NVL( TRIM(Recinfo.global_attribute14),'-999')) THEN
781              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute14 '||X_Global_Attribute14 ||' Database  global_attribute14 '||Recinfo.global_attribute14);
782         END IF;
783         IF (NVL(TRIM(X_Global_Attribute15),'-999') <> NVL( TRIM(Recinfo.global_attribute15),'-999')) THEN
784              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute15 '||X_Global_Attribute15 ||' Database  global_attribute15 '||Recinfo.global_attribute15);
785         END IF;
786         IF (NVL(TRIM(X_Global_Attribute16),'-999') <> NVL( TRIM(Recinfo.global_attribute16),'-999')) THEN
787              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute16 '||X_Global_Attribute16 ||' Database  global_attribute16 '||Recinfo.global_attribute16);
788         END IF;
789         IF (NVL(TRIM(X_Global_Attribute17),'-999') <> NVL( TRIM(Recinfo.global_attribute17),'-999')) THEN
790              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute17 '||X_Global_Attribute17 ||' Database  global_attribute17 '||Recinfo.global_attribute17);
791         END IF;
792         IF (NVL(TRIM(X_Global_Attribute18),'-999') <> NVL( TRIM(Recinfo.global_attribute18),'-999')) THEN
793              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute18 '||X_Global_Attribute18 ||' Database  global_attribute18 '||Recinfo.global_attribute18);
794         END IF;
795         IF (NVL(TRIM(X_Global_Attribute19),'-999') <> NVL( TRIM(Recinfo.global_attribute19),'-999')) THEN
796              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute19 '||X_Global_Attribute19 ||' Database  global_attribute19 '||Recinfo.global_attribute19);
797         END IF;
798         IF (NVL(TRIM(X_Global_Attribute20),'-999') <> NVL( TRIM(Recinfo.global_attribute20),'-999')) THEN
799              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute20 '||X_Global_Attribute20 ||' Database  global_attribute20 '||Recinfo.global_attribute20);
800         END IF;
801         IF (NVL(TRIM(p_shipping_control),'-999') <> NVL( TRIM(Recinfo.shipping_control),'-999')) THEN
802              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form shipping_control '||p_shipping_control ||' Database  shipping_control '||Recinfo.shipping_control);
803         END IF;
804         IF (NVL(TRIM(p_conterms_exist_flag),'-999') <> NVL( TRIM(Recinfo.conterms_exist_flag),'-999')) THEN
805              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form conterms_exist_flag '||p_conterms_exist_flag ||' Database  conterms_exist_flag '||Recinfo.conterms_exist_flag);
806         END IF;
807         IF (NVL(TRIM(p_encumbrance_required_flag),'-999') <> NVL( TRIM(Recinfo.encumbrance_required_flag),'-999')) THEN
808              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form encumbrance_required_flag '||p_encumbrance_required_flag ||' Database  encumbrance_required_flag '||Recinfo.encumbrance_required_flag);
809         END IF;
810     END IF;
811 
812       IF (g_fnd_debug = 'Y') THEN
813           IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_ERROR) THEN
814             FND_LOG.string(FND_LOG.level_error, g_module_prefix || 'lock_row.010',
815                          'Failed second if statement when comparing fields');
816           END IF;
817       END IF;
821   else
818       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
819       APP_EXCEPTION.RAISE_EXCEPTION;
820     end if;
822 		IF (g_fnd_debug = 'Y') THEN
823         IF (NVL(X_Po_Header_Id,-999) <> NVL(Recinfo.po_header_id,-999)) THEN
824              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form po_header_id'||X_Po_Header_Id ||' Database  po_header_id '|| Recinfo.po_header_id);
825         END IF;
826         IF (NVL(X_Agent_Id,-999) <> NVL(Recinfo.agent_id,-999)) THEN
827              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form agent_id'||X_Agent_Id ||' Database  agent_id '|| Recinfo.agent_id);
828         END IF;
829         IF (NVL(TRIM(X_Type_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.type_lookup_code),'-999')) THEN
830              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form type_lookup_code '||X_Type_Lookup_Code ||' Database  type_lookup_code '||Recinfo.type_lookup_code);
831         END IF;
832         IF (NVL(TRIM(X_Segment1),'-999') <> NVL( TRIM(Recinfo.segment1),'-999')) THEN
833              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form segment1 '||X_Segment1 ||' Database  segment1 '||Recinfo.segment1);
834         END IF;
835         IF (NVL(TRIM(X_Summary_Flag),'-999') <> NVL( TRIM(Recinfo.summary_flag),'-999')) THEN
836              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form summary_flag '||X_Summary_Flag ||' Database  summary_flag '||Recinfo.summary_flag);
837         END IF;
838         IF (NVL(TRIM(X_Enabled_Flag),'-999') <> NVL( TRIM(Recinfo.enabled_flag),'-999')) THEN
839              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form enabled_flag '||X_Enabled_Flag ||' Database  enabled_flag '||Recinfo.enabled_flag);
840         END IF;
841         IF (NVL(TRIM(X_Segment2),'-999') <> NVL( TRIM(Recinfo.segment2),'-999')) THEN
842              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form segment2 '||X_Segment2 ||' Database  segment2 '||Recinfo.segment2);
843         END IF;
844         IF (NVL(TRIM(X_Segment3),'-999') <> NVL( TRIM(Recinfo.segment3),'-999')) THEN
845              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form segment3 '||X_Segment3 ||' Database  segment3 '||Recinfo.segment3);
846         END IF;
847         IF (NVL(TRIM(X_Segment4),'-999') <> NVL( TRIM(Recinfo.segment4),'-999')) THEN
848              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form segment4 '||X_Segment4 ||' Database  segment4 '||Recinfo.segment4);
849         END IF;
850         IF (NVL(TRIM(X_Segment5),'-999') <> NVL( TRIM(Recinfo.segment5),'-999')) THEN
851              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form segment5 '||X_Segment5 ||' Database  segment5 '||Recinfo.segment5);
852         END IF;
853         IF (X_Start_Date_Active <> Recinfo.start_date_active ) THEN
854               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form start_date_active '||X_Start_Date_Active ||' Database  start_date_active '||Recinfo.start_date_active);
855         END IF;
856         IF (X_End_Date_Active <> Recinfo.end_date_active ) THEN
857               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form end_date_active '||X_End_Date_Active ||' Database  end_date_active '||Recinfo.end_date_active);
858         END IF;
859         IF (NVL(X_Vendor_Id,-999) <> NVL(Recinfo.vendor_id,-999)) THEN
860              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form vendor_id'||X_Vendor_Id ||' Database  vendor_id '|| Recinfo.vendor_id);
861         END IF;
862         IF (NVL(X_Vendor_Site_Id,-999) <> NVL(Recinfo.vendor_site_id,-999)) THEN
863              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form vendor_site_id'||X_Vendor_Site_Id ||' Database  vendor_site_id '|| Recinfo.vendor_site_id);
864         END IF;
865         IF (NVL(X_Vendor_Contact_Id,-999) <> NVL(Recinfo.vendor_contact_id,-999)) THEN
866              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form vendor_contact_id'||X_Vendor_Contact_Id ||' Database  vendor_contact_id '|| Recinfo.vendor_contact_id);
867         END IF;
868         IF (NVL(X_Ship_To_Location_Id,-999) <> NVL(Recinfo.ship_to_location_id,-999)) THEN
869              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form ship_to_location_id'||X_Ship_To_Location_Id ||' Database  ship_to_location_id '|| Recinfo.ship_to_location_id);
870         END IF;
871         IF (NVL(X_Bill_To_Location_Id,-999) <> NVL(Recinfo.bill_to_location_id,-999)) THEN
872              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form bill_to_location_id'||X_Bill_To_Location_Id ||' Database  bill_to_location_id '|| Recinfo.bill_to_location_id);
873         END IF;
874         IF (NVL(X_Terms_Id,-999) <> NVL(Recinfo.terms_id,-999)) THEN
875              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form terms_id'||X_Terms_Id ||' Database  terms_id '|| Recinfo.terms_id);
876         END IF;
877         IF (NVL(TRIM(X_Ship_Via_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.ship_via_lookup_code),'-999')) THEN
878              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form ship_via_lookup_code '||X_Ship_Via_Lookup_Code ||' Database  ship_via_lookup_code '||Recinfo.ship_via_lookup_code);
879         END IF;
880         IF (NVL(TRIM(X_Fob_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.fob_lookup_code),'-999')) THEN
881              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form fob_lookup_code '||X_Fob_Lookup_Code ||' Database  fob_lookup_code '||Recinfo.fob_lookup_code);
882         END IF;
883         IF (NVL(TRIM(X_Pay_On_Code),'-999') <> NVL( TRIM(Recinfo.pay_on_code),'-999')) THEN
884              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form pay_on_code '||X_Pay_On_Code ||' Database  pay_on_code '||Recinfo.pay_on_code);
885         END IF;
886         IF (NVL(TRIM(X_Freight_Terms_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.freight_terms_lookup_code),'-999')) THEN
890              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form status_lookup_code '||X_Status_Lookup_Code ||' Database  status_lookup_code '||Recinfo.status_lookup_code);
887              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form freight_terms_lookup_code '||X_Freight_Terms_Lookup_Code ||' Database  freight_terms_lookup_code '||Recinfo.freight_terms_lookup_code);
888         END IF;
889         IF (NVL(TRIM(X_Status_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.status_lookup_code),'-999')) THEN
891         END IF;
892         IF (NVL(TRIM(X_Currency_Code),'-999') <> NVL( TRIM(Recinfo.currency_code),'-999')) THEN
893              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form currency_code '||X_Currency_Code ||' Database  currency_code '||Recinfo.currency_code);
894         END IF;
895         IF (NVL(TRIM(X_Rate_Type),'-999') <> NVL( TRIM(Recinfo.rate_type),'-999')) THEN
896              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form rate_type '||X_Rate_Type ||' Database  rate_type '||Recinfo.rate_type);
897         END IF;
898         IF (X_Rate_Date <> Recinfo.rate_date ) THEN
899               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form rate_date '||X_Rate_Date ||' Database  rate_date '||Recinfo.rate_date);
900         END IF;
901         IF (NVL(X_Rate,-999) <> NVL(Recinfo.rate,-999)) THEN
902              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form rate'||X_Rate ||' Database  rate '|| Recinfo.rate);
903         END IF;
904         IF (NVL(X_From_Header_Id,-999) <> NVL(Recinfo.from_header_id,-999)) THEN
905              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form from_header_id'||X_From_Header_Id ||' Database  from_header_id '|| Recinfo.from_header_id);
906         END IF;
907         IF (NVL(TRIM(X_From_Type_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.from_type_lookup_code),'-999')) THEN
908              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form from_type_lookup_code '||X_From_Type_Lookup_Code ||' Database  from_type_lookup_code '||Recinfo.from_type_lookup_code);
909         END IF;
910         IF (X_Start_Date <> Recinfo.start_date ) THEN
911               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form start_date '||X_Start_Date ||' Database  start_date '||Recinfo.start_date);
912         END IF;
913         IF (X_End_Date <> Recinfo.end_date ) THEN
914               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form end_date '||X_End_Date ||' Database  end_date '||Recinfo.end_date);
915         END IF;
916         IF (NVL(X_Blanket_Total_Amount,-999) <> NVL(Recinfo.blanket_total_amount,-999)) THEN
917              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form blanket_total_amount'||X_Blanket_Total_Amount ||' Database  blanket_total_amount '|| Recinfo.blanket_total_amount);
918         END IF;
919         IF (NVL(TRIM(X_Authorization_Status),'-999') <> NVL( TRIM(Recinfo.authorization_status),'-999')) THEN
920              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form authorization_status '||X_Authorization_Status ||' Database  authorization_status '||Recinfo.authorization_status);
921         END IF;
922         IF (NVL(X_Revision_Num,-999) <> NVL(Recinfo.revision_num,-999)) THEN
923              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form revision_num'||X_Revision_Num ||' Database  revision_num '|| Recinfo.revision_num);
924         END IF;
925         IF (X_Revised_Date <> Recinfo.revised_date ) THEN
926               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form revised_date '||X_Revised_Date ||' Database  revised_date '||Recinfo.revised_date);
927         END IF;
928         IF (NVL(TRIM(X_Approved_Flag),'-999') <> NVL( TRIM(Recinfo.approved_flag),'-999')) THEN
929              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form approved_flag '||X_Approved_Flag ||' Database  approved_flag '||Recinfo.approved_flag);
930         END IF;
931         IF (X_Approved_Date <> Recinfo.approved_date ) THEN
932               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form approved_date '||X_Approved_Date ||' Database  approved_date '||Recinfo.approved_date);
933         END IF;
934         IF (NVL(X_Amount_Limit,-999) <> NVL(Recinfo.amount_limit,-999)) THEN
935              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form amount_limit'||X_Amount_Limit ||' Database  amount_limit '|| Recinfo.amount_limit);
936         END IF;
937         IF (NVL(X_Min_Release_Amount,-999) <> NVL(Recinfo.min_release_amount,-999)) THEN
938              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form min_release_amount'||X_Min_Release_Amount ||' Database  min_release_amount '|| Recinfo.min_release_amount);
939         END IF;
940         IF (NVL(TRIM(X_Note_To_Authorizer),'-999') <> NVL( TRIM(Recinfo.note_to_authorizer),'-999')) THEN
941              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form note_to_authorizer '||X_Note_To_Authorizer ||' Database  note_to_authorizer '||Recinfo.note_to_authorizer);
942         END IF;
943         IF (NVL(TRIM(X_Note_To_Vendor),'-999') <> NVL( TRIM(Recinfo.note_to_vendor),'-999')) THEN
944              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form note_to_vendor '||X_Note_To_Vendor ||' Database  note_to_vendor '||Recinfo.note_to_vendor);
945         END IF;
946         IF (NVL(TRIM(X_Note_To_Receiver),'-999') <> NVL( TRIM(Recinfo.note_to_receiver),'-999')) THEN
947              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form note_to_receiver '||X_Note_To_Receiver ||' Database  note_to_receiver '||Recinfo.note_to_receiver);
948         END IF;
949         IF (NVL(TRIM(X_Vendor_Order_Num),'-999') <> NVL( TRIM(Recinfo.vendor_order_num),'-999')) THEN
950              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form vendor_order_num '||X_Vendor_Order_Num ||' Database  vendor_order_num '||Recinfo.vendor_order_num);
951         END IF;
952         IF (NVL(TRIM(X_Confirming_Order_Flag),'-999') <> NVL( TRIM(Recinfo.confirming_order_flag),'-999')) THEN
956              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form comments '||X_Comments ||' Database  comments '||Recinfo.comments);
953              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form confirming_order_flag '||X_Confirming_Order_Flag ||' Database  confirming_order_flag '||Recinfo.confirming_order_flag);
954         END IF;
955         IF (NVL(TRIM(X_Comments),'-999') <> NVL( TRIM(Recinfo.comments),'-999')) THEN
957         END IF;
958         IF (X_Reply_Date <> Recinfo.reply_date ) THEN
959               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form reply_date '||X_Reply_Date ||' Database  reply_date '||Recinfo.reply_date);
960         END IF;
961         IF (NVL(TRIM(X_Reply_Method_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.reply_method_lookup_code),'-999')) THEN
962              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form reply_method_lookup_code '||X_Reply_Method_Lookup_Code ||' Database  reply_method_lookup_code '||Recinfo.reply_method_lookup_code);
963         END IF;
964         IF (X_Rfq_Close_Date <> Recinfo.rfq_close_date ) THEN
965               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form rfq_close_date '||X_Rfq_Close_Date ||' Database  rfq_close_date '||Recinfo.rfq_close_date);
966         END IF;
967         IF (NVL(TRIM(X_Quote_Type_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.quote_type_lookup_code),'-999')) THEN
968              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form quote_type_lookup_code '||X_Quote_Type_Lookup_Code ||' Database  quote_type_lookup_code '||Recinfo.quote_type_lookup_code);
969         END IF;
970         IF (NVL(TRIM(X_Quotation_Class_Code),'-999') <> NVL( TRIM(Recinfo.quotation_class_code),'-999')) THEN
971              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form quotation_class_code '||X_Quotation_Class_Code ||' Database  quotation_class_code '||Recinfo.quotation_class_code);
972         END IF;
973         IF (NVL(TRIM(X_Quote_Warning_Delay_Unit),'-999') <> NVL( TRIM(Recinfo.quote_warning_delay_unit),'-999')) THEN
974              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form quote_warning_delay_unit '||X_Quote_Warning_Delay_Unit ||' Database  quote_warning_delay_unit '||Recinfo.quote_warning_delay_unit);
975         END IF;
976         IF (NVL(X_Quote_Warning_Delay,-999) <> NVL(Recinfo.quote_warning_delay,-999)) THEN
977              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form quote_warning_delay'||X_Quote_Warning_Delay ||' Database  quote_warning_delay '|| Recinfo.quote_warning_delay);
978         END IF;
979         IF (NVL(TRIM(X_Quote_Vendor_Quote_Number),'-999') <> NVL( TRIM(Recinfo.quote_vendor_quote_number),'-999')) THEN
980              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form quote_vendor_quote_number '||X_Quote_Vendor_Quote_Number ||' Database  quote_vendor_quote_number '||Recinfo.quote_vendor_quote_number);
981         END IF;
982         IF (NVL(TRIM(X_Acceptance_Required_Flag),'-999') <> NVL( TRIM(Recinfo.acceptance_required_flag),'-999')) THEN
983              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form acceptance_required_flag '||X_Acceptance_Required_Flag ||' Database  acceptance_required_flag '||Recinfo.acceptance_required_flag);
984         END IF;
985         IF (X_Acceptance_Due_Date <> Recinfo.acceptance_due_date ) THEN
986               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form acceptance_due_date '||X_Acceptance_Due_Date ||' Database  acceptance_due_date '||Recinfo.acceptance_due_date);
987         END IF;
988         IF (X_Closed_Date <> Recinfo.closed_date ) THEN
989               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form closed_date '||X_Closed_Date ||' Database  closed_date '||Recinfo.closed_date);
990         END IF;
991         IF (NVL(TRIM(X_User_Hold_Flag),'-999') <> NVL( TRIM(Recinfo.user_hold_flag),'-999')) THEN
992              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form user_hold_flag '||X_User_Hold_Flag ||' Database  user_hold_flag '||Recinfo.user_hold_flag);
993         END IF;
994         IF (NVL(TRIM(X_Approval_Required_Flag),'-999') <> NVL( TRIM(Recinfo.approval_required_flag),'-999')) THEN
995              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form approval_required_flag '||X_Approval_Required_Flag ||' Database  approval_required_flag '||Recinfo.approval_required_flag);
996         END IF;
997         IF (NVL(TRIM(X_Cancel_Flag),'-999') <> NVL( TRIM(Recinfo.cancel_flag),'-999')) THEN
998              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form cancel_flag '||X_Cancel_Flag ||' Database  cancel_flag '||Recinfo.cancel_flag);
999         END IF;
1000         IF (NVL(TRIM(X_Firm_Status_Lookup_Code),'-999') <> NVL( TRIM(Recinfo.firm_status_lookup_code),'-999')) THEN
1001              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form firm_status_lookup_code '||X_Firm_Status_Lookup_Code ||' Database  firm_status_lookup_code '||Recinfo.firm_status_lookup_code);
1002         END IF;
1003         IF (X_Firm_Date <> Recinfo.firm_date ) THEN
1004               FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form firm_date '||X_Firm_Date ||' Database  firm_date '||Recinfo.firm_date);
1005         END IF;
1006         IF (NVL(TRIM(X_Frozen_Flag),'-999') <> NVL( TRIM(Recinfo.frozen_flag),'-999')) THEN
1007              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form frozen_flag '||X_Frozen_Flag ||' Database  frozen_flag '||Recinfo.frozen_flag);
1008         END IF;
1009         IF (NVL(TRIM(X_Attribute_Category),'-999') <> NVL( TRIM(Recinfo.attribute_category),'-999')) THEN
1010              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute_category '||X_Attribute_Category ||' Database  attribute_category '||Recinfo.attribute_category);
1011         END IF;
1012         IF (NVL(TRIM(X_Attribute1),'-999') <> NVL( TRIM(Recinfo.attribute1),'-999')) THEN
1013              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute1 '||X_Attribute1 ||' Database  attribute1 '||Recinfo.attribute1);
1014         END IF;
1018         IF (NVL(TRIM(X_Attribute3),'-999') <> NVL( TRIM(Recinfo.attribute3),'-999')) THEN
1015         IF (NVL(TRIM(X_Attribute2),'-999') <> NVL( TRIM(Recinfo.attribute2),'-999')) THEN
1016              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute2 '||X_Attribute2 ||' Database  attribute2 '||Recinfo.attribute2);
1017         END IF;
1019              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute3 '||X_Attribute3 ||' Database  attribute3 '||Recinfo.attribute3);
1020         END IF;
1021         IF (NVL(TRIM(X_Attribute4),'-999') <> NVL( TRIM(Recinfo.attribute4),'-999')) THEN
1022              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute4 '||X_Attribute4 ||' Database  attribute4 '||Recinfo.attribute4);
1023         END IF;
1024         IF (NVL(TRIM(X_Attribute5),'-999') <> NVL( TRIM(Recinfo.attribute5),'-999')) THEN
1025              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute5 '||X_Attribute5 ||' Database  attribute5 '||Recinfo.attribute5);
1026         END IF;
1027         IF (NVL(TRIM(X_Attribute6),'-999') <> NVL( TRIM(Recinfo.attribute6),'-999')) THEN
1028              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute6 '||X_Attribute6 ||' Database  attribute6 '||Recinfo.attribute6);
1029         END IF;
1030         IF (NVL(TRIM(X_Attribute7),'-999') <> NVL( TRIM(Recinfo.attribute7),'-999')) THEN
1031              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute7 '||X_Attribute7 ||' Database  attribute7 '||Recinfo.attribute7);
1032         END IF;
1033         IF (NVL(TRIM(X_Attribute8),'-999') <> NVL( TRIM(Recinfo.attribute8),'-999')) THEN
1034              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute8 '||X_Attribute8 ||' Database  attribute8 '||Recinfo.attribute8);
1035         END IF;
1036         IF (NVL(TRIM(X_Attribute9),'-999') <> NVL( TRIM(Recinfo.attribute9),'-999')) THEN
1037              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute9 '||X_Attribute9 ||' Database  attribute9 '||Recinfo.attribute9);
1038         END IF;
1039         IF (NVL(TRIM(X_Attribute10),'-999') <> NVL( TRIM(Recinfo.attribute10),'-999')) THEN
1040              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute10 '||X_Attribute10 ||' Database  attribute10 '||Recinfo.attribute10);
1041         END IF;
1042         IF (NVL(TRIM(X_Attribute11),'-999') <> NVL( TRIM(Recinfo.attribute11),'-999')) THEN
1043              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute11 '||X_Attribute11 ||' Database  attribute11 '||Recinfo.attribute11);
1044         END IF;
1045         IF (NVL(TRIM(X_Attribute12),'-999') <> NVL( TRIM(Recinfo.attribute12),'-999')) THEN
1046              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute12 '||X_Attribute12 ||' Database  attribute12 '||Recinfo.attribute12);
1047         END IF;
1048         IF (NVL(TRIM(X_Attribute13),'-999') <> NVL( TRIM(Recinfo.attribute13),'-999')) THEN
1049              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute13 '||X_Attribute13 ||' Database  attribute13 '||Recinfo.attribute13);
1050         END IF;
1051         IF (NVL(TRIM(X_Attribute14),'-999') <> NVL( TRIM(Recinfo.attribute14),'-999')) THEN
1052              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute14 '||X_Attribute14 ||' Database  attribute14 '||Recinfo.attribute14);
1053         END IF;
1054         IF (NVL(TRIM(X_Attribute15),'-999') <> NVL( TRIM(Recinfo.attribute15),'-999')) THEN
1055              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form attribute15 '||X_Attribute15 ||' Database  attribute15 '||Recinfo.attribute15);
1056         END IF;
1057         IF (NVL(TRIM(X_Closed_Code),'-999') <> NVL( TRIM(Recinfo.closed_code),'-999')) THEN
1058              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form closed_code '||X_Closed_Code ||' Database  closed_code '||Recinfo.closed_code);
1059         END IF;
1060         IF (NVL(TRIM(X_Government_Context),'-999') <> NVL( TRIM(Recinfo.government_context),'-999')) THEN
1061              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form government_context '||X_Government_Context ||' Database  government_context '||Recinfo.government_context);
1062         END IF;
1063         IF (NVL(TRIM(X_Supply_Agreement_flag),'-999') <> NVL( TRIM(Recinfo.supply_agreement_flag),'-999')) THEN
1064              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form supply_agreement_flag '||X_Supply_Agreement_flag ||' Database  supply_agreement_flag '||Recinfo.supply_agreement_flag);
1065         END IF;
1066         IF (NVL(X_Price_Update_Tolerance,-999) <> NVL(Recinfo.price_update_tolerance,-999)) THEN
1067              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form price_update_tolerance'||X_Price_Update_Tolerance ||' Database  price_update_tolerance '|| Recinfo.price_update_tolerance);
1068         END IF;
1069         IF (NVL(TRIM(X_Global_Attribute_Category),'-999') <> NVL( TRIM(Recinfo.global_attribute_category),'-999')) THEN
1070              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute_category '||X_Global_Attribute_Category ||' Database  global_attribute_category '||Recinfo.global_attribute_category);
1071         END IF;
1072         IF (NVL(TRIM(X_Global_Attribute1),'-999') <> NVL( TRIM(Recinfo.global_attribute1),'-999')) THEN
1073              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute1 '||X_Global_Attribute1 ||' Database  global_attribute1 '||Recinfo.global_attribute1);
1074         END IF;
1075         IF (NVL(TRIM(X_Global_Attribute2),'-999') <> NVL( TRIM(Recinfo.global_attribute2),'-999')) THEN
1076              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute2 '||X_Global_Attribute2 ||' Database  global_attribute2 '||Recinfo.global_attribute2);
1077         END IF;
1078         IF (NVL(TRIM(X_Global_Attribute3),'-999') <> NVL( TRIM(Recinfo.global_attribute3),'-999')) THEN
1082              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute4 '||X_Global_Attribute4 ||' Database  global_attribute4 '||Recinfo.global_attribute4);
1079              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute3 '||X_Global_Attribute3 ||' Database  global_attribute3 '||Recinfo.global_attribute3);
1080         END IF;
1081         IF (NVL(TRIM(X_Global_Attribute4),'-999') <> NVL( TRIM(Recinfo.global_attribute4),'-999')) THEN
1083         END IF;
1084         IF (NVL(TRIM(X_Global_Attribute5),'-999') <> NVL( TRIM(Recinfo.global_attribute5),'-999')) THEN
1085              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute5 '||X_Global_Attribute5 ||' Database  global_attribute5 '||Recinfo.global_attribute5);
1086         END IF;
1087         IF (NVL(TRIM(X_Global_Attribute6),'-999') <> NVL( TRIM(Recinfo.global_attribute6),'-999')) THEN
1088              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute6 '||X_Global_Attribute6 ||' Database  global_attribute6 '||Recinfo.global_attribute6);
1089         END IF;
1090         IF (NVL(TRIM(X_Global_Attribute7),'-999') <> NVL( TRIM(Recinfo.global_attribute7),'-999')) THEN
1091              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute7 '||X_Global_Attribute7 ||' Database  global_attribute7 '||Recinfo.global_attribute7);
1092         END IF;
1093         IF (NVL(TRIM(X_Global_Attribute8),'-999') <> NVL( TRIM(Recinfo.global_attribute8),'-999')) THEN
1094              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute8 '||X_Global_Attribute8 ||' Database  global_attribute8 '||Recinfo.global_attribute8);
1095         END IF;
1096         IF (NVL(TRIM(X_Global_Attribute9),'-999') <> NVL( TRIM(Recinfo.global_attribute9),'-999')) THEN
1097              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute9 '||X_Global_Attribute9 ||' Database  global_attribute9 '||Recinfo.global_attribute9);
1098         END IF;
1099         IF (NVL(TRIM(X_Global_Attribute10),'-999') <> NVL( TRIM(Recinfo.global_attribute10),'-999')) THEN
1100              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute10 '||X_Global_Attribute10 ||' Database  global_attribute10 '||Recinfo.global_attribute10);
1101         END IF;
1102         IF (NVL(TRIM(X_Global_Attribute11),'-999') <> NVL( TRIM(Recinfo.global_attribute11),'-999')) THEN
1103              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute11 '||X_Global_Attribute11 ||' Database  global_attribute11 '||Recinfo.global_attribute11);
1104         END IF;
1105         IF (NVL(TRIM(X_Global_Attribute12),'-999') <> NVL( TRIM(Recinfo.global_attribute12),'-999')) THEN
1106              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute12 '||X_Global_Attribute12 ||' Database  global_attribute12 '||Recinfo.global_attribute12);
1107         END IF;
1108         IF (NVL(TRIM(X_Global_Attribute13),'-999') <> NVL( TRIM(Recinfo.global_attribute13),'-999')) THEN
1109              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute13 '||X_Global_Attribute13 ||' Database  global_attribute13 '||Recinfo.global_attribute13);
1110         END IF;
1111         IF (NVL(TRIM(X_Global_Attribute14),'-999') <> NVL( TRIM(Recinfo.global_attribute14),'-999')) THEN
1112              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute14 '||X_Global_Attribute14 ||' Database  global_attribute14 '||Recinfo.global_attribute14);
1113         END IF;
1114         IF (NVL(TRIM(X_Global_Attribute15),'-999') <> NVL( TRIM(Recinfo.global_attribute15),'-999')) THEN
1115              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute15 '||X_Global_Attribute15 ||' Database  global_attribute15 '||Recinfo.global_attribute15);
1116         END IF;
1117         IF (NVL(TRIM(X_Global_Attribute16),'-999') <> NVL( TRIM(Recinfo.global_attribute16),'-999')) THEN
1118              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute16 '||X_Global_Attribute16 ||' Database  global_attribute16 '||Recinfo.global_attribute16);
1119         END IF;
1120         IF (NVL(TRIM(X_Global_Attribute17),'-999') <> NVL( TRIM(Recinfo.global_attribute17),'-999')) THEN
1121              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute17 '||X_Global_Attribute17 ||' Database  global_attribute17 '||Recinfo.global_attribute17);
1122         END IF;
1123         IF (NVL(TRIM(X_Global_Attribute18),'-999') <> NVL( TRIM(Recinfo.global_attribute18),'-999')) THEN
1124              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute18 '||X_Global_Attribute18 ||' Database  global_attribute18 '||Recinfo.global_attribute18);
1125         END IF;
1126         IF (NVL(TRIM(X_Global_Attribute19),'-999') <> NVL( TRIM(Recinfo.global_attribute19),'-999')) THEN
1127              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute19 '||X_Global_Attribute19 ||' Database  global_attribute19 '||Recinfo.global_attribute19);
1128         END IF;
1129         IF (NVL(TRIM(X_Global_Attribute20),'-999') <> NVL( TRIM(Recinfo.global_attribute20),'-999')) THEN
1130              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form global_attribute20 '||X_Global_Attribute20 ||' Database  global_attribute20 '||Recinfo.global_attribute20);
1131         END IF;
1132         IF (NVL(TRIM(p_shipping_control),'-999') <> NVL( TRIM(Recinfo.shipping_control),'-999')) THEN
1133              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form shipping_control '||p_shipping_control ||' Database  shipping_control '||Recinfo.shipping_control);
1134         END IF;
1135         IF (NVL(TRIM(p_conterms_exist_flag),'-999') <> NVL( TRIM(Recinfo.conterms_exist_flag),'-999')) THEN
1136              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form conterms_exist_flag '||p_conterms_exist_flag ||' Database  conterms_exist_flag '||Recinfo.conterms_exist_flag);
1137         END IF;
1138         IF (NVL(TRIM(p_encumbrance_required_flag),'-999') <> NVL( TRIM(Recinfo.encumbrance_required_flag),'-999')) THEN
1139              FND_LOG.string(FND_LOG.LEVEL_STATEMENT,g_module_prefix || l_api_name,' Form encumbrance_required_flag '||p_encumbrance_required_flag ||' Database  encumbrance_required_flag '||Recinfo.encumbrance_required_flag);
1140         END IF;
1141 		END IF;
1142 
1143       IF (g_fnd_debug = 'Y') THEN
1144           IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_ERROR) THEN
1145             FND_LOG.string(FND_LOG.level_error, g_module_prefix || 'lock_row.020',
1146                          'Failed first if statement when comparing fields');
1147           END IF;
1148       END IF;
1149       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
1150       APP_EXCEPTION.RAISE_EXCEPTION;
1151 
1152   end if;
1153 
1154   EXCEPTION   --Bug 12373682
1155       WHEN app_exception.record_lock_exception THEN
1156           po_message_s.app_error ('PO_ALL_CANNOT_RESERVE_RECORD');
1157 
1158 
1159   END Lock_Row;
1160 
1161 END PO_HEADERS_PKG_S1;