DBA Data[Home] [Help]

PACKAGE BODY: APPS.GML_GPOI

Source


1 package body GML_GPOI as
2 -- $Header: GMLWPOIB.pls 115.5 2002/11/08 07:09:21 gmangari ship $
3 
4 procedure process_gpoi_inbound
5 	(
6 	errbuf			OUT	NOCOPY varchar2,
7 	retcode			OUT	NOCOPY varchar2,
8 	i_file_path             IN      varchar2,
9         i_file_name             IN      varchar2,
10         i_run_import            IN      varchar2,
11 	i_transaction_type	IN	varchar2,
12 	i_map_id		IN	number,
13 	i_debug_mode		IN	number
14         )
15 is
16 i_submit_id		number;
17 i_run_id		number;
18 i_map_type		varchar2(40);
19       cEnabled                   VARCHAR2(1)          := 'Y';
20       ece_transaction_disabled   EXCEPTION;
21 
22 begin
23 ec_debug.enable_debug(i_debug_mode);
24 ec_debug.pl(0,'EC','ECE_START_INBOUND','TRANSACTION_TYPE',i_transaction_type);
25 ec_debug.push('GML_GPOI.PROCESS_GPOI_INBOUND');
26 ec_debug.pl(3,'i_file_path',i_file_path);
27 ec_debug.pl(3,'i_file_name',i_file_name);
28 ec_debug.pl(3,'i_run_import',i_run_import);
29 ec_debug.pl(3,'i_transaction_type',i_transaction_type);
30 ec_debug.pl(3,'i_map_id',i_transaction_type);
31 ec_debug.pl(3,'i_debug_mode',i_debug_mode);
32 
33          /* Check to see if the transaction is enabled. If not, abort */
34          fnd_profile.get('ECE_' || i_transaction_type || '_ENABLED',cEnabled);
35          IF cEnabled = 'N' THEN
36             RAISE ece_transaction_disabled;
37          END IF;
38 
39 	ec_debug.pl(0,'EC','ECE_BEGIN_STAGING','TRANSACTION_TYPE',i_transaction_type);
40 	select map_type into i_map_type
41         from ece_mappings
42         where map_id = i_map_id
43           and enabled ='Y';
44 
45         IF i_map_type = 'XML' THEN
46         ec_xml_utils.ec_xml_processor_in_generic
47                 (
48                 i_map_id,
49                 i_run_id,
50                 i_file_path,
51                 i_file_name
52                 );
53         ELSE
54         ec_inbound_stage.load_data
55                 (
56                 i_transaction_type,
57                 i_file_name,
58                 i_file_path,
59                 i_map_id,
60                 i_run_id
61                 );
62         END IF;
63 	ec_debug.pl(0,'EC','ECE_END_STAGING','TRANSACTION_TYPE',i_transaction_type);
64 
65 	/**
66 	Initialize the Stack Table
67 	**/
68 	ec_utils.g_stack.DELETE;
69 
70 	ec_debug.pl(0,'EC','ECE_START_GENERIC_INBOUND','TRANSACTION_TYPE',i_transaction_type);
71         ece_inbound.process_run_inbound
72                 (
73                 i_transaction_type => i_transaction_type,
74                 i_run_id => i_run_id
75                 );
76 	ec_debug.pl(0,'EC','ECE_FINISH_GENERIC_INBOUND','TRANSACTION_TYPE',i_transaction_type);
77 
78 	IF (i_Run_Import = 'Y' OR i_Run_Import = 'Yes')
79 	THEN
80          	i_Submit_ID := fnd_request.submit_request
81 			(
82             		application => 'GML',
83             		program     => 'GMLOEOI'
84 			);
85 		ec_debug.pl(0,'EC','ECE_EXECUTE_OPEN_INTERFACE','TRANSACTION_TYPE',i_transaction_type,
86 				'REQUEST_ID',i_Submit_Id);
87       	END IF;
88 
89 commit;
90 retcode := ec_utils.i_ret_code;
91 ec_debug.pl(3,'i_submit_id',i_submit_id);
92 ec_debug.pl(3,'retcode',retcode);
93 ec_debug.pl(3,'errbuf',errbuf);
94 ec_debug.pop('GML_GPOI.PROCESS_GPOI_INBOUND');
95 ec_debug.pl(0,'EC','ECE_END_INBOUND','TRANSACTION_TYPE',i_transaction_type);
96 ec_debug.disable_debug;
97 EXCEPTION
98       WHEN ece_transaction_disabled THEN
99          ec_debug.pl(0,'EC','ECE_TRANSACTION_DISABLED','TRANSACTION',i_transaction_type);
100          retcode := 2;
101          ec_debug.disable_debug;
102          ROLLBACK WORK;
103          RAISE;
104 
105 WHEN EC_UTILS.PROGRAM_EXIT then
106 	errbuf := ec_utils.i_errbuf;
107 	retcode := ec_utils.i_ret_code;
108 	ece_flatfile_pvt.print_attributes;
109 	rollback work;
110 	ec_debug.disable_debug;
111 WHEN OTHERS THEN
112         ec_debug.pl(0,'EC','ECE_PROGRAM_ERROR','PROGRESS_LEVEL','GML_GPOI.PROCESS_GPOI_INBOUND');
113         ec_debug.pl(0,'EC','ECE_ERROR_MESSAGE','ERROR_MESSAGE',SQLERRM);
114 	retcode := 2;
115 	rollback work;
116 	ece_flatfile_pvt.print_attributes;
117 	ec_debug.disable_debug;
118 end process_gpoi_inbound;
119 
120 end GML_GPOI;