DBA Data[Home] [Help]

PACKAGE BODY: APPS.BOM_DEFAULT_RTG_REVISION

Source


1 PACKAGE BODY BOM_Default_Rtg_Revision AS
2 /* $Header: BOMDRRVB.pls 115.3 2002/11/21 05:21:10 djebar ship $ */
3 /****************************************************************************
4 --
5 --  Copyright (c) 2000 Oracle Corporation, Redwood Shores, CA, USA
6 --  All rights reserved.
7 --
8 --  FILENAME
9 --
10 --     BOMDRRVB.pls
11 --
12 --  DESCRIPTION
13 --
14 --      Body of package BOM_Default_Rtg_Revision
15 --
16 --  NOTES
17 --
18 --  HISTORY
19 --
20 --  07-AUG-00 Biao Zhang Initial Creation
21 --
22 ****************************************************************************/
23         G_Pkg_Name      VARCHAR2(30) := 'BOM_Default_Rtg_Revision';
24         g_token_tbl     Error_Handler.Token_Tbl_Type;
25 
26         PROCEDURE Get_Flex_Rtg_revision
27           (  p_rtg_revision_rec IN  Bom_Rtg_Pub.Rtg_Revision_Rec_Type
28            , x_rtg_revision_rec IN OUT NOCOPY Bom_Rtg_Pub.Rtg_Revision_Rec_Type
29           )
30         IS
31         BEGIN
32 
33             --  In the future call Flex APIs for defaults
34                 x_rtg_revision_rec := p_rtg_revision_rec;
35 
36                 IF p_rtg_revision_rec.attribute_category =FND_API.G_MISS_CHAR THEN
37                         x_rtg_revision_rec.attribute_category := NULL;
38                 END IF;
39 
40                 IF p_rtg_revision_rec.attribute2 = FND_API.G_MISS_CHAR THEN
41                         x_rtg_revision_rec.attribute2  := NULL;
42                 END IF;
43 
44                 IF p_rtg_revision_rec.attribute3 = FND_API.G_MISS_CHAR THEN
45                         x_rtg_revision_rec.attribute3  := NULL;
46                 END IF;
47 
48                 IF p_rtg_revision_rec.attribute4 = FND_API.G_MISS_CHAR THEN
49                         x_rtg_revision_rec.attribute4  := NULL;
50                 END IF;
51 
52                 IF p_rtg_revision_rec.attribute5 = FND_API.G_MISS_CHAR THEN
53                         x_rtg_revision_rec.attribute5  := NULL;
54                 END IF;
55 
56                 IF p_rtg_revision_rec.attribute7 = FND_API.G_MISS_CHAR THEN
57                         x_rtg_revision_rec.attribute7  := NULL;
58                 END IF;
59 
60                 IF p_rtg_revision_rec.attribute8 = FND_API.G_MISS_CHAR THEN
61                         x_rtg_revision_rec.attribute8  := NULL;
62                 END IF;
63 
64                 IF p_rtg_revision_rec.attribute9 = FND_API.G_MISS_CHAR THEN
65                         x_rtg_revision_rec.attribute9  := NULL;
66                 END IF;
67 
68                 IF p_rtg_revision_rec.attribute11 = FND_API.G_MISS_CHAR THEN
69                         x_rtg_revision_rec.attribute11 := NULL;
70                 END IF;
71 
72                 IF p_rtg_revision_rec.attribute12 = FND_API.G_MISS_CHAR THEN
73                         x_rtg_revision_rec.attribute12 := NULL;
74                 END IF;
75 
76                 IF p_rtg_revision_rec.attribute13 = FND_API.G_MISS_CHAR THEN
77                         x_rtg_revision_rec.attribute13 := NULL;
78                 END IF;
79 
80                 IF p_rtg_revision_rec.attribute14 = FND_API.G_MISS_CHAR THEN
81                         x_rtg_revision_rec.attribute14 := NULL;
82                 END IF;
83 
84                 IF p_rtg_revision_rec.attribute15 = FND_API.G_MISS_CHAR THEN
85                         x_rtg_revision_rec.attribute15 := NULL;
86                 END IF;
87 
88                 IF p_rtg_revision_rec.attribute1 = FND_API.G_MISS_CHAR THEN
89                         x_rtg_revision_rec.attribute1  := NULL;
90                 END IF;
91 
92                 IF p_rtg_revision_rec.attribute6 = FND_API.G_MISS_CHAR THEN
93                         x_rtg_revision_rec.attribute6  := NULL;
94                 END IF;
95 
96                 IF p_rtg_revision_rec.attribute10 = FND_API.G_MISS_CHAR THEN
97                         x_rtg_revision_rec.attribute10 := NULL;
98                 END IF;
99 
100         END Get_Flex_Rtg_revision;
101 
102 
103 
104         /*********************************************************************
105         * Procedure     : Attribute_Defaulting
106         * Parameters IN : Rtg revision exposed record
107         *                 Rtg revision unexposed record
108         * Parameters out: Rtg revision exposed record after defaulting
109         *                 Rtg revision unexposed record after defaulting
110         *                 Mesg_Token_Table
111         *                 Return_Status
112         * Purpose       : Attribute Defaulting will default the necessary null
113         *                 attribute with appropriate values.
114         **********************************************************************/
115         PROCEDURE Attribute_Defaulting
116         (  p_rtg_revision_rec   IN  Bom_Rtg_Pub.Rtg_Revision_Rec_Type
117          , p_rtg_rev_unexp_rec IN  Bom_Rtg_Pub.Rtg_Rev_Unexposed_Rec_Type
118          , x_rtg_revision_rec   IN OUT NOCOPY Bom_Rtg_Pub.Rtg_Revision_Rec_Type
119          , x_rtg_rev_unexp_rec IN OUT NOCOPY Bom_Rtg_Pub.Rtg_Rev_Unexposed_Rec_Type
120          , x_mesg_token_tbl     IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
121          , x_return_status      IN OUT NOCOPY VARCHAR2
122          )
123         IS
124         BEGIN
125 
126                 x_rtg_revision_rec := p_rtg_revision_rec;
127                 x_rtg_rev_unexp_rec := p_rtg_rev_unexp_rec;
128                 x_return_status := FND_API.G_RET_STS_SUCCESS;
129 
130 
131                 Get_Flex_Rtg_revision(  p_rtg_revision_rec => p_rtg_revision_rec                                    , x_rtg_revision_rec => x_rtg_revision_rec
132                                     );
133 
134         END Attribute_Defaulting;
135 
136         /*********************************************************************
137         * Procedure     : Entity_Attribute_Defaulting
138         * Parameters IN : Rtg revision exposed record
139         *                 Rtg revision unexposed record
140         * Parameters out: Rtg revision exposed record after defaulting
141         *                 Rtg revision unexposed record after defaulting
142         *                 Mesg_Token_Table
143         *                 Return_Status
144         * Purpose       : Entity Attribute Defaulting will default the necessary        *                 entity level attribute with appropriate values.
145         **********************************************************************/
146         PROCEDURE Entity_Attribute_Defaulting
147         (  p_rtg_revision_rec        IN  Bom_Rtg_Pub.Rtg_Revision_Rec_Type
148          , p_rtg_rev_unexp_rec       IN  Bom_Rtg_Pub.Rtg_Rev_Unexposed_Rec_Type
149          , x_rtg_revision_rec        IN OUT NOCOPY Bom_Rtg_Pub.Rtg_Revision_Rec_Type
150          , x_rtg_rev_unexp_rec       IN OUT NOCOPY Bom_Rtg_Pub.Rtg_Rev_Unexposed_Rec_Type
151          , x_mesg_token_tbl          IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
152          , x_return_status           IN OUT NOCOPY VARCHAR2
153          )
154         IS
155         BEGIN
156 
157                 x_rtg_revision_rec := p_rtg_revision_rec;
158                 x_rtg_rev_unexp_rec := p_rtg_rev_unexp_rec;
159                 x_return_status := FND_API.G_RET_STS_SUCCESS;
160 
161 
162                 -- Start effecitive date
163                 IF p_rtg_revision_rec.start_effective_date IS NOT NULL
164                 AND
165                    p_rtg_revision_rec.start_effective_date
166                                                 <> FND_API.G_MISS_DATE
167                 THEN
168                    IF trunc(p_rtg_revision_rec.start_effective_date)
169                        = trunc(sysdate)
170                    THEN
171                      x_rtg_revision_rec.start_effective_date
172                       := to_char(sysdate, 'HH24:MI:SS');
173                    ELSIF
174                         trunc(p_rtg_revision_rec.start_effective_date)
175                        > trunc(sysdate)
176                       THEN  x_rtg_revision_rec.start_effective_date
177                         := trunc(p_rtg_revision_rec.start_effective_date);
178                    END IF;
179                 END IF;
180 
181                 IF p_rtg_rev_unexp_rec.implementation_date IS  NULL
182                 OR TRUNC(p_rtg_revision_rec.start_effective_date)
183                     <>  TRUNC(p_rtg_rev_unexp_rec.implementation_date)
184                 THEN   x_rtg_rev_unexp_rec.implementation_date
185                         := p_rtg_revision_rec.start_effective_date;
186                 END IF;
187 
188         END ENTITY_Attribute_Defaulting;
189 
190         /******************************************************************
191         * Procedure     : Populate_Null_Columns
192         * Parameters IN : Rtg revision Exposed column record
193         *                 Rtg revision Unexposed column record
194         *                 Old Rtg revision Exposed Column Record
195         *                 Old Rtg revision Unexposed Column Record
196         * Parameters out: Rtg revision Exposed column record after populating
197         *                 Rtg revision Unexposed Column record after  populating
198         * Purpose       : This procedure will look at the columns that the user         *                 has not filled in and will assign those columns a
199         *                 value from the old record.
200         *                 This procedure is not called CREATE
201         ********************************************************************/
202         PROCEDURE Populate_Null_Columns
203         (  p_rtg_revision_rec       IN  Bom_Rtg_Pub.Rtg_Revision_Rec_Type
204          , p_rtg_rev_unexp_rec IN  Bom_Rtg_Pub.Rtg_Rev_Unexposed_Rec_Type
205          , p_old_rtg_revision_rec   IN  Bom_Rtg_Pub.Rtg_Revision_Rec_Type
206          , p_old_rtg_rev_unexp_rec IN Bom_Rtg_Pub.Rtg_Rev_Unexposed_Rec_Type              , x_rtg_revision_rec       IN OUT NOCOPY Bom_Rtg_Pub.Rtg_Revision_Rec_Type
207          , x_rtg_rev_unexp_rec IN OUT NOCOPY Bom_Rtg_Pub.Rtg_Rev_Unexposed_Rec_Type
208         )
209         IS
210         BEGIN
211                 x_rtg_revision_rec := p_rtg_revision_rec;
212                 x_rtg_rev_unexp_rec := p_rtg_rev_unexp_rec;
213 
214                 IF p_rtg_revision_rec.attribute_category IS NULL OR
215                    p_rtg_revision_rec.attribute_category = FND_API.G_MISS_CHAR
216                 THEN
217                         x_rtg_revision_rec.attribute_category :=
218                                 p_old_rtg_revision_rec.attribute_category;
219 
220                 END IF;
221 
222                 IF p_rtg_revision_rec.attribute2 = FND_API.G_MISS_CHAR OR
223                    p_rtg_revision_rec.attribute2 IS NULL
224                 THEN
225                         x_rtg_revision_rec.attribute2  :=
226                                 p_old_rtg_revision_rec.attribute2;
227                 END IF;
228 
229                 IF p_rtg_revision_rec.attribute3 = FND_API.G_MISS_CHAR OR
230                    p_rtg_revision_rec.attribute3 IS NULL
231                 THEN
232                         x_rtg_revision_rec.attribute3  :=
233                                 p_old_rtg_revision_rec.attribute3;
234                 END IF;
235 
236                 IF p_rtg_revision_rec.attribute4 = FND_API.G_MISS_CHAR OR
237                    p_rtg_revision_rec.attribute4 IS NULL
238                 THEN
239                         x_rtg_revision_rec.attribute4  :=
240                                 p_old_rtg_revision_rec.attribute4;
241                 END IF;
242 
243                 IF p_rtg_revision_rec.attribute5 = FND_API.G_MISS_CHAR OR
244                    p_rtg_revision_rec.attribute5 IS NULL
245                 THEN
246                         x_rtg_revision_rec.attribute5  :=
247                                 p_old_rtg_revision_rec.attribute5;
248                 END IF;
249 
250                 IF p_rtg_revision_rec.attribute7 = FND_API.G_MISS_CHAR OR
251                    p_rtg_revision_rec.attribute7 IS NULL
252                 THEN
253                         x_rtg_revision_rec.attribute7  :=
254                                 p_old_rtg_revision_rec.attribute7;
255                 END IF;
256 
257                 IF p_rtg_revision_rec.attribute8 = FND_API.G_MISS_CHAR OR
258                    p_rtg_revision_rec.attribute8 IS NULL
259                 THEN
260                         x_rtg_revision_rec.attribute8  :=
261                                 p_old_rtg_revision_rec.attribute8;
262                 END IF;
263 
264                 IF p_rtg_revision_rec.attribute9 = FND_API.G_MISS_CHAR OR
265                    p_rtg_revision_rec.attribute9 IS NULL
266                 THEN
267                         x_rtg_revision_rec.attribute9  :=
268                                 p_old_rtg_revision_rec.attribute9;
272                    p_rtg_revision_rec.attribute11 IS NULL
269                 END IF;
270 
271                 IF p_rtg_revision_rec.attribute11 = FND_API.G_MISS_CHAR OR
273                 THEN
274                         x_rtg_revision_rec.attribute11 :=
275                                 p_old_rtg_revision_rec.attribute11;
276                 END IF;
277 
278                 IF p_rtg_revision_rec.attribute12 = FND_API.G_MISS_CHAR OR
279                    p_rtg_revision_rec.attribute12 IS NULL
280                 THEN
281                         x_rtg_revision_rec.attribute12 :=
282                                 p_old_rtg_revision_rec.attribute12;
283                 END IF;
284 
285                 IF p_rtg_revision_rec.attribute13 = FND_API.G_MISS_CHAR OR
286                    p_rtg_revision_rec.attribute13 IS NULL
287                 THEN
288                         x_rtg_revision_rec.attribute13 :=
289                                 p_old_rtg_revision_rec.attribute13;
290                 END IF;
291 
292                 IF p_rtg_revision_rec.attribute14 = FND_API.G_MISS_CHAR OR
293                    p_rtg_revision_rec.attribute14 IS NULL
294                 THEN
295                         x_rtg_revision_rec.attribute14 :=
296                                 p_old_rtg_revision_rec.attribute14;
297                 END IF;
298 
299                 IF p_rtg_revision_rec.attribute15 = FND_API.G_MISS_CHAR OR
300                    p_rtg_revision_rec.attribute15 IS NULL
301                 THEN
302                         x_rtg_revision_rec.attribute15 :=
303                                 p_old_rtg_revision_rec.attribute15;
304                 END IF;
305 
306                 IF p_rtg_revision_rec.attribute1 = FND_API.G_MISS_CHAR OR
307                    p_rtg_revision_rec.attribute1 IS NULL
308                 THEN
309                         x_rtg_revision_rec.attribute1  :=
310                                 p_old_rtg_revision_rec.attribute1;
311                 END IF;
312 
313                 IF p_rtg_revision_rec.attribute6 = FND_API.G_MISS_CHAR OR
314                    p_rtg_revision_rec.attribute6 IS NULL
315                 THEN
316                         x_rtg_revision_rec.attribute6  :=
317                                 p_old_rtg_revision_rec.attribute6;
318                 END IF;
319 
320                 IF p_rtg_revision_rec.attribute10 = FND_API.G_MISS_CHAR OR
321                    p_rtg_revision_rec.attribute10 IS NULL
322                 THEN
323                         x_rtg_revision_rec.attribute10 :=
324                                 p_old_rtg_revision_rec.attribute10;
325                 END IF;
326 
327                  --
328                 -- Get the unexposed columns from the database and return
329                 -- them as the unexposed columns for the current record.
330                 --
331                 x_rtg_rev_unexp_rec.routing_sequence_id :=
332                          p_old_rtg_rev_unexp_rec.routing_sequence_id;
333 
334 
335 END Populate_Null_Columns;
336 
337 
338 
339 END BOM_Default_Rtg_Revision;