DBA Data[Home] [Help]

PACKAGE BODY: APPS.JMF_INTERLOCK_SHIKYU_CP

Source


1 PACKAGE BODY JMF_INTERLOCK_SHIKYU_CP AS
2 -- $Header: JMFCSHKB.pls 120.2 2005/07/08 17:44 vchu noship $
3 --+=======================================================================+
4 --|               Copyright (c) 2005 Oracle Corporation                   |
5 --|                       Redwood Shores, CA, USA                         |
6 --|                         All rights reserved.                          |
7 --+=======================================================================+
8 --| FILENAME                                                              |
9 --|     JMFCSHKB.pls                                                      |
10 --|                                                                       |
11 --| DESCRIPTION                                                           |
12 --|     Interlock SHIKYU Concurrent Program wrapper                       |
13 --| HISTORY                                                               |
14 --|     04/26/2005 pseshadr       Created                                 |
15 --|     07/05/2005 rajkrish       Updated MOAC                            |
16 --|     07/08/2005 vchu           Fixed GSCC error File.Pkg.21            |
17 --+======================================================================--
18 
19 G_PKG_NAME CONSTANT    VARCHAR2(30) := 'JMF_Interlock_Shikyu_CP';
20 g_log_enabled          BOOLEAN;
21 
22 --=============================================
23 -- PROCEDURES AND FUNCTIONS
24 --=============================================
25 
26 --========================================================================
27 -- PROCEDURE : Interlock_SHIKYU_Manager     PUBLIC
28 -- PARAMETERS: x_retcode            OUT NOCOPY Return status
29 --             x_errbuff            OUT NOCOPY Return error message
30 --             p_batch_size         IN    Size of a batch
31 --             p_max_workers        IN    Number of workers allowed
32 --             p_operating_unit     IN    Operating Unit
33 --             p_from_organization  IN    From Organization
34 --             p_to_organization    IN    To Organization
35 -- COMMENT   : This is the concurrent program wrapper for the Interlock
36 --             SHIKYU Manager.This will invoke the JMF_Subcontract_Orders Private
37 --             package to load the subcontract orders and assign records to batches.
38 --=========================================================================
39 PROCEDURE Interlock_SHIKYU_Manager
40 ( x_retcode            OUT NOCOPY VARCHAR2
41 , x_errbuff            OUT NOCOPY VARCHAR2
42 , p_batch_size         IN  NUMBER
43 , p_max_workers        IN  NUMBER
44 , p_from_organization  IN  NUMBER
45 , p_to_organization    IN  NUMBER
46 )
47 IS
48  l_program CONSTANT VARCHAR2(30) := 'Interlock_Shikyu_Manager';
49  l_OU_id   NUMBER ;
50 
51 BEGIN
52 
53   IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
54     g_log_enabled := TRUE;
55     FND_LOG.string(FND_LOG.LEVEL_PROCEDURE
56                   , G_PKG_NAME
57                   , '>> '||l_program||'Start >>'
58                   );
59   END IF;
60 
61   l_OU_ID := MO_GLOBAL.get_current_org_id ;
62 
63   IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
64     FND_LOG.string(FND_LOG.LEVEL_PROCEDURE
65                   , G_PKG_NAME
66                   , 'l_OU_ID => '|| l_OU_ID
67                   );
68   END IF;
69   JMF_SUBCONTRACT_ORDERS_PVT.Subcontract_Orders_Manager
70   ( p_batch_size         => p_batch_size
71   , p_max_workers        => p_max_workers
72   , p_operating_unit     => l_ou_id
73   , p_from_organization  => p_from_organization
74   , p_to_organization    => p_to_organization
75   , p_init_msg_list      => FND_API.G_TRUE
76   , p_validation_level   => FND_API.G_VALID_LEVEL_FULL
77   );
78 
79   IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
80     FND_LOG.string(FND_LOG.LEVEL_PROCEDURE
81                   , G_PKG_NAME
82                   , '  Subcontract_Orders_Manager '
83                   );
84   END IF;
85 
86   IF g_log_enabled
87   THEN
88   IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
89     FND_LOG.string( FND_LOG.LEVEL_PROCEDURE
90                   , G_PKG_NAME ||l_program
91                   , 'Exit'
92                   ) ;
93   END IF;
94   END IF;
95 
96 EXCEPTION
97 
98   WHEN OTHERS THEN
99     x_retcode := 2;
100     x_errbuff := SUBSTRB(FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE)
101                         ,1
102                         ,250);
103 
104 END Interlock_SHIKYU_Manager;
105 
106 --========================================================================
107 -- PROCEDURE : Interlock_SHIKYU_Worker     PUBLIC
108 -- PARAMETERS: x_retcode            OUT NOCOPY  Return status
109 --             x_errbuff            OUT NOCOPY  Return error message
110 --             p_batch_id           IN    Batch identifier
111 -- COMMENT   : This procedure will process all the records in the batch
112 --=========================================================================
113 PROCEDURE Interlock_SHIKYU_Worker
114 ( x_retcode            OUT NOCOPY VARCHAR2
115 , x_errbuff            OUT NOCOPY VARCHAR2
116 , p_batch_id           IN  NUMBER
117 )
118 IS
119  l_program CONSTANT VARCHAR2(30) := 'Interlock_Shikyu_Worker';
120 
121 BEGIN
122   IF g_log_enabled
123   THEN
124   IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
125     FND_LOG.string( FND_LOG.LEVEL_PROCEDURE
126                   , G_PKG_NAME ||l_program
127                   , 'Entry'
128                   ) ;
129   END IF;
130   END IF;
131 
132   JMF_SUBCONTRACT_ORDERS_PVT.Subcontract_Orders_Worker
133   ( p_batch_id  => p_batch_id
134   );
135 
136   IF g_log_enabled
137   THEN
138     IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
139     FND_LOG.string( FND_LOG.LEVEL_PROCEDURE
140                   , G_PKG_NAME ||l_program
141                   , 'Exit'
142                   ) ;
143   END IF;
144   END IF;
145 
146 EXCEPTION
147 
148   WHEN OTHERS THEN
149     x_retcode := 2;
150     x_errbuff := SUBSTRB(FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE)
151                         ,1
152                         ,250);
153 
154 
155 END Interlock_SHIKYU_Worker;
156 
157 --========================================================================
158 -- PROCEDURE :Run_SHIKYU_reconciliation     PUBLIC
159 -- PARAMETERS:
160 --             x_retcode            OUT NOCOPY Return status
161 --             x_errbuff            OUT NOCOPY Return error message
162 --             p_operating_unit         IN    Operating Unit
163 --             p_from_organization   IN    From Organization
164 --             p_to_organization       IN    To Organization
165 -- COMMENT   : This is the concurrent program wrapper for the SHIKYU
166 --                            reconciliation process
167 --=========================================================================
168 
169 PROCEDURE Run_SHIKYU_reconciliation
170 ( x_retcode                     OUT NOCOPY VARCHAR2
171 , x_errbuff                     OUT NOCOPY VARCHAR2
172 , p_from_organization           IN  NUMBER
173 , p_to_organization             IN  NUMBER
174 )
175 IS
176 
177 l_return_status VARCHAR2(1) ;
178 l_msg_count      NUMBER ;
179 l_msg_data       VARCHAR2(3000) ;
180 l_OU_ID          NUMBER ;
181 BEGIN
182 
183   IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL)
184   THEN
185     g_log_enabled := TRUE;
186     FND_LOG.string(FND_LOG.LEVEL_PROCEDURE
187                  , G_PKG_NAME ||
188             'Run_SHIKYU_reconciliation.invoked'
189                  , 'Entry' ) ;
190   END IF;
191 
192  l_OU_ID   := MO_GLOBAL.get_current_org_id ;
193 
194   IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL)
195   THEN
196     FND_LOG.string(FND_LOG.LEVEL_PROCEDURE
197                  , G_PKG_NAME ,
198             'l_OU_ID => '|| l_OU_ID
199                   ) ;
200   END IF;
201 
202    JMF_SHIKYU_RECONCILIAITON_PVT.Process_SHIKYU_Reconciliation
203   ( p_api_version              => 1.0
204   , p_init_msg_list            => NULL
205   , p_commit                   => NULL
206   , p_validation_level         => NULL
207   , x_return_status            => l_return_status
208   , x_msg_count                => l_msg_count
209   , x_msg_data                 => l_msg_data
210   , P_Operating_unit           => l_OU_ID
211   , p_from_organization        => p_from_organization
212   , p_to_organization         => p_to_organization
213   ) ;
214 
215 
216   IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL)
217   THEN
218     FND_LOG.string(FND_LOG.LEVEL_PROCEDURE
219                  , G_PKG_NAME ||
220             'Process_SHIKYU_Reconciliation'
221              , ' return'
222                   ) ;
223   END IF;
224   IF g_log_enabled
225   THEN
226    IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
227     FND_LOG.string(FND_LOG.LEVEL_PROCEDURE
228                  , G_PKG_NAME ||
229         'Run_SHIKYU_reconciliation.invoked'
230                  , 'Exit' ) ;
231   END IF;
232   END IF;
233 
234 EXCEPTION
235 
236  WHEN OTHERS THEN
237    x_retcode := 2;
238    x_errbuff := SUBSTRB(FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE)
239                        ,1
240                        ,250);
241 
242 END Run_SHIKYU_reconciliation ;
243 
244 END JMF_Interlock_SHIKYU_CP;