DBA Data[Home] [Help]

PACKAGE BODY: APPS.FA_MC_UPG_CONVERT_PKG

Source


1 PACKAGE BODY FA_MC_UPG_CONVERT_PKG AS
2 /* $Header: faxmcucb.pls 120.4 2009/03/27 09:42:14 bridgway ship $  */
3 
4 g_print_debug boolean := fa_cache_pkg.fa_print_debug;
5 
6 PROCEDURE main_convert(
7                         errbuf                  OUT NOCOPY     VARCHAR2,
8                         retcode                 OUT NOCOPY     NUMBER,
9                         p_book_type_code        IN      VARCHAR2,
10                         p_reporting_book        IN      VARCHAR2,
11 			p_fixed_conversion	IN	VARCHAR2) IS
12 
13 	p_msg_count	NUMBER := 0;
14 	p_msg_data	VARCHAR2(512);
15 
16 BEGIN
17         fa_rx_conc_mesg_pkg.log('Converting Assets from ');
18         fa_rx_conc_mesg_pkg.log('Primary Book: ' || p_book_type_code || ' TO');
19         fa_rx_conc_mesg_pkg.log('Reporting Book: ' || p_reporting_book);
20 
21 
22 	-- Initialize server message stack
23 	FA_SRVR_MSG.Init_Server_Message;
24 	FA_DEBUG_PKG.Initialize;
25 	-- FA_DEBUG_PKG.Set_Debug_Flag;
26 
27 	-- call routine to convert assets to reporting book
28 	fa_mc_upg1_pkg.convert_reporting_book(
29 				p_book_type_code,
30 				p_reporting_book,
31 				p_fixed_conversion);
32 
33         fa_srvr_msg.add_message(
34                 calling_fn => 'fa_mc_upg_select_pkg.main_convert',
35                 name       => 'FA_SHARED_END_SUCCESS',
36                 token1     => 'PROGRAM',
37                 value1     => 'FAMRCUPG2');
38 
39         -- Dump Debug messages when run in debug mode to log file
40         IF (g_print_debug) THEN
41             fa_mc_upg1_pkg.Write_DebugMsg_Log(
42                                         p_msg_count);
43         END IF;
44 
45 	-- write messages to log file
46         FND_MSG_PUB.Count_And_Get(
47                 p_count                => p_msg_count,
48                 p_data                 => p_msg_data);
49 
50         fa_mc_upg1_pkg.Write_ErrMsg_Log(p_msg_count);
51 
52 	-- return success to concurrent manager
53 	retcode := 0;
54 
55 EXCEPTION
56 	WHEN OTHERS THEN
57                 fa_srvr_msg.add_message(
58                         calling_fn => 'fa_mc_upg_select_pkg.main_convert',
59                         name       => 'FA_SHARED_END_WITH_ERROR',
60                         token1     => 'PROGRAM',
61                         value1     => 'FAMRCUPG2');
62 
63                 IF (g_print_debug) THEN
64                    fa_mc_upg1_pkg.Write_DebugMsg_Log(
65                                         p_msg_count);
66 		END IF;
67 
68                 FND_MSG_PUB.Count_And_Get(
69                         p_count                => p_msg_count,
70                         p_data                 => p_msg_data);
71 
72                 fa_mc_upg1_pkg.Write_ErrMsg_Log(
73                                         p_msg_count);
74 
75 		-- return failure to concurrent manager
76 		retcode := 2;
77 
78 END main_convert;
79 
80 END FA_MC_UPG_CONVERT_PKG;