DBA Data[Home] [Help]

PACKAGE BODY: APPS.INV_CONSIGNED_DIAGNOSTICS_CP

Source


1 PACKAGE BODY INV_CONSIGNED_DIAGNOSTICS_CP AS
2 -- $Header: INVCCIDB.pls 115.0 2003/09/17 03:45:16 rajkrish noship $
3 --+=======================================================================+
4 --|               Copyright (c) 2002 Oracle Corporation                   |
5 --|                       Redwood Shores, CA, USA                         |
6 --|                         All rights reserved.                          |
7 --+=======================================================================+
8 --| FILENAME                                                              |
9 --|     INVCCIDB.pls
10 --|INV_CONSIGNED_INV_PREVAL_CP
11 --| DESCRIPTION                                                           |
12 --|     consigned inv Diagnostics/Pre-validation conc pgm
13 --| HISTORY                                                               |
14 --|     Jul-28th Rajesh Krishnan Created
15 --+======================================================================--
16 
17 ------------------
18 --- constants
19 -------------------
20 
21 g_debug      NUMBER := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
22 --===================
23 -- PROCEDURES AND FUNCTIONS
24 --===================
25 
26 /*========================================================================
27 -- PROCEDURE : Run_Consigned_Diagnostics
28 -- PARAMETERS: x_retcode            OUT NOCOPY Return status
29 --             x_errbuff            OUT NOCOPY Return error message
30 --             p_send_notification  IN VARCHAR2
31 --              to indicate if workflow notifications needs to be
32 --               send to the Buyer
33 --             p_notification_resend_days IN NUMBER
34 --              to indicate to send notification only if
35 --             las_notification sent date for the same combination
36 --             of org/item/supplier/site/error + p_notification_resend_days
37 --              >= sysdate
38 --
39 -- COMMENT   : This is the main concurrent program procedure
40 --              that is directly invoked by the conc program
41 --             " INV Consigned Inventory Diagnostics"
42 --             This program does not accept any specific ORG
43 --             as Input as the logic is to validate all
44 --             eligible consigned transactions
45 --             1) Ownership transfer to regulat stock and
46 --             2) Consumption Advice pre-validation
47 --             and insert into a new errors table
48 --             The results of the concurrent program can be
49 --             viewed from a separate HTML UI under INV
50 --=======================================================================*/
51 PROCEDURE Run_Consigned_Diagnostics
52 ( x_retcode                  OUT NOCOPY VARCHAR2
53 , x_errbuff                  OUT NOCOPY VARCHAR2
54 , p_send_notification        IN VARCHAR2
55 , p_notification_resend_days IN NUMBER
56 )
57 IS
58 
59 
60 
61 BEGIN
62   IF (g_debug = 1)
63   THEN
64     INV_LOG_UTIL.trace
65     ( '>>  IN INVCCIDB: Run_Consigned_Diagnostics' ,9);
66   END IF;
67 
68  x_retcode := 0;
69  x_errbuff := NULL ;
70 
71 
72   IF (g_debug = 1)
73   THEN
74     INV_LOG_UTIL.trace
75     ( 'Calling INV_CONSIGNED_DIAGNOSTICS_PROC.Consigned_diagnostics'
76        ,' Run_Consigned_Diagnostics' ,9);
77   END IF;
78 
79   INV_CONSIGNED_DIAGNOSTICS_PROC.Consigned_diagnostics
80   ( p_send_notification       => p_send_notification
81    , p_notification_resend_days => p_notification_resend_days
82    );
83 
84   IF (g_debug = 1)
85   THEN
86     INV_LOG_UTIL.trace
87     ( 'out INV_CONSIGNED_DIAGNOSTICS_PROC.Consigned_diagnostics'
88        ,' Run_Consigned_Diagnostics' ,9);
89   END IF;
90 
91 
92   IF (g_debug = 1)
93   THEN
94     INV_LOG_UTIL.trace
95     ( '<<  OUT INVCCTDB: Run_Consigned_Diagnostics' ,9);
96   END IF;
97 
98 EXCEPTION
99 
100   WHEN OTHERS THEN
101 
102     x_retcode := 2;
103     x_errbuff := SUBSTRB(sqlerrm
104                         ,1
105                         ,250);
106     INV_LOG_UTIL.trace
107     ( 'SQLERRM: '|| SQLERRM , 9 );
108 
109    INV_LOG_UTIL.trace
110     ( 'Error in Run_Consigned_Diagnostics', 9 );
111 
112    rollback;
113    RAISE ;
114 END Run_Consigned_Diagnostics ;
115 
116 
117 
118 END INV_CONSIGNED_DIAGNOSTICS_CP ;