DBA Data[Home] [Help]

PACKAGE BODY: APPS.WIP_TRANSACTION_PVT

Source


1 PACKAGE BODY WIP_Transaction_PVT AS
2 /* $Header: WIPVTXNB.pls 120.1.12010000.4 2010/03/10 21:07:11 hliew ship $ */
3 
4 --  Global constant holding the package name
5 
6 G_PKG_NAME                    CONSTANT VARCHAR2(30) := 'WIP_Transaction_PVT';
7 
8 -- Process_OSP_Transaction
9 
10 PROCEDURE Process_OSP_Transaction
11 (   p_OSP_rec                       IN  WIP_Transaction_PUB.Res_Rec_Type
12 ,   p_validation_level              IN  NUMBER DEFAULT COMPLETE
13 ,   p_return_status                 OUT NOCOPY VARCHAR2
14 ,   p_init_msg_list                 IN  VARCHAR2 := FND_API.G_FALSE
15 ,   p_msg_count                     OUT NOCOPY NUMBER
16 ,   p_msg_data                      OUT NOCOPY VARCHAR2
17 )
18 IS
19    l_direct_item_flag   NUMBER;
20    l_return_status      VARCHAR2(1);
21    l_OSP_rec            WIP_Transaction_PUB.Res_Rec_Type :=
22                           WIP_Transaction_PUB.G_MISS_RES_REC;
23    l_ShopFloorMove_rec  WIP_Transaction_PUB.ShopFloorMove_Rec_Type  :=
24                           WIP_Transaction_PUB.G_MISS_SHOPFLOORMOVE_REC;
25 
26  /* this variable is passed as a value for the p_old_res_rec
27         in the procedure wip_validate_res.Attributes. Enhancement No: 2665334
28 */
29 
30    l_old_OSP_rec WIP_Transaction_PUB.Res_Rec_Type :=
31                           WIP_Transaction_PUB.G_MISS_RES_REC;
32 
33   l_old_ShopFloorMove_rec        WIP_Transaction_PUB.Shopfloormove_Rec_Type :=
34                                         WIP_Transaction_PUB.G_MISS_SHOPFLOORMOVE_REC;
35 
36   l_log_level     NUMBER := fnd_log.g_current_runtime_level;
37   l_error_msg     VARCHAR2(240);
38   l_process_phase VARCHAR2(3);
39   l_params        wip_logger.param_tbl_t;
40   /*Fix bug 9356683*/
41   l_receiving_transaction_id   NUMBER;
42   l_entity_type                NUMBER;
43   l_encumbrance_amount         NUMBER;
44   l_encumbrance_quantity       NUMBER;
45   l_encumbrance_ccid           NUMBER;
46   l_encumbrance_type_id        NUMBER;
47   l_logLevel number := fnd_log.g_current_runtime_level;
48 
49 BEGIN
50   l_process_phase := '1';
51   -- write parameter value to log file
52   IF (l_log_level <= wip_constants.trace_logging) THEN
53     l_params(1).paramName   := 'p_validation_level';
54     l_params(1).paramValue  :=  p_validation_level;
55     l_params(2).paramName   := 'p_init_msg_list';
56     l_params(2).paramValue  :=  p_init_msg_list;
57 
58     wip_logger.entryPoint(p_procName     => 'WIP_Transaction_PVT.Process_OSP_Transaction',
59                           p_params       => l_params,
60                           x_returnStatus => l_return_status);
61   END IF;
62   -- Initialize message list if p_init_msg_list is set to TRUE.
63   IF FND_API.to_Boolean( p_init_msg_list ) THEN
64     FND_MSG_PUB.initialize;
65   END IF;
66 
67   --  Initialize API return status to success
68   p_return_status := FND_API.G_RET_STS_SUCCESS;
69   l_OSP_rec := p_OSP_rec;
70   l_process_phase := '2';
71   -- Check for direct items
72   CST_eamCost_PUB.check_if_direct_item (
73                   p_api_version      => 1.0,
74                   p_validation_level => p_validation_level,
75                   p_interface_txn_id => l_OSP_rec.rcv_transaction_id,
76                   x_direct_item_flag => l_direct_item_flag,
77                   x_return_status    => p_return_status,
78                   x_msg_count        => p_msg_count,
79                   x_msg_data         => p_msg_data);
80 
81   if (p_return_status <> fnd_api.g_ret_sts_success) then
82     Raise fnd_api.g_exc_unexpected_error ;
83   end if;
84 
85   if (l_direct_item_flag = 1) then
86     l_process_phase := '3';
87     CST_eamCost_PUB.process_direct_item_txn (
88                   p_api_version => 1.0,
89                   p_validation_level => p_validation_level,
90                   p_directItem_rec => l_osp_rec,
91                   x_directItem_rec => l_osp_rec,
92                   x_return_status => p_return_status,
93                   x_msg_count => p_msg_count,
94                   x_msg_data => p_msg_data);
95 
96     if (p_return_status <> fnd_api.g_ret_sts_success) then
97       Raise fnd_api.g_exc_unexpected_error ;
98     end if;
99   else
100      l_process_phase := '4';
101      --Default the OSP Record
102      WIP_Default_Res.Attributes(
103                                 p_Res_rec    => l_OSP_rec
104                                 ,x_Res_rec   => l_OSP_rec);
105 
106      /* Fix bug 9356683, for costing encumbrance project*/
107      l_receiving_transaction_id := l_OSP_rec.rcv_transaction_id;
108      l_entity_type := l_OSP_rec.entity_type;
109      /*Call CST_eamCost_PUB.Get_Encumbrance_Data only for EAM Work Order and receiving_
110      transaction_id not null*/
111      if (l_entity_type = wip_constants.eam and l_receiving_transaction_id is not null) then
112         if (l_logLevel <= wip_constants.full_logging) then
113            wip_logger.log(p_msg => 'Calling CST_eamCost_PUB.Get_Encumbrance_Data',
114                           x_returnStatus => l_return_status);
115          end if;
116 
117          CST_eamCost_PUB.Get_Encumbrance_Data(
118            p_receiving_transaction_id   => l_receiving_transaction_id
119            ,x_encumbrance_amount        => l_encumbrance_amount
120            ,x_encumbrance_quantity      => l_encumbrance_quantity
121            ,x_encumbrance_ccid          => l_encumbrance_ccid
122            ,x_encumbrance_type_id       => l_encumbrance_type_id
123            ,x_return_status             => p_return_status
124            ,x_msg_count                 => p_msg_count
125            ,x_msg_data                  => p_msg_data);
126 
127          if (l_logLevel <= wip_constants.full_logging) then
128            wip_logger.log(p_msg => 'CST_eamCost_PUB.Get_Encumbrance_Data returns '
129                                    || p_return_status,
130                           x_returnStatus => l_return_status);
131          end if;
132 
133          if ( p_return_status <> fnd_api.g_ret_sts_success ) then
134            raise fnd_api.g_exc_unexpected_error;
135          end if;
136 
137          l_OSP_rec.encumbrance_type_id   :=  l_encumbrance_type_id;
138          l_OSP_rec.encumbrance_amount    :=  l_encumbrance_amount;
139          l_OSP_rec.encumbrance_quantity  :=  l_encumbrance_quantity;
140          l_OSP_rec.encumbrance_ccid      := l_encumbrance_ccid;
141     end if;  --end if entity_type = eam & receiving_transaction_id not null
142     /* End of Fix bug 9356683*/
143   end if;
144   l_process_phase := '5';
145   l_OSP_rec := WIP_Res_Util.Convert_Miss_To_Null(l_OSP_rec);
146   l_process_phase := '6';
147   --Validate the OSP Record
148   WIP_Validate_Res.Attributes(x_return_status  => l_return_status
149                                ,p_Res_rec       => l_OSP_rec
150                                ,p_validation_level => p_validation_level
151                                ,p_old_Res_rec  => l_old_OSP_rec);
152 
153   l_process_phase := '7';
154   if (l_return_status <> FND_API.G_RET_STS_ERROR) then
155     WIP_Validate_Res.Entity(
156              x_return_status  => l_return_status
157             ,p_Res_rec       => l_OSP_rec
158             ,p_validation_level => p_validation_level
159              ,p_old_Res_rec  => l_old_OSP_rec);
160   end if;
161 
162   --Bug 7409477(FP 6991030): Resource to be charged must be an OSP resource
163    if (l_return_status <> FND_API.G_RET_STS_ERROR) then
164         if (l_OSP_rec.autocharge_type IS NOT NULL AND
165             l_OSP_rec.autocharge_type <> WIP_CONSTANTS.PO_MOVE AND
166             l_OSP_rec.autocharge_type <> WIP_CONSTANTS.PO_RECEIPT)
167         then
168                 l_return_status := FND_API.G_RET_STS_ERROR;
169                 WIP_Globals.Add_Error_Message
170                         (p_message_name => 'WIP_INVALID_OSP_RESOURCE');
171         end if;
172    end if;
173 
174   l_process_phase := '8';
175   --Create the OSP record (resource transaction)
176   if (l_return_status <> FND_API.G_RET_STS_ERROR) then
177     WIP_Res_Util.Insert_Row(p_Res_rec   => l_OSP_rec);
178   end if;
179   l_process_phase := '9';
180   if (l_direct_item_flag <> 1) then
181     --Perform the Move transaction if the autocharge is PO Move
182     -- do not do this if direct item
183     if (l_return_status <> FND_API.G_RET_STS_ERROR) then
184        IF l_OSP_rec.autocharge_type = WIP_CONSTANTS.PO_MOVE THEN
185            l_process_phase := '10';
186            --Default the ShopFloorMove record
187            WIP_Default_ShopFloorMove.Attributes(
188                    p_ShopFloorMove_rec   => l_ShopFloorMove_rec,
189                    x_ShopFloorMove_rec   => l_ShopFloorMove_rec,
190                    p_OSP_rec             => l_OSP_rec);
191            l_process_phase := '11';
192            l_ShopFloorMove_rec :=
193              WIP_ShopFloorMove_Util.Convert_Miss_To_Null(l_ShopFloorMove_rec);
194            l_process_phase := '12';
195            --Validate the ShopFloorMove record
196            WIP_Validate_ShopFloorMove.Attributes(
197                    x_return_status       => l_return_status,
198                    p_ShopFloorMove_rec   => l_ShopFloorMove_rec,
199                    p_validation_level    => p_validation_level
200                    ,p_old_ShopFloorMove_rec => l_old_ShopFloorMove_rec);
201            l_process_phase := '13';
202            if (l_return_status <> FND_API.G_RET_STS_ERROR) then
203              l_process_phase := '14';
204              WIP_Validate_ShopFloorMove.Entity(
205                    x_return_status       => l_return_status,
206                    p_ShopFloorMove_rec   => l_ShopFloorMove_rec,
207                    p_validation_level    => p_validation_level
208                    ,p_old_ShopFloorMove_rec => l_old_ShopFloorMove_rec);
209            end if;
210            l_process_phase := '15';
211            --Create the ShopFloorMove record
212            if (l_return_status <> FND_API.G_RET_STS_ERROR) then
213              WIP_ShopFloorMove_Util.Insert_Row(
214                    p_ShopFloorMove_rec   => l_ShopFloorMove_rec);
215            end if;
216            l_process_phase := '16';
217        end if;   -- if autocharge_type = PO_MOVE
218      END IF;
219    END IF;  -- end of check for direct items
220 
221    FND_MSG_PUB.Count_And_Get
222    (       p_encoded               =>      FND_API.G_FALSE ,
223            p_count                 =>      p_msg_count     ,
224            p_data                  =>      p_msg_data
225    );
226    p_return_status := l_return_status;
227    -- write to the log file
228   IF (l_log_level <= wip_constants.trace_logging) THEN
229     wip_logger.exitPoint(p_procName => 'WIP_Transaction_PVT.Process_OSP_Transaction',
230                          p_procReturnStatus => p_return_status,
231                          p_msg => 'procedure complete',
232                          x_returnStatus => l_return_status);
233   END IF;
234 EXCEPTION
235 
236    WHEN FND_API.G_EXC_ERROR THEN
237       l_OSP_rec.return_status := FND_API.G_RET_STS_ERROR;
238 
239       p_return_status := l_OSP_rec.return_status ;
240 
241       FND_MSG_PUB.Count_And_Get
242       (   p_count                       => p_msg_count
243       ,   p_data                        => p_msg_data
244       );
245       l_error_msg := 'process_phase = ' || l_process_phase || ';' ||
246                     ' unexpected error: ' || p_msg_data;
247       IF (l_log_level <= wip_constants.trace_logging) THEN
248         wip_logger.exitPoint(
249           p_procName         => 'WIP_Transaction_PVT.Process_OSP_Transaction',
250           p_procReturnStatus => p_return_status,
251           p_msg              => l_error_msg,
252           x_returnStatus     => l_return_status);
253       END IF;
254    WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
255 
256       l_OSP_rec.return_status := FND_API.G_RET_STS_UNEXP_ERROR;
257       p_return_status := l_OSP_rec.return_status ;
258 
259       FND_MSG_PUB.Count_And_Get
260       (   p_count                       => p_msg_count
261       ,   p_data                        => p_msg_data
262       );
263       l_error_msg := 'process_phase = ' || l_process_phase || ';' ||
264                     ' unexpected error: ' || p_msg_data;
265       IF (l_log_level <= wip_constants.trace_logging) THEN
266         wip_logger.exitPoint(
267           p_procName         => 'WIP_Transaction_PVT.Process_OSP_Transaction',
268           p_procReturnStatus => p_return_status,
269           p_msg              => l_error_msg,
270           x_returnStatus     => l_return_status);
271       END IF;
272 
273    WHEN OTHERS THEN
274 
275       l_OSP_rec.return_status := FND_API.G_RET_STS_UNEXP_ERROR;
276 
277       IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
278         THEN
279          FND_MSG_PUB.Add_Exc_Msg
280            (   G_PKG_NAME
281                ,   'Process_OSP_Transaction' || SQLERRM
282                );
283       END IF;
284       p_return_status := l_OSP_rec.return_status ;
285 
286       FND_MSG_PUB.Count_And_Get
287       (   p_count                       => p_msg_count
288       ,   p_data                        => p_msg_data
289       );
290       l_error_msg := 'process_phase = ' || l_process_phase || ';' ||
291                     ' unexpected error: ' || SQLERRM;
292       IF (l_log_level <= wip_constants.trace_logging) THEN
293         wip_logger.exitPoint(
294           p_procName         => 'WIP_Transaction_PVT.Process_OSP_Transaction',
295           p_procReturnStatus => p_return_status,
296           p_msg              => l_error_msg,
297           x_returnStatus     => l_return_status);
298       END IF;
299 END Process_OSP_Transaction;
300 
301 
302 --  Start of Comments
303 --  API name    Get_Transaction
304 --  Type        Private
305 --  Function
306 --
307 --  Pre-reqs
308 --
309 --  Parameters
310 --
311 --  Version     Current version = 1.0
312 --              Initial version = 1.0
313 --
314 --  Notes
315 --
316 --  End of Comments
317 
318 PROCEDURE Get_Transaction
319 (   p_api_version_number            IN  NUMBER
320 ,   p_init_msg_list                 IN  VARCHAR2 := FND_API.G_FALSE
321 ,   x_return_status                 OUT NOCOPY VARCHAR2
322 ,   x_msg_count                     OUT NOCOPY NUMBER
323 ,   x_msg_data                      OUT NOCOPY VARCHAR2
324 ,   p_dummy                         IN  VARCHAR2
325 ,   x_WIPTransaction_tbl            OUT NOCOPY WIP_Transaction_PUB.Wiptransaction_Tbl_Type
326 ,   x_Res_tbl                       OUT NOCOPY WIP_Transaction_PUB.Res_Tbl_Type
327 ,   x_ShopFloorMove_tbl             OUT NOCOPY WIP_Transaction_PUB.Shopfloormove_Tbl_Type
328 )
329 IS
330 l_api_version_number          CONSTANT NUMBER := 1.0;
331 l_api_name                    CONSTANT VARCHAR2(30):= 'Get_Transaction';
332 l_WIPTransaction_tbl          WIP_Transaction_PUB.Wiptransaction_Tbl_Type;
333 l_Res_tbl                     WIP_Transaction_PUB.Res_Tbl_Type;
334 l_x_Res_tbl                   WIP_Transaction_PUB.Res_Tbl_Type;
335 l_ShopFloorMove_tbl           WIP_Transaction_PUB.Shopfloormove_Tbl_Type;
336 l_x_ShopFloorMove_tbl         WIP_Transaction_PUB.Shopfloormove_Tbl_Type;
337 BEGIN
338 
339     --  Standard call to check for call compatibility
340 
341     IF NOT FND_API.Compatible_API_Call
342            (   l_api_version_number
343            ,   p_api_version_number
344            ,   l_api_name
345            ,   G_PKG_NAME
346            )
347     THEN
348         NULL;
349     END IF;
350 
351     --  Initialize message list.
352 
353     IF FND_API.to_Boolean(p_init_msg_list) THEN
354         FND_MSG_PUB.initialize;
355     END IF;
356 
357     --  Get WIPTransaction ( parent = WIPTransaction )
358     -- Since I am using WIP Transactions as a dummy parent, the following lines of code don't make sense.
359 /*
360     l_WIPTransaction_tbl :=  WIP_Wiptransaction_Util.Query_Rows
361     (   p_dummy               => p_dummy
362     );
363 
364     --  Loop over WIPTransaction's children
365 
366     FOR I1 IN 1..l_WIPTransaction_tbl.COUNT LOOP
367 
368         --  Get OSP ( parent = WIPTransaction )
369 
370         l_OSP_tbl :=  WIP_Res_Util.Query_Rows
371         (   p_dummy                 => l_WIPTransaction_tbl(I1).dummy
372         );
373 
374         FOR I2 IN 1..l_Res_tbl.COUNT LOOP
375             l_Res_tbl(I2).WIPTransaction_Index := I1;
376             l_x_Res_tbl
377             (l_x_Res_tbl.COUNT + 1)        := l_Res_tbl(I2);
378         END LOOP;
379 
380 
381         --  Get ShopFloorMove ( parent = WIPTransaction )
382 
383         l_ShopFloorMove_tbl :=  WIP_Shopfloormove_Util.Query_Rows
384         (   p_dummy                 => l_WIPTransaction_tbl(I1).dummy
385         );
386 
387         FOR I2 IN 1..l_ShopFloorMove_tbl.COUNT LOOP
388             l_ShopFloorMove_tbl(I2).WIPTransaction_Index := I1;
389             l_x_ShopFloorMove_tbl
390             (l_x_ShopFloorMove_tbl.COUNT + 1) := l_ShopFloorMove_tbl(I2);
391         END LOOP;
392 
393     END LOOP;
394 
395 */
396     --  Load out parameters
397 
398     x_WIPTransaction_tbl           := l_WIPTransaction_tbl;
399     x_Res_tbl                      := l_x_Res_tbl;
400     x_ShopFloorMove_tbl            := l_x_ShopFloorMove_tbl;
401 
402     --  Set return status
403 
404     x_return_status := FND_API.G_RET_STS_SUCCESS;
405 
406     --  Get message count and data
407 
408     FND_MSG_PUB.Count_And_Get
409     (   p_count                       => x_msg_count
410     ,   p_data                        => x_msg_data
411     );
412 
413 
414 EXCEPTION
415 
416     WHEN FND_API.G_EXC_ERROR THEN
417 
418         x_return_status := FND_API.G_RET_STS_ERROR;
419 
420         --  Get message count and data
421 
422         FND_MSG_PUB.Count_And_Get
423         (   p_count                       => x_msg_count
424         ,   p_data                        => x_msg_data
425         );
426 
427     WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
428 
429         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
430 
431         --  Get message count and data
432 
433         FND_MSG_PUB.Count_And_Get
434         (   p_count                       => x_msg_count
435         ,   p_data                        => x_msg_data
436         );
437 
438     WHEN OTHERS THEN
439 
440         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
441 
442         IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
443         THEN
444             FND_MSG_PUB.Add_Exc_Msg
445             (   G_PKG_NAME
446             ,   'Get_Transaction'
447             );
448         END IF;
449 
450         --  Get message count and data
451 
452         FND_MSG_PUB.Count_And_Get
453         (   p_count                       => x_msg_count
454         ,   p_data                        => x_msg_data
455         );
456 
457 END Get_Transaction;
458 
459 
460 -- ----------------------------
461 -- Process_Resource_Transaction
462 -- ----------------------------
463 
464 PROCEDURE Process_Resource_Transaction
465 (   p_res_txn_rec                   IN  WIP_Transaction_PUB.Res_Rec_Type
466 ,   p_validation_level              IN  NUMBER DEFAULT COMPLETE
467 ,   p_return_status                 OUT NOCOPY VARCHAR2
468 ,   p_init_msg_list                 IN  VARCHAR2 := FND_API.G_FALSE
469 ,   p_msg_count                     OUT NOCOPY NUMBER
470 ,   p_msg_data                      OUT NOCOPY VARCHAR2
471 )
472 IS
473    l_return_status      VARCHAR2(1);
474    l_res_txn_rec        WIP_Transaction_PUB.Res_Rec_Type;
475 
476  /* this variable is passed as a value for the p_old_res_rec
477         in the procedure wip_validate_res.Attributes. Enhancement No: 2665334
478 */
479 
480    l_old_OSP_rec WIP_Transaction_PUB.Res_Rec_Type :=
481                           WIP_Transaction_PUB.G_MISS_RES_REC;
482 
483   l_log_level     NUMBER := fnd_log.g_current_runtime_level;
484   l_error_msg     VARCHAR2(240);
485   l_process_phase VARCHAR2(3);
486   l_params        wip_logger.param_tbl_t;
487 BEGIN
488   l_process_phase := '1';
489   -- write parameter value to log file
490   IF (l_log_level <= wip_constants.trace_logging) THEN
491     l_params(1).paramName   := 'p_validation_level';
492     l_params(1).paramValue  :=  p_validation_level;
493     l_params(2).paramName   := 'p_init_msg_list';
494     l_params(2).paramValue  :=  p_init_msg_list;
495 
496     wip_logger.entryPoint(p_procName     => 'WIP_Transaction_PVT.Process_Resource_Transaction',
497                           p_params       => l_params,
498                           x_returnStatus => l_return_status);
499   END IF;
500    -- Initialize message list if p_init_msg_list is set to TRUE.
501    IF FND_API.to_Boolean( p_init_msg_list ) THEN
502            FND_MSG_PUB.initialize;
503    END IF;
504 
505    --  Initialize API return status to success
506    l_return_status := FND_API.G_RET_STS_SUCCESS;
507 
508    l_res_txn_rec := p_res_txn_rec;
509    l_process_phase := '2';
510    --Default the Resource Record
511    WIP_Default_Res.Attributes(
512                                p_Res_rec    => l_res_txn_rec
513                               ,x_Res_rec   => l_res_txn_rec);
514    l_process_phase := '3';
515 
516    WIP_Res_Util.Print_Record(l_res_txn_rec);
517    l_process_phase := '4';
518    l_res_txn_rec := WIP_Res_Util.Convert_Miss_To_Null(l_res_txn_rec);
519    l_process_phase := '5';
520    -- Validate the Resource Record in 2 stages :
521    --  1. The Resource Record Attributes
522    --  2. The Resource Record Entity as such
523 
524    WIP_Validate_Res.Attributes(
525                                x_return_status    => l_return_status
526                               ,p_Res_rec          => l_res_txn_rec
527                               ,p_validation_level => p_validation_level
528                               ,p_old_Res_rec  => l_old_OSP_rec);
529 
530    l_process_phase := '6';
531    WIP_Validate_Res.Entity(
532                            x_return_status    => l_return_status
533                           ,p_Res_rec         => l_res_txn_rec
534                           ,p_validation_level => p_validation_level
535                            ,p_old_Res_rec  => l_old_OSP_rec);
536 
537    l_process_phase := '7';
538    --Create the Resource record (resource transaction)
539    WIP_Res_Util.Insert_Row(p_Res_rec   => l_res_txn_rec);
540    l_process_phase := '8';
541    FND_MSG_PUB.Count_And_Get
542    (       p_encoded               =>      FND_API.G_FALSE ,
543            p_count                 =>      p_msg_count     ,
544            p_data                  =>      p_msg_data
545    );
546 
547    p_return_status := l_return_status;
548    -- write to the log file
549   IF (l_log_level <= wip_constants.trace_logging) THEN
550     wip_logger.exitPoint(p_procName => 'WIP_Transaction_PVT.Process_Resource_Transaction',
551                          p_procReturnStatus => p_return_status,
552                          p_msg => 'procedure complete',
553                          x_returnStatus => l_return_status);
554   END IF;
555 EXCEPTION
556 
557    WHEN FND_API.G_EXC_ERROR THEN
558      l_res_txn_rec.return_status := FND_API.G_RET_STS_ERROR;
559      l_error_msg := 'process_phase = ' || l_process_phase || ';';
560      IF (l_log_level <= wip_constants.trace_logging) THEN
561        wip_logger.exitPoint(
562           p_procName         => 'WIP_Transaction_PVT.Process_Resource_Transaction',
563           p_procReturnStatus => p_return_status,
564           p_msg              => l_error_msg,
565           x_returnStatus     => l_return_status);
566       END IF;
567    WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
568      l_res_txn_rec.return_status := FND_API.G_RET_STS_UNEXP_ERROR;
569      l_error_msg := 'process_phase = ' || l_process_phase || ';';
570      IF (l_log_level <= wip_constants.trace_logging) THEN
571        wip_logger.exitPoint(
572           p_procName         => 'WIP_Transaction_PVT.Process_Resource_Transaction',
573           p_procReturnStatus => p_return_status,
574           p_msg              => l_error_msg,
575           x_returnStatus     => l_return_status);
576       END IF;
577    WHEN OTHERS THEN
578      l_res_txn_rec.return_status := FND_API.G_RET_STS_UNEXP_ERROR;
579 
580       IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
581         THEN
582          FND_MSG_PUB.Add_Exc_Msg
583            (   G_PKG_NAME
584                ,   'Process_Resource_Transaction' || SQLERRM
585                );
586       END IF;
587      l_error_msg := 'process_phase = ' || l_process_phase || ';' ||
588                     ' unexpected error: ' || SQLERRM;
589       IF (l_log_level <= wip_constants.trace_logging) THEN
590         wip_logger.exitPoint(
591           p_procName         => 'WIP_Transaction_PVT.Process_Resource_Transaction',
592           p_procReturnStatus => p_return_status,
593           p_msg              => l_error_msg,
594           x_returnStatus     => l_return_status);
595       END IF;
596 END Process_Resource_Transaction;
597 
598 
599 
600 END WIP_Transaction_PVT;