DBA Data[Home] [Help]

PACKAGE BODY: APPS.QP_QP_FORM_CON

Source


1 PACKAGE BODY QP_QP_Form_Con AS
2 /* $Header: QPXFCONB.pls 120.1 2005/06/13 00:29:16 appldev  $ */
3 
4 --  Global constant holding the package name
5 
6 G_PKG_NAME                    CONSTANT VARCHAR2(30) := 'QP_QP_Form_Con';
7 
8 --  Global variables holding cached record.
9 
10 g_CON_rec                     QP_Attributes_PUB.Con_Rec_Type;
11 g_db_CON_rec                  QP_Attributes_PUB.Con_Rec_Type;
12 
13 --  Forward declaration of procedures maintaining entity record cache.
14 
15 PROCEDURE Write_CON
16 (   p_CON_rec                       IN  QP_Attributes_PUB.Con_Rec_Type
17 ,   p_db_record                     IN  BOOLEAN := FALSE
18 );
19 
20 FUNCTION Get_CON
21 (   p_db_record                     IN  BOOLEAN := FALSE
22 ,   p_prc_context_id                IN  NUMBER
23 )
24 RETURN QP_Attributes_PUB.Con_Rec_Type;
25 
26 PROCEDURE Clear_CON;
27 
28 --  Global variable holding performed operations.
29 
30 g_opr__tbl                    QP_Attributes_PUB.Con_Tbl_Type;
31 
32 --  Procedure : Default_Attributes
33 --
34 
35 PROCEDURE Default_Attributes
36 (   x_return_status                 OUT NOCOPY /* file.sql.39 change */ VARCHAR2
37 ,   x_msg_count                     OUT NOCOPY /* file.sql.39 change */ NUMBER
38 ,   x_msg_data                      OUT NOCOPY /* file.sql.39 change */ VARCHAR2
39 ,   x_attribute1                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
40 ,   x_attribute10                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2
41 ,   x_attribute11                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2
42 ,   x_attribute12                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2
43 ,   x_attribute13                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2
44 ,   x_attribute14                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2
45 ,   x_attribute15                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2
46 ,   x_attribute2                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
47 ,   x_attribute3                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
48 ,   x_attribute4                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
49 ,   x_attribute5                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
50 ,   x_attribute6                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
51 ,   x_attribute7                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
52 ,   x_attribute8                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
53 ,   x_attribute9                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
54 ,   x_context                       OUT NOCOPY /* file.sql.39 change */ VARCHAR2
55 ,   x_enabled_flag                  OUT NOCOPY /* file.sql.39 change */ VARCHAR2
56 ,   x_prc_context_code              OUT NOCOPY /* file.sql.39 change */ VARCHAR2
57 ,   x_prc_context_id                OUT NOCOPY /* file.sql.39 change */ NUMBER
58 ,   x_prc_context_type              OUT NOCOPY /* file.sql.39 change */ VARCHAR2
59 ,   x_seeded_description            OUT NOCOPY /* file.sql.39 change */ VARCHAR2
60 ,   x_seeded_flag                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2
61 ,   x_seeded_prc_context_name       OUT NOCOPY /* file.sql.39 change */ VARCHAR2
62 ,   x_user_description              OUT NOCOPY /* file.sql.39 change */ VARCHAR2
63 ,   x_user_prc_context_name         OUT NOCOPY /* file.sql.39 change */ VARCHAR2
64 ,   x_enabled                       OUT NOCOPY /* file.sql.39 change */ VARCHAR2
65 ,   x_prc_context                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2
66 ,   x_seeded                        OUT NOCOPY /* file.sql.39 change */ VARCHAR2
67 )
68 IS
69 l_CON_rec                     QP_Attributes_PUB.Con_Rec_Type;
70 l_CON_val_rec                 QP_Attributes_PUB.Con_Val_Rec_Type;
71 l_control_rec                 QP_GLOBALS.Control_Rec_Type;
72 l_return_status               VARCHAR2(1);
73 l_x_CON_rec                   QP_Attributes_PUB.Con_Rec_Type;
74 l_x_SEG_rec                   QP_Attributes_PUB.Seg_Rec_Type;
75 l_x_SEG_tbl                   QP_Attributes_PUB.Seg_Tbl_Type;
76 BEGIN
77 
78     --  Set control flags.
79 
80     l_control_rec.controlled_operation := TRUE;
81     l_control_rec.default_attributes   := TRUE;
82 
83     l_control_rec.change_attributes    := FALSE;
84     l_control_rec.validate_entity      := FALSE;
85     l_control_rec.write_to_DB          := FALSE;
86     l_control_rec.process              := FALSE;
87 
88     --  Instruct API to retain its caches
89 
90     l_control_rec.clear_api_cache      := FALSE;
91     l_control_rec.clear_api_requests   := FALSE;
92 
93     --  Load IN parameters if any exist
94 
95 
96     --  Defaulting of flex values is currently done by the form.
97     --  Set flex attributes to NULL in order to avoid defaulting them.
98 
99     l_CON_rec.attribute1                          := NULL;
100     l_CON_rec.attribute10                         := NULL;
101     l_CON_rec.attribute11                         := NULL;
102     l_CON_rec.attribute12                         := NULL;
103     l_CON_rec.attribute13                         := NULL;
104     l_CON_rec.attribute14                         := NULL;
105     l_CON_rec.attribute15                         := NULL;
106     l_CON_rec.attribute2                          := NULL;
107     l_CON_rec.attribute3                          := NULL;
108     l_CON_rec.attribute4                          := NULL;
109     l_CON_rec.attribute5                          := NULL;
110     l_CON_rec.attribute6                          := NULL;
111     l_CON_rec.attribute7                          := NULL;
112     l_CON_rec.attribute8                          := NULL;
113     l_CON_rec.attribute9                          := NULL;
114     l_CON_rec.context                             := NULL;
115 
116     --  Set Operation to Create
117 
118     l_CON_rec.operation := QP_GLOBALS.G_OPR_CREATE;
119 
120     --  Call QP_Attributes_PVT.Process_Attributes
121 
122     QP_Attributes_PVT.Process_Attributes
123     (   p_api_version_number          => 1.0
124     ,   p_init_msg_list               => FND_API.G_TRUE
125     ,   x_return_status               => l_return_status
126     ,   x_msg_count                   => x_msg_count
127     ,   x_msg_data                    => x_msg_data
128     ,   p_control_rec                 => l_control_rec
129     ,   p_CON_rec                     => l_CON_rec
130     ,   x_CON_rec                     => l_x_CON_rec
131     ,   x_SEG_tbl                     => l_x_SEG_tbl
132     );
133 
134     IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
135         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
136     ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
137         RAISE FND_API.G_EXC_ERROR;
138     END IF;
139 
140 
141     --  Load OUT parameters.
142 
143     x_attribute1                   := l_x_CON_rec.attribute1;
144     x_attribute10                  := l_x_CON_rec.attribute10;
145     x_attribute11                  := l_x_CON_rec.attribute11;
146     x_attribute12                  := l_x_CON_rec.attribute12;
147     x_attribute13                  := l_x_CON_rec.attribute13;
148     x_attribute14                  := l_x_CON_rec.attribute14;
149     x_attribute15                  := l_x_CON_rec.attribute15;
150     x_attribute2                   := l_x_CON_rec.attribute2;
151     x_attribute3                   := l_x_CON_rec.attribute3;
152     x_attribute4                   := l_x_CON_rec.attribute4;
153     x_attribute5                   := l_x_CON_rec.attribute5;
154     x_attribute6                   := l_x_CON_rec.attribute6;
155     x_attribute7                   := l_x_CON_rec.attribute7;
156     x_attribute8                   := l_x_CON_rec.attribute8;
157     x_attribute9                   := l_x_CON_rec.attribute9;
158     x_context                      := l_x_CON_rec.context;
159     x_enabled_flag                 := l_x_CON_rec.enabled_flag;
160     x_prc_context_code          := l_x_CON_rec.prc_context_code;
161     x_prc_context_id               := l_x_CON_rec.prc_context_id;
162     x_prc_context_type             := l_x_CON_rec.prc_context_type;
163     x_seeded_description           := l_x_CON_rec.seeded_description;
164     x_seeded_flag                  := l_x_CON_rec.seeded_flag;
165     x_seeded_prc_context_name      := l_x_CON_rec.seeded_prc_context_name;
166     x_user_description             := l_x_CON_rec.user_description;
167     x_user_prc_context_name        := l_x_CON_rec.user_prc_context_name;
168 
169     --  Load display out parameters if any
170 
171     l_CON_val_rec := QP_Con_Util.Get_Values
172     (   p_CON_rec                     => l_x_CON_rec
173     );
174     x_enabled                      := l_CON_val_rec.enabled;
175     x_prc_context                  := l_CON_val_rec.prc_context;
176     x_seeded                       := l_CON_val_rec.seeded;
177 
178     --  Write to cache.
179     --  Set db_flag to False before writing to cache
180 
181     l_x_CON_rec.db_flag := FND_API.G_FALSE;
182 
183     Write_CON
184     (   p_CON_rec                     => l_x_CON_rec
185     );
186 
187     --  Set return status.
188 
189     x_return_status := FND_API.G_RET_STS_SUCCESS;
190 
191     --  Get message count and data
192 
193     OE_MSG_PUB.Count_And_Get
194     (   p_count                       => x_msg_count
195     ,   p_data                        => x_msg_data
196     );
197 
198 
199 EXCEPTION
200 
201     WHEN FND_API.G_EXC_ERROR THEN
202 
203         x_return_status := FND_API.G_RET_STS_ERROR;
204 
205         --  Get message count and data
206 
207         OE_MSG_PUB.Count_And_Get
208         (   p_count                       => x_msg_count
209         ,   p_data                        => x_msg_data
210         );
211 
212     WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
213 
214         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
215 
216         --  Get message count and data
217 
218         OE_MSG_PUB.Count_And_Get
219         (   p_count                       => x_msg_count
220         ,   p_data                        => x_msg_data
221         );
222 
223     WHEN OTHERS THEN
224 
225         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
226 
227         IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
228         THEN
229             OE_MSG_PUB.Add_Exc_Msg
230             (   G_PKG_NAME
231             ,   'Default_Attributes'
232             );
233         END IF;
234 
235         --  Get message count and data
236 
237         OE_MSG_PUB.Count_And_Get
238         (   p_count                       => x_msg_count
239         ,   p_data                        => x_msg_data
240         );
241 
242 END Default_Attributes;
243 
244 --  Procedure   :   Change_Attribute
245 --
246 
247 PROCEDURE Change_Attribute
248 (   x_return_status                 OUT NOCOPY /* file.sql.39 change */ VARCHAR2
249 ,   x_msg_count                     OUT NOCOPY /* file.sql.39 change */ NUMBER
250 ,   x_msg_data                      OUT NOCOPY /* file.sql.39 change */ VARCHAR2
251 ,   p_prc_context_id                IN  NUMBER
252 ,   p_attr_id                       IN  NUMBER
253 ,   p_attr_value                    IN  VARCHAR2
254 ,   p_attribute1                    IN  VARCHAR2
255 ,   p_attribute10                   IN  VARCHAR2
256 ,   p_attribute11                   IN  VARCHAR2
257 ,   p_attribute12                   IN  VARCHAR2
258 ,   p_attribute13                   IN  VARCHAR2
259 ,   p_attribute14                   IN  VARCHAR2
260 ,   p_attribute15                   IN  VARCHAR2
261 ,   p_attribute2                    IN  VARCHAR2
262 ,   p_attribute3                    IN  VARCHAR2
263 ,   p_attribute4                    IN  VARCHAR2
264 ,   p_attribute5                    IN  VARCHAR2
265 ,   p_attribute6                    IN  VARCHAR2
266 ,   p_attribute7                    IN  VARCHAR2
267 ,   p_attribute8                    IN  VARCHAR2
268 ,   p_attribute9                    IN  VARCHAR2
269 ,   p_context                       IN  VARCHAR2
270 ,   x_attribute1                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
271 ,   x_attribute10                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2
272 ,   x_attribute11                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2
273 ,   x_attribute12                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2
274 ,   x_attribute13                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2
275 ,   x_attribute14                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2
276 ,   x_attribute15                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2
277 ,   x_attribute2                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
278 ,   x_attribute3                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
279 ,   x_attribute4                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
280 ,   x_attribute5                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
281 ,   x_attribute6                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
282 ,   x_attribute7                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
283 ,   x_attribute8                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
284 ,   x_attribute9                    OUT NOCOPY /* file.sql.39 change */ VARCHAR2
285 ,   x_context                       OUT NOCOPY /* file.sql.39 change */ VARCHAR2
286 ,   x_enabled_flag                  OUT NOCOPY /* file.sql.39 change */ VARCHAR2
287 ,   x_prc_context_code              OUT NOCOPY /* file.sql.39 change */ VARCHAR2
288 ,   x_prc_context_id                OUT NOCOPY /* file.sql.39 change */ NUMBER
289 ,   x_prc_context_type              OUT NOCOPY /* file.sql.39 change */ VARCHAR2
290 ,   x_seeded_description            OUT NOCOPY /* file.sql.39 change */ VARCHAR2
291 ,   x_seeded_flag                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2
292 ,   x_seeded_prc_context_name       OUT NOCOPY /* file.sql.39 change */ VARCHAR2
293 ,   x_user_description              OUT NOCOPY /* file.sql.39 change */ VARCHAR2
294 ,   x_user_prc_context_name         OUT NOCOPY /* file.sql.39 change */ VARCHAR2
295 ,   x_enabled                       OUT NOCOPY /* file.sql.39 change */ VARCHAR2
296 ,   x_prc_context                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2
297 ,   x_seeded                        OUT NOCOPY /* file.sql.39 change */ VARCHAR2
298 )
299 IS
300 l_CON_rec                     QP_Attributes_PUB.Con_Rec_Type;
301 l_old_CON_rec                 QP_Attributes_PUB.Con_Rec_Type;
302 l_CON_val_rec                 QP_Attributes_PUB.Con_Val_Rec_Type;
303 l_control_rec                 QP_GLOBALS.Control_Rec_Type;
304 l_return_status               VARCHAR2(1);
305 l_x_CON_rec                   QP_Attributes_PUB.Con_Rec_Type;
306 l_x_SEG_rec                   QP_Attributes_PUB.Seg_Rec_Type;
307 l_x_SEG_tbl                   QP_Attributes_PUB.Seg_Tbl_Type;
308 BEGIN
309 
310     --  Set control flags.
311 
312     l_control_rec.controlled_operation := TRUE;
313     l_control_rec.change_attributes    := TRUE;
314 
315     l_control_rec.default_attributes   := FALSE;
316     l_control_rec.validate_entity      := FALSE;
317     l_control_rec.write_to_DB          := FALSE;
318     l_control_rec.process              := FALSE;
319 
320     --  Instruct API to retain its caches
321 
322     l_control_rec.clear_api_cache      := FALSE;
323     l_control_rec.clear_api_requests   := FALSE;
324 
325     --  Read CON from cache
326 
327     l_CON_rec := Get_CON
328     (   p_db_record                   => FALSE
329     ,   p_prc_context_id              => p_prc_context_id
330     );
331 
332     l_old_CON_rec                  := l_CON_rec;
333 
334     IF p_attr_id = QP_Con_Util.G_ENABLED THEN
335         l_CON_rec.enabled_flag := p_attr_value;
336     ELSIF p_attr_id = QP_Con_Util.G_PRC_CONTEXT_code THEN
337         l_CON_rec.prc_context_code := p_attr_value;
338     ELSIF p_attr_id = QP_Con_Util.G_PRC_CONTEXT THEN
339         l_CON_rec.prc_context_id := TO_NUMBER(p_attr_value);
340     ELSIF p_attr_id = QP_Con_Util.G_PRC_CONTEXT_TYPE THEN
341         l_CON_rec.prc_context_type := p_attr_value;
342     ELSIF p_attr_id = QP_Con_Util.G_SEEDED_DESCRIPTION THEN
343         l_CON_rec.seeded_description := p_attr_value;
344     ELSIF p_attr_id = QP_Con_Util.G_SEEDED THEN
345         l_CON_rec.seeded_flag := p_attr_value;
346     ELSIF p_attr_id = QP_Con_Util.G_SEEDED_PRC_CONTEXT_NAME THEN
347         l_CON_rec.seeded_prc_context_name := p_attr_value;
348     ELSIF p_attr_id = QP_Con_Util.G_USER_DESCRIPTION THEN
349         l_CON_rec.user_description := p_attr_value;
350     ELSIF p_attr_id = QP_Con_Util.G_USER_PRC_CONTEXT_NAME THEN
351         l_CON_rec.user_prc_context_name := p_attr_value;
352     ELSIF p_attr_id = QP_Con_Util.G_ATTRIBUTE1
353     OR     p_attr_id = QP_Con_Util.G_ATTRIBUTE10
354     OR     p_attr_id = QP_Con_Util.G_ATTRIBUTE11
355     OR     p_attr_id = QP_Con_Util.G_ATTRIBUTE12
356     OR     p_attr_id = QP_Con_Util.G_ATTRIBUTE13
357     OR     p_attr_id = QP_Con_Util.G_ATTRIBUTE14
358     OR     p_attr_id = QP_Con_Util.G_ATTRIBUTE15
359     OR     p_attr_id = QP_Con_Util.G_ATTRIBUTE2
360     OR     p_attr_id = QP_Con_Util.G_ATTRIBUTE3
361     OR     p_attr_id = QP_Con_Util.G_ATTRIBUTE4
362     OR     p_attr_id = QP_Con_Util.G_ATTRIBUTE5
363     OR     p_attr_id = QP_Con_Util.G_ATTRIBUTE6
364     OR     p_attr_id = QP_Con_Util.G_ATTRIBUTE7
365     OR     p_attr_id = QP_Con_Util.G_ATTRIBUTE8
366     OR     p_attr_id = QP_Con_Util.G_ATTRIBUTE9
367     OR     p_attr_id = QP_Con_Util.G_CONTEXT
368     THEN
369 
370         l_CON_rec.attribute1           := p_attribute1;
371         l_CON_rec.attribute10          := p_attribute10;
372         l_CON_rec.attribute11          := p_attribute11;
373         l_CON_rec.attribute12          := p_attribute12;
374         l_CON_rec.attribute13          := p_attribute13;
375         l_CON_rec.attribute14          := p_attribute14;
376         l_CON_rec.attribute15          := p_attribute15;
377         l_CON_rec.attribute2           := p_attribute2;
378         l_CON_rec.attribute3           := p_attribute3;
379         l_CON_rec.attribute4           := p_attribute4;
380         l_CON_rec.attribute5           := p_attribute5;
381         l_CON_rec.attribute6           := p_attribute6;
382         l_CON_rec.attribute7           := p_attribute7;
383         l_CON_rec.attribute8           := p_attribute8;
384         l_CON_rec.attribute9           := p_attribute9;
385         l_CON_rec.context              := p_context;
386 
387     ELSE
388 
389         --  Unexpected error, unrecognized attribute
390 
391         IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
392         THEN
393             OE_MSG_PUB.Add_Exc_Msg
394             (   G_PKG_NAME
395             ,   'Change_Attribute'
396             ,   'Unrecognized attribute'
397             );
398         END IF;
399 
400         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
401 
402     END IF;
403 
404     --  Set Operation.
405 
406     IF FND_API.To_Boolean(l_CON_rec.db_flag) THEN
407         l_CON_rec.operation := QP_GLOBALS.G_OPR_UPDATE;
408     ELSE
409         l_CON_rec.operation := QP_GLOBALS.G_OPR_CREATE;
410     END IF;
411 
412     --  Call QP_Attributes_PVT.Process_Attributes
413 
414     QP_Attributes_PVT.Process_Attributes
415     (   p_api_version_number          => 1.0
416     ,   p_init_msg_list               => FND_API.G_TRUE
417     ,   p_validation_level            => FND_API.G_VALID_LEVEL_NONE
418     ,   x_return_status               => l_return_status
419     ,   x_msg_count                   => x_msg_count
420     ,   x_msg_data                    => x_msg_data
421     ,   p_control_rec                 => l_control_rec
422     ,   p_CON_rec                     => l_CON_rec
423     ,   p_old_CON_rec                 => l_old_CON_rec
424     ,   x_CON_rec                     => l_x_CON_rec
425     ,   x_SEG_tbl                     => l_x_SEG_tbl
426     );
427 
428     IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
429         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
430     ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
431         RAISE FND_API.G_EXC_ERROR;
432     END IF;
433 
434 
435     --  Init OUT parameters to missing.
436 
437     x_attribute1                   := FND_API.G_MISS_CHAR;
438     x_attribute10                  := FND_API.G_MISS_CHAR;
439     x_attribute11                  := FND_API.G_MISS_CHAR;
440     x_attribute12                  := FND_API.G_MISS_CHAR;
441     x_attribute13                  := FND_API.G_MISS_CHAR;
442     x_attribute14                  := FND_API.G_MISS_CHAR;
443     x_attribute15                  := FND_API.G_MISS_CHAR;
444     x_attribute2                   := FND_API.G_MISS_CHAR;
445     x_attribute3                   := FND_API.G_MISS_CHAR;
446     x_attribute4                   := FND_API.G_MISS_CHAR;
447     x_attribute5                   := FND_API.G_MISS_CHAR;
448     x_attribute6                   := FND_API.G_MISS_CHAR;
449     x_attribute7                   := FND_API.G_MISS_CHAR;
450     x_attribute8                   := FND_API.G_MISS_CHAR;
451     x_attribute9                   := FND_API.G_MISS_CHAR;
452     x_context                      := FND_API.G_MISS_CHAR;
453     x_enabled_flag                 := FND_API.G_MISS_CHAR;
454     x_prc_context_code          := FND_API.G_MISS_CHAR;
455     x_prc_context_id               := FND_API.G_MISS_NUM;
456     x_prc_context_type             := FND_API.G_MISS_CHAR;
457     x_seeded_description           := FND_API.G_MISS_CHAR;
458     x_seeded_flag                  := FND_API.G_MISS_CHAR;
459     x_seeded_prc_context_name      := FND_API.G_MISS_CHAR;
460     x_user_description             := FND_API.G_MISS_CHAR;
461     x_user_prc_context_name        := FND_API.G_MISS_CHAR;
462     x_enabled                      := FND_API.G_MISS_CHAR;
463     x_prc_context                  := FND_API.G_MISS_CHAR;
464     x_seeded                       := FND_API.G_MISS_CHAR;
465 
466     --  Load display out parameters if any
467 
468     l_CON_val_rec := QP_Con_Util.Get_Values
469     (   p_CON_rec                     => l_x_CON_rec
470     ,   p_old_CON_rec                 => l_CON_rec
471     );
472 
473     --  Return changed attributes.
474 
475     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.attribute1,
476                             l_CON_rec.attribute1)
477     THEN
478         x_attribute1 := l_x_CON_rec.attribute1;
479     END IF;
480 
481     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.attribute10,
482                             l_CON_rec.attribute10)
483     THEN
484         x_attribute10 := l_x_CON_rec.attribute10;
485     END IF;
486 
487     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.attribute11,
488                             l_CON_rec.attribute11)
489     THEN
490         x_attribute11 := l_x_CON_rec.attribute11;
491     END IF;
492 
493     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.attribute12,
494                             l_CON_rec.attribute12)
495     THEN
496         x_attribute12 := l_x_CON_rec.attribute12;
497     END IF;
498 
499     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.attribute13,
500                             l_CON_rec.attribute13)
501     THEN
502         x_attribute13 := l_x_CON_rec.attribute13;
503     END IF;
504 
505     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.attribute14,
506                             l_CON_rec.attribute14)
507     THEN
508         x_attribute14 := l_x_CON_rec.attribute14;
509     END IF;
510 
511     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.attribute15,
512                             l_CON_rec.attribute15)
513     THEN
514         x_attribute15 := l_x_CON_rec.attribute15;
515     END IF;
516 
517     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.attribute2,
518                             l_CON_rec.attribute2)
519     THEN
520         x_attribute2 := l_x_CON_rec.attribute2;
521     END IF;
522 
523     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.attribute3,
524                             l_CON_rec.attribute3)
525     THEN
526         x_attribute3 := l_x_CON_rec.attribute3;
527     END IF;
528 
529     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.attribute4,
530                             l_CON_rec.attribute4)
531     THEN
532         x_attribute4 := l_x_CON_rec.attribute4;
533     END IF;
534 
535     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.attribute5,
536                             l_CON_rec.attribute5)
537     THEN
538         x_attribute5 := l_x_CON_rec.attribute5;
539     END IF;
540 
541     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.attribute6,
542                             l_CON_rec.attribute6)
543     THEN
544         x_attribute6 := l_x_CON_rec.attribute6;
545     END IF;
546 
547     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.attribute7,
548                             l_CON_rec.attribute7)
549     THEN
550         x_attribute7 := l_x_CON_rec.attribute7;
551     END IF;
552 
553     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.attribute8,
554                             l_CON_rec.attribute8)
555     THEN
556         x_attribute8 := l_x_CON_rec.attribute8;
557     END IF;
558 
559     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.attribute9,
560                             l_CON_rec.attribute9)
561     THEN
562         x_attribute9 := l_x_CON_rec.attribute9;
563     END IF;
564 
565     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.context,
566                             l_CON_rec.context)
567     THEN
568         x_context := l_x_CON_rec.context;
569     END IF;
570 
571     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.enabled_flag,
572                             l_CON_rec.enabled_flag)
573     THEN
574         x_enabled_flag := l_x_CON_rec.enabled_flag;
575         x_enabled := l_CON_val_rec.enabled;
576     END IF;
577 
578     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.prc_context_code,
579                             l_CON_rec.prc_context_code)
580     THEN
581         x_prc_context_code := l_x_CON_rec.prc_context_code;
582     END IF;
583 
584     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.prc_context_id,
585                             l_CON_rec.prc_context_id)
586     THEN
587         x_prc_context_id := l_x_CON_rec.prc_context_id;
588         x_prc_context := l_CON_val_rec.prc_context;
589     END IF;
590 
591     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.prc_context_type,
592                             l_CON_rec.prc_context_type)
593     THEN
594         x_prc_context_type := l_x_CON_rec.prc_context_type;
595     END IF;
596 
597     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.seeded_description,
598                             l_CON_rec.seeded_description)
599     THEN
600         x_seeded_description := l_x_CON_rec.seeded_description;
601     END IF;
602 
603     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.seeded_flag,
604                             l_CON_rec.seeded_flag)
605     THEN
606         x_seeded_flag := l_x_CON_rec.seeded_flag;
607         x_seeded := l_CON_val_rec.seeded;
608     END IF;
609 
610     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.seeded_prc_context_name,
611                             l_CON_rec.seeded_prc_context_name)
612     THEN
613         x_seeded_prc_context_name := l_x_CON_rec.seeded_prc_context_name;
614     END IF;
615 
616     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.user_description,
617                             l_CON_rec.user_description)
618     THEN
619         x_user_description := l_x_CON_rec.user_description;
620     END IF;
621 
622     IF NOT QP_GLOBALS.Equal(l_x_CON_rec.user_prc_context_name,
623                             l_CON_rec.user_prc_context_name)
624     THEN
625         x_user_prc_context_name := l_x_CON_rec.user_prc_context_name;
626     END IF;
627 
628 
629     --  Write to cache.
630 
631     Write_CON
632     (   p_CON_rec                     => l_x_CON_rec
633     );
634 
635     --  Set return status.
636 
637     x_return_status := FND_API.G_RET_STS_SUCCESS;
638 
639     --  Get message count and data
640 
641     OE_MSG_PUB.Count_And_Get
642     (   p_count                       => x_msg_count
643     ,   p_data                        => x_msg_data
644     );
645 
646 
647 EXCEPTION
648 
649     WHEN FND_API.G_EXC_ERROR THEN
650 
651         x_return_status := FND_API.G_RET_STS_ERROR;
652 
653         --  Get message count and data
654 
655         OE_MSG_PUB.Count_And_Get
656         (   p_count                       => x_msg_count
657         ,   p_data                        => x_msg_data
658         );
659 
660     WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
661 
662         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
663 
664         --  Get message count and data
665 
666         OE_MSG_PUB.Count_And_Get
667         (   p_count                       => x_msg_count
668         ,   p_data                        => x_msg_data
669         );
670 
671     WHEN OTHERS THEN
672 
673         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
674 
675         IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
676         THEN
677             OE_MSG_PUB.Add_Exc_Msg
678             (   G_PKG_NAME
679             ,   'Change_Attribute'
680             );
681         END IF;
682 
683         --  Get message count and data
684 
685         OE_MSG_PUB.Count_And_Get
686         (   p_count                       => x_msg_count
687         ,   p_data                        => x_msg_data
688         );
689 
690 END Change_Attribute;
691 
692 --  Procedure       Validate_And_Write
693 --
694 
695 PROCEDURE Validate_And_Write
696 (   x_return_status                 OUT NOCOPY /* file.sql.39 change */ VARCHAR2
697 ,   x_msg_count                     OUT NOCOPY /* file.sql.39 change */ NUMBER
698 ,   x_msg_data                      OUT NOCOPY /* file.sql.39 change */ VARCHAR2
699 ,   p_prc_context_id                IN  NUMBER
700 ,   x_creation_date                 OUT NOCOPY /* file.sql.39 change */ DATE
701 ,   x_created_by                    OUT NOCOPY /* file.sql.39 change */ NUMBER
702 ,   x_last_update_date              OUT NOCOPY /* file.sql.39 change */ DATE
703 ,   x_last_updated_by               OUT NOCOPY /* file.sql.39 change */ NUMBER
704 ,   x_last_update_login             OUT NOCOPY /* file.sql.39 change */ NUMBER
705 )
706 IS
707 l_CON_rec                     QP_Attributes_PUB.Con_Rec_Type;
708 l_old_CON_rec                 QP_Attributes_PUB.Con_Rec_Type;
709 l_control_rec                 QP_GLOBALS.Control_Rec_Type;
710 l_return_status               VARCHAR2(1);
711 l_x_CON_rec                   QP_Attributes_PUB.Con_Rec_Type;
712 l_x_SEG_rec                   QP_Attributes_PUB.Seg_Rec_Type;
713 l_x_SEG_tbl                   QP_Attributes_PUB.Seg_Tbl_Type;
714 BEGIN
715 
716     --  Set control flags.
717 
718     l_control_rec.controlled_operation := TRUE;
719     l_control_rec.validate_entity      := TRUE;
720     l_control_rec.write_to_DB          := TRUE;
721 
722     l_control_rec.default_attributes   := FALSE;
723     l_control_rec.change_attributes    := FALSE;
724     l_control_rec.process              := FALSE;
725 
726     --  Instruct API to retain its caches
727 
728     l_control_rec.clear_api_cache      := FALSE;
729     l_control_rec.clear_api_requests   := FALSE;
730 
731     --  Read CON from cache
732 
733     l_old_CON_rec := Get_CON
734     (   p_db_record                   => TRUE
735     ,   p_prc_context_id              => p_prc_context_id
736     );
737 
738     l_CON_rec := Get_CON
739     (   p_db_record                   => FALSE
740     ,   p_prc_context_id              => p_prc_context_id
741     );
742 
743     --  Set Operation.
744 
745     IF FND_API.To_Boolean(l_CON_rec.db_flag) THEN
746         l_CON_rec.operation := QP_GLOBALS.G_OPR_UPDATE;
747     ELSE
748         l_CON_rec.operation := QP_GLOBALS.G_OPR_CREATE;
749     END IF;
750 
751     --  Call QP_Attributes_PVT.Process_Attributes
752 
753     QP_Attributes_PVT.Process_Attributes
754     (   p_api_version_number          => 1.0
755     ,   p_init_msg_list               => FND_API.G_TRUE
756     ,   x_return_status               => l_return_status
757     ,   x_msg_count                   => x_msg_count
758     ,   x_msg_data                    => x_msg_data
759     ,   p_control_rec                 => l_control_rec
760     ,   p_CON_rec                     => l_CON_rec
761     ,   p_old_CON_rec                 => l_old_CON_rec
762     ,   x_CON_rec                     => l_x_CON_rec
763     ,   x_SEG_tbl                     => l_x_SEG_tbl
764     );
765 
766     IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
767         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
768     ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
769         RAISE FND_API.G_EXC_ERROR;
770     END IF;
771 
772 
773     --  Load OUT parameters.
774 
775 
776     x_creation_date                := l_x_CON_rec.creation_date;
777     x_created_by                   := l_x_CON_rec.created_by;
778     x_last_update_date             := l_x_CON_rec.last_update_date;
779     x_last_updated_by              := l_x_CON_rec.last_updated_by;
780     x_last_update_login            := l_x_CON_rec.last_update_login;
781 
782     --  Clear CON record cache
783 
784     Clear_CON;
785 
786     --  Keep track of performed operations.
787 
788     l_old_CON_rec.operation := l_CON_rec.operation;
789 
790 
791     --  Set return status.
792 
793     x_return_status := FND_API.G_RET_STS_SUCCESS;
794 
795     --  Get message count and data
796 
797     OE_MSG_PUB.Count_And_Get
798     (   p_count                       => x_msg_count
799     ,   p_data                        => x_msg_data
800     );
801 
802 
803 EXCEPTION
804 
805     WHEN FND_API.G_EXC_ERROR THEN
806 
807         x_return_status := FND_API.G_RET_STS_ERROR;
808 
809         --  Get message count and data
810 
811         OE_MSG_PUB.Count_And_Get
812         (   p_count                       => x_msg_count
813         ,   p_data                        => x_msg_data
814         );
815 
816     WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
817 
818         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
819 
820         --  Get message count and data
821 
822         OE_MSG_PUB.Count_And_Get
823         (   p_count                       => x_msg_count
824         ,   p_data                        => x_msg_data
825         );
826 
827     WHEN OTHERS THEN
828 
829         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
830 
831         IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
832         THEN
833             OE_MSG_PUB.Add_Exc_Msg
834             (   G_PKG_NAME
835             ,   'Validate_And_Write'
836             );
837         END IF;
838 
839         --  Get message count and data
840 
841         OE_MSG_PUB.Count_And_Get
842         (   p_count                       => x_msg_count
843         ,   p_data                        => x_msg_data
844         );
845 
846 END Validate_And_Write;
847 
848 --  Procedure       Delete_Row
849 --
850 
851 PROCEDURE Delete_Row
852 (   x_return_status                 OUT NOCOPY /* file.sql.39 change */ VARCHAR2
853 ,   x_msg_count                     OUT NOCOPY /* file.sql.39 change */ NUMBER
854 ,   x_msg_data                      OUT NOCOPY /* file.sql.39 change */ VARCHAR2
855 ,   p_prc_context_id                IN  NUMBER
856 )
857 IS
858 l_CON_rec                     QP_Attributes_PUB.Con_Rec_Type;
859 l_control_rec                 QP_GLOBALS.Control_Rec_Type;
860 l_return_status               VARCHAR2(1);
861 l_x_CON_rec                   QP_Attributes_PUB.Con_Rec_Type;
862 l_x_SEG_rec                   QP_Attributes_PUB.Seg_Rec_Type;
863 l_x_SEG_tbl                   QP_Attributes_PUB.Seg_Tbl_Type;
864 BEGIN
865 
866     --  Set control flags.
867 
868     l_control_rec.controlled_operation := TRUE;
869     l_control_rec.validate_entity      := TRUE;
870     l_control_rec.write_to_DB          := TRUE;
871 
872     l_control_rec.default_attributes   := FALSE;
873     l_control_rec.change_attributes    := FALSE;
874     l_control_rec.process              := FALSE;
875 
876     --  Instruct API to retain its caches
877 
878     l_control_rec.clear_api_cache      := FALSE;
879     l_control_rec.clear_api_requests   := FALSE;
880 
881     --  Read DB record from cache
882 
883     l_CON_rec := Get_CON
884     (   p_db_record                   => TRUE
885     ,   p_prc_context_id              => p_prc_context_id
886     );
887 
888     --  Set Operation.
889 
890     l_CON_rec.operation := QP_GLOBALS.G_OPR_DELETE;
891 
892     --  Call QP_Attributes_PVT.Process_Attributes
893 
894     QP_Attributes_PVT.Process_Attributes
895     (   p_api_version_number          => 1.0
896     ,   p_init_msg_list               => FND_API.G_TRUE
897     ,   x_return_status               => l_return_status
898     ,   x_msg_count                   => x_msg_count
899     ,   x_msg_data                    => x_msg_data
900     ,   p_control_rec                 => l_control_rec
901     ,   p_CON_rec                     => l_CON_rec
902     ,   x_CON_rec                     => l_x_CON_rec
903     ,   x_SEG_tbl                     => l_x_SEG_tbl
904     );
905 
906     IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
907         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
908     ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
909         RAISE FND_API.G_EXC_ERROR;
910     END IF;
911 
912 
913     --  Clear CON record cache
914 
915     Clear_CON;
916 
917     --  Set return status.
918 
919     x_return_status := FND_API.G_RET_STS_SUCCESS;
920 
921     --  Get message count and data
922 
923     OE_MSG_PUB.Count_And_Get
924     (   p_count                       => x_msg_count
925     ,   p_data                        => x_msg_data
926     );
927 
928 
929 EXCEPTION
930 
931     WHEN FND_API.G_EXC_ERROR THEN
932 
933         x_return_status := FND_API.G_RET_STS_ERROR;
934 
935         --  Get message count and data
936 
937         OE_MSG_PUB.Count_And_Get
938         (   p_count                       => x_msg_count
939         ,   p_data                        => x_msg_data
940         );
941 
942     WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
943 
944         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
945 
946         --  Get message count and data
947 
948         OE_MSG_PUB.Count_And_Get
949         (   p_count                       => x_msg_count
950         ,   p_data                        => x_msg_data
951         );
952 
953     WHEN OTHERS THEN
954 
955         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
956 
957         IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
958         THEN
959             OE_MSG_PUB.Add_Exc_Msg
960             (   G_PKG_NAME
961             ,   'Delete_Row'
962             );
963         END IF;
964 
965         --  Get message count and data
966 
967         OE_MSG_PUB.Count_And_Get
968         (   p_count                       => x_msg_count
969         ,   p_data                        => x_msg_data
970         );
971 
972 END Delete_Row;
973 
974 --  Procedure       Process_Entity
975 --
976 
977 PROCEDURE Process_Entity
978 (   x_return_status                 OUT NOCOPY /* file.sql.39 change */ VARCHAR2
979 ,   x_msg_count                     OUT NOCOPY /* file.sql.39 change */ NUMBER
980 ,   x_msg_data                      OUT NOCOPY /* file.sql.39 change */ VARCHAR2
981 )
982 IS
983 l_control_rec                 QP_GLOBALS.Control_Rec_Type;
984 l_return_status               VARCHAR2(1);
985 l_x_CON_rec                   QP_Attributes_PUB.Con_Rec_Type;
986 l_x_SEG_rec                   QP_Attributes_PUB.Seg_Rec_Type;
987 l_x_SEG_tbl                   QP_Attributes_PUB.Seg_Tbl_Type;
988 BEGIN
989 
990     --  Set control flags.
991 
992     l_control_rec.controlled_operation := TRUE;
993     l_control_rec.process              := TRUE;
994     l_control_rec.process_entity       := QP_GLOBALS.G_ENTITY_CON;
995 
996     l_control_rec.default_attributes   := FALSE;
997     l_control_rec.change_attributes    := FALSE;
998     l_control_rec.validate_entity      := FALSE;
999     l_control_rec.write_to_DB          := FALSE;
1000 
1001     --  Instruct API to clear its request table
1002 
1003     l_control_rec.clear_api_cache      := FALSE;
1004     l_control_rec.clear_api_requests   := FALSE;
1005 
1006     --  Call QP_Attributes_PVT.Process_Attributes
1007 
1008     QP_Attributes_PVT.Process_Attributes
1009     (   p_api_version_number          => 1.0
1010     ,   p_init_msg_list               => FND_API.G_TRUE
1011     ,   x_return_status               => l_return_status
1012     ,   x_msg_count                   => x_msg_count
1013     ,   x_msg_data                    => x_msg_data
1014     ,   p_control_rec                 => l_control_rec
1015     ,   x_CON_rec                     => l_x_CON_rec
1016     ,   x_SEG_tbl                     => l_x_SEG_tbl
1017     );
1018 
1019     IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1020         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1021     ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
1022         RAISE FND_API.G_EXC_ERROR;
1023     END IF;
1024 
1025 
1026     --  Set return status.
1027 
1028     x_return_status := FND_API.G_RET_STS_SUCCESS;
1029 
1030     --  Get message count and data
1031 
1032     OE_MSG_PUB.Count_And_Get
1033     (   p_count                       => x_msg_count
1034     ,   p_data                        => x_msg_data
1035     );
1036 
1037 
1038 EXCEPTION
1039 
1040     WHEN FND_API.G_EXC_ERROR THEN
1041 
1042         x_return_status := FND_API.G_RET_STS_ERROR;
1043 
1044         --  Get message count and data
1045 
1046         OE_MSG_PUB.Count_And_Get
1047         (   p_count                       => x_msg_count
1048         ,   p_data                        => x_msg_data
1049         );
1050 
1051     WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1052 
1053         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1054 
1055         --  Get message count and data
1056 
1057         OE_MSG_PUB.Count_And_Get
1058         (   p_count                       => x_msg_count
1059         ,   p_data                        => x_msg_data
1060         );
1061 
1062     WHEN OTHERS THEN
1063 
1064         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1065 
1066         IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1067         THEN
1068             OE_MSG_PUB.Add_Exc_Msg
1069             (   G_PKG_NAME
1070             ,   'Process_Entity'
1071             );
1072         END IF;
1073 
1074         --  Get message count and data
1075 
1076         OE_MSG_PUB.Count_And_Get
1077         (   p_count                       => x_msg_count
1078         ,   p_data                        => x_msg_data
1079         );
1080 
1081 END Process_Entity;
1082 
1083 --  Procedure       Process_Object
1084 --
1085 
1086 PROCEDURE Process_Object
1087 (   x_return_status                 OUT NOCOPY /* file.sql.39 change */ VARCHAR2
1088 ,   x_msg_count                     OUT NOCOPY /* file.sql.39 change */ NUMBER
1089 ,   x_msg_data                      OUT NOCOPY /* file.sql.39 change */ VARCHAR2
1090 )
1091 IS
1092 l_control_rec                 QP_GLOBALS.Control_Rec_Type;
1093 l_return_status               VARCHAR2(1);
1094 l_x_CON_rec                   QP_Attributes_PUB.Con_Rec_Type;
1095 l_x_SEG_rec                   QP_Attributes_PUB.Seg_Rec_Type;
1096 l_x_SEG_tbl                   QP_Attributes_PUB.Seg_Tbl_Type;
1097 BEGIN
1098 
1099     --  Set control flags.
1100 
1101     l_control_rec.controlled_operation := TRUE;
1102     l_control_rec.process              := TRUE;
1103     l_control_rec.process_entity       := QP_GLOBALS.G_ENTITY_ALL;
1104 
1105     l_control_rec.default_attributes   := FALSE;
1106     l_control_rec.change_attributes    := FALSE;
1107     l_control_rec.validate_entity      := FALSE;
1108     l_control_rec.write_to_DB          := FALSE;
1109 
1110     --  Instruct API to clear its request table
1111 
1112     l_control_rec.clear_api_cache      := FALSE;
1113     l_control_rec.clear_api_requests   := TRUE;
1114 
1115     --  Call QP_Attributes_PVT.Process_Attributes
1116 
1117     QP_Attributes_PVT.Process_Attributes
1118     (   p_api_version_number          => 1.0
1119     ,   p_init_msg_list               => FND_API.G_TRUE
1120     ,   x_return_status               => l_return_status
1121     ,   x_msg_count                   => x_msg_count
1122     ,   x_msg_data                    => x_msg_data
1123     ,   p_control_rec                 => l_control_rec
1124     ,   x_CON_rec                     => l_x_CON_rec
1125     ,   x_SEG_tbl                     => l_x_SEG_tbl
1126     );
1127 
1128     IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1129         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1130     ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
1131         RAISE FND_API.G_EXC_ERROR;
1132     END IF;
1133 
1134 
1135     --  Set return status.
1136 
1137     x_return_status := FND_API.G_RET_STS_SUCCESS;
1138 
1139     --  Get message count and data
1140 
1141     OE_MSG_PUB.Count_And_Get
1142     (   p_count                       => x_msg_count
1143     ,   p_data                        => x_msg_data
1144     );
1145 
1146 
1147 EXCEPTION
1148 
1149     WHEN FND_API.G_EXC_ERROR THEN
1150 
1151         x_return_status := FND_API.G_RET_STS_ERROR;
1152 
1153         --  Get message count and data
1154 
1155         OE_MSG_PUB.Count_And_Get
1156         (   p_count                       => x_msg_count
1157         ,   p_data                        => x_msg_data
1158         );
1159 
1160     WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1161 
1162         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1163 
1164         --  Get message count and data
1165 
1166         OE_MSG_PUB.Count_And_Get
1167         (   p_count                       => x_msg_count
1168         ,   p_data                        => x_msg_data
1169         );
1170 
1171     WHEN OTHERS THEN
1172 
1173         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1174 
1175         IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1176         THEN
1177             OE_MSG_PUB.Add_Exc_Msg
1178             (   G_PKG_NAME
1179             ,   'Process_Object'
1180             );
1181         END IF;
1182 
1183         --  Get message count and data
1184 
1185         OE_MSG_PUB.Count_And_Get
1186         (   p_count                       => x_msg_count
1187         ,   p_data                        => x_msg_data
1188         );
1189 
1190 END Process_Object;
1191 
1192 --  Procedure       lock_Row
1193 --
1194 
1195 PROCEDURE Lock_Row
1196 (   x_return_status                 OUT NOCOPY /* file.sql.39 change */ VARCHAR2
1197 ,   x_msg_count                     OUT NOCOPY /* file.sql.39 change */ NUMBER
1198 ,   x_msg_data                      OUT NOCOPY /* file.sql.39 change */ VARCHAR2
1199 ,   p_attribute1                    IN  VARCHAR2
1200 ,   p_attribute10                   IN  VARCHAR2
1201 ,   p_attribute11                   IN  VARCHAR2
1202 ,   p_attribute12                   IN  VARCHAR2
1203 ,   p_attribute13                   IN  VARCHAR2
1204 ,   p_attribute14                   IN  VARCHAR2
1205 ,   p_attribute15                   IN  VARCHAR2
1206 ,   p_attribute2                    IN  VARCHAR2
1207 ,   p_attribute3                    IN  VARCHAR2
1208 ,   p_attribute4                    IN  VARCHAR2
1209 ,   p_attribute5                    IN  VARCHAR2
1210 ,   p_attribute6                    IN  VARCHAR2
1211 ,   p_attribute7                    IN  VARCHAR2
1212 ,   p_attribute8                    IN  VARCHAR2
1213 ,   p_attribute9                    IN  VARCHAR2
1214 ,   p_context                       IN  VARCHAR2
1215 ,   p_created_by                    IN  NUMBER
1216 ,   p_creation_date                 IN  DATE
1217 ,   p_enabled_flag                  IN  VARCHAR2
1218 ,   p_last_updated_by               IN  NUMBER
1219 ,   p_last_update_date              IN  DATE
1220 ,   p_last_update_login             IN  NUMBER
1221 ,   p_prc_context_code              IN  VARCHAR2
1222 ,   p_prc_context_id                IN  NUMBER
1223 ,   p_prc_context_type              IN  VARCHAR2
1224 ,   p_program_application_id        IN  NUMBER
1225 ,   p_program_id                    IN  NUMBER
1226 ,   p_program_update_date           IN  DATE
1227 ,   p_seeded_description            IN  VARCHAR2
1228 ,   p_seeded_flag                   IN  VARCHAR2
1229 ,   p_seeded_prc_context_name       IN  VARCHAR2
1230 ,   p_user_description              IN  VARCHAR2
1231 ,   p_user_prc_context_name         IN  VARCHAR2
1232 )
1233 IS
1234 l_return_status               VARCHAR2(1);
1235 l_CON_rec                     QP_Attributes_PUB.Con_Rec_Type;
1236 l_x_CON_rec                   QP_Attributes_PUB.Con_Rec_Type;
1237 l_x_SEG_rec                   QP_Attributes_PUB.Seg_Rec_Type;
1238 l_x_SEG_tbl                   QP_Attributes_PUB.Seg_Tbl_Type;
1239 BEGIN
1240 
1241     --  Load CON record
1242 
1243     l_CON_rec.attribute1           := p_attribute1;
1244     l_CON_rec.attribute10          := p_attribute10;
1245     l_CON_rec.attribute11          := p_attribute11;
1246     l_CON_rec.attribute12          := p_attribute12;
1247     l_CON_rec.attribute13          := p_attribute13;
1248     l_CON_rec.attribute14          := p_attribute14;
1249     l_CON_rec.attribute15          := p_attribute15;
1250     l_CON_rec.attribute2           := p_attribute2;
1251     l_CON_rec.attribute3           := p_attribute3;
1252     l_CON_rec.attribute4           := p_attribute4;
1253     l_CON_rec.attribute5           := p_attribute5;
1254     l_CON_rec.attribute6           := p_attribute6;
1255     l_CON_rec.attribute7           := p_attribute7;
1256     l_CON_rec.attribute8           := p_attribute8;
1257     l_CON_rec.attribute9           := p_attribute9;
1258     l_CON_rec.context              := p_context;
1259     l_CON_rec.created_by           := p_created_by;
1260     l_CON_rec.creation_date        := p_creation_date;
1261     l_CON_rec.enabled_flag         := p_enabled_flag;
1262     l_CON_rec.last_updated_by      := p_last_updated_by;
1263     l_CON_rec.last_update_date     := p_last_update_date;
1264     l_CON_rec.last_update_login    := p_last_update_login;
1265     l_CON_rec.prc_context_code  := p_prc_context_code;
1266     l_CON_rec.prc_context_id       := p_prc_context_id;
1267     l_CON_rec.prc_context_type     := p_prc_context_type;
1268     l_CON_rec.program_application_id := p_program_application_id;
1269     l_CON_rec.program_id           := p_program_id;
1270     l_CON_rec.program_update_date  := p_program_update_date;
1271     l_CON_rec.seeded_description   := p_seeded_description;
1272     l_CON_rec.seeded_flag          := p_seeded_flag;
1273     l_CON_rec.seeded_prc_context_name := p_seeded_prc_context_name;
1274     l_CON_rec.user_description     := p_user_description;
1275     l_CON_rec.user_prc_context_name := p_user_prc_context_name;
1276 
1277     --  Call QP_Attributes_PVT.Lock_Attributes
1278 
1279     QP_Attributes_PVT.Lock_Attributes
1280     (   p_api_version_number          => 1.0
1281     ,   p_init_msg_list               => FND_API.G_TRUE
1282     ,   x_return_status               => l_return_status
1283     ,   x_msg_count                   => x_msg_count
1284     ,   x_msg_data                    => x_msg_data
1285     ,   p_CON_rec                     => l_CON_rec
1286     ,   x_CON_rec                     => l_x_CON_rec
1287     ,   x_SEG_tbl                     => l_x_SEG_tbl
1288     );
1289 
1290     IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
1291 
1292         --  Set DB flag and write record to cache.
1293 
1294         l_x_CON_rec.db_flag := FND_API.G_TRUE;
1295 
1296         Write_CON
1297         (   p_CON_rec                     => l_x_CON_rec
1298         ,   p_db_record                   => TRUE
1299         );
1300 
1301     END IF;
1302 
1303     --  Set return status.
1304 
1305     x_return_status := l_return_status;
1306 
1307     --  Get message count and data
1308 
1309     OE_MSG_PUB.Count_And_Get
1310     (   p_count                       => x_msg_count
1311     ,   p_data                        => x_msg_data
1312     );
1313 
1314 
1315 EXCEPTION
1316 
1317     WHEN OTHERS THEN
1318 
1319         IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1320         THEN
1321             OE_MSG_PUB.Add_Exc_Msg
1322             (   G_PKG_NAME
1323             ,   'Lock_Row'
1324             );
1325         END IF;
1326 
1327         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1328 
1329         --  Get message count and data
1330 
1331         OE_MSG_PUB.Count_And_Get
1332         (   p_count                       => x_msg_count
1333         ,   p_data                        => x_msg_data
1334         );
1335 
1336 
1337 
1338 END Lock_Row;
1339 
1340 --  Procedures maintaining CON record cache.
1341 
1342 PROCEDURE Write_CON
1343 (   p_CON_rec                       IN  QP_Attributes_PUB.Con_Rec_Type
1344 ,   p_db_record                     IN  BOOLEAN := FALSE
1345 )
1346 IS
1347 BEGIN
1348 
1349     g_CON_rec := p_CON_rec;
1350 
1351     IF p_db_record THEN
1352 
1353         g_db_CON_rec := p_CON_rec;
1354 
1355     END IF;
1356 
1357 END Write_Con;
1358 
1359 FUNCTION Get_CON
1360 (   p_db_record                     IN  BOOLEAN := FALSE
1361 ,   p_prc_context_id                IN  NUMBER
1362 )
1363 RETURN QP_Attributes_PUB.Con_Rec_Type
1364 IS
1365 BEGIN
1366 
1367     IF  p_prc_context_id <> g_CON_rec.prc_context_id
1368     THEN
1369 
1370         --  Query row from DB
1371 
1372         g_CON_rec := QP_Con_Util.Query_Row
1373         (   p_prc_context_id              => p_prc_context_id
1374         );
1375 
1376         g_CON_rec.db_flag              := FND_API.G_TRUE;
1377 
1378         --  Load DB record
1379 
1380         g_db_CON_rec                   := g_CON_rec;
1381 
1382     END IF;
1383 
1384     IF p_db_record THEN
1385 
1386         RETURN g_db_CON_rec;
1387 
1388     ELSE
1389 
1390         RETURN g_CON_rec;
1391 
1392     END IF;
1393 
1394 END Get_Con;
1395 
1396 PROCEDURE Clear_Con
1397 IS
1398 BEGIN
1399 
1400     g_CON_rec                      := QP_Attributes_PUB.G_MISS_CON_REC;
1401     g_db_CON_rec                   := QP_Attributes_PUB.G_MISS_CON_REC;
1402 
1403 END Clear_Con;
1404 
1405 END QP_QP_Form_Con;