DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_REQUISITION_LINES_PKG4

Source


1 PACKAGE BODY PO_REQUISITION_LINES_PKG4 as
2 /* $Header: POXRIL5B.pls 120.0 2005/06/01 21:23:36 appldev noship $ */
3 
4 
5   PROCEDURE Lock4_Row(X_Rowid                            VARCHAR2,
6                      X_Item_Revision                    VARCHAR2,
7                      X_Quantity_Delivered               NUMBER,
8                      X_Suggested_Buyer_Id               NUMBER,
9                      X_Encumbered_Flag                  VARCHAR2,
10                      X_Rfq_Required_Flag                VARCHAR2,
11                      X_Need_By_Date                     DATE,
12                      X_Line_Location_Id                 NUMBER,
13                      X_Modified_By_Agent_Flag           VARCHAR2,
14                      X_Parent_Req_Line_Id               NUMBER,
15                      X_Justification                    VARCHAR2,
16                      X_Note_To_Agent                    VARCHAR2,
17                      X_Note_To_Receiver                 VARCHAR2,
18                      X_Purchasing_Agent_Id              NUMBER,
19                      X_Document_Type_Code               VARCHAR2,
20                      X_Blanket_Po_Header_Id             NUMBER,
21                      X_Blanket_Po_Line_Num              NUMBER,
22                      X_Currency_Code                    VARCHAR2
23   ) IS
24 
25     CURSOR C IS
26         SELECT *
27         FROM   PO_REQUISITION_LINES
28         WHERE  rowid = X_Rowid
29         FOR UPDATE of Requisition_Line_Id NOWAIT;
30 
31     Recinfo C%ROWTYPE;
32   BEGIN
33     OPEN C;
34     FETCH C INTO Recinfo;
35     if (C%NOTFOUND) then
36       CLOSE C;
37       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
38       APP_EXCEPTION.Raise_Exception;
39     end if;
40     CLOSE C;
41     if (
42                (   (Recinfo.item_revision = X_Item_Revision)
43                 OR (    (Recinfo.item_revision IS NULL)
44                     AND (X_Item_Revision IS NULL)))
45            AND (   (Recinfo.quantity_delivered = X_Quantity_Delivered)
46                 OR (    (Recinfo.quantity_delivered IS NULL)
47                     AND (X_Quantity_Delivered IS NULL)))
48            AND (   (Recinfo.suggested_buyer_id = X_Suggested_Buyer_Id)
49                 OR (    (Recinfo.suggested_buyer_id IS NULL)
50                     AND (X_Suggested_Buyer_Id IS NULL)))
51            AND (   (Recinfo.encumbered_flag = X_Encumbered_Flag)
52                 OR (    (Recinfo.encumbered_flag IS NULL)
53                     AND (X_Encumbered_Flag IS NULL)))
54            AND (   (Recinfo.rfq_required_flag = X_Rfq_Required_Flag)
55                 OR (    (Recinfo.rfq_required_flag IS NULL)
56                     AND (X_Rfq_Required_Flag IS NULL)))
57            AND (   (Recinfo.need_by_date = X_Need_By_Date)
58                 OR (    (Recinfo.need_by_date IS NULL)
59                     AND (X_Need_By_Date IS NULL)))
60            AND (   (Recinfo.line_location_id = X_Line_Location_Id)
61                 OR (    (Recinfo.line_location_id IS NULL)
62                     AND (X_Line_Location_Id IS NULL)))
63            AND (   (Recinfo.modified_by_agent_flag = X_Modified_By_Agent_Flag)
64                 OR (    (Recinfo.modified_by_agent_flag IS NULL)
65                     AND (X_Modified_By_Agent_Flag IS NULL)))
66            AND (   (Recinfo.parent_req_line_id = X_Parent_Req_Line_Id)
67                 OR (    (Recinfo.parent_req_line_id IS NULL)
68                     AND (X_Parent_Req_Line_Id IS NULL)))
69            AND (   (Recinfo.justification = X_Justification)
70                 OR (    (Recinfo.justification IS NULL)
71                     AND (X_Justification IS NULL)))
72            AND (   (Recinfo.note_to_agent = X_Note_To_Agent)
73                 OR (    (Recinfo.note_to_agent IS NULL)
74                     AND (X_Note_To_Agent IS NULL)))
75            AND (   (Recinfo.note_to_receiver = X_Note_To_Receiver)
76                 OR (    (Recinfo.note_to_receiver IS NULL)
77                     AND (X_Note_To_Receiver IS NULL)))
78            AND (   (Recinfo.purchasing_agent_id = X_Purchasing_Agent_Id)
79                 OR (    (Recinfo.purchasing_agent_id IS NULL)
80                     AND (X_Purchasing_Agent_Id IS NULL)))
81            AND (   (Recinfo.document_type_code = X_Document_Type_Code)
82                 OR (    (Recinfo.document_type_code IS NULL)
83                     AND (X_Document_Type_Code IS NULL)))
84            AND (   (Recinfo.blanket_po_header_id = X_Blanket_Po_Header_Id)
85                 OR (    (Recinfo.blanket_po_header_id IS NULL)
86                     AND (X_Blanket_Po_Header_Id IS NULL)))
87            AND (   (Recinfo.blanket_po_line_num = X_Blanket_Po_Line_Num)
88                 OR (    (Recinfo.blanket_po_line_num IS NULL)
89                     AND (X_Blanket_Po_Line_Num IS NULL)))
90            AND (   (Recinfo.currency_code = X_Currency_Code)
91                 OR (    (Recinfo.currency_code IS NULL)
92                     AND (X_Currency_Code IS NULL)))
93             ) then
94       return;
95     else
96       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
97       APP_EXCEPTION.RAISE_EXCEPTION;
98     end if;
99   END Lock4_Row;
100 
101 END PO_REQUISITION_LINES_PKG4;