DBA Data[Home] [Help]

PACKAGE BODY: APPS.XLA_PROD_ACCT_LINES_F_PKG

Source


1 PACKAGE BODY xla_prod_acct_lines_f_pkg AS
2 /* $Header: xlatbpal.pkb 120.8 2003/03/18 00:43:33 dcshah ship $ */
3 /*======================================================================+
4 |             Copyright (c) 2001-2002 Oracle Corporation                |
5 |                       Redwood Shores, CA, USA                         |
6 |                         All rights reserved.                          |
7 +=======================================================================+
8 | PACKAGE NAME                                                          |
9 |    xla_prod_acct_lines_f_pkg                                          |
10 |                                                                       |
11 | DESCRIPTION                                                           |
12 |    Forms PL/SQL Wrapper for xla_prod_acct_lines                       |
13 |                                                                       |
14 | HISTORY                                                               |
15 |    05/22/01     Dimple Shah    Created                                |
16 |                                                                       |
17 +======================================================================*/
18 
19 
20 
21 /*======================================================================+
22 |                                                                       |
23 |  Procedure insert_row                                                 |
24 |                                                                       |
25 +======================================================================*/
26 PROCEDURE insert_row
27   (x_rowid                            IN OUT NOCOPY VARCHAR2
28   ,x_application_id                   IN NUMBER
29   ,x_amb_context_code                 IN VARCHAR2
30   ,x_product_rule_type_code           IN VARCHAR2
31   ,x_product_rule_code                IN VARCHAR2
32   ,x_entity_code                      IN VARCHAR2
33   ,x_event_class_code                 IN VARCHAR2
34   ,x_event_type_code                  IN VARCHAR2
35   ,x_accounting_line_type_code        IN VARCHAR2
36   ,x_accounting_line_code             IN VARCHAR2
37   ,x_description_type_code            IN VARCHAR2
38   ,x_description_code                 IN VARCHAR2
39   ,x_active_flag                     IN VARCHAR2
40   ,x_creation_date                    IN DATE
41   ,x_created_by                       IN NUMBER
42   ,x_last_update_date                 IN DATE
43   ,x_last_updated_by                  IN NUMBER
44   ,x_last_update_login                IN NUMBER)
45 IS
46 
47 CURSOR c IS
48 SELECT rowid
49 FROM   xla_prod_acct_lines
50 WHERE  application_id                   = x_application_id
51   AND  amb_context_code                 = x_amb_context_code
52   AND  product_rule_type_code           = x_product_rule_type_code
53   AND  product_rule_code                = x_product_rule_code
54   AND  entity_code                      = x_entity_code
55   AND  event_class_code                 = x_event_class_code
56   AND  event_type_code                  = x_event_type_code
57   AND  accounting_line_type_code        = x_accounting_line_type_code
58   AND  accounting_line_code             = x_accounting_line_code
59 ;
60 
61 BEGIN
62 xla_utility_pkg.trace('> .insert_row'                    ,20);
63 
64 INSERT INTO xla_prod_acct_lines
65 (creation_date
66 ,created_by
67 ,application_id
68 ,amb_context_code
69 ,product_rule_type_code
70 ,product_rule_code
71 ,entity_code
72 ,event_class_code
73 ,event_type_code
74 ,accounting_line_type_code
75 ,accounting_line_code
76 ,description_type_code
77 ,description_code
78 ,active_flag
79 ,last_update_date
80 ,last_updated_by
81 ,last_update_login)
82 VALUES
83 (x_creation_date
84 ,x_created_by
85 ,x_application_id
86 ,x_amb_context_code
87 ,x_product_rule_type_code
88 ,x_product_rule_code
89 ,x_entity_code
90 ,x_event_class_code
91 ,x_event_type_code
92 ,x_accounting_line_type_code
93 ,x_accounting_line_code
94 ,x_description_type_code
95 ,x_description_code
96 ,x_active_flag
97 ,x_last_update_date
98 ,x_last_updated_by
99 ,x_last_update_login)
100 ;
101 
102 OPEN c;
103 FETCH c INTO x_rowid;
104 
105 IF (c%NOTFOUND) THEN
106    CLOSE c;
107    RAISE NO_DATA_FOUND;
108 END IF;
109 CLOSE c;
110 
111 xla_utility_pkg.trace('< .insert_row'                    ,20);
112 END insert_row;
113 
114 /*======================================================================+
115 |                                                                       |
116 |  Procedure lock_row                                                   |
117 |                                                                       |
118 +======================================================================*/
119 PROCEDURE lock_row
120   (x_rowid                            IN OUT NOCOPY VARCHAR2
121   ,x_application_id                   IN NUMBER
122   ,x_amb_context_code                 IN VARCHAR2
123   ,x_product_rule_type_code           IN VARCHAR2
124   ,x_product_rule_code                IN VARCHAR2
125   ,x_entity_code                      IN VARCHAR2
126   ,x_event_class_code                 IN VARCHAR2
127   ,x_event_type_code                  IN VARCHAR2
128   ,x_accounting_line_type_code        IN VARCHAR2
129   ,x_accounting_line_code             IN VARCHAR2
130   ,x_description_type_code            IN VARCHAR2
131   ,x_description_code                 IN VARCHAR2
132   ,x_active_flag                     IN VARCHAR2)
133 
134 IS
135 
136 CURSOR c IS
137 SELECT application_id
138       ,amb_context_code
139       ,product_rule_type_code
140       ,product_rule_code
141       ,entity_code
142       ,event_class_code
143       ,event_type_code
144       ,accounting_line_type_code
145       ,accounting_line_code
146       ,description_type_code
147       ,description_code
148       ,active_flag
149 FROM   xla_prod_acct_lines
150 WHERE  application_id                   = x_application_id
151   AND  amb_context_code                 = x_amb_context_code
152   AND  product_rule_type_code           = x_product_rule_type_code
153   AND  product_rule_code                = x_product_rule_code
154   AND  entity_code                      = x_entity_code
155   AND  event_class_code                 = x_event_class_code
156   AND  event_type_code                  = x_event_type_code
157   AND  accounting_line_type_code        = x_accounting_line_type_code
158   AND  accounting_line_code             = x_accounting_line_code
159 FOR UPDATE OF application_id NOWAIT;
160 
161 recinfo              c%ROWTYPE;
162 
163 BEGIN
164 xla_utility_pkg.trace('> .lock_row'                      ,20);
165 
166 OPEN c;
167 FETCH c INTO recinfo;
168 
169 IF (c%NOTFOUND) THEN
170    CLOSE c;
171    fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
172    app_exception.raise_exception;
173 END IF;
174 CLOSE c;
175 
176 IF ( (recinfo.application_id                    = x_application_id)
177  AND (recinfo.amb_context_code                  = x_amb_context_code)
178  AND (recinfo.product_rule_type_code            = x_product_rule_type_code)
179  AND (recinfo.product_rule_code                 = x_product_rule_code)
180  AND (recinfo.entity_code                       = x_entity_code)
181  AND (recinfo.event_class_code                  = x_event_class_code)
182  AND (recinfo.event_type_code                   = x_event_type_code)
183  AND (recinfo.accounting_line_type_code         = x_accounting_line_type_code)
184  AND (recinfo.accounting_line_code              = x_accounting_line_code)
185  AND (recinfo.active_flag                      = x_active_flag)
186  AND ((recinfo.description_type_code            = x_description_type_code)
187    OR ((recinfo.description_type_code           IS NULL)
188   AND (x_description_type_code              IS NULL)))
189  AND ((recinfo.description_code            = x_description_code)
190    OR ((recinfo.description_code           IS NULL)
191   AND (x_description_code              IS NULL)))
192                    ) THEN
193    null;
194 ELSE
195    fnd_message.set_name('FND', 'FORM_RECORD_CHANGED');
196    app_exception.raise_exception;
197 END IF;
198 
199 xla_utility_pkg.trace('< .lock_row'                      ,20);
200 RETURN;
201 
202 END lock_row;
203 
204 /*======================================================================+
205 |                                                                       |
206 |  Procedure update_row                                                 |
207 |                                                                       |
208 +======================================================================*/
209 PROCEDURE update_row
210   (x_rowid                            IN OUT NOCOPY VARCHAR2
211   ,x_application_id                   IN NUMBER
212   ,x_amb_context_code                 IN VARCHAR2
213   ,x_product_rule_type_code           IN VARCHAR2
214   ,x_product_rule_code                IN VARCHAR2
215   ,x_entity_code                      IN VARCHAR2
216   ,x_event_class_code                 IN VARCHAR2
217   ,x_event_type_code                  IN VARCHAR2
218   ,x_accounting_line_type_code        IN VARCHAR2
219   ,x_accounting_line_code             IN VARCHAR2
220   ,x_description_type_code            IN VARCHAR2
221   ,x_description_code                 IN VARCHAR2
222   ,x_active_flag                     IN VARCHAR2
223   ,x_last_update_date                 IN DATE
224   ,x_last_updated_by                  IN NUMBER
225   ,x_last_update_login                IN NUMBER)
226 
227 IS
228 
229 BEGIN
230 xla_utility_pkg.trace('> .update_row'                    ,20);
231 UPDATE xla_prod_acct_lines
232    SET
233        last_update_date                 = x_last_update_date
234       ,description_type_code            = x_description_type_code
235       ,description_code                 = x_description_code
236       ,active_flag                      = x_active_flag
237       ,last_updated_by                  = x_last_updated_by
238       ,last_update_login                = x_last_update_login
239 WHERE  application_id                   = x_application_id
240   AND  amb_context_code                 = x_amb_context_code
241   AND  product_rule_type_code           = x_product_rule_type_code
242   AND  product_rule_code                = x_product_rule_code
243   AND  entity_code                      = x_entity_code
244   AND  event_class_code                 = x_event_class_code
245   AND  event_type_code                  = x_event_type_code
246   AND  accounting_line_type_code        = x_accounting_line_type_code
247   AND  accounting_line_code             = x_accounting_line_code;
248 
249 IF (SQL%NOTFOUND) THEN
250    RAISE NO_DATA_FOUND;
251 END IF;
252 
253 xla_utility_pkg.trace('< .update_row'                    ,20);
254 END update_row;
255 
256 /*======================================================================+
257 |                                                                       |
258 |  Procedure delete_row                                                 |
259 |                                                                       |
260 +======================================================================*/
261 PROCEDURE delete_row
262   (x_application_id                   IN NUMBER
263   ,x_amb_context_code                 IN VARCHAR2
264   ,x_product_rule_type_code           IN VARCHAR2
265   ,x_product_rule_code                IN VARCHAR2
266   ,x_entity_code                      IN VARCHAR2
267   ,x_event_class_code                 IN VARCHAR2
268   ,x_event_type_code                  IN VARCHAR2
269   ,x_accounting_line_type_code        IN VARCHAR2
270   ,x_accounting_line_code             IN VARCHAR2)
271 
272 IS
273 
274 BEGIN
275 xla_utility_pkg.trace('> .delete_row'                    ,20);
276 DELETE FROM xla_prod_acct_lines
277 WHERE  application_id                   = x_application_id
278   AND  amb_context_code                 = x_amb_context_code
279   AND  product_rule_type_code           = x_product_rule_type_code
280   AND  product_rule_code                = x_product_rule_code
281   AND  entity_code                      = x_entity_code
282   AND  event_class_code                 = x_event_class_code
283   AND  event_type_code                  = x_event_type_code
284   AND  accounting_line_type_code        = x_accounting_line_type_code
285   AND  accounting_line_code             = x_accounting_line_code;
286 
287 IF (SQL%NOTFOUND) THEN
288    RAISE NO_DATA_FOUND;
289 END IF;
290 
291 xla_utility_pkg.trace('< .delete_row'                    ,20);
292 END delete_row;
293 
294 end xla_prod_acct_lines_f_pkg;