DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_REQUISITION_LINES_PKG6

Source


1 PACKAGE BODY PO_REQUISITION_LINES_PKG6 as
2 /* $Header: POXRIL6B.pls 120.1.12020000.2 2013/02/10 14:16:00 vegajula ship $ */
3  G_CURRENT_RUNTIME_LEVEL      NUMBER;
4 g_fnd_debug CONSTANT VARCHAR2(1) := NVL(FND_PROFILE.VALUE('AFLOG_ENABLED'),'N');
5 
6 c_log_head    CONSTANT VARCHAR2(35) := 'po.plsql.PO_REQUISITION_LINES_PKG6.';
7 
8 
9   PROCEDURE Lock5_Row(X_Rowid                           VARCHAR2,
10                      X_Attribute7                       VARCHAR2,
11                      X_Attribute8                       VARCHAR2,
12                      X_Attribute9                       VARCHAR2,
13                      X_Attribute10                      VARCHAR2,
14                      X_Attribute11                      VARCHAR2,
15                      X_Attribute12                      VARCHAR2,
16                      X_Attribute13                      VARCHAR2,
17                      X_Attribute14                      VARCHAR2,
18                      X_Attribute15                      VARCHAR2,
19                      X_Bom_Resource_Id                  NUMBER,
20                      X_Ussgl_Transaction_Code           VARCHAR2,
21                      X_Government_Context               VARCHAR2,
22                      X_Closed_Reason                    VARCHAR2,
23                      X_Closed_Date                      DATE,
24                      X_Transaction_Reason_Code          VARCHAR2,
25                      X_Quantity_Received                NUMBER
26   ) IS
27 
28     CURSOR C IS
29         SELECT *
30         FROM   PO_REQUISITION_LINES
31         WHERE  rowid = X_Rowid
32         FOR UPDATE of Requisition_Line_Id NOWAIT;
33 
34     Recinfo C%ROWTYPE;
35  --For debugging Purposes.
36   l_api_name CONSTANT VARCHAR2(30) := 'Lock5_Row';
37   BEGIN
38     OPEN C;
39     FETCH C INTO Recinfo;
40     if (C%NOTFOUND) then
41       CLOSE C;
42       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
43       APP_EXCEPTION.Raise_Exception;
44     end if;
45     CLOSE C;
46 
47     if (
48                (   (TRIM(Recinfo.attribute7) = TRIM(X_Attribute7))
49                 OR (    (TRIM(Recinfo.attribute7) IS NULL)
50                     AND (TRIM(X_Attribute7) IS NULL)))
51            AND (   (TRIM(Recinfo.attribute8) = TRIM(X_Attribute8))
52                 OR (    (TRIM(Recinfo.attribute8) IS NULL)
53                     AND (TRIM(X_Attribute8) IS NULL)))
54            AND (   (TRIM(Recinfo.attribute9) = TRIM(X_Attribute9))
55                 OR (    (TRIM(Recinfo.attribute9) IS NULL)
56                     AND (TRIM(X_Attribute9) IS NULL)))
57            AND (   (TRIM(Recinfo.attribute10) = TRIM(X_Attribute10))
58                 OR (    (TRIM(Recinfo.attribute10) IS NULL)
59                     AND (TRIM(X_Attribute10) IS NULL)))
60            AND (   (TRIM(Recinfo.attribute11) = TRIM(X_Attribute11))
61                 OR (    (TRIM(Recinfo.attribute11) IS NULL)
62                     AND (TRIM(X_Attribute11) IS NULL)))
63            AND (   (TRIM(Recinfo.attribute12) = TRIM(X_Attribute12))
64                 OR (    (TRIM(Recinfo.attribute12) IS NULL)
65                     AND (TRIM(X_Attribute12) IS NULL)))
66            AND (   (TRIM(Recinfo.attribute13) = TRIM(X_Attribute13))
67                 OR (    (TRIM(Recinfo.attribute13) IS NULL)
68                     AND (TRIM(X_Attribute13) IS NULL)))
69            AND (   (TRIM(Recinfo.attribute14) = TRIM(X_Attribute14))
70                 OR (    (TRIM(Recinfo.attribute14) IS NULL)
71                     AND (TRIM(X_Attribute14) IS NULL)))
72            AND (   (TRIM(Recinfo.attribute15) = TRIM(X_Attribute15))
73                 OR (    (TRIM(Recinfo.attribute15) IS NULL)
74                     AND (TRIM(X_Attribute15) IS NULL)))
75            AND (   (Recinfo.bom_resource_id = X_Bom_Resource_Id)
76                 OR (    (Recinfo.bom_resource_id IS NULL)
77                     AND (X_Bom_Resource_Id IS NULL)))
78            AND (   (TRIM(Recinfo.government_context) = TRIM(X_Government_Context))
79                 OR (    (TRIM(Recinfo.government_context) IS NULL)
80                     AND (TRIM(X_Government_Context) IS NULL)))
81            AND (   (TRIM(Recinfo.closed_reason) = TRIM(X_Closed_Reason))
82                 OR (    (TRIM(Recinfo.closed_reason) IS NULL)
83                     AND (TRIM(X_Closed_Reason) IS NULL)))
84            AND (   (Recinfo.closed_date = X_Closed_Date)
85                 OR (    (Recinfo.closed_date IS NULL)
86                     AND (X_Closed_Date IS NULL)))
87            AND (   (TRIM(Recinfo.transaction_reason_code) = TRIM(X_Transaction_Reason_Code))
88                 OR (    (TRIM(Recinfo.transaction_reason_code) IS NULL)
89                     AND (TRIM(X_Transaction_Reason_Code) IS NULL)))
90            AND
91 	 (   (Recinfo.quantity_received = X_Quantity_Received)
92                 OR (    (Recinfo.quantity_received IS NULL)
93                     AND (X_Quantity_Received IS NULL)))
94 
95             ) then
96       return;
97     else
98      -- Logging Infra: Setting up runtime level
99      G_CURRENT_RUNTIME_LEVEL := FND_LOG.G_CURRENT_RUNTIME_LEVEL;
100      -- Logging Infra: Procedure level
101      IF (FND_LOG.LEVEL_PROCEDURE >= G_CURRENT_RUNTIME_LEVEL ) THEN
102 if (nvl(X_Attribute7,'-999') <> nvl(Recinfo.Attribute7,'-999')   ) then
103 	FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Attribute7 '||X_Attribute7 ||' Database  Attribute7 '||Recinfo.Attribute7);
104  end if;
105 if (nvl(X_Attribute8,'-999') <> nvl(Recinfo.Attribute8,'-999')   ) then
106 	FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Attribute8 '||X_Attribute8 ||' Database  Attribute8 '||Recinfo.Attribute8);
107  end if;
108 if (nvl(X_Attribute9,'-999') <> nvl(Recinfo.Attribute9,'-999')   ) then
109 	FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Attribute9 '||X_Attribute9 ||' Database  Attribute9 '||Recinfo.Attribute9);
110  end if;
111 if (nvl(X_Attribute10,'-999') <> nvl(Recinfo.Attribute10,'-999')   ) then
112 	FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Attribute10 '||X_Attribute10 ||' Database  Attribute10 '||Recinfo.Attribute10);
113  end if;
114 if (nvl(X_Attribute11,'-999') <> nvl(Recinfo.Attribute11,'-999')   ) then
115 	FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Attribute11 '||X_Attribute11 ||' Database  Attribute11 '||Recinfo.Attribute11);
116  end if;
117 if (nvl(X_Attribute12,'-999') <> nvl(Recinfo.Attribute12,'-999')   ) then
118 	FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Attribute12 '||X_Attribute12 ||' Database  Attribute12 '||Recinfo.Attribute12);
119  end if;
120 if (nvl(X_Attribute13,'-999') <> nvl(Recinfo.Attribute13,'-999')   ) then
121 	FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Attribute13 '||X_Attribute13 ||' Database  Attribute13 '||Recinfo.Attribute13);
122  end if;
123 if (nvl(X_Attribute14,'-999') <> nvl(Recinfo.Attribute14,'-999')   ) then
124 	FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Attribute14 '||X_Attribute14 ||' Database  Attribute14 '||Recinfo.Attribute14);
125  end if;
126 if (nvl(X_Attribute15,'-999') <> nvl(Recinfo.Attribute15,'-999')   ) then
127 	FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Attribute15 '||X_Attribute15 ||' Database  Attribute15 '||Recinfo.Attribute15);
128  end if;
129 if (nvl(X_Bom_Resource_Id, -999 ) <> nvl(Recinfo.Bom_Resource_Id, -999 )   ) then
130 	FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Bom_Resource_Id '||X_Bom_Resource_Id ||' Database  Bom_Resource_Id '||Recinfo.Bom_Resource_Id);
131  end if;
132 if (nvl(X_Government_Context,'-999') <> nvl(Recinfo.Government_Context,'-999')   ) then
133 	FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Government_Context '||X_Government_Context ||' Database  Government_Context '||Recinfo.Government_Context);
134  end if;
135 if (nvl(X_Closed_Reason,'-999') <> nvl(Recinfo.Closed_Reason,'-999')   ) then
136 	FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Closed_Reason '||X_Closed_Reason ||' Database  Closed_Reason '||Recinfo.Closed_Reason);
137  end if;
138 if (trunc(X_Closed_Date) <>  trunc(Recinfo.Closed_Date) ) then
139  	FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Closed_Date '||X_Closed_Date ||' Database  Closed_Date '||Recinfo.Closed_Date);
140  end if;
141 if (nvl(X_Transaction_Reason_Code,'-999') <> nvl(Recinfo.Transaction_Reason_Code,'-999')   ) then
142 	FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Transaction_Reason_Code '||X_Transaction_Reason_Code ||' Database  Transaction_Reason_Code '||Recinfo.Transaction_Reason_Code);
143  end if;
144 if (nvl(X_Quantity_Received, -999 ) <> nvl(Recinfo.Quantity_Received, -999 )   ) then
145 	FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form X_Quantity_Received '||X_Quantity_Received ||' Database  Quantity_Received '||Recinfo.Quantity_Received);
146  end if;
147 
148 
149      END IF;
150       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
151       APP_EXCEPTION.RAISE_EXCEPTION;
152     end if;
153 
154   END Lock5_Row;
155 
156 END PO_REQUISITION_LINES_PKG6;