DBA Data[Home] [Help]

PACKAGE BODY: APPS.XLA_AAD_HDR_ACCT_ATTRS_F_PKG

Source


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