112: l_lower_lvl_tbl GMF_ItemCost_PUB.Lower_Level_Dtl_Tbl_Type;
113: l_costcmpnt_ids GMF_ItemCost_PUB.costcmpnt_ids_tbl_type;
114: l_p_dir VARCHAR2(150);
115: l_output_file VARCHAR2(120);
116: l_outfile_handle UTL_FILE.FILE_TYPE;
117: l_input_file VARCHAR2(120);
118: l_infile_handle UTL_FILE.FILE_TYPE;
119: l_line VARCHAR2(4000);
120: l_delimiter VARCHAR(11);
114: l_p_dir VARCHAR2(150);
115: l_output_file VARCHAR2(120);
116: l_outfile_handle UTL_FILE.FILE_TYPE;
117: l_input_file VARCHAR2(120);
118: l_infile_handle UTL_FILE.FILE_TYPE;
119: l_line VARCHAR2(4000);
120: l_delimiter VARCHAR(11);
121: l_log_dir VARCHAR2(150);
122: l_log_name VARCHAR2(120) :='gmf_api_cric_wrapper';
119: l_line VARCHAR2(4000);
120: l_delimiter VARCHAR(11);
121: l_log_dir VARCHAR2(150);
122: l_log_name VARCHAR2(120) :='gmf_api_cric_wrapper';
123: l_log_handle UTL_FILE.FILE_TYPE;
124: l_global_file VARCHAR2(120);
125: l_idx NUMBER(10);
126: l_idx1 NUMBER(10);
127: l_type VARCHAR2(100);
151:
152: /****************************************************************
153: * Open The Wrapper File For Output And The Input File for Input *
154: ****************************************************************/
155: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
156: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
157:
158: /********************************************************
159: * Loop thru flat file and call Inventory Quantities API *
152: /****************************************************************
153: * Open The Wrapper File For Output And The Input File for Input *
154: ****************************************************************/
155: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
156: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
157:
158: /********************************************************
159: * Loop thru flat file and call Inventory Quantities API *
160: ********************************************************/
162: -- DBMS_OUTPUT.PUT_LINE('Input Directory ' || l_p_dir );
163: -- DBMS_OUTPUT.PUT_LINE('Input File ' || l_input_file );
164: -- DBMS_OUTPUT.PUT_LINE('Delimiter ' || l_delimiter );
165: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
166: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
167: UTL_FILE.NEW_LINE(l_log_handle);
168: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
169: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
170: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
163: -- DBMS_OUTPUT.PUT_LINE('Input File ' || l_input_file );
164: -- DBMS_OUTPUT.PUT_LINE('Delimiter ' || l_delimiter );
165: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
166: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
167: UTL_FILE.NEW_LINE(l_log_handle);
168: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
169: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
170: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
171: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
164: -- DBMS_OUTPUT.PUT_LINE('Delimiter ' || l_delimiter );
165: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
166: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
167: UTL_FILE.NEW_LINE(l_log_handle);
168: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
169: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
170: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
171: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
172: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
165: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
166: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
167: UTL_FILE.NEW_LINE(l_log_handle);
168: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
169: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
170: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
171: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
172: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
173: BEGIN
166: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
167: UTL_FILE.NEW_LINE(l_log_handle);
168: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
169: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
170: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
171: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
172: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
173: BEGIN
174: UTL_FILE.GET_LINE(l_infile_handle, l_line);
167: UTL_FILE.NEW_LINE(l_log_handle);
168: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
169: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
170: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
171: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
172: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
173: BEGIN
174: UTL_FILE.GET_LINE(l_infile_handle, l_line);
175: l_record_count :=l_record_count+1;
168: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
169: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
170: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
171: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
172: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
173: BEGIN
174: UTL_FILE.GET_LINE(l_infile_handle, l_line);
175: l_record_count :=l_record_count+1;
176: l_type := Get_Field(l_line,l_delimiter,1) ; /* = 10 : header rec, 20 : this level, 30 : lower level*/
170: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
171: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
172: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
173: BEGIN
174: UTL_FILE.GET_LINE(l_infile_handle, l_line);
175: l_record_count :=l_record_count+1;
176: l_type := Get_Field(l_line,l_delimiter,1) ; /* = 10 : header rec, 20 : this level, 30 : lower level*/
177: EXCEPTION
178: WHEN NO_DATA_FOUND THEN
179: raise;
180: END;
181: LOOP
182: BEGIN
183: UTL_FILE.PUT_LINE(l_log_handle, '--');
184: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
185: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
186: IF l_type = '10' THEN
187: /*******************
180: END;
181: LOOP
182: BEGIN
183: UTL_FILE.PUT_LINE(l_log_handle, '--');
184: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
185: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
186: IF l_type = '10' THEN
187: /*******************
188: * empty the tables *
181: LOOP
182: BEGIN
183: UTL_FILE.PUT_LINE(l_log_handle, '--');
184: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
185: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
186: IF l_type = '10' THEN
187: /*******************
188: * empty the tables *
189: *******************/
203: l_header_rec.user_name := Get_Field(l_line,l_delimiter,11) ;
204: l_idx := 0 ;
205: l_idx1 := 0 ;
206: /*
207: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
208: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
209: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
210: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
211: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
204: l_idx := 0 ;
205: l_idx1 := 0 ;
206: /*
207: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
208: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
209: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
210: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
211: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
212: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
205: l_idx1 := 0 ;
206: /*
207: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
208: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
209: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
210: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
211: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
212: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
213: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
206: /*
207: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
208: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
209: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
210: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
211: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
212: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
213: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
214: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
207: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
208: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
209: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
210: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
211: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
212: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
213: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
214: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
215: */
208: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
209: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
210: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
211: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
212: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
213: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
214: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
215: */
216:
209: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
210: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
211: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
212: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
213: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
214: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
215: */
216:
217: ELSIF l_type = '20' AND l_skip_details = 'Y' THEN
210: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
211: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
212: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
213: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
214: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
215: */
216:
217: ELSIF l_type = '20' AND l_skip_details = 'Y' THEN
218: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
214: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
215: */
216:
217: ELSIF l_type = '20' AND l_skip_details = 'Y' THEN
218: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
219: ELSIF l_type = '20' AND l_skip_details = 'N' THEN
220: l_idx := l_idx + 1 ;
221: l_this_lvl_tbl(l_idx).cmpntcost_id := Get_Field(l_line,l_delimiter,2) ;
222: l_this_lvl_tbl(l_idx).cost_cmpntcls_id := Get_Field(l_line,l_delimiter,3) ;
260: l_this_lvl_tbl(l_idx).attribute30 := Get_Field(l_line,l_delimiter,41) ;
261: l_this_lvl_tbl(l_idx).attribute_category := Get_Field(l_line,l_delimiter,42) ;
262:
263: /*
264: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpntcost_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpntcost_id) ;
265: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
266: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
267: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
268: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
261: l_this_lvl_tbl(l_idx).attribute_category := Get_Field(l_line,l_delimiter,42) ;
262:
263: /*
264: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpntcost_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpntcost_id) ;
265: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
266: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
267: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
268: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
269: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
262:
263: /*
264: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpntcost_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpntcost_id) ;
265: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
266: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
267: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
268: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
269: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
270: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
263: /*
264: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpntcost_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpntcost_id) ;
265: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
266: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
267: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
268: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
269: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
270: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
271: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
264: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpntcost_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpntcost_id) ;
265: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
266: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
267: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
268: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
269: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
270: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
271: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
272: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
265: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
266: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
267: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
268: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
269: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
270: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
271: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
272: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
273: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
266: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
267: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
268: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
269: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
270: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
271: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
272: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
273: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
274: */
267: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
268: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
269: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
270: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
271: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
272: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
273: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
274: */
275: ELSIF l_type = '30' AND l_skip_details = 'Y' THEN
268: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
269: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
270: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
271: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
272: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
273: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
274: */
275: ELSIF l_type = '30' AND l_skip_details = 'Y' THEN
276: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
269: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
270: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
271: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
272: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
273: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
274: */
275: ELSIF l_type = '30' AND l_skip_details = 'Y' THEN
276: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
277: ELSIF l_type = '30' AND l_skip_details = 'N' THEN
272: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
273: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
274: */
275: ELSIF l_type = '30' AND l_skip_details = 'Y' THEN
276: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
277: ELSIF l_type = '30' AND l_skip_details = 'N' THEN
278: l_idx1 := l_idx1 + 1 ;
279: l_type := Get_Field(l_line,l_delimiter,1) ;
280: l_lower_lvl_tbl(l_idx1).cmpntcost_id := Get_Field(l_line,l_delimiter,2) ;
283: l_lower_lvl_tbl(l_idx1).cost_analysis_code := Get_Field(l_line,l_delimiter,5) ;
284: l_lower_lvl_tbl(l_idx1).cmpnt_cost := Get_Field(l_line,l_delimiter,6) ;
285: l_lower_lvl_tbl(l_idx1).delete_mark := Get_Field(l_line,l_delimiter,7) ;
286: /*
287: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpntcost_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpntcost_id) ;
288: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_id) ;
289: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_code) ;
290: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_analysis_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_analysis_code) ;
291: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpnt_cost('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpnt_cost) ;
284: l_lower_lvl_tbl(l_idx1).cmpnt_cost := Get_Field(l_line,l_delimiter,6) ;
285: l_lower_lvl_tbl(l_idx1).delete_mark := Get_Field(l_line,l_delimiter,7) ;
286: /*
287: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpntcost_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpntcost_id) ;
288: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_id) ;
289: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_code) ;
290: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_analysis_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_analysis_code) ;
291: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpnt_cost('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpnt_cost) ;
292: */
285: l_lower_lvl_tbl(l_idx1).delete_mark := Get_Field(l_line,l_delimiter,7) ;
286: /*
287: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpntcost_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpntcost_id) ;
288: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_id) ;
289: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_code) ;
290: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_analysis_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_analysis_code) ;
291: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpnt_cost('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpnt_cost) ;
292: */
293: END IF ;
286: /*
287: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpntcost_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpntcost_id) ;
288: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_id) ;
289: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_code) ;
290: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_analysis_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_analysis_code) ;
291: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpnt_cost('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpnt_cost) ;
292: */
293: END IF ;
294: EXCEPTION
287: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpntcost_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpntcost_id) ;
288: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_id) ;
289: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_code) ;
290: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_analysis_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_analysis_code) ;
291: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpnt_cost('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpnt_cost) ;
292: */
293: END IF ;
294: EXCEPTION
295: WHEN OTHERS THEN
292: */
293: END IF ;
294: EXCEPTION
295: WHEN OTHERS THEN
296: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
297: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
298: IF l_type = '10' THEN
299: l_skip_details := 'Y' ;
300: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skip detail records.');
293: END IF ;
294: EXCEPTION
295: WHEN OTHERS THEN
296: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
297: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
298: IF l_type = '10' THEN
299: l_skip_details := 'Y' ;
300: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skip detail records.');
301: ELSIF l_type = '20' THEN
296: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
297: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
298: IF l_type = '10' THEN
299: l_skip_details := 'Y' ;
300: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skip detail records.');
301: ELSIF l_type = '20' THEN
302: l_this_lvl_tbl.delete(l_idx);
303: l_idx := l_idx-1;
304: ELSIF l_type = '30' THEN
306: l_idx1 := l_idx1-1;
307: END IF ;
308: END ;
309: BEGIN
310: UTL_FILE.GET_LINE(l_infile_handle, l_line);
311: l_record_count :=l_record_count+1;
312: UTL_FILE.NEW_LINE(l_log_handle);
313: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : this level, 30 : lower level
314: -- goto GET_MSG_STACK ; commented this goto as per bug 5586406, otherwise it is skiping the records inserting
308: END ;
309: BEGIN
310: UTL_FILE.GET_LINE(l_infile_handle, l_line);
311: l_record_count :=l_record_count+1;
312: UTL_FILE.NEW_LINE(l_log_handle);
313: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : this level, 30 : lower level
314: -- goto GET_MSG_STACK ; commented this goto as per bug 5586406, otherwise it is skiping the records inserting
315: --l_skip_details := 'N' ;
316: --UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
312: UTL_FILE.NEW_LINE(l_log_handle);
313: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : this level, 30 : lower level
314: -- goto GET_MSG_STACK ; commented this goto as per bug 5586406, otherwise it is skiping the records inserting
315: --l_skip_details := 'N' ;
316: --UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
317: --UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
318: EXCEPTION
319: WHEN NO_DATA_FOUND THEN
320: IF l_skip_details = 'N' THEN
313: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : this level, 30 : lower level
314: -- goto GET_MSG_STACK ; commented this goto as per bug 5586406, otherwise it is skiping the records inserting
315: --l_skip_details := 'N' ;
316: --UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
317: --UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
318: EXCEPTION
319: WHEN NO_DATA_FOUND THEN
320: IF l_skip_details = 'N' THEN
321: GMF_ItemCost_PUB.Create_Item_Cost
330: p_this_level_dtl_tbl => l_this_lvl_tbl,
331: p_lower_level_dtl_Tbl => l_lower_lvl_tbl,
332: x_costcmpnt_ids => l_costcmpnt_ids
333: );
334: UTL_FILE.PUT_LINE(l_log_handle, 'in exception. after API call. status := ' || l_status ||' cnt := ' || l_count );
335: l_continue := 'N' ;
336: goto GET_MSG_STACK ;
337: END IF ;
338: END;
352: p_this_level_dtl_tbl => l_this_lvl_tbl,
353: p_lower_level_dtl_Tbl => l_lower_lvl_tbl,
354: x_costcmpnt_ids => l_costcmpnt_ids
355: );
356: UTL_FILE.PUT_LINE(l_log_handle, 'after API call. status := ' || l_status ||' cnt := ' || l_count );
357:
358: END IF;
359:
360: <
374: p_msg_index_out => l_dummy_cnt
375: );
376:
377: -- DBMS_OUTPUT.PUT_LINE(l_data );
378: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
379: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
380: --UTL_FILE.NEW_LINE(l_outfile_handle);
381: UTL_FILE.PUT_LINE(l_log_handle, l_data);
382:
375: );
376:
377: -- DBMS_OUTPUT.PUT_LINE(l_data );
378: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
379: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
380: --UTL_FILE.NEW_LINE(l_outfile_handle);
381: UTL_FILE.PUT_LINE(l_log_handle, l_data);
382:
383: /**********************
376:
377: -- DBMS_OUTPUT.PUT_LINE(l_data );
378: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
379: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
380: --UTL_FILE.NEW_LINE(l_outfile_handle);
381: UTL_FILE.PUT_LINE(l_log_handle, l_data);
382:
383: /**********************
384: * Update error status *
377: -- DBMS_OUTPUT.PUT_LINE(l_data );
378: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
379: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
380: --UTL_FILE.NEW_LINE(l_outfile_handle);
381: UTL_FILE.PUT_LINE(l_log_handle, l_data);
382:
383: /**********************
384: * Update error status *
385: **********************/
399: END IF;
400: -- DBMS_OUTPUT.PUT_LINE('# of CostIds inserted : ' || l_costcmpnt_ids.count);
401: FOR i in 1..l_costcmpnt_ids.count
402: LOOP
403: UTL_FILE.PUT_LINE(l_log_handle, ' CmpntClsId : ' || l_costcmpnt_ids(i).cost_cmpntcls_id ||
404: ' Analysis Code : ' || l_costcmpnt_ids(i).cost_analysis_code ||
405: ' Cost Level : ' || l_costcmpnt_ids(i).cost_level ||
406: ' CostId : ' || l_costcmpnt_ids(i).cmpntcost_id);
407: END LOOP ;
409: EXIT ;
410: END IF ;
411: END LOOP;
412: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
413: UTL_FILE.NEW_LINE(l_log_handle);
414: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
415: UTL_FILE.FCLOSE_ALL;
416:
417: RETURN l_return_status;
410: END IF ;
411: END LOOP;
412: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
413: UTL_FILE.NEW_LINE(l_log_handle);
414: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
415: UTL_FILE.FCLOSE_ALL;
416:
417: RETURN l_return_status;
418: EXCEPTION
411: END LOOP;
412: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
413: UTL_FILE.NEW_LINE(l_log_handle);
414: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
415: UTL_FILE.FCLOSE_ALL;
416:
417: RETURN l_return_status;
418: EXCEPTION
419: WHEN UTL_FILE.INVALID_OPERATION THEN
415: UTL_FILE.FCLOSE_ALL;
416:
417: RETURN l_return_status;
418: EXCEPTION
419: WHEN UTL_FILE.INVALID_OPERATION THEN
420: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
421: UTL_FILE.FCLOSE_ALL;
422: RETURN l_return_status;
423: WHEN UTL_FILE.INVALID_PATH THEN
417: RETURN l_return_status;
418: EXCEPTION
419: WHEN UTL_FILE.INVALID_OPERATION THEN
420: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
421: UTL_FILE.FCLOSE_ALL;
422: RETURN l_return_status;
423: WHEN UTL_FILE.INVALID_PATH THEN
424: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
425: UTL_FILE.FCLOSE_ALL;
419: WHEN UTL_FILE.INVALID_OPERATION THEN
420: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
421: UTL_FILE.FCLOSE_ALL;
422: RETURN l_return_status;
423: WHEN UTL_FILE.INVALID_PATH THEN
424: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
425: UTL_FILE.FCLOSE_ALL;
426: RETURN l_return_status;
427: WHEN UTL_FILE.INVALID_MODE THEN
421: UTL_FILE.FCLOSE_ALL;
422: RETURN l_return_status;
423: WHEN UTL_FILE.INVALID_PATH THEN
424: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
425: UTL_FILE.FCLOSE_ALL;
426: RETURN l_return_status;
427: WHEN UTL_FILE.INVALID_MODE THEN
428: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
429: UTL_FILE.FCLOSE_ALL;
423: WHEN UTL_FILE.INVALID_PATH THEN
424: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
425: UTL_FILE.FCLOSE_ALL;
426: RETURN l_return_status;
427: WHEN UTL_FILE.INVALID_MODE THEN
428: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
429: UTL_FILE.FCLOSE_ALL;
430: RETURN l_return_status;
431: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
425: UTL_FILE.FCLOSE_ALL;
426: RETURN l_return_status;
427: WHEN UTL_FILE.INVALID_MODE THEN
428: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
429: UTL_FILE.FCLOSE_ALL;
430: RETURN l_return_status;
431: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
432: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
433: UTL_FILE.FCLOSE_ALL;
427: WHEN UTL_FILE.INVALID_MODE THEN
428: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
429: UTL_FILE.FCLOSE_ALL;
430: RETURN l_return_status;
431: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
432: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
433: UTL_FILE.FCLOSE_ALL;
434: RETURN l_return_status;
435: WHEN UTL_FILE.WRITE_ERROR THEN
429: UTL_FILE.FCLOSE_ALL;
430: RETURN l_return_status;
431: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
432: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
433: UTL_FILE.FCLOSE_ALL;
434: RETURN l_return_status;
435: WHEN UTL_FILE.WRITE_ERROR THEN
436: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
437: UTL_FILE.FCLOSE_ALL;
431: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
432: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
433: UTL_FILE.FCLOSE_ALL;
434: RETURN l_return_status;
435: WHEN UTL_FILE.WRITE_ERROR THEN
436: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
437: UTL_FILE.FCLOSE_ALL;
438: RETURN l_return_status;
439: WHEN UTL_FILE.READ_ERROR THEN
433: UTL_FILE.FCLOSE_ALL;
434: RETURN l_return_status;
435: WHEN UTL_FILE.WRITE_ERROR THEN
436: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
437: UTL_FILE.FCLOSE_ALL;
438: RETURN l_return_status;
439: WHEN UTL_FILE.READ_ERROR THEN
440: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
441: UTL_FILE.FCLOSE_ALL;
435: WHEN UTL_FILE.WRITE_ERROR THEN
436: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
437: UTL_FILE.FCLOSE_ALL;
438: RETURN l_return_status;
439: WHEN UTL_FILE.READ_ERROR THEN
440: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
441: UTL_FILE.FCLOSE_ALL;
442: RETURN l_return_status;
443: WHEN UTL_FILE.INTERNAL_ERROR THEN
437: UTL_FILE.FCLOSE_ALL;
438: RETURN l_return_status;
439: WHEN UTL_FILE.READ_ERROR THEN
440: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
441: UTL_FILE.FCLOSE_ALL;
442: RETURN l_return_status;
443: WHEN UTL_FILE.INTERNAL_ERROR THEN
444: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
445: UTL_FILE.FCLOSE_ALL;
439: WHEN UTL_FILE.READ_ERROR THEN
440: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
441: UTL_FILE.FCLOSE_ALL;
442: RETURN l_return_status;
443: WHEN UTL_FILE.INTERNAL_ERROR THEN
444: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
445: UTL_FILE.FCLOSE_ALL;
446: RETURN l_return_status;
447: WHEN OTHERS THEN
441: UTL_FILE.FCLOSE_ALL;
442: RETURN l_return_status;
443: WHEN UTL_FILE.INTERNAL_ERROR THEN
444: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
445: UTL_FILE.FCLOSE_ALL;
446: RETURN l_return_status;
447: WHEN OTHERS THEN
448: -- DBMS_OUTPUT.PUT_LINE('Other Error');
449: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
445: UTL_FILE.FCLOSE_ALL;
446: RETURN l_return_status;
447: WHEN OTHERS THEN
448: -- DBMS_OUTPUT.PUT_LINE('Other Error');
449: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
450: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
451: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
452: UTL_FILE.FCLOSE_ALL;
453: l_return_status := 'U' ;
446: RETURN l_return_status;
447: WHEN OTHERS THEN
448: -- DBMS_OUTPUT.PUT_LINE('Other Error');
449: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
450: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
451: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
452: UTL_FILE.FCLOSE_ALL;
453: l_return_status := 'U' ;
454: RETURN l_return_status;
447: WHEN OTHERS THEN
448: -- DBMS_OUTPUT.PUT_LINE('Other Error');
449: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
450: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
451: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
452: UTL_FILE.FCLOSE_ALL;
453: l_return_status := 'U' ;
454: RETURN l_return_status;
455: END Create_Item_Cost;
448: -- DBMS_OUTPUT.PUT_LINE('Other Error');
449: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
450: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
451: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
452: UTL_FILE.FCLOSE_ALL;
453: l_return_status := 'U' ;
454: RETURN l_return_status;
455: END Create_Item_Cost;
456:
561: l_lower_lvl_tbl GMF_ItemCost_PUB.Lower_Level_Dtl_Tbl_Type;
562: l_costcmpnt_ids GMF_ItemCost_PUB.costcmpnt_ids_tbl_type;
563: l_p_dir VARCHAR2(150);
564: l_output_file VARCHAR2(120);
565: l_outfile_handle UTL_FILE.FILE_TYPE;
566: l_input_file VARCHAR2(120);
567: l_infile_handle UTL_FILE.FILE_TYPE;
568: l_line VARCHAR2(1800);
569: l_delimiter VARCHAR(11);
563: l_p_dir VARCHAR2(150);
564: l_output_file VARCHAR2(120);
565: l_outfile_handle UTL_FILE.FILE_TYPE;
566: l_input_file VARCHAR2(120);
567: l_infile_handle UTL_FILE.FILE_TYPE;
568: l_line VARCHAR2(1800);
569: l_delimiter VARCHAR(11);
570: l_log_dir VARCHAR2(150);
571: l_log_name VARCHAR2(120) :='gmf_api_updic_wrapper';
568: l_line VARCHAR2(1800);
569: l_delimiter VARCHAR(11);
570: l_log_dir VARCHAR2(150);
571: l_log_name VARCHAR2(120) :='gmf_api_updic_wrapper';
572: l_log_handle UTL_FILE.FILE_TYPE;
573: l_global_file VARCHAR2(120);
574: l_idx NUMBER(10);
575: l_idx1 NUMBER(10);
576: l_type VARCHAR2(100);
603:
604: /****************************************************************
605: * Open The Wrapper File For Output And The Input File for Input *
606: ****************************************************************/
607: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
608: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
609:
610: /********************************************************
611: * Loop thru flat file and call Inventory Quantities API *
604: /****************************************************************
605: * Open The Wrapper File For Output And The Input File for Input *
606: ****************************************************************/
607: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
608: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
609:
610: /********************************************************
611: * Loop thru flat file and call Inventory Quantities API *
612: ********************************************************/
615: -- DBMS_OUTPUT.PUT_LINE('Input File ' || l_input_file );
616: -- DBMS_OUTPUT.PUT_LINE('Delimiter ' || l_delimiter );
617: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
618: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
619: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
620: UTL_FILE.NEW_LINE(l_log_handle);
621: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
622: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
623: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
616: -- DBMS_OUTPUT.PUT_LINE('Delimiter ' || l_delimiter );
617: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
618: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
619: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
620: UTL_FILE.NEW_LINE(l_log_handle);
621: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
622: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
623: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
624: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
617: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
618: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
619: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
620: UTL_FILE.NEW_LINE(l_log_handle);
621: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
622: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
623: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
624: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
625: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
618: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
619: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
620: UTL_FILE.NEW_LINE(l_log_handle);
621: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
622: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
623: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
624: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
625: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
626: BEGIN
619: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
620: UTL_FILE.NEW_LINE(l_log_handle);
621: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
622: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
623: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
624: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
625: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
626: BEGIN
627: UTL_FILE.GET_LINE(l_infile_handle, l_line);
620: UTL_FILE.NEW_LINE(l_log_handle);
621: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
622: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
623: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
624: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
625: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
626: BEGIN
627: UTL_FILE.GET_LINE(l_infile_handle, l_line);
628: l_record_count :=l_record_count+1;
621: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
622: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
623: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
624: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
625: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
626: BEGIN
627: UTL_FILE.GET_LINE(l_infile_handle, l_line);
628: l_record_count :=l_record_count+1;
629: l_type := Get_Field(l_line,l_delimiter,1) ; /* = 10 : header rec, 20 : this level, 30 : lower level*/
623: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
624: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
625: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
626: BEGIN
627: UTL_FILE.GET_LINE(l_infile_handle, l_line);
628: l_record_count :=l_record_count+1;
629: l_type := Get_Field(l_line,l_delimiter,1) ; /* = 10 : header rec, 20 : this level, 30 : lower level*/
630: --UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
631: --UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
626: BEGIN
627: UTL_FILE.GET_LINE(l_infile_handle, l_line);
628: l_record_count :=l_record_count+1;
629: l_type := Get_Field(l_line,l_delimiter,1) ; /* = 10 : header rec, 20 : this level, 30 : lower level*/
630: --UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
631: --UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
632: EXCEPTION
633: WHEN NO_DATA_FOUND THEN
634: RAISE;
627: UTL_FILE.GET_LINE(l_infile_handle, l_line);
628: l_record_count :=l_record_count+1;
629: l_type := Get_Field(l_line,l_delimiter,1) ; /* = 10 : header rec, 20 : this level, 30 : lower level*/
630: --UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
631: --UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
632: EXCEPTION
633: WHEN NO_DATA_FOUND THEN
634: RAISE;
635: END;
633: WHEN NO_DATA_FOUND THEN
634: RAISE;
635: END;
636: /*
637: UTL_FILE.NEW_LINE(l_log_handle);
638: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
639: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : this level, 30 : lower level
640: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
641: DBMS_OUTPUT.PUT_LINE('firt record of type = ' || l_type);
634: RAISE;
635: END;
636: /*
637: UTL_FILE.NEW_LINE(l_log_handle);
638: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
639: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : this level, 30 : lower level
640: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
641: DBMS_OUTPUT.PUT_LINE('firt record of type = ' || l_type);
642: */
636: /*
637: UTL_FILE.NEW_LINE(l_log_handle);
638: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
639: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : this level, 30 : lower level
640: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
641: DBMS_OUTPUT.PUT_LINE('firt record of type = ' || l_type);
642: */
643: LOOP
644: BEGIN
641: DBMS_OUTPUT.PUT_LINE('firt record of type = ' || l_type);
642: */
643: LOOP
644: BEGIN
645: UTL_FILE.PUT_LINE(l_log_handle, '--');
646: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
647: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
648: IF l_type = '10' THEN
649: /*******************
642: */
643: LOOP
644: BEGIN
645: UTL_FILE.PUT_LINE(l_log_handle, '--');
646: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
647: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
648: IF l_type = '10' THEN
649: /*******************
650: * empty the tables *
643: LOOP
644: BEGIN
645: UTL_FILE.PUT_LINE(l_log_handle, '--');
646: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
647: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
648: IF l_type = '10' THEN
649: /*******************
650: * empty the tables *
651: *******************/
668: -- DBMS_OUTPUT.PUT_LINE('in wrapper. l_this_lvl_tbl count : ' || l_this_lvl_tbl.count) ;
669: -- DBMS_OUTPUT.PUT_LINE('in wrapper. l_lower_lvl_tbl count : ' || l_lower_lvl_tbl.count) ;
670: -- DBMS_OUTPUT.PUT_LINE('calendar_code = ' || l_header_rec.calendar_code) ;
671: /*
672: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
673: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
674: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
675: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
676: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
669: -- DBMS_OUTPUT.PUT_LINE('in wrapper. l_lower_lvl_tbl count : ' || l_lower_lvl_tbl.count) ;
670: -- DBMS_OUTPUT.PUT_LINE('calendar_code = ' || l_header_rec.calendar_code) ;
671: /*
672: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
673: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
674: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
675: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
676: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
677: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
670: -- DBMS_OUTPUT.PUT_LINE('calendar_code = ' || l_header_rec.calendar_code) ;
671: /*
672: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
673: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
674: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
675: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
676: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
677: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
678: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
671: /*
672: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
673: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
674: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
675: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
676: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
677: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
678: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
679: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
672: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
673: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
674: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
675: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
676: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
677: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
678: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
679: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
680: */
673: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
674: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
675: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
676: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
677: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
678: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
679: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
680: */
681: ELSIF l_type = '20' AND l_skip_details = 'Y' THEN
674: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
675: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
676: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
677: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
678: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
679: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
680: */
681: ELSIF l_type = '20' AND l_skip_details = 'Y' THEN
682: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
675: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
676: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
677: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
678: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
679: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
680: */
681: ELSIF l_type = '20' AND l_skip_details = 'Y' THEN
682: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
683: ELSIF l_type = '20' AND l_skip_details = 'N' THEN
678: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
679: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
680: */
681: ELSIF l_type = '20' AND l_skip_details = 'Y' THEN
682: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
683: ELSIF l_type = '20' AND l_skip_details = 'N' THEN
684: l_idx := l_idx + 1 ;
685: --UTL_FILE.PUT_LINE(l_log_handle, 'Populating this level table...' || l_idx ) ;
686: l_this_lvl_tbl(l_idx).cmpntcost_id := Get_Field(l_line,l_delimiter,2) ;
681: ELSIF l_type = '20' AND l_skip_details = 'Y' THEN
682: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
683: ELSIF l_type = '20' AND l_skip_details = 'N' THEN
684: l_idx := l_idx + 1 ;
685: --UTL_FILE.PUT_LINE(l_log_handle, 'Populating this level table...' || l_idx ) ;
686: l_this_lvl_tbl(l_idx).cmpntcost_id := Get_Field(l_line,l_delimiter,2) ;
687: l_this_lvl_tbl(l_idx).cost_cmpntcls_id := Get_Field(l_line,l_delimiter,3) ;
688: l_this_lvl_tbl(l_idx).cost_cmpntcls_code := Get_Field(l_line,l_delimiter,4) ;
689: l_this_lvl_tbl(l_idx).cost_analysis_code := Get_Field(l_line,l_delimiter,5) ;
724: l_this_lvl_tbl(l_idx).attribute29 := Get_Field(l_line,l_delimiter,40) ;
725: l_this_lvl_tbl(l_idx).attribute30 := Get_Field(l_line,l_delimiter,41) ;
726: l_this_lvl_tbl(l_idx).attribute_category := Get_Field(l_line,l_delimiter,42) ;
727: /*
728: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpntcost_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpntcost_id) ;
729: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
730: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
731: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
732: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
725: l_this_lvl_tbl(l_idx).attribute30 := Get_Field(l_line,l_delimiter,41) ;
726: l_this_lvl_tbl(l_idx).attribute_category := Get_Field(l_line,l_delimiter,42) ;
727: /*
728: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpntcost_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpntcost_id) ;
729: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
730: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
731: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
732: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
733: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
726: l_this_lvl_tbl(l_idx).attribute_category := Get_Field(l_line,l_delimiter,42) ;
727: /*
728: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpntcost_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpntcost_id) ;
729: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
730: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
731: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
732: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
733: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
734: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
727: /*
728: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpntcost_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpntcost_id) ;
729: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
730: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
731: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
732: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
733: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
734: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
735: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
728: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpntcost_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpntcost_id) ;
729: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
730: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
731: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
732: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
733: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
734: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
735: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
736: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
729: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
730: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
731: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
732: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
733: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
734: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
735: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
736: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
737: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
730: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
731: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
732: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
733: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
734: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
735: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
736: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
737: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
738: */
731: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
732: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
733: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
734: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
735: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
736: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
737: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
738: */
739: ELSIF l_type = '30' AND l_skip_details = 'Y' THEN
732: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
733: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
734: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
735: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
736: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
737: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
738: */
739: ELSIF l_type = '30' AND l_skip_details = 'Y' THEN
740: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
733: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
734: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
735: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
736: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
737: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
738: */
739: ELSIF l_type = '30' AND l_skip_details = 'Y' THEN
740: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
741: ELSIF l_type = '30' AND l_skip_details = 'N' THEN
736: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
737: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
738: */
739: ELSIF l_type = '30' AND l_skip_details = 'Y' THEN
740: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
741: ELSIF l_type = '30' AND l_skip_details = 'N' THEN
742: l_idx1 := l_idx1 + 1 ;
743: --UTL_FILE.PUT_LINE(l_log_handle, 'Populating lower level table...' || l_idx1 ) ;
744: l_type := Get_Field(l_line,l_delimiter,1) ;
739: ELSIF l_type = '30' AND l_skip_details = 'Y' THEN
740: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
741: ELSIF l_type = '30' AND l_skip_details = 'N' THEN
742: l_idx1 := l_idx1 + 1 ;
743: --UTL_FILE.PUT_LINE(l_log_handle, 'Populating lower level table...' || l_idx1 ) ;
744: l_type := Get_Field(l_line,l_delimiter,1) ;
745: l_lower_lvl_tbl(l_idx1).cmpntcost_id := Get_Field(l_line,l_delimiter,2) ;
746: l_lower_lvl_tbl(l_idx1).cost_cmpntcls_id := Get_Field(l_line,l_delimiter,3) ;
747: l_lower_lvl_tbl(l_idx1).cost_cmpntcls_code := Get_Field(l_line,l_delimiter,4) ;
748: l_lower_lvl_tbl(l_idx1).cost_analysis_code := Get_Field(l_line,l_delimiter,5) ;
749: l_lower_lvl_tbl(l_idx1).cmpnt_cost := Get_Field(l_line,l_delimiter,6) ;
750: l_lower_lvl_tbl(l_idx1).delete_mark := Get_Field(l_line,l_delimiter,7) ;
751: /*
752: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpntcost_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpntcost_id) ;
753: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_id) ;
754: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_code) ;
755: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_analysis_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_analysis_code) ;
756: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpnt_cost('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpnt_cost) ;
749: l_lower_lvl_tbl(l_idx1).cmpnt_cost := Get_Field(l_line,l_delimiter,6) ;
750: l_lower_lvl_tbl(l_idx1).delete_mark := Get_Field(l_line,l_delimiter,7) ;
751: /*
752: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpntcost_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpntcost_id) ;
753: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_id) ;
754: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_code) ;
755: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_analysis_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_analysis_code) ;
756: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpnt_cost('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpnt_cost) ;
757: */
750: l_lower_lvl_tbl(l_idx1).delete_mark := Get_Field(l_line,l_delimiter,7) ;
751: /*
752: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpntcost_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpntcost_id) ;
753: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_id) ;
754: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_code) ;
755: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_analysis_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_analysis_code) ;
756: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpnt_cost('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpnt_cost) ;
757: */
758: END IF ;
751: /*
752: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpntcost_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpntcost_id) ;
753: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_id) ;
754: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_code) ;
755: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_analysis_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_analysis_code) ;
756: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpnt_cost('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpnt_cost) ;
757: */
758: END IF ;
759: EXCEPTION
752: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpntcost_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpntcost_id) ;
753: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_id) ;
754: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_code) ;
755: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_analysis_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_analysis_code) ;
756: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpnt_cost('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpnt_cost) ;
757: */
758: END IF ;
759: EXCEPTION
760: WHEN OTHERS THEN
757: */
758: END IF ;
759: EXCEPTION
760: WHEN OTHERS THEN
761: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
762: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
763: IF l_type = '10' THEN
764: l_skip_details := 'Y' ;
765: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skip detail records.');
758: END IF ;
759: EXCEPTION
760: WHEN OTHERS THEN
761: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
762: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
763: IF l_type = '10' THEN
764: l_skip_details := 'Y' ;
765: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skip detail records.');
766: ELSIF l_type = '20' THEN
761: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
762: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
763: IF l_type = '10' THEN
764: l_skip_details := 'Y' ;
765: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skip detail records.');
766: ELSIF l_type = '20' THEN
767: l_this_lvl_tbl.delete(l_idx);
768: l_idx := l_idx-1;
769: ELSIF l_type = '30' THEN
771: l_idx1 := l_idx1-1;
772: END IF ;
773: END ;
774: BEGIN
775: UTL_FILE.GET_LINE(l_infile_handle, l_line);
776: l_record_count :=l_record_count+1;
777: UTL_FILE.NEW_LINE(l_log_handle);
778: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : this level, 30 : lower level
779: --l_skip_details := 'N' ;
773: END ;
774: BEGIN
775: UTL_FILE.GET_LINE(l_infile_handle, l_line);
776: l_record_count :=l_record_count+1;
777: UTL_FILE.NEW_LINE(l_log_handle);
778: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : this level, 30 : lower level
779: --l_skip_details := 'N' ;
780: --UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
781: --UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
776: l_record_count :=l_record_count+1;
777: UTL_FILE.NEW_LINE(l_log_handle);
778: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : this level, 30 : lower level
779: --l_skip_details := 'N' ;
780: --UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
781: --UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
782: EXCEPTION
783: WHEN NO_DATA_FOUND THEN
784: IF l_skip_details = 'N' THEN
777: UTL_FILE.NEW_LINE(l_log_handle);
778: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : this level, 30 : lower level
779: --l_skip_details := 'N' ;
780: --UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
781: --UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
782: EXCEPTION
783: WHEN NO_DATA_FOUND THEN
784: IF l_skip_details = 'N' THEN
785: -- DBMS_OUTPUT.PUT_LINE('In exception. Calling Update_Item_Cost API...');
794: p_header_rec => l_header_rec,
795: p_this_level_dtl_tbl => l_this_lvl_tbl,
796: p_lower_level_dtl_Tbl => l_lower_lvl_tbl
797: );
798: UTL_FILE.PUT_LINE(l_log_handle, 'in exception. after API call. status := ' || l_status ||' cnt := ' || l_count );
799: l_continue := 'N' ;
800: goto GET_MSG_STACK ;
801: END IF ;
802: END;
814: p_header_rec => l_header_rec,
815: p_this_level_dtl_tbl => l_this_lvl_tbl,
816: p_lower_level_dtl_Tbl => l_lower_lvl_tbl
817: );
818: UTL_FILE.PUT_LINE(l_log_handle, 'after API call. status := ' || l_status ||' cnt := ' || l_count );
819: END IF;
820: <
821: NULL;
822:
833: p_encoded => FND_API.G_FALSE,
834: p_msg_index_out => l_dummy_cnt
835: );
836: -- DBMS_OUTPUT.PUT_LINE(l_data );
837: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
838: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
839: --UTL_FILE.NEW_LINE(l_outfile_handle);
840: UTL_FILE.PUT_LINE(l_log_handle, l_data);
841: /**********************
834: p_msg_index_out => l_dummy_cnt
835: );
836: -- DBMS_OUTPUT.PUT_LINE(l_data );
837: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
838: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
839: --UTL_FILE.NEW_LINE(l_outfile_handle);
840: UTL_FILE.PUT_LINE(l_log_handle, l_data);
841: /**********************
842: * Update error status *
835: );
836: -- DBMS_OUTPUT.PUT_LINE(l_data );
837: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
838: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
839: --UTL_FILE.NEW_LINE(l_outfile_handle);
840: UTL_FILE.PUT_LINE(l_log_handle, l_data);
841: /**********************
842: * Update error status *
843: **********************/
836: -- DBMS_OUTPUT.PUT_LINE(l_data );
837: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
838: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
839: --UTL_FILE.NEW_LINE(l_outfile_handle);
840: UTL_FILE.PUT_LINE(l_log_handle, l_data);
841: /**********************
842: * Update error status *
843: **********************/
844: IF (l_status = 'U') THEN
859: EXIT ;
860: END IF ;
861: END LOOP;
862: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
863: UTL_FILE.NEW_LINE(l_log_handle);
864: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
865: UTL_FILE.FCLOSE_ALL;
866: RETURN l_return_status;
867: EXCEPTION
860: END IF ;
861: END LOOP;
862: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
863: UTL_FILE.NEW_LINE(l_log_handle);
864: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
865: UTL_FILE.FCLOSE_ALL;
866: RETURN l_return_status;
867: EXCEPTION
868: WHEN UTL_FILE.INVALID_OPERATION THEN
861: END LOOP;
862: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
863: UTL_FILE.NEW_LINE(l_log_handle);
864: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
865: UTL_FILE.FCLOSE_ALL;
866: RETURN l_return_status;
867: EXCEPTION
868: WHEN UTL_FILE.INVALID_OPERATION THEN
869: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
864: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
865: UTL_FILE.FCLOSE_ALL;
866: RETURN l_return_status;
867: EXCEPTION
868: WHEN UTL_FILE.INVALID_OPERATION THEN
869: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
870: UTL_FILE.FCLOSE_ALL;
871: RETURN l_return_status;
872: WHEN UTL_FILE.INVALID_PATH THEN
866: RETURN l_return_status;
867: EXCEPTION
868: WHEN UTL_FILE.INVALID_OPERATION THEN
869: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
870: UTL_FILE.FCLOSE_ALL;
871: RETURN l_return_status;
872: WHEN UTL_FILE.INVALID_PATH THEN
873: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
874: UTL_FILE.FCLOSE_ALL;
868: WHEN UTL_FILE.INVALID_OPERATION THEN
869: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
870: UTL_FILE.FCLOSE_ALL;
871: RETURN l_return_status;
872: WHEN UTL_FILE.INVALID_PATH THEN
873: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
874: UTL_FILE.FCLOSE_ALL;
875: RETURN l_return_status;
876: WHEN UTL_FILE.INVALID_MODE THEN
870: UTL_FILE.FCLOSE_ALL;
871: RETURN l_return_status;
872: WHEN UTL_FILE.INVALID_PATH THEN
873: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
874: UTL_FILE.FCLOSE_ALL;
875: RETURN l_return_status;
876: WHEN UTL_FILE.INVALID_MODE THEN
877: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
878: UTL_FILE.FCLOSE_ALL;
872: WHEN UTL_FILE.INVALID_PATH THEN
873: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
874: UTL_FILE.FCLOSE_ALL;
875: RETURN l_return_status;
876: WHEN UTL_FILE.INVALID_MODE THEN
877: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
878: UTL_FILE.FCLOSE_ALL;
879: RETURN l_return_status;
880: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
874: UTL_FILE.FCLOSE_ALL;
875: RETURN l_return_status;
876: WHEN UTL_FILE.INVALID_MODE THEN
877: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
878: UTL_FILE.FCLOSE_ALL;
879: RETURN l_return_status;
880: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
881: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
882: UTL_FILE.FCLOSE_ALL;
876: WHEN UTL_FILE.INVALID_MODE THEN
877: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
878: UTL_FILE.FCLOSE_ALL;
879: RETURN l_return_status;
880: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
881: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
882: UTL_FILE.FCLOSE_ALL;
883: RETURN l_return_status;
884: WHEN UTL_FILE.WRITE_ERROR THEN
878: UTL_FILE.FCLOSE_ALL;
879: RETURN l_return_status;
880: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
881: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
882: UTL_FILE.FCLOSE_ALL;
883: RETURN l_return_status;
884: WHEN UTL_FILE.WRITE_ERROR THEN
885: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
886: UTL_FILE.FCLOSE_ALL;
880: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
881: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
882: UTL_FILE.FCLOSE_ALL;
883: RETURN l_return_status;
884: WHEN UTL_FILE.WRITE_ERROR THEN
885: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
886: UTL_FILE.FCLOSE_ALL;
887: RETURN l_return_status;
888: WHEN UTL_FILE.READ_ERROR THEN
882: UTL_FILE.FCLOSE_ALL;
883: RETURN l_return_status;
884: WHEN UTL_FILE.WRITE_ERROR THEN
885: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
886: UTL_FILE.FCLOSE_ALL;
887: RETURN l_return_status;
888: WHEN UTL_FILE.READ_ERROR THEN
889: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
890: UTL_FILE.FCLOSE_ALL;
884: WHEN UTL_FILE.WRITE_ERROR THEN
885: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
886: UTL_FILE.FCLOSE_ALL;
887: RETURN l_return_status;
888: WHEN UTL_FILE.READ_ERROR THEN
889: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
890: UTL_FILE.FCLOSE_ALL;
891: RETURN l_return_status;
892: WHEN UTL_FILE.INTERNAL_ERROR THEN
886: UTL_FILE.FCLOSE_ALL;
887: RETURN l_return_status;
888: WHEN UTL_FILE.READ_ERROR THEN
889: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
890: UTL_FILE.FCLOSE_ALL;
891: RETURN l_return_status;
892: WHEN UTL_FILE.INTERNAL_ERROR THEN
893: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
894: UTL_FILE.FCLOSE_ALL;
888: WHEN UTL_FILE.READ_ERROR THEN
889: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
890: UTL_FILE.FCLOSE_ALL;
891: RETURN l_return_status;
892: WHEN UTL_FILE.INTERNAL_ERROR THEN
893: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
894: UTL_FILE.FCLOSE_ALL;
895: RETURN l_return_status;
896: WHEN OTHERS THEN
890: UTL_FILE.FCLOSE_ALL;
891: RETURN l_return_status;
892: WHEN UTL_FILE.INTERNAL_ERROR THEN
893: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
894: UTL_FILE.FCLOSE_ALL;
895: RETURN l_return_status;
896: WHEN OTHERS THEN
897: -- DBMS_OUTPUT.PUT_LINE('Other Error');
898: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
894: UTL_FILE.FCLOSE_ALL;
895: RETURN l_return_status;
896: WHEN OTHERS THEN
897: -- DBMS_OUTPUT.PUT_LINE('Other Error');
898: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
899: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
900: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
901: UTL_FILE.FCLOSE_ALL;
902: l_return_status := 'U' ;
895: RETURN l_return_status;
896: WHEN OTHERS THEN
897: -- DBMS_OUTPUT.PUT_LINE('Other Error');
898: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
899: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
900: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
901: UTL_FILE.FCLOSE_ALL;
902: l_return_status := 'U' ;
903: RETURN l_return_status;
896: WHEN OTHERS THEN
897: -- DBMS_OUTPUT.PUT_LINE('Other Error');
898: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
899: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
900: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
901: UTL_FILE.FCLOSE_ALL;
902: l_return_status := 'U' ;
903: RETURN l_return_status;
904: END Update_Item_Cost;
897: -- DBMS_OUTPUT.PUT_LINE('Other Error');
898: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
899: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
900: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
901: UTL_FILE.FCLOSE_ALL;
902: l_return_status := 'U' ;
903: RETURN l_return_status;
904: END Update_Item_Cost;
905:
1008: l_lower_lvl_tbl GMF_ItemCost_PUB.Lower_Level_Dtl_Tbl_Type;
1009: l_costcmpnt_ids GMF_ItemCost_PUB.costcmpnt_ids_tbl_type;
1010: l_p_dir VARCHAR2(150);
1011: l_output_file VARCHAR2(120);
1012: l_outfile_handle UTL_FILE.FILE_TYPE;
1013: l_input_file VARCHAR2(120);
1014: l_infile_handle UTL_FILE.FILE_TYPE;
1015: l_line VARCHAR2(1800);
1016: l_delimiter VARCHAR(11);
1010: l_p_dir VARCHAR2(150);
1011: l_output_file VARCHAR2(120);
1012: l_outfile_handle UTL_FILE.FILE_TYPE;
1013: l_input_file VARCHAR2(120);
1014: l_infile_handle UTL_FILE.FILE_TYPE;
1015: l_line VARCHAR2(1800);
1016: l_delimiter VARCHAR(11);
1017: l_log_dir VARCHAR2(150);
1018: l_log_name VARCHAR2(120) :='gmf_api_delic_wrapper';
1015: l_line VARCHAR2(1800);
1016: l_delimiter VARCHAR(11);
1017: l_log_dir VARCHAR2(150);
1018: l_log_name VARCHAR2(120) :='gmf_api_delic_wrapper';
1019: l_log_handle UTL_FILE.FILE_TYPE;
1020: l_global_file VARCHAR2(120);
1021: l_idx NUMBER(10);
1022: l_idx1 NUMBER(10);
1023: l_type VARCHAR2(100);
1050:
1051: /*****************************************************************
1052: * Open The Wrapper File For Output And The Input File for Input. *
1053: *****************************************************************/
1054: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
1055: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
1056:
1057: /********************************************************
1058: * Loop thru flat file and call Inventory Quantities API *
1051: /*****************************************************************
1052: * Open The Wrapper File For Output And The Input File for Input. *
1053: *****************************************************************/
1054: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
1055: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
1056:
1057: /********************************************************
1058: * Loop thru flat file and call Inventory Quantities API *
1059: ********************************************************/
1062: -- DBMS_OUTPUT.PUT_LINE('Input File ' || l_input_file );
1063: -- DBMS_OUTPUT.PUT_LINE('Delimiter ' || l_delimiter );
1064: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
1065: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
1066: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1067: UTL_FILE.NEW_LINE(l_log_handle);
1068: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1069: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1070: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1063: -- DBMS_OUTPUT.PUT_LINE('Delimiter ' || l_delimiter );
1064: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
1065: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
1066: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1067: UTL_FILE.NEW_LINE(l_log_handle);
1068: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1069: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1070: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1071: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1064: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
1065: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
1066: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1067: UTL_FILE.NEW_LINE(l_log_handle);
1068: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1069: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1070: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1071: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1072: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1065: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
1066: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1067: UTL_FILE.NEW_LINE(l_log_handle);
1068: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1069: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1070: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1071: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1072: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1073: BEGIN
1066: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1067: UTL_FILE.NEW_LINE(l_log_handle);
1068: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1069: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1070: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1071: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1072: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1073: BEGIN
1074: UTL_FILE.GET_LINE(l_infile_handle, l_line);
1067: UTL_FILE.NEW_LINE(l_log_handle);
1068: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1069: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1070: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1071: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1072: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1073: BEGIN
1074: UTL_FILE.GET_LINE(l_infile_handle, l_line);
1075: l_record_count :=l_record_count+1;
1068: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1069: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1070: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1071: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1072: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1073: BEGIN
1074: UTL_FILE.GET_LINE(l_infile_handle, l_line);
1075: l_record_count :=l_record_count+1;
1076: l_type := Get_Field(l_line,l_delimiter,1) ; /* = 10 : header rec, 20 : this level, 30 : lower level */
1070: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1071: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1072: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1073: BEGIN
1074: UTL_FILE.GET_LINE(l_infile_handle, l_line);
1075: l_record_count :=l_record_count+1;
1076: l_type := Get_Field(l_line,l_delimiter,1) ; /* = 10 : header rec, 20 : this level, 30 : lower level */
1077: --UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
1078: --UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
1073: BEGIN
1074: UTL_FILE.GET_LINE(l_infile_handle, l_line);
1075: l_record_count :=l_record_count+1;
1076: l_type := Get_Field(l_line,l_delimiter,1) ; /* = 10 : header rec, 20 : this level, 30 : lower level */
1077: --UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
1078: --UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
1079: EXCEPTION
1080: WHEN NO_DATA_FOUND THEN
1081: RAISE;
1074: UTL_FILE.GET_LINE(l_infile_handle, l_line);
1075: l_record_count :=l_record_count+1;
1076: l_type := Get_Field(l_line,l_delimiter,1) ; /* = 10 : header rec, 20 : this level, 30 : lower level */
1077: --UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
1078: --UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
1079: EXCEPTION
1080: WHEN NO_DATA_FOUND THEN
1081: RAISE;
1082: END;
1081: RAISE;
1082: END;
1083: LOOP
1084: BEGIN
1085: UTL_FILE.PUT_LINE(l_log_handle, '--');
1086: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
1087: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
1088: IF l_type = '10' THEN
1089: /*******************
1082: END;
1083: LOOP
1084: BEGIN
1085: UTL_FILE.PUT_LINE(l_log_handle, '--');
1086: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
1087: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
1088: IF l_type = '10' THEN
1089: /*******************
1090: * empty the tables *
1083: LOOP
1084: BEGIN
1085: UTL_FILE.PUT_LINE(l_log_handle, '--');
1086: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
1087: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
1088: IF l_type = '10' THEN
1089: /*******************
1090: * empty the tables *
1091: *******************/
1108: -- DBMS_OUTPUT.PUT_LINE('in wrapper. l_this_lvl_tbl count : ' || l_this_lvl_tbl.count) ;
1109: -- DBMS_OUTPUT.PUT_LINE('in wrapper. l_lower_lvl_tbl count : ' || l_lower_lvl_tbl.count) ;
1110: -- DBMS_OUTPUT.PUT_LINE('calendar_code = ' || l_header_rec.calendar_code) ;
1111: /*
1112: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
1113: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
1114: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
1115: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
1116: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
1109: -- DBMS_OUTPUT.PUT_LINE('in wrapper. l_lower_lvl_tbl count : ' || l_lower_lvl_tbl.count) ;
1110: -- DBMS_OUTPUT.PUT_LINE('calendar_code = ' || l_header_rec.calendar_code) ;
1111: /*
1112: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
1113: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
1114: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
1115: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
1116: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
1117: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
1110: -- DBMS_OUTPUT.PUT_LINE('calendar_code = ' || l_header_rec.calendar_code) ;
1111: /*
1112: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
1113: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
1114: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
1115: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
1116: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
1117: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
1118: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
1111: /*
1112: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
1113: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
1114: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
1115: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
1116: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
1117: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
1118: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
1119: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
1112: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
1113: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
1114: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
1115: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
1116: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
1117: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
1118: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
1119: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
1120: */
1113: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
1114: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
1115: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
1116: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
1117: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
1118: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
1119: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
1120: */
1121: ELSIF l_type = '20' AND l_skip_details = 'Y' THEN
1114: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
1115: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
1116: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
1117: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
1118: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
1119: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
1120: */
1121: ELSIF l_type = '20' AND l_skip_details = 'Y' THEN
1122: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
1115: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
1116: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
1117: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
1118: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
1119: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
1120: */
1121: ELSIF l_type = '20' AND l_skip_details = 'Y' THEN
1122: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
1123: ELSIF l_type = '20' AND l_skip_details = 'N' THEN
1118: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
1119: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
1120: */
1121: ELSIF l_type = '20' AND l_skip_details = 'Y' THEN
1122: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
1123: ELSIF l_type = '20' AND l_skip_details = 'N' THEN
1124: l_idx := l_idx + 1 ;
1125: --UTL_FILE.PUT_LINE(l_log_handle, 'Populating this level table...' || l_idx ) ;
1126: l_this_lvl_tbl(l_idx).cmpntcost_id := Get_Field(l_line,l_delimiter,2) ;
1121: ELSIF l_type = '20' AND l_skip_details = 'Y' THEN
1122: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
1123: ELSIF l_type = '20' AND l_skip_details = 'N' THEN
1124: l_idx := l_idx + 1 ;
1125: --UTL_FILE.PUT_LINE(l_log_handle, 'Populating this level table...' || l_idx ) ;
1126: l_this_lvl_tbl(l_idx).cmpntcost_id := Get_Field(l_line,l_delimiter,2) ;
1127: l_this_lvl_tbl(l_idx).cost_cmpntcls_id := Get_Field(l_line,l_delimiter,3) ;
1128: l_this_lvl_tbl(l_idx).cost_cmpntcls_code := Get_Field(l_line,l_delimiter,4) ;
1129: l_this_lvl_tbl(l_idx).cost_analysis_code := Get_Field(l_line,l_delimiter,5) ;
1164: l_this_lvl_tbl(l_idx).attribute29 := Get_Field(l_line,l_delimiter,40) ;
1165: l_this_lvl_tbl(l_idx).attribute30 := Get_Field(l_line,l_delimiter,41) ;
1166: l_this_lvl_tbl(l_idx).attribute_category := Get_Field(l_line,l_delimiter,42) ;
1167: /*
1168: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpntcost_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpntcost_id) ;
1169: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
1170: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
1171: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
1172: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
1165: l_this_lvl_tbl(l_idx).attribute30 := Get_Field(l_line,l_delimiter,41) ;
1166: l_this_lvl_tbl(l_idx).attribute_category := Get_Field(l_line,l_delimiter,42) ;
1167: /*
1168: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpntcost_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpntcost_id) ;
1169: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
1170: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
1171: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
1172: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
1173: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
1166: l_this_lvl_tbl(l_idx).attribute_category := Get_Field(l_line,l_delimiter,42) ;
1167: /*
1168: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpntcost_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpntcost_id) ;
1169: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
1170: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
1171: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
1172: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
1173: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
1174: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
1167: /*
1168: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpntcost_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpntcost_id) ;
1169: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
1170: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
1171: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
1172: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
1173: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
1174: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
1175: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
1168: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpntcost_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpntcost_id) ;
1169: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
1170: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
1171: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
1172: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
1173: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
1174: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
1175: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
1176: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
1169: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_id('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_id) ;
1170: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
1171: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
1172: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
1173: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
1174: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
1175: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
1176: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
1177: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
1170: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_cmpntcls_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_cmpntcls_code) ;
1171: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
1172: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
1173: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
1174: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
1175: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
1176: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
1177: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
1178: */
1171: UTL_FILE.PUT_LINE(l_log_handle,'tl cost_analysis_code('||l_idx||') = '||l_this_lvl_tbl(l_idx).cost_analysis_code) ;
1172: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
1173: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
1174: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
1175: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
1176: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
1177: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
1178: */
1179: ELSIF l_type = '30' AND l_skip_details = 'Y' THEN
1172: UTL_FILE.PUT_LINE(l_log_handle,'tl cmpnt_cost('||l_idx||') = '||l_this_lvl_tbl(l_idx).cmpnt_cost) ;
1173: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
1174: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
1175: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
1176: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
1177: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
1178: */
1179: ELSIF l_type = '30' AND l_skip_details = 'Y' THEN
1180: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
1173: UTL_FILE.PUT_LINE(l_log_handle,'tl burden_ind('||l_idx||') = '||l_this_lvl_tbl(l_idx).burden_ind) ;
1174: UTL_FILE.PUT_LINE(l_log_handle,'tl total_qty('||l_idx||') = '||l_this_lvl_tbl(l_idx).total_qty) ;
1175: UTL_FILE.PUT_LINE(l_log_handle,'tl costcalc_orig('||l_idx||') = '||l_this_lvl_tbl(l_idx).costcalc_orig) ;
1176: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
1177: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
1178: */
1179: ELSIF l_type = '30' AND l_skip_details = 'Y' THEN
1180: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
1181: ELSIF l_type = '30' AND l_skip_details = 'N' THEN
1176: UTL_FILE.PUT_LINE(l_log_handle,'tl rmcalc_type('||l_idx||') = '||l_this_lvl_tbl(l_idx).rmcalc_type) ;
1177: UTL_FILE.PUT_LINE(l_log_handle,'tl delete_mark('||l_idx||') = '||l_this_lvl_tbl(l_idx).delete_mark) ;
1178: */
1179: ELSIF l_type = '30' AND l_skip_details = 'Y' THEN
1180: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
1181: ELSIF l_type = '30' AND l_skip_details = 'N' THEN
1182: l_idx1 := l_idx1 + 1 ;
1183: --UTL_FILE.PUT_LINE(l_log_handle, 'Populating lower level table...' || l_idx1 ) ;
1184: l_type := Get_Field(l_line,l_delimiter,1) ;
1179: ELSIF l_type = '30' AND l_skip_details = 'Y' THEN
1180: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
1181: ELSIF l_type = '30' AND l_skip_details = 'N' THEN
1182: l_idx1 := l_idx1 + 1 ;
1183: --UTL_FILE.PUT_LINE(l_log_handle, 'Populating lower level table...' || l_idx1 ) ;
1184: l_type := Get_Field(l_line,l_delimiter,1) ;
1185: l_lower_lvl_tbl(l_idx1).cmpntcost_id := Get_Field(l_line,l_delimiter,2) ;
1186: l_lower_lvl_tbl(l_idx1).cost_cmpntcls_id := Get_Field(l_line,l_delimiter,3) ;
1187: l_lower_lvl_tbl(l_idx1).cost_cmpntcls_code := Get_Field(l_line,l_delimiter,4) ;
1188: l_lower_lvl_tbl(l_idx1).cost_analysis_code := Get_Field(l_line,l_delimiter,5) ;
1189: l_lower_lvl_tbl(l_idx1).cmpnt_cost := Get_Field(l_line,l_delimiter,6) ;
1190: l_lower_lvl_tbl(l_idx1).delete_mark := Get_Field(l_line,l_delimiter,7) ;
1191: /*
1192: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpntcost_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpntcost_id) ;
1193: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_id) ;
1194: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_code) ;
1195: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_analysis_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_analysis_code) ;
1196: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpnt_cost('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpnt_cost) ;
1189: l_lower_lvl_tbl(l_idx1).cmpnt_cost := Get_Field(l_line,l_delimiter,6) ;
1190: l_lower_lvl_tbl(l_idx1).delete_mark := Get_Field(l_line,l_delimiter,7) ;
1191: /*
1192: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpntcost_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpntcost_id) ;
1193: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_id) ;
1194: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_code) ;
1195: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_analysis_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_analysis_code) ;
1196: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpnt_cost('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpnt_cost) ;
1197: */
1190: l_lower_lvl_tbl(l_idx1).delete_mark := Get_Field(l_line,l_delimiter,7) ;
1191: /*
1192: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpntcost_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpntcost_id) ;
1193: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_id) ;
1194: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_code) ;
1195: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_analysis_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_analysis_code) ;
1196: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpnt_cost('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpnt_cost) ;
1197: */
1198: END IF ;
1191: /*
1192: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpntcost_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpntcost_id) ;
1193: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_id) ;
1194: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_code) ;
1195: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_analysis_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_analysis_code) ;
1196: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpnt_cost('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpnt_cost) ;
1197: */
1198: END IF ;
1199: EXCEPTION
1192: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpntcost_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpntcost_id) ;
1193: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_id('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_id) ;
1194: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_cmpntcls_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_cmpntcls_code) ;
1195: UTL_FILE.PUT_LINE(l_log_handle,'ll cost_analysis_code('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cost_analysis_code) ;
1196: UTL_FILE.PUT_LINE(l_log_handle,'ll cmpnt_cost('||l_idx1||') = '||l_lower_lvl_tbl(l_idx1).cmpnt_cost) ;
1197: */
1198: END IF ;
1199: EXCEPTION
1200: WHEN OTHERS THEN
1197: */
1198: END IF ;
1199: EXCEPTION
1200: WHEN OTHERS THEN
1201: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1202: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1203: IF l_type = '10' THEN
1204: l_skip_details := 'Y' ;
1205: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skip detail records.');
1198: END IF ;
1199: EXCEPTION
1200: WHEN OTHERS THEN
1201: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1202: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1203: IF l_type = '10' THEN
1204: l_skip_details := 'Y' ;
1205: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skip detail records.');
1206: ELSIF l_type = '20' THEN
1201: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1202: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1203: IF l_type = '10' THEN
1204: l_skip_details := 'Y' ;
1205: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skip detail records.');
1206: ELSIF l_type = '20' THEN
1207: l_this_lvl_tbl.delete(l_idx);
1208: l_idx := l_idx-1;
1209: ELSIF l_type = '30' THEN
1211: l_idx1 := l_idx1-1;
1212: END IF ;
1213: END ;
1214: BEGIN
1215: UTL_FILE.GET_LINE(l_infile_handle, l_line);
1216: l_record_count :=l_record_count+1;
1217: UTL_FILE.NEW_LINE(l_log_handle);
1218: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : this level, 30 : lower level
1219: --l_skip_details := 'N' ;
1213: END ;
1214: BEGIN
1215: UTL_FILE.GET_LINE(l_infile_handle, l_line);
1216: l_record_count :=l_record_count+1;
1217: UTL_FILE.NEW_LINE(l_log_handle);
1218: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : this level, 30 : lower level
1219: --l_skip_details := 'N' ;
1220: --UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
1221: --UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
1216: l_record_count :=l_record_count+1;
1217: UTL_FILE.NEW_LINE(l_log_handle);
1218: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : this level, 30 : lower level
1219: --l_skip_details := 'N' ;
1220: --UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
1221: --UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
1222: EXCEPTION
1223: WHEN NO_DATA_FOUND THEN
1224: IF l_skip_details = 'N' THEN
1217: UTL_FILE.NEW_LINE(l_log_handle);
1218: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : this level, 30 : lower level
1219: --l_skip_details := 'N' ;
1220: --UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
1221: --UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
1222: EXCEPTION
1223: WHEN NO_DATA_FOUND THEN
1224: IF l_skip_details = 'N' THEN
1225: -- DBMS_OUTPUT.PUT_LINE('In exception. Calling Delete_Item_Cost API...');
1234: p_header_rec => l_header_rec,
1235: p_this_level_dtl_tbl => l_this_lvl_tbl,
1236: p_lower_level_dtl_Tbl => l_lower_lvl_tbl
1237: );
1238: UTL_FILE.PUT_LINE(l_log_handle, 'in exception. after API call. status := ' || l_status ||' cnt := ' || l_count );
1239: l_continue := 'N' ;
1240: GOTO GET_MSG_STACK ;
1241: END IF ;
1242: END;
1254: p_header_rec => l_header_rec,
1255: p_this_level_dtl_tbl => l_this_lvl_tbl,
1256: p_lower_level_dtl_Tbl => l_lower_lvl_tbl
1257: );
1258: UTL_FILE.PUT_LINE(l_log_handle, 'after API call. status := ' || l_status ||' cnt := ' || l_count );
1259: END IF;
1260: <
1261: NULL;
1262:
1273: p_encoded => FND_API.G_FALSE,
1274: p_msg_index_out => l_dummy_cnt
1275: );
1276: -- DBMS_OUTPUT.PUT_LINE(l_data );
1277: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
1278: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
1279: --UTL_FILE.NEW_LINE(l_outfile_handle);
1280: UTL_FILE.PUT_LINE(l_log_handle, l_data);
1281:
1274: p_msg_index_out => l_dummy_cnt
1275: );
1276: -- DBMS_OUTPUT.PUT_LINE(l_data );
1277: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
1278: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
1279: --UTL_FILE.NEW_LINE(l_outfile_handle);
1280: UTL_FILE.PUT_LINE(l_log_handle, l_data);
1281:
1282: /**********************
1275: );
1276: -- DBMS_OUTPUT.PUT_LINE(l_data );
1277: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
1278: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
1279: --UTL_FILE.NEW_LINE(l_outfile_handle);
1280: UTL_FILE.PUT_LINE(l_log_handle, l_data);
1281:
1282: /**********************
1283: * Update error status *
1276: -- DBMS_OUTPUT.PUT_LINE(l_data );
1277: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
1278: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
1279: --UTL_FILE.NEW_LINE(l_outfile_handle);
1280: UTL_FILE.PUT_LINE(l_log_handle, l_data);
1281:
1282: /**********************
1283: * Update error status *
1284: **********************/
1300: EXIT ;
1301: END IF ;
1302: END LOOP;
1303: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1304: UTL_FILE.NEW_LINE(l_log_handle);
1305: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1306: UTL_FILE.FCLOSE_ALL;
1307: RETURN l_return_status;
1308: EXCEPTION
1301: END IF ;
1302: END LOOP;
1303: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1304: UTL_FILE.NEW_LINE(l_log_handle);
1305: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1306: UTL_FILE.FCLOSE_ALL;
1307: RETURN l_return_status;
1308: EXCEPTION
1309: WHEN UTL_FILE.INVALID_OPERATION THEN
1302: END LOOP;
1303: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1304: UTL_FILE.NEW_LINE(l_log_handle);
1305: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1306: UTL_FILE.FCLOSE_ALL;
1307: RETURN l_return_status;
1308: EXCEPTION
1309: WHEN UTL_FILE.INVALID_OPERATION THEN
1310: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
1305: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1306: UTL_FILE.FCLOSE_ALL;
1307: RETURN l_return_status;
1308: EXCEPTION
1309: WHEN UTL_FILE.INVALID_OPERATION THEN
1310: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
1311: UTL_FILE.FCLOSE_ALL;
1312: RETURN l_return_status;
1313: WHEN UTL_FILE.INVALID_PATH THEN
1307: RETURN l_return_status;
1308: EXCEPTION
1309: WHEN UTL_FILE.INVALID_OPERATION THEN
1310: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
1311: UTL_FILE.FCLOSE_ALL;
1312: RETURN l_return_status;
1313: WHEN UTL_FILE.INVALID_PATH THEN
1314: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
1315: UTL_FILE.FCLOSE_ALL;
1309: WHEN UTL_FILE.INVALID_OPERATION THEN
1310: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
1311: UTL_FILE.FCLOSE_ALL;
1312: RETURN l_return_status;
1313: WHEN UTL_FILE.INVALID_PATH THEN
1314: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
1315: UTL_FILE.FCLOSE_ALL;
1316: RETURN l_return_status;
1317: WHEN UTL_FILE.INVALID_MODE THEN
1311: UTL_FILE.FCLOSE_ALL;
1312: RETURN l_return_status;
1313: WHEN UTL_FILE.INVALID_PATH THEN
1314: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
1315: UTL_FILE.FCLOSE_ALL;
1316: RETURN l_return_status;
1317: WHEN UTL_FILE.INVALID_MODE THEN
1318: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
1319: UTL_FILE.FCLOSE_ALL;
1313: WHEN UTL_FILE.INVALID_PATH THEN
1314: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
1315: UTL_FILE.FCLOSE_ALL;
1316: RETURN l_return_status;
1317: WHEN UTL_FILE.INVALID_MODE THEN
1318: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
1319: UTL_FILE.FCLOSE_ALL;
1320: RETURN l_return_status;
1321: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
1315: UTL_FILE.FCLOSE_ALL;
1316: RETURN l_return_status;
1317: WHEN UTL_FILE.INVALID_MODE THEN
1318: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
1319: UTL_FILE.FCLOSE_ALL;
1320: RETURN l_return_status;
1321: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
1322: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
1323: UTL_FILE.FCLOSE_ALL;
1317: WHEN UTL_FILE.INVALID_MODE THEN
1318: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
1319: UTL_FILE.FCLOSE_ALL;
1320: RETURN l_return_status;
1321: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
1322: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
1323: UTL_FILE.FCLOSE_ALL;
1324: RETURN l_return_status;
1325: WHEN UTL_FILE.WRITE_ERROR THEN
1319: UTL_FILE.FCLOSE_ALL;
1320: RETURN l_return_status;
1321: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
1322: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
1323: UTL_FILE.FCLOSE_ALL;
1324: RETURN l_return_status;
1325: WHEN UTL_FILE.WRITE_ERROR THEN
1326: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
1327: UTL_FILE.FCLOSE_ALL;
1321: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
1322: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
1323: UTL_FILE.FCLOSE_ALL;
1324: RETURN l_return_status;
1325: WHEN UTL_FILE.WRITE_ERROR THEN
1326: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
1327: UTL_FILE.FCLOSE_ALL;
1328: RETURN l_return_status;
1329: WHEN UTL_FILE.READ_ERROR THEN
1323: UTL_FILE.FCLOSE_ALL;
1324: RETURN l_return_status;
1325: WHEN UTL_FILE.WRITE_ERROR THEN
1326: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
1327: UTL_FILE.FCLOSE_ALL;
1328: RETURN l_return_status;
1329: WHEN UTL_FILE.READ_ERROR THEN
1330: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
1331: UTL_FILE.FCLOSE_ALL;
1325: WHEN UTL_FILE.WRITE_ERROR THEN
1326: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
1327: UTL_FILE.FCLOSE_ALL;
1328: RETURN l_return_status;
1329: WHEN UTL_FILE.READ_ERROR THEN
1330: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
1331: UTL_FILE.FCLOSE_ALL;
1332: RETURN l_return_status;
1333: WHEN UTL_FILE.INTERNAL_ERROR THEN
1327: UTL_FILE.FCLOSE_ALL;
1328: RETURN l_return_status;
1329: WHEN UTL_FILE.READ_ERROR THEN
1330: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
1331: UTL_FILE.FCLOSE_ALL;
1332: RETURN l_return_status;
1333: WHEN UTL_FILE.INTERNAL_ERROR THEN
1334: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
1335: UTL_FILE.FCLOSE_ALL;
1329: WHEN UTL_FILE.READ_ERROR THEN
1330: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
1331: UTL_FILE.FCLOSE_ALL;
1332: RETURN l_return_status;
1333: WHEN UTL_FILE.INTERNAL_ERROR THEN
1334: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
1335: UTL_FILE.FCLOSE_ALL;
1336: RETURN l_return_status;
1337: WHEN OTHERS THEN
1331: UTL_FILE.FCLOSE_ALL;
1332: RETURN l_return_status;
1333: WHEN UTL_FILE.INTERNAL_ERROR THEN
1334: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
1335: UTL_FILE.FCLOSE_ALL;
1336: RETURN l_return_status;
1337: WHEN OTHERS THEN
1338: -- DBMS_OUTPUT.PUT_LINE('Other Error');
1339: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1335: UTL_FILE.FCLOSE_ALL;
1336: RETURN l_return_status;
1337: WHEN OTHERS THEN
1338: -- DBMS_OUTPUT.PUT_LINE('Other Error');
1339: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1340: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1341: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1342: UTL_FILE.FCLOSE_ALL;
1343: l_return_status := 'U' ;
1336: RETURN l_return_status;
1337: WHEN OTHERS THEN
1338: -- DBMS_OUTPUT.PUT_LINE('Other Error');
1339: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1340: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1341: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1342: UTL_FILE.FCLOSE_ALL;
1343: l_return_status := 'U' ;
1344: RETURN l_return_status;
1337: WHEN OTHERS THEN
1338: -- DBMS_OUTPUT.PUT_LINE('Other Error');
1339: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1340: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1341: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1342: UTL_FILE.FCLOSE_ALL;
1343: l_return_status := 'U' ;
1344: RETURN l_return_status;
1345: END Delete_Item_Cost;
1338: -- DBMS_OUTPUT.PUT_LINE('Other Error');
1339: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1340: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1341: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1342: UTL_FILE.FCLOSE_ALL;
1343: l_return_status := 'U' ;
1344: RETURN l_return_status;
1345: END Delete_Item_Cost;
1346:
1451: l_lower_lvl_tbl GMF_ItemCost_PUB.Lower_Level_Dtl_Tbl_Type;
1452: l_costcmpnt_ids GMF_ItemCost_PUB.costcmpnt_ids_tbl_type;
1453: l_p_dir VARCHAR2(150);
1454: l_output_file VARCHAR2(120);
1455: l_outfile_handle UTL_FILE.FILE_TYPE;
1456: l_input_file VARCHAR2(120);
1457: l_infile_handle UTL_FILE.FILE_TYPE;
1458: l_line VARCHAR2(1000);
1459: l_delimiter VARCHAR(11);
1453: l_p_dir VARCHAR2(150);
1454: l_output_file VARCHAR2(120);
1455: l_outfile_handle UTL_FILE.FILE_TYPE;
1456: l_input_file VARCHAR2(120);
1457: l_infile_handle UTL_FILE.FILE_TYPE;
1458: l_line VARCHAR2(1000);
1459: l_delimiter VARCHAR(11);
1460: l_log_dir VARCHAR2(150);
1461: l_log_name VARCHAR2(120) :='gmf_api_getic_wrapper';
1458: l_line VARCHAR2(1000);
1459: l_delimiter VARCHAR(11);
1460: l_log_dir VARCHAR2(150);
1461: l_log_name VARCHAR2(120) :='gmf_api_getic_wrapper';
1462: l_log_handle UTL_FILE.FILE_TYPE;
1463: l_global_file VARCHAR2(120);
1464: l_idx NUMBER(10);
1465: l_idx1 NUMBER(10);
1466: l_type VARCHAR2(100);
1493:
1494: /*****************************************************************
1495: * Open The Wrapper File For Output And The Input File for Input. *
1496: *****************************************************************/
1497: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
1498: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
1499:
1500: /* Loop thru flat file and call Inventory Quantities API */
1501: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1494: /*****************************************************************
1495: * Open The Wrapper File For Output And The Input File for Input. *
1496: *****************************************************************/
1497: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
1498: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
1499:
1500: /* Loop thru flat file and call Inventory Quantities API */
1501: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1502: -- DBMS_OUTPUT.PUT_LINE('Input Directory ' || l_p_dir );
1503: -- DBMS_OUTPUT.PUT_LINE('Input File ' || l_input_file );
1504: -- DBMS_OUTPUT.PUT_LINE('Delimiter ' || l_delimiter );
1505: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
1506: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
1507: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1508: UTL_FILE.NEW_LINE(l_log_handle);
1509: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1510: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1511: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1504: -- DBMS_OUTPUT.PUT_LINE('Delimiter ' || l_delimiter );
1505: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
1506: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
1507: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1508: UTL_FILE.NEW_LINE(l_log_handle);
1509: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1510: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1511: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1512: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1505: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
1506: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
1507: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1508: UTL_FILE.NEW_LINE(l_log_handle);
1509: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1510: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1511: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1512: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1513: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1506: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
1507: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1508: UTL_FILE.NEW_LINE(l_log_handle);
1509: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1510: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1511: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1512: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1513: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1514: LOOP
1507: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1508: UTL_FILE.NEW_LINE(l_log_handle);
1509: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1510: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1511: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1512: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1513: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1514: LOOP
1515: l_record_count :=l_record_count+1;
1508: UTL_FILE.NEW_LINE(l_log_handle);
1509: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1510: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1511: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1512: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1513: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1514: LOOP
1515: l_record_count :=l_record_count+1;
1516: BEGIN
1509: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1510: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1511: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1512: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1513: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1514: LOOP
1515: l_record_count :=l_record_count+1;
1516: BEGIN
1517: UTL_FILE.GET_LINE(l_infile_handle, l_line);
1513: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1514: LOOP
1515: l_record_count :=l_record_count+1;
1516: BEGIN
1517: UTL_FILE.GET_LINE(l_infile_handle, l_line);
1518: EXCEPTION
1519: WHEN NO_DATA_FOUND THEN
1520: EXIT;
1521: END;
1519: WHEN NO_DATA_FOUND THEN
1520: EXIT;
1521: END;
1522: BEGIN
1523: UTL_FILE.NEW_LINE(l_log_handle);
1524: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
1525: l_header_rec.period_id := Get_Field(l_line,l_delimiter,1) ;
1526: l_header_rec.calendar_code := Get_Field(l_line,l_delimiter,2) ;
1527: l_header_rec.period_code := Get_Field(l_line,l_delimiter,3) ;
1520: EXIT;
1521: END;
1522: BEGIN
1523: UTL_FILE.NEW_LINE(l_log_handle);
1524: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
1525: l_header_rec.period_id := Get_Field(l_line,l_delimiter,1) ;
1526: l_header_rec.calendar_code := Get_Field(l_line,l_delimiter,2) ;
1527: l_header_rec.period_code := Get_Field(l_line,l_delimiter,3) ;
1528: l_header_rec.cost_type_id := Get_Field(l_line,l_delimiter,4) ;
1531: l_header_rec.organization_code := Get_Field(l_line,l_delimiter,7) ;
1532: l_header_rec.inventory_item_id := Get_Field(l_line,l_delimiter,8) ;
1533: l_header_rec.item_number := Get_Field(l_line,l_delimiter,9) ;
1534: l_header_rec.user_name := Get_Field(l_line,l_delimiter,10) ;
1535: UTL_FILE.PUT_LINE(l_log_handle, 'Period_id = ' || l_header_rec.period_id) ;
1536: UTL_FILE.PUT_LINE(l_log_handle, 'Calendar_code = ' || l_header_rec.Calendar_code) ;
1537: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
1538: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id = ' || l_header_rec.cost_type_id) ;
1539: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
1532: l_header_rec.inventory_item_id := Get_Field(l_line,l_delimiter,8) ;
1533: l_header_rec.item_number := Get_Field(l_line,l_delimiter,9) ;
1534: l_header_rec.user_name := Get_Field(l_line,l_delimiter,10) ;
1535: UTL_FILE.PUT_LINE(l_log_handle, 'Period_id = ' || l_header_rec.period_id) ;
1536: UTL_FILE.PUT_LINE(l_log_handle, 'Calendar_code = ' || l_header_rec.Calendar_code) ;
1537: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
1538: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id = ' || l_header_rec.cost_type_id) ;
1539: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
1540: UTL_FILE.PUT_LINE(l_log_handle, 'Organization_id = ' || l_header_rec.organization_id) ;
1533: l_header_rec.item_number := Get_Field(l_line,l_delimiter,9) ;
1534: l_header_rec.user_name := Get_Field(l_line,l_delimiter,10) ;
1535: UTL_FILE.PUT_LINE(l_log_handle, 'Period_id = ' || l_header_rec.period_id) ;
1536: UTL_FILE.PUT_LINE(l_log_handle, 'Calendar_code = ' || l_header_rec.Calendar_code) ;
1537: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
1538: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id = ' || l_header_rec.cost_type_id) ;
1539: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
1540: UTL_FILE.PUT_LINE(l_log_handle, 'Organization_id = ' || l_header_rec.organization_id) ;
1541: UTL_FILE.PUT_LINE(l_log_handle, 'Organization_code= ' || l_header_rec.organization_code) ;
1534: l_header_rec.user_name := Get_Field(l_line,l_delimiter,10) ;
1535: UTL_FILE.PUT_LINE(l_log_handle, 'Period_id = ' || l_header_rec.period_id) ;
1536: UTL_FILE.PUT_LINE(l_log_handle, 'Calendar_code = ' || l_header_rec.Calendar_code) ;
1537: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
1538: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id = ' || l_header_rec.cost_type_id) ;
1539: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
1540: UTL_FILE.PUT_LINE(l_log_handle, 'Organization_id = ' || l_header_rec.organization_id) ;
1541: UTL_FILE.PUT_LINE(l_log_handle, 'Organization_code= ' || l_header_rec.organization_code) ;
1542: UTL_FILE.PUT_LINE(l_log_handle, 'inventory_item_id= ' || l_header_rec.inventory_item_id) ;
1535: UTL_FILE.PUT_LINE(l_log_handle, 'Period_id = ' || l_header_rec.period_id) ;
1536: UTL_FILE.PUT_LINE(l_log_handle, 'Calendar_code = ' || l_header_rec.Calendar_code) ;
1537: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
1538: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id = ' || l_header_rec.cost_type_id) ;
1539: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
1540: UTL_FILE.PUT_LINE(l_log_handle, 'Organization_id = ' || l_header_rec.organization_id) ;
1541: UTL_FILE.PUT_LINE(l_log_handle, 'Organization_code= ' || l_header_rec.organization_code) ;
1542: UTL_FILE.PUT_LINE(l_log_handle, 'inventory_item_id= ' || l_header_rec.inventory_item_id) ;
1543: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || l_header_rec.item_number) ;
1536: UTL_FILE.PUT_LINE(l_log_handle, 'Calendar_code = ' || l_header_rec.Calendar_code) ;
1537: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
1538: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id = ' || l_header_rec.cost_type_id) ;
1539: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
1540: UTL_FILE.PUT_LINE(l_log_handle, 'Organization_id = ' || l_header_rec.organization_id) ;
1541: UTL_FILE.PUT_LINE(l_log_handle, 'Organization_code= ' || l_header_rec.organization_code) ;
1542: UTL_FILE.PUT_LINE(l_log_handle, 'inventory_item_id= ' || l_header_rec.inventory_item_id) ;
1543: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || l_header_rec.item_number) ;
1544: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
1537: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
1538: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id = ' || l_header_rec.cost_type_id) ;
1539: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
1540: UTL_FILE.PUT_LINE(l_log_handle, 'Organization_id = ' || l_header_rec.organization_id) ;
1541: UTL_FILE.PUT_LINE(l_log_handle, 'Organization_code= ' || l_header_rec.organization_code) ;
1542: UTL_FILE.PUT_LINE(l_log_handle, 'inventory_item_id= ' || l_header_rec.inventory_item_id) ;
1543: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || l_header_rec.item_number) ;
1544: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
1545: -- DBMS_OUTPUT.PUT_LINE('Calling Get_Item_Cost API...');
1538: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id = ' || l_header_rec.cost_type_id) ;
1539: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
1540: UTL_FILE.PUT_LINE(l_log_handle, 'Organization_id = ' || l_header_rec.organization_id) ;
1541: UTL_FILE.PUT_LINE(l_log_handle, 'Organization_code= ' || l_header_rec.organization_code) ;
1542: UTL_FILE.PUT_LINE(l_log_handle, 'inventory_item_id= ' || l_header_rec.inventory_item_id) ;
1543: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || l_header_rec.item_number) ;
1544: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
1545: -- DBMS_OUTPUT.PUT_LINE('Calling Get_Item_Cost API...');
1546: GMF_ItemCost_PUB.Get_Item_Cost
1539: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
1540: UTL_FILE.PUT_LINE(l_log_handle, 'Organization_id = ' || l_header_rec.organization_id) ;
1541: UTL_FILE.PUT_LINE(l_log_handle, 'Organization_code= ' || l_header_rec.organization_code) ;
1542: UTL_FILE.PUT_LINE(l_log_handle, 'inventory_item_id= ' || l_header_rec.inventory_item_id) ;
1543: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || l_header_rec.item_number) ;
1544: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
1545: -- DBMS_OUTPUT.PUT_LINE('Calling Get_Item_Cost API...');
1546: GMF_ItemCost_PUB.Get_Item_Cost
1547: (
1540: UTL_FILE.PUT_LINE(l_log_handle, 'Organization_id = ' || l_header_rec.organization_id) ;
1541: UTL_FILE.PUT_LINE(l_log_handle, 'Organization_code= ' || l_header_rec.organization_code) ;
1542: UTL_FILE.PUT_LINE(l_log_handle, 'inventory_item_id= ' || l_header_rec.inventory_item_id) ;
1543: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || l_header_rec.item_number) ;
1544: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
1545: -- DBMS_OUTPUT.PUT_LINE('Calling Get_Item_Cost API...');
1546: GMF_ItemCost_PUB.Get_Item_Cost
1547: (
1548: p_api_version => 3.0,
1553: p_header_rec => l_header_rec,
1554: x_this_level_dtl_tbl => l_this_lvl_tbl,
1555: x_lower_level_dtl_Tbl => l_lower_lvl_tbl
1556: );
1557: UTL_FILE.PUT_LINE(l_log_handle, 'after API call. status := ' || l_status ||' cnt := ' || l_count );
1558: IF l_count > 0 THEN
1559: l_loop_cnt :=1;
1560: LOOP
1561: FND_MSG_PUB.Get
1565: p_encoded => FND_API.G_FALSE,
1566: p_msg_index_out => l_dummy_cnt
1567: );
1568: -- DBMS_OUTPUT.PUT_LINE(l_data );
1569: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
1570: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
1571: --UTL_FILE.NEW_LINE(l_outfile_handle);
1572: UTL_FILE.PUT_LINE(l_log_handle, l_data);
1573:
1566: p_msg_index_out => l_dummy_cnt
1567: );
1568: -- DBMS_OUTPUT.PUT_LINE(l_data );
1569: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
1570: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
1571: --UTL_FILE.NEW_LINE(l_outfile_handle);
1572: UTL_FILE.PUT_LINE(l_log_handle, l_data);
1573:
1574: /**********************
1567: );
1568: -- DBMS_OUTPUT.PUT_LINE(l_data );
1569: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
1570: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
1571: --UTL_FILE.NEW_LINE(l_outfile_handle);
1572: UTL_FILE.PUT_LINE(l_log_handle, l_data);
1573:
1574: /**********************
1575: * Update error status *
1568: -- DBMS_OUTPUT.PUT_LINE(l_data );
1569: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
1570: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
1571: --UTL_FILE.NEW_LINE(l_outfile_handle);
1572: UTL_FILE.PUT_LINE(l_log_handle, l_data);
1573:
1574: /**********************
1575: * Update error status *
1576: **********************/
1586: EXIT;
1587: END IF;
1588: END LOOP;
1589: END IF;
1590: UTL_FILE.NEW_LINE(l_log_handle);
1591: UTL_FILE.PUT_LINE( l_log_handle, 'This Level Cost Components : ' ) ;
1592: FOR i in 1..l_this_lvl_tbl.count LOOP
1593: UTL_FILE.PUT_LINE( l_log_handle, ' CostId : ' || l_this_lvl_tbl(i).cmpntcost_id ||
1594: ' CmpntClsId : ' || l_this_lvl_tbl(i).cost_cmpntcls_id ||
1587: END IF;
1588: END LOOP;
1589: END IF;
1590: UTL_FILE.NEW_LINE(l_log_handle);
1591: UTL_FILE.PUT_LINE( l_log_handle, 'This Level Cost Components : ' ) ;
1592: FOR i in 1..l_this_lvl_tbl.count LOOP
1593: UTL_FILE.PUT_LINE( l_log_handle, ' CostId : ' || l_this_lvl_tbl(i).cmpntcost_id ||
1594: ' CmpntClsId : ' || l_this_lvl_tbl(i).cost_cmpntcls_id ||
1595: ' CmpntCls Code : ' || l_this_lvl_tbl(i).cost_cmpntcls_Code ||
1589: END IF;
1590: UTL_FILE.NEW_LINE(l_log_handle);
1591: UTL_FILE.PUT_LINE( l_log_handle, 'This Level Cost Components : ' ) ;
1592: FOR i in 1..l_this_lvl_tbl.count LOOP
1593: UTL_FILE.PUT_LINE( l_log_handle, ' CostId : ' || l_this_lvl_tbl(i).cmpntcost_id ||
1594: ' CmpntClsId : ' || l_this_lvl_tbl(i).cost_cmpntcls_id ||
1595: ' CmpntCls Code : ' || l_this_lvl_tbl(i).cost_cmpntcls_Code ||
1596: ' Analysis Code : ' || l_this_lvl_tbl(i).cost_analysis_code ||
1597: ' Cmpt Cost : ' || l_this_lvl_tbl(i).cmpnt_cost) ;
1595: ' CmpntCls Code : ' || l_this_lvl_tbl(i).cost_cmpntcls_Code ||
1596: ' Analysis Code : ' || l_this_lvl_tbl(i).cost_analysis_code ||
1597: ' Cmpt Cost : ' || l_this_lvl_tbl(i).cmpnt_cost) ;
1598: END LOOP ;
1599: UTL_FILE.NEW_LINE(l_log_handle);
1600: UTL_FILE.PUT_LINE( l_log_handle, 'Lower Level Cost Components : ' ) ;
1601: FOR i in 1..l_lower_lvl_tbl.count LOOP
1602: UTL_FILE.PUT_LINE( l_log_handle, ' CostId : ' || l_lower_lvl_tbl(i).cmpntcost_id ||
1603: ' CmpntClsId : ' || l_lower_lvl_tbl(i).cost_cmpntcls_id ||
1596: ' Analysis Code : ' || l_this_lvl_tbl(i).cost_analysis_code ||
1597: ' Cmpt Cost : ' || l_this_lvl_tbl(i).cmpnt_cost) ;
1598: END LOOP ;
1599: UTL_FILE.NEW_LINE(l_log_handle);
1600: UTL_FILE.PUT_LINE( l_log_handle, 'Lower Level Cost Components : ' ) ;
1601: FOR i in 1..l_lower_lvl_tbl.count LOOP
1602: UTL_FILE.PUT_LINE( l_log_handle, ' CostId : ' || l_lower_lvl_tbl(i).cmpntcost_id ||
1603: ' CmpntClsId : ' || l_lower_lvl_tbl(i).cost_cmpntcls_id ||
1604: ' CmpntCls Code : ' || l_lower_lvl_tbl(i).cost_cmpntcls_Code ||
1598: END LOOP ;
1599: UTL_FILE.NEW_LINE(l_log_handle);
1600: UTL_FILE.PUT_LINE( l_log_handle, 'Lower Level Cost Components : ' ) ;
1601: FOR i in 1..l_lower_lvl_tbl.count LOOP
1602: UTL_FILE.PUT_LINE( l_log_handle, ' CostId : ' || l_lower_lvl_tbl(i).cmpntcost_id ||
1603: ' CmpntClsId : ' || l_lower_lvl_tbl(i).cost_cmpntcls_id ||
1604: ' CmpntCls Code : ' || l_lower_lvl_tbl(i).cost_cmpntcls_Code ||
1605: ' Analysis Code : ' || l_lower_lvl_tbl(i).cost_analysis_code ||
1606: ' Cmpt Cost : ' || l_lower_lvl_tbl(i).cmpnt_cost) ;
1606: ' Cmpt Cost : ' || l_lower_lvl_tbl(i).cmpnt_cost) ;
1607: END LOOP ;
1608: EXCEPTION
1609: WHEN OTHERS THEN
1610: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1611: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1612: l_return_status := 'U' ;
1613: END ;
1614: END LOOP;
1607: END LOOP ;
1608: EXCEPTION
1609: WHEN OTHERS THEN
1610: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1611: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1612: l_return_status := 'U' ;
1613: END ;
1614: END LOOP;
1615: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1612: l_return_status := 'U' ;
1613: END ;
1614: END LOOP;
1615: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1616: UTL_FILE.NEW_LINE(l_log_handle);
1617: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1618: UTL_FILE.FCLOSE_ALL;
1619: RETURN l_return_status;
1620: EXCEPTION
1613: END ;
1614: END LOOP;
1615: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1616: UTL_FILE.NEW_LINE(l_log_handle);
1617: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1618: UTL_FILE.FCLOSE_ALL;
1619: RETURN l_return_status;
1620: EXCEPTION
1621: WHEN UTL_FILE.INVALID_OPERATION THEN
1614: END LOOP;
1615: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1616: UTL_FILE.NEW_LINE(l_log_handle);
1617: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1618: UTL_FILE.FCLOSE_ALL;
1619: RETURN l_return_status;
1620: EXCEPTION
1621: WHEN UTL_FILE.INVALID_OPERATION THEN
1622: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
1617: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1618: UTL_FILE.FCLOSE_ALL;
1619: RETURN l_return_status;
1620: EXCEPTION
1621: WHEN UTL_FILE.INVALID_OPERATION THEN
1622: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
1623: UTL_FILE.FCLOSE_ALL;
1624: RETURN l_return_status;
1625: WHEN UTL_FILE.INVALID_PATH THEN
1619: RETURN l_return_status;
1620: EXCEPTION
1621: WHEN UTL_FILE.INVALID_OPERATION THEN
1622: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
1623: UTL_FILE.FCLOSE_ALL;
1624: RETURN l_return_status;
1625: WHEN UTL_FILE.INVALID_PATH THEN
1626: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
1627: UTL_FILE.FCLOSE_ALL;
1621: WHEN UTL_FILE.INVALID_OPERATION THEN
1622: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
1623: UTL_FILE.FCLOSE_ALL;
1624: RETURN l_return_status;
1625: WHEN UTL_FILE.INVALID_PATH THEN
1626: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
1627: UTL_FILE.FCLOSE_ALL;
1628: RETURN l_return_status;
1629: WHEN UTL_FILE.INVALID_MODE THEN
1623: UTL_FILE.FCLOSE_ALL;
1624: RETURN l_return_status;
1625: WHEN UTL_FILE.INVALID_PATH THEN
1626: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
1627: UTL_FILE.FCLOSE_ALL;
1628: RETURN l_return_status;
1629: WHEN UTL_FILE.INVALID_MODE THEN
1630: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
1631: UTL_FILE.FCLOSE_ALL;
1625: WHEN UTL_FILE.INVALID_PATH THEN
1626: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
1627: UTL_FILE.FCLOSE_ALL;
1628: RETURN l_return_status;
1629: WHEN UTL_FILE.INVALID_MODE THEN
1630: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
1631: UTL_FILE.FCLOSE_ALL;
1632: RETURN l_return_status;
1633: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
1627: UTL_FILE.FCLOSE_ALL;
1628: RETURN l_return_status;
1629: WHEN UTL_FILE.INVALID_MODE THEN
1630: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
1631: UTL_FILE.FCLOSE_ALL;
1632: RETURN l_return_status;
1633: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
1634: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
1635: UTL_FILE.FCLOSE_ALL;
1629: WHEN UTL_FILE.INVALID_MODE THEN
1630: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
1631: UTL_FILE.FCLOSE_ALL;
1632: RETURN l_return_status;
1633: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
1634: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
1635: UTL_FILE.FCLOSE_ALL;
1636: RETURN l_return_status;
1637: WHEN UTL_FILE.WRITE_ERROR THEN
1631: UTL_FILE.FCLOSE_ALL;
1632: RETURN l_return_status;
1633: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
1634: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
1635: UTL_FILE.FCLOSE_ALL;
1636: RETURN l_return_status;
1637: WHEN UTL_FILE.WRITE_ERROR THEN
1638: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
1639: UTL_FILE.FCLOSE_ALL;
1633: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
1634: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
1635: UTL_FILE.FCLOSE_ALL;
1636: RETURN l_return_status;
1637: WHEN UTL_FILE.WRITE_ERROR THEN
1638: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
1639: UTL_FILE.FCLOSE_ALL;
1640: RETURN l_return_status;
1641: WHEN UTL_FILE.READ_ERROR THEN
1635: UTL_FILE.FCLOSE_ALL;
1636: RETURN l_return_status;
1637: WHEN UTL_FILE.WRITE_ERROR THEN
1638: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
1639: UTL_FILE.FCLOSE_ALL;
1640: RETURN l_return_status;
1641: WHEN UTL_FILE.READ_ERROR THEN
1642: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
1643: UTL_FILE.FCLOSE_ALL;
1637: WHEN UTL_FILE.WRITE_ERROR THEN
1638: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
1639: UTL_FILE.FCLOSE_ALL;
1640: RETURN l_return_status;
1641: WHEN UTL_FILE.READ_ERROR THEN
1642: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
1643: UTL_FILE.FCLOSE_ALL;
1644: RETURN l_return_status;
1645: WHEN UTL_FILE.INTERNAL_ERROR THEN
1639: UTL_FILE.FCLOSE_ALL;
1640: RETURN l_return_status;
1641: WHEN UTL_FILE.READ_ERROR THEN
1642: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
1643: UTL_FILE.FCLOSE_ALL;
1644: RETURN l_return_status;
1645: WHEN UTL_FILE.INTERNAL_ERROR THEN
1646: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
1647: UTL_FILE.FCLOSE_ALL;
1641: WHEN UTL_FILE.READ_ERROR THEN
1642: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
1643: UTL_FILE.FCLOSE_ALL;
1644: RETURN l_return_status;
1645: WHEN UTL_FILE.INTERNAL_ERROR THEN
1646: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
1647: UTL_FILE.FCLOSE_ALL;
1648: RETURN l_return_status;
1649: WHEN OTHERS THEN
1643: UTL_FILE.FCLOSE_ALL;
1644: RETURN l_return_status;
1645: WHEN UTL_FILE.INTERNAL_ERROR THEN
1646: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
1647: UTL_FILE.FCLOSE_ALL;
1648: RETURN l_return_status;
1649: WHEN OTHERS THEN
1650: -- DBMS_OUTPUT.PUT_LINE('Other Error');
1651: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1647: UTL_FILE.FCLOSE_ALL;
1648: RETURN l_return_status;
1649: WHEN OTHERS THEN
1650: -- DBMS_OUTPUT.PUT_LINE('Other Error');
1651: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1652: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1653: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1654: UTL_FILE.FCLOSE_ALL;
1655: l_return_status := 'U' ;
1648: RETURN l_return_status;
1649: WHEN OTHERS THEN
1650: -- DBMS_OUTPUT.PUT_LINE('Other Error');
1651: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1652: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1653: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1654: UTL_FILE.FCLOSE_ALL;
1655: l_return_status := 'U' ;
1656: RETURN l_return_status;
1649: WHEN OTHERS THEN
1650: -- DBMS_OUTPUT.PUT_LINE('Other Error');
1651: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1652: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1653: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1654: UTL_FILE.FCLOSE_ALL;
1655: l_return_status := 'U' ;
1656: RETURN l_return_status;
1657: END Get_Item_Cost;
1650: -- DBMS_OUTPUT.PUT_LINE('Other Error');
1651: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1652: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1653: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1654: UTL_FILE.FCLOSE_ALL;
1655: l_return_status := 'U' ;
1656: RETURN l_return_status;
1657: END Get_Item_Cost;
1658:
1763: l_data VARCHAR2(32767);
1764: l_adjustment_rec GMF_ACTUAL_COST_ADJUSTMENT_PUB.ADJUSTMENT_REC_TYPE;
1765: l_p_dir VARCHAR2(150);
1766: l_output_file VARCHAR2(120);
1767: l_outfile_handle UTL_FILE.FILE_TYPE;
1768: l_input_file VARCHAR2(120);
1769: l_infile_handle UTL_FILE.FILE_TYPE;
1770: l_line VARCHAR2(32767);
1771: l_delimiter VARCHAR(11);
1765: l_p_dir VARCHAR2(150);
1766: l_output_file VARCHAR2(120);
1767: l_outfile_handle UTL_FILE.FILE_TYPE;
1768: l_input_file VARCHAR2(120);
1769: l_infile_handle UTL_FILE.FILE_TYPE;
1770: l_line VARCHAR2(32767);
1771: l_delimiter VARCHAR(11);
1772: l_log_dir VARCHAR2(150);
1773: l_log_name VARCHAR2(120) ;
1770: l_line VARCHAR2(32767);
1771: l_delimiter VARCHAR(11);
1772: l_log_dir VARCHAR2(150);
1773: l_log_name VARCHAR2(120) ;
1774: l_log_handle UTL_FILE.FILE_TYPE;
1775: l_global_file VARCHAR2(120);
1776: l_idx NUMBER(10);
1777: l_idx1 NUMBER(10);
1778: l_type VARCHAR2(32767);
1811:
1812: /*****************************************************************
1813: * Open The Wrapper File For Output And The Input File for Input. *
1814: *****************************************************************/
1815: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
1816: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
1817: /*
1818: DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1819: DBMS_OUTPUT.PUT_LINE('Input Directory ' || l_p_dir );
1812: /*****************************************************************
1813: * Open The Wrapper File For Output And The Input File for Input. *
1814: *****************************************************************/
1815: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
1816: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
1817: /*
1818: DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1819: DBMS_OUTPUT.PUT_LINE('Input Directory ' || l_p_dir );
1820: DBMS_OUTPUT.PUT_LINE('Input File ' || l_input_file );
1821: DBMS_OUTPUT.PUT_LINE('Delimiter ' || l_delimiter );
1822: DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
1823: */
1824:
1825: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1826: UTL_FILE.NEW_LINE(l_log_handle);
1827: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1828: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1829: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1822: DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
1823: */
1824:
1825: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1826: UTL_FILE.NEW_LINE(l_log_handle);
1827: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1828: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1829: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1830: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1823: */
1824:
1825: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1826: UTL_FILE.NEW_LINE(l_log_handle);
1827: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1828: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1829: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1830: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1831: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1824:
1825: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1826: UTL_FILE.NEW_LINE(l_log_handle);
1827: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1828: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1829: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1830: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1831: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1832: LOOP
1825: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1826: UTL_FILE.NEW_LINE(l_log_handle);
1827: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1828: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1829: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1830: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1831: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1832: LOOP
1833: l_record_count :=l_record_count+1;
1826: UTL_FILE.NEW_LINE(l_log_handle);
1827: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1828: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1829: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1830: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1831: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1832: LOOP
1833: l_record_count :=l_record_count+1;
1834: BEGIN
1827: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
1828: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
1829: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
1830: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
1831: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1832: LOOP
1833: l_record_count :=l_record_count+1;
1834: BEGIN
1835: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || to_char(l_record_count));
1831: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
1832: LOOP
1833: l_record_count :=l_record_count+1;
1834: BEGIN
1835: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || to_char(l_record_count));
1836: UTL_FILE.GET_LINE(l_infile_handle, l_line);
1837: IF l_line IS NOT NULL THEN
1838: l_adjustment_rec.cost_adjust_id := Get_Field(l_line,l_delimiter,1);
1839: l_adjustment_rec.organization_id := Get_Field(l_line,l_delimiter,2);
1832: LOOP
1833: l_record_count :=l_record_count+1;
1834: BEGIN
1835: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || to_char(l_record_count));
1836: UTL_FILE.GET_LINE(l_infile_handle, l_line);
1837: IF l_line IS NOT NULL THEN
1838: l_adjustment_rec.cost_adjust_id := Get_Field(l_line,l_delimiter,1);
1839: l_adjustment_rec.organization_id := Get_Field(l_line,l_delimiter,2);
1840: l_adjustment_rec.organization_code := Get_Field(l_line,l_delimiter,3);
1904: EXCEPTION
1905: WHEN no_data_found THEN
1906: l_continue := 'N';
1907: WHEN OTHERS THEN
1908: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1909: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1910: l_continue := 'N' ;
1911: END;
1912:
1905: WHEN no_data_found THEN
1906: l_continue := 'N';
1907: WHEN OTHERS THEN
1908: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1909: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1910: l_continue := 'N' ;
1911: END;
1912:
1913: /*******************************************************************************************
1922: p_data => l_data,
1923: p_encoded => FND_API.G_FALSE,
1924: p_msg_index_out => l_dummy_cnt
1925: );
1926: UTL_FILE.PUT_LINE(l_log_handle, l_data);
1927:
1928: /**********************
1929: * Update error status *
1930: **********************/
1945: IF l_continue = 'N' THEN
1946: EXIT ;
1947: END IF ;
1948: END LOOP;
1949: UTL_FILE.NEW_LINE(l_log_handle);
1950: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1951: UTL_FILE.FCLOSE_ALL;
1952: RETURN l_return_status;
1953: EXCEPTION
1946: EXIT ;
1947: END IF ;
1948: END LOOP;
1949: UTL_FILE.NEW_LINE(l_log_handle);
1950: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1951: UTL_FILE.FCLOSE_ALL;
1952: RETURN l_return_status;
1953: EXCEPTION
1954: WHEN UTL_FILE.INVALID_OPERATION THEN
1947: END IF ;
1948: END LOOP;
1949: UTL_FILE.NEW_LINE(l_log_handle);
1950: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1951: UTL_FILE.FCLOSE_ALL;
1952: RETURN l_return_status;
1953: EXCEPTION
1954: WHEN UTL_FILE.INVALID_OPERATION THEN
1955: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
1950: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1951: UTL_FILE.FCLOSE_ALL;
1952: RETURN l_return_status;
1953: EXCEPTION
1954: WHEN UTL_FILE.INVALID_OPERATION THEN
1955: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
1956: UTL_FILE.FCLOSE_ALL;
1957: RETURN l_return_status;
1958: WHEN UTL_FILE.INVALID_PATH THEN
1952: RETURN l_return_status;
1953: EXCEPTION
1954: WHEN UTL_FILE.INVALID_OPERATION THEN
1955: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
1956: UTL_FILE.FCLOSE_ALL;
1957: RETURN l_return_status;
1958: WHEN UTL_FILE.INVALID_PATH THEN
1959: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
1960: UTL_FILE.FCLOSE_ALL;
1954: WHEN UTL_FILE.INVALID_OPERATION THEN
1955: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
1956: UTL_FILE.FCLOSE_ALL;
1957: RETURN l_return_status;
1958: WHEN UTL_FILE.INVALID_PATH THEN
1959: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
1960: UTL_FILE.FCLOSE_ALL;
1961: RETURN l_return_status;
1962: WHEN UTL_FILE.INVALID_MODE THEN
1956: UTL_FILE.FCLOSE_ALL;
1957: RETURN l_return_status;
1958: WHEN UTL_FILE.INVALID_PATH THEN
1959: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
1960: UTL_FILE.FCLOSE_ALL;
1961: RETURN l_return_status;
1962: WHEN UTL_FILE.INVALID_MODE THEN
1963: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
1964: UTL_FILE.FCLOSE_ALL;
1958: WHEN UTL_FILE.INVALID_PATH THEN
1959: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
1960: UTL_FILE.FCLOSE_ALL;
1961: RETURN l_return_status;
1962: WHEN UTL_FILE.INVALID_MODE THEN
1963: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
1964: UTL_FILE.FCLOSE_ALL;
1965: RETURN l_return_status;
1966: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
1960: UTL_FILE.FCLOSE_ALL;
1961: RETURN l_return_status;
1962: WHEN UTL_FILE.INVALID_MODE THEN
1963: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
1964: UTL_FILE.FCLOSE_ALL;
1965: RETURN l_return_status;
1966: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
1967: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
1968: UTL_FILE.FCLOSE_ALL;
1962: WHEN UTL_FILE.INVALID_MODE THEN
1963: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
1964: UTL_FILE.FCLOSE_ALL;
1965: RETURN l_return_status;
1966: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
1967: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
1968: UTL_FILE.FCLOSE_ALL;
1969: RETURN l_return_status;
1970: WHEN UTL_FILE.WRITE_ERROR THEN
1964: UTL_FILE.FCLOSE_ALL;
1965: RETURN l_return_status;
1966: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
1967: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
1968: UTL_FILE.FCLOSE_ALL;
1969: RETURN l_return_status;
1970: WHEN UTL_FILE.WRITE_ERROR THEN
1971: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
1972: UTL_FILE.FCLOSE_ALL;
1966: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
1967: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
1968: UTL_FILE.FCLOSE_ALL;
1969: RETURN l_return_status;
1970: WHEN UTL_FILE.WRITE_ERROR THEN
1971: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
1972: UTL_FILE.FCLOSE_ALL;
1973: RETURN l_return_status;
1974: WHEN UTL_FILE.READ_ERROR THEN
1968: UTL_FILE.FCLOSE_ALL;
1969: RETURN l_return_status;
1970: WHEN UTL_FILE.WRITE_ERROR THEN
1971: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
1972: UTL_FILE.FCLOSE_ALL;
1973: RETURN l_return_status;
1974: WHEN UTL_FILE.READ_ERROR THEN
1975: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
1976: UTL_FILE.FCLOSE_ALL;
1970: WHEN UTL_FILE.WRITE_ERROR THEN
1971: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
1972: UTL_FILE.FCLOSE_ALL;
1973: RETURN l_return_status;
1974: WHEN UTL_FILE.READ_ERROR THEN
1975: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
1976: UTL_FILE.FCLOSE_ALL;
1977: RETURN l_return_status;
1978: WHEN UTL_FILE.INTERNAL_ERROR THEN
1972: UTL_FILE.FCLOSE_ALL;
1973: RETURN l_return_status;
1974: WHEN UTL_FILE.READ_ERROR THEN
1975: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
1976: UTL_FILE.FCLOSE_ALL;
1977: RETURN l_return_status;
1978: WHEN UTL_FILE.INTERNAL_ERROR THEN
1979: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
1980: UTL_FILE.FCLOSE_ALL;
1974: WHEN UTL_FILE.READ_ERROR THEN
1975: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
1976: UTL_FILE.FCLOSE_ALL;
1977: RETURN l_return_status;
1978: WHEN UTL_FILE.INTERNAL_ERROR THEN
1979: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
1980: UTL_FILE.FCLOSE_ALL;
1981: RETURN l_return_status;
1982: WHEN OTHERS THEN
1976: UTL_FILE.FCLOSE_ALL;
1977: RETURN l_return_status;
1978: WHEN UTL_FILE.INTERNAL_ERROR THEN
1979: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
1980: UTL_FILE.FCLOSE_ALL;
1981: RETURN l_return_status;
1982: WHEN OTHERS THEN
1983: -- DBMS_OUTPUT.PUT_LINE('Other Error');
1984: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1980: UTL_FILE.FCLOSE_ALL;
1981: RETURN l_return_status;
1982: WHEN OTHERS THEN
1983: -- DBMS_OUTPUT.PUT_LINE('Other Error');
1984: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1985: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1986: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1987: UTL_FILE.FCLOSE_ALL;
1988: l_return_status := 'U' ;
1981: RETURN l_return_status;
1982: WHEN OTHERS THEN
1983: -- DBMS_OUTPUT.PUT_LINE('Other Error');
1984: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1985: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1986: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1987: UTL_FILE.FCLOSE_ALL;
1988: l_return_status := 'U' ;
1989: RETURN l_return_status;
1982: WHEN OTHERS THEN
1983: -- DBMS_OUTPUT.PUT_LINE('Other Error');
1984: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1985: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1986: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1987: UTL_FILE.FCLOSE_ALL;
1988: l_return_status := 'U' ;
1989: RETURN l_return_status;
1990: END Process_ActualCost_Adjustment;
1983: -- DBMS_OUTPUT.PUT_LINE('Other Error');
1984: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1985: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
1986: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
1987: UTL_FILE.FCLOSE_ALL;
1988: l_return_status := 'U' ;
1989: RETURN l_return_status;
1990: END Process_ActualCost_Adjustment;
1991:
2119: l_data VARCHAR2(1000);
2120: l_adjustment_rec GMF_ACTUAL_COST_ADJUSTMENT_PUB.ADJUSTMENT_REC_TYPE;
2121: l_p_dir VARCHAR2(150);
2122: l_output_file VARCHAR2(120);
2123: l_outfile_handle UTL_FILE.FILE_TYPE;
2124: l_input_file VARCHAR2(120);
2125: l_infile_handle UTL_FILE.FILE_TYPE;
2126: l_line VARCHAR2(1000);
2127: l_delimiter VARCHAR(11);
2121: l_p_dir VARCHAR2(150);
2122: l_output_file VARCHAR2(120);
2123: l_outfile_handle UTL_FILE.FILE_TYPE;
2124: l_input_file VARCHAR2(120);
2125: l_infile_handle UTL_FILE.FILE_TYPE;
2126: l_line VARCHAR2(1000);
2127: l_delimiter VARCHAR(11);
2128: l_log_dir VARCHAR2(150);
2129: l_log_name VARCHAR2(120) :='gmf_api_getactualcost_wrapper';
2126: l_line VARCHAR2(1000);
2127: l_delimiter VARCHAR(11);
2128: l_log_dir VARCHAR2(150);
2129: l_log_name VARCHAR2(120) :='gmf_api_getactualcost_wrapper';
2130: l_log_handle UTL_FILE.FILE_TYPE;
2131: l_global_file VARCHAR2(120);
2132: l_idx NUMBER(10);
2133: l_idx1 NUMBER(10);
2134: l_continue VARCHAR2(1) := 'Y' ;
2160:
2161: /****************************************************************
2162: * Open The Wrapper File For Output And The Input File for Input *
2163: ****************************************************************/
2164: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
2165: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
2166: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2167: -- DBMS_OUTPUT.PUT_LINE('Input Directory ' || l_p_dir );
2168: -- DBMS_OUTPUT.PUT_LINE('Input File ' || l_input_file );
2161: /****************************************************************
2162: * Open The Wrapper File For Output And The Input File for Input *
2163: ****************************************************************/
2164: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
2165: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
2166: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2167: -- DBMS_OUTPUT.PUT_LINE('Input Directory ' || l_p_dir );
2168: -- DBMS_OUTPUT.PUT_LINE('Input File ' || l_input_file );
2169: -- DBMS_OUTPUT.PUT_LINE('Delimiter ' || l_delimiter );
2167: -- DBMS_OUTPUT.PUT_LINE('Input Directory ' || l_p_dir );
2168: -- DBMS_OUTPUT.PUT_LINE('Input File ' || l_input_file );
2169: -- DBMS_OUTPUT.PUT_LINE('Delimiter ' || l_delimiter );
2170: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
2171: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2172: UTL_FILE.NEW_LINE(l_log_handle);
2173: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2174: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2175: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2168: -- DBMS_OUTPUT.PUT_LINE('Input File ' || l_input_file );
2169: -- DBMS_OUTPUT.PUT_LINE('Delimiter ' || l_delimiter );
2170: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
2171: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2172: UTL_FILE.NEW_LINE(l_log_handle);
2173: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2174: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2175: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2176: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2169: -- DBMS_OUTPUT.PUT_LINE('Delimiter ' || l_delimiter );
2170: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
2171: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2172: UTL_FILE.NEW_LINE(l_log_handle);
2173: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2174: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2175: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2176: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2177: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
2170: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
2171: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2172: UTL_FILE.NEW_LINE(l_log_handle);
2173: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2174: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2175: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2176: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2177: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
2178: LOOP
2171: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2172: UTL_FILE.NEW_LINE(l_log_handle);
2173: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2174: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2175: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2176: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2177: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
2178: LOOP
2179: l_record_count :=l_record_count+1;
2172: UTL_FILE.NEW_LINE(l_log_handle);
2173: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2174: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2175: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2176: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2177: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
2178: LOOP
2179: l_record_count :=l_record_count+1;
2180: BEGIN
2173: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2174: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2175: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2176: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2177: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
2178: LOOP
2179: l_record_count :=l_record_count+1;
2180: BEGIN
2181: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || to_char(l_record_count));
2177: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
2178: LOOP
2179: l_record_count :=l_record_count+1;
2180: BEGIN
2181: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || to_char(l_record_count));
2182: UTL_FILE.GET_LINE(l_infile_handle, l_line);
2183: l_adjustment_rec.cost_adjust_id := Get_Field(l_line,l_delimiter,1);
2184: l_adjustment_rec.organization_id := Get_Field(l_line,l_delimiter,2);
2185: l_adjustment_rec.organization_code := Get_Field(l_line,l_delimiter,3);
2178: LOOP
2179: l_record_count :=l_record_count+1;
2180: BEGIN
2181: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || to_char(l_record_count));
2182: UTL_FILE.GET_LINE(l_infile_handle, l_line);
2183: l_adjustment_rec.cost_adjust_id := Get_Field(l_line,l_delimiter,1);
2184: l_adjustment_rec.organization_id := Get_Field(l_line,l_delimiter,2);
2185: l_adjustment_rec.organization_code := Get_Field(l_line,l_delimiter,3);
2186: l_adjustment_rec.inventory_item_id := Get_Field(l_line,l_delimiter,4);
2244: x_msg_data => l_data,
2245: p_adjustment_rec => l_adjustment_rec
2246: );
2247:
2248: UTL_FILE.PUT_LINE(l_log_handle, 'After API call. status := ' || l_status ||' cnt := ' || l_count );
2249:
2250: EXCEPTION
2251: WHEN OTHERS THEN
2252: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2248: UTL_FILE.PUT_LINE(l_log_handle, 'After API call. status := ' || l_status ||' cnt := ' || l_count );
2249:
2250: EXCEPTION
2251: WHEN OTHERS THEN
2252: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2253: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2254: l_continue := 'N' ;
2255: END;
2256:
2249:
2250: EXCEPTION
2251: WHEN OTHERS THEN
2252: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2253: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2254: l_continue := 'N' ;
2255: END;
2256:
2257: /*******************************************************************************************
2266: p_data => l_data,
2267: p_encoded => FND_API.G_FALSE,
2268: p_msg_index_out => l_dummy_cnt
2269: );
2270: UTL_FILE.PUT_LINE(l_log_handle, l_data);
2271:
2272: /**********************
2273: * Update error status *
2274: **********************/
2285: END IF;
2286: END LOOP;
2287: l_count := 0 ;
2288: END IF;
2289: UTL_FILE.NEW_LINE(l_log_handle);
2290: UTL_FILE.NEW_LINE(l_log_handle);
2291: UTL_FILE.NEW_LINE(l_log_handle);
2292: IF l_continue = 'N' THEN
2293: EXIT;
2286: END LOOP;
2287: l_count := 0 ;
2288: END IF;
2289: UTL_FILE.NEW_LINE(l_log_handle);
2290: UTL_FILE.NEW_LINE(l_log_handle);
2291: UTL_FILE.NEW_LINE(l_log_handle);
2292: IF l_continue = 'N' THEN
2293: EXIT;
2294: END IF;
2287: l_count := 0 ;
2288: END IF;
2289: UTL_FILE.NEW_LINE(l_log_handle);
2290: UTL_FILE.NEW_LINE(l_log_handle);
2291: UTL_FILE.NEW_LINE(l_log_handle);
2292: IF l_continue = 'N' THEN
2293: EXIT;
2294: END IF;
2295: END LOOP;
2292: IF l_continue = 'N' THEN
2293: EXIT;
2294: END IF;
2295: END LOOP;
2296: UTL_FILE.NEW_LINE(l_log_handle);
2297: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2298: UTL_FILE.FCLOSE_ALL;
2299: RETURN l_return_status;
2300: EXCEPTION
2293: EXIT;
2294: END IF;
2295: END LOOP;
2296: UTL_FILE.NEW_LINE(l_log_handle);
2297: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2298: UTL_FILE.FCLOSE_ALL;
2299: RETURN l_return_status;
2300: EXCEPTION
2301: WHEN UTL_FILE.INVALID_OPERATION THEN
2294: END IF;
2295: END LOOP;
2296: UTL_FILE.NEW_LINE(l_log_handle);
2297: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2298: UTL_FILE.FCLOSE_ALL;
2299: RETURN l_return_status;
2300: EXCEPTION
2301: WHEN UTL_FILE.INVALID_OPERATION THEN
2302: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
2297: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2298: UTL_FILE.FCLOSE_ALL;
2299: RETURN l_return_status;
2300: EXCEPTION
2301: WHEN UTL_FILE.INVALID_OPERATION THEN
2302: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
2303: UTL_FILE.FCLOSE_ALL;
2304: RETURN l_return_status;
2305: WHEN UTL_FILE.INVALID_PATH THEN
2299: RETURN l_return_status;
2300: EXCEPTION
2301: WHEN UTL_FILE.INVALID_OPERATION THEN
2302: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
2303: UTL_FILE.FCLOSE_ALL;
2304: RETURN l_return_status;
2305: WHEN UTL_FILE.INVALID_PATH THEN
2306: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
2307: UTL_FILE.FCLOSE_ALL;
2301: WHEN UTL_FILE.INVALID_OPERATION THEN
2302: -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file);
2303: UTL_FILE.FCLOSE_ALL;
2304: RETURN l_return_status;
2305: WHEN UTL_FILE.INVALID_PATH THEN
2306: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
2307: UTL_FILE.FCLOSE_ALL;
2308: RETURN l_return_status;
2309: WHEN UTL_FILE.INVALID_MODE THEN
2303: UTL_FILE.FCLOSE_ALL;
2304: RETURN l_return_status;
2305: WHEN UTL_FILE.INVALID_PATH THEN
2306: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
2307: UTL_FILE.FCLOSE_ALL;
2308: RETURN l_return_status;
2309: WHEN UTL_FILE.INVALID_MODE THEN
2310: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
2311: UTL_FILE.FCLOSE_ALL;
2305: WHEN UTL_FILE.INVALID_PATH THEN
2306: -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file);
2307: UTL_FILE.FCLOSE_ALL;
2308: RETURN l_return_status;
2309: WHEN UTL_FILE.INVALID_MODE THEN
2310: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
2311: UTL_FILE.FCLOSE_ALL;
2312: RETURN l_return_status;
2313: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
2307: UTL_FILE.FCLOSE_ALL;
2308: RETURN l_return_status;
2309: WHEN UTL_FILE.INVALID_MODE THEN
2310: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
2311: UTL_FILE.FCLOSE_ALL;
2312: RETURN l_return_status;
2313: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
2314: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
2315: UTL_FILE.FCLOSE_ALL;
2309: WHEN UTL_FILE.INVALID_MODE THEN
2310: -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file);
2311: UTL_FILE.FCLOSE_ALL;
2312: RETURN l_return_status;
2313: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
2314: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
2315: UTL_FILE.FCLOSE_ALL;
2316: RETURN l_return_status;
2317: WHEN UTL_FILE.WRITE_ERROR THEN
2311: UTL_FILE.FCLOSE_ALL;
2312: RETURN l_return_status;
2313: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
2314: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
2315: UTL_FILE.FCLOSE_ALL;
2316: RETURN l_return_status;
2317: WHEN UTL_FILE.WRITE_ERROR THEN
2318: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
2319: UTL_FILE.FCLOSE_ALL;
2313: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
2314: -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file);
2315: UTL_FILE.FCLOSE_ALL;
2316: RETURN l_return_status;
2317: WHEN UTL_FILE.WRITE_ERROR THEN
2318: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
2319: UTL_FILE.FCLOSE_ALL;
2320: RETURN l_return_status;
2321: WHEN UTL_FILE.READ_ERROR THEN
2315: UTL_FILE.FCLOSE_ALL;
2316: RETURN l_return_status;
2317: WHEN UTL_FILE.WRITE_ERROR THEN
2318: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
2319: UTL_FILE.FCLOSE_ALL;
2320: RETURN l_return_status;
2321: WHEN UTL_FILE.READ_ERROR THEN
2322: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
2323: UTL_FILE.FCLOSE_ALL;
2317: WHEN UTL_FILE.WRITE_ERROR THEN
2318: -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file);
2319: UTL_FILE.FCLOSE_ALL;
2320: RETURN l_return_status;
2321: WHEN UTL_FILE.READ_ERROR THEN
2322: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
2323: UTL_FILE.FCLOSE_ALL;
2324: RETURN l_return_status;
2325: WHEN UTL_FILE.INTERNAL_ERROR THEN
2319: UTL_FILE.FCLOSE_ALL;
2320: RETURN l_return_status;
2321: WHEN UTL_FILE.READ_ERROR THEN
2322: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
2323: UTL_FILE.FCLOSE_ALL;
2324: RETURN l_return_status;
2325: WHEN UTL_FILE.INTERNAL_ERROR THEN
2326: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
2327: UTL_FILE.FCLOSE_ALL;
2321: WHEN UTL_FILE.READ_ERROR THEN
2322: -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file);
2323: UTL_FILE.FCLOSE_ALL;
2324: RETURN l_return_status;
2325: WHEN UTL_FILE.INTERNAL_ERROR THEN
2326: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
2327: UTL_FILE.FCLOSE_ALL;
2328: RETURN l_return_status;
2329: WHEN OTHERS THEN
2323: UTL_FILE.FCLOSE_ALL;
2324: RETURN l_return_status;
2325: WHEN UTL_FILE.INTERNAL_ERROR THEN
2326: -- DBMS_OUTPUT.PUT_LINE('Internal Error');
2327: UTL_FILE.FCLOSE_ALL;
2328: RETURN l_return_status;
2329: WHEN OTHERS THEN
2330: -- DBMS_OUTPUT.PUT_LINE('Other Error');
2331: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2327: UTL_FILE.FCLOSE_ALL;
2328: RETURN l_return_status;
2329: WHEN OTHERS THEN
2330: -- DBMS_OUTPUT.PUT_LINE('Other Error');
2331: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2332: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2333: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2334: UTL_FILE.FCLOSE_ALL;
2335: l_return_status := 'U' ;
2328: RETURN l_return_status;
2329: WHEN OTHERS THEN
2330: -- DBMS_OUTPUT.PUT_LINE('Other Error');
2331: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2332: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2333: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2334: UTL_FILE.FCLOSE_ALL;
2335: l_return_status := 'U' ;
2336: RETURN l_return_status;
2329: WHEN OTHERS THEN
2330: -- DBMS_OUTPUT.PUT_LINE('Other Error');
2331: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2332: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2333: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2334: UTL_FILE.FCLOSE_ALL;
2335: l_return_status := 'U' ;
2336: RETURN l_return_status;
2337: END Get_ActualCost_Adjustment;
2330: -- DBMS_OUTPUT.PUT_LINE('Other Error');
2331: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2332: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2333: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2334: UTL_FILE.FCLOSE_ALL;
2335: l_return_status := 'U' ;
2336: RETURN l_return_status;
2337: END Get_ActualCost_Adjustment;
2338:
2445: l_data VARCHAR2(2000);
2446: alloc_rec GMF_ALLOCATIONDEFINITION_PUB.Allocation_Definition_Rec_Type;
2447: l_p_dir VARCHAR2(150);
2448: l_output_file VARCHAR2(120);
2449: l_outfile_handle UTL_FILE.FILE_TYPE;
2450: l_input_file VARCHAR2(120);
2451: l_infile_handle UTL_FILE.FILE_TYPE;
2452: l_line VARCHAR2(1800);
2453: l_delimiter VARCHAR(11);
2447: l_p_dir VARCHAR2(150);
2448: l_output_file VARCHAR2(120);
2449: l_outfile_handle UTL_FILE.FILE_TYPE;
2450: l_input_file VARCHAR2(120);
2451: l_infile_handle UTL_FILE.FILE_TYPE;
2452: l_line VARCHAR2(1800);
2453: l_delimiter VARCHAR(11);
2454: l_log_dir VARCHAR2(150);
2455: l_log_name VARCHAR2(120) :='gmf_api_cralloc_wrapper';
2452: l_line VARCHAR2(1800);
2453: l_delimiter VARCHAR(11);
2454: l_log_dir VARCHAR2(150);
2455: l_log_name VARCHAR2(120) :='gmf_api_cralloc_wrapper';
2456: l_log_handle UTL_FILE.FILE_TYPE;
2457: l_global_file VARCHAR2(120);
2458:
2459: l_session_id VARCHAR2(110);
2460:
2483:
2484:
2485: /* Open The Wrapper File For Output And The Input File for Input. */
2486:
2487: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
2488: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
2489:
2490: /* Loop thru flat file and call Inventory Quantities API */
2491: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2484:
2485: /* Open The Wrapper File For Output And The Input File for Input. */
2486:
2487: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
2488: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
2489:
2490: /* Loop thru flat file and call Inventory Quantities API */
2491: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2492: -- DBMS_OUTPUT.PUT_LINE('Input Directory ' || l_p_dir );
2495: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
2496:
2497:
2498: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
2499: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2500: UTL_FILE.NEW_LINE(l_log_handle);
2501: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2502: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2503: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2496:
2497:
2498: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
2499: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2500: UTL_FILE.NEW_LINE(l_log_handle);
2501: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2502: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2503: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2504: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2497:
2498: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
2499: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2500: UTL_FILE.NEW_LINE(l_log_handle);
2501: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2502: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2503: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2504: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2505:
2498: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
2499: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2500: UTL_FILE.NEW_LINE(l_log_handle);
2501: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2502: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2503: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2504: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2505:
2506: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
2499: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2500: UTL_FILE.NEW_LINE(l_log_handle);
2501: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2502: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2503: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2504: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2505:
2506: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
2507:
2500: UTL_FILE.NEW_LINE(l_log_handle);
2501: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2502: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2503: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2504: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2505:
2506: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
2507:
2508:
2502: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2503: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2504: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2505:
2506: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
2507:
2508:
2509: LOOP
2510: l_record_count :=l_record_count+1;
2509: LOOP
2510: l_record_count :=l_record_count+1;
2511:
2512: BEGIN
2513: UTL_FILE.GET_LINE(l_infile_handle, l_line);
2514: EXCEPTION
2515: WHEN NO_DATA_FOUND THEN
2516: EXIT;
2517: END;
2516: EXIT;
2517: END;
2518:
2519: BEGIN
2520: UTL_FILE.NEW_LINE(l_log_handle);
2521: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
2522:
2523: alloc_rec.alloc_id := Get_Field(l_line,l_delimiter,1) ;
2524: alloc_rec.alloc_code := Get_Field(l_line,l_delimiter,2) ;
2517: END;
2518:
2519: BEGIN
2520: UTL_FILE.NEW_LINE(l_log_handle);
2521: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
2522:
2523: alloc_rec.alloc_id := Get_Field(l_line,l_delimiter,1) ;
2524: alloc_rec.alloc_code := Get_Field(l_line,l_delimiter,2) ;
2525: alloc_rec.legal_entity_id := Get_Field(l_line,l_delimiter,3) ;
2540: alloc_rec.analysis_code := Get_Field(l_line,l_delimiter,18) ;
2541: alloc_rec.delete_mark := Get_Field(l_line,l_delimiter,19) ;
2542: alloc_rec.user_name := Get_Field(l_line,l_delimiter,20) ;
2543: /*
2544: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_id = ' || alloc_rec.alloc_id) ;
2545: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
2546: UTL_FILE.PUT_LINE(l_log_handle, 'co_code = ' || alloc_rec.co_code) ;
2547: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
2548: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2541: alloc_rec.delete_mark := Get_Field(l_line,l_delimiter,19) ;
2542: alloc_rec.user_name := Get_Field(l_line,l_delimiter,20) ;
2543: /*
2544: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_id = ' || alloc_rec.alloc_id) ;
2545: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
2546: UTL_FILE.PUT_LINE(l_log_handle, 'co_code = ' || alloc_rec.co_code) ;
2547: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
2548: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2549: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2542: alloc_rec.user_name := Get_Field(l_line,l_delimiter,20) ;
2543: /*
2544: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_id = ' || alloc_rec.alloc_id) ;
2545: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
2546: UTL_FILE.PUT_LINE(l_log_handle, 'co_code = ' || alloc_rec.co_code) ;
2547: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
2548: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2549: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2550: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || alloc_rec.item_no) ;
2543: /*
2544: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_id = ' || alloc_rec.alloc_id) ;
2545: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
2546: UTL_FILE.PUT_LINE(l_log_handle, 'co_code = ' || alloc_rec.co_code) ;
2547: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
2548: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2549: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2550: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || alloc_rec.item_no) ;
2551: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2544: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_id = ' || alloc_rec.alloc_id) ;
2545: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
2546: UTL_FILE.PUT_LINE(l_log_handle, 'co_code = ' || alloc_rec.co_code) ;
2547: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
2548: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2549: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2550: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || alloc_rec.item_no) ;
2551: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2552: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2545: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
2546: UTL_FILE.PUT_LINE(l_log_handle, 'co_code = ' || alloc_rec.co_code) ;
2547: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
2548: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2549: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2550: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || alloc_rec.item_no) ;
2551: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2552: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2553: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2546: UTL_FILE.PUT_LINE(l_log_handle, 'co_code = ' || alloc_rec.co_code) ;
2547: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
2548: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2549: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2550: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || alloc_rec.item_no) ;
2551: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2552: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2553: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2554: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2547: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
2548: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2549: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2550: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || alloc_rec.item_no) ;
2551: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2552: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2553: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2554: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2555: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2548: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2549: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2550: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || alloc_rec.item_no) ;
2551: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2552: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2553: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2554: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2555: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2556: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2549: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2550: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || alloc_rec.item_no) ;
2551: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2552: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2553: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2554: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2555: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2556: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2557: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
2550: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || alloc_rec.item_no) ;
2551: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2552: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2553: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2554: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2555: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2556: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2557: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
2558: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || alloc_rec.whse_code) ;
2551: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2552: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2553: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2554: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2555: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2556: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2557: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
2558: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || alloc_rec.whse_code) ;
2559: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
2552: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2553: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2554: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2555: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2556: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2557: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
2558: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || alloc_rec.whse_code) ;
2559: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
2560: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || alloc_rec.user_name) ;
2553: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2554: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2555: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2556: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2557: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
2558: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || alloc_rec.whse_code) ;
2559: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
2560: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || alloc_rec.user_name) ;
2561: */
2554: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2555: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2556: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2557: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
2558: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || alloc_rec.whse_code) ;
2559: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
2560: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || alloc_rec.user_name) ;
2561: */
2562: GMF_ALLOCATIONDEFINITION_PUB.Create_Allocation_Definition
2555: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2556: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2557: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
2558: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || alloc_rec.whse_code) ;
2559: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
2560: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || alloc_rec.user_name) ;
2561: */
2562: GMF_ALLOCATIONDEFINITION_PUB.Create_Allocation_Definition
2563: ( p_api_version => 3.0
2556: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2557: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
2558: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || alloc_rec.whse_code) ;
2559: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
2560: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || alloc_rec.user_name) ;
2561: */
2562: GMF_ALLOCATIONDEFINITION_PUB.Create_Allocation_Definition
2563: ( p_api_version => 3.0
2564: , p_init_msg_list => FND_API.G_TRUE
2570:
2571: , p_allocation_definition_rec => alloc_rec
2572: );
2573:
2574: UTL_FILE.PUT_LINE(l_log_handle, 'after API call. status := ' || l_status ||' cnt := ' || l_count );
2575: IF l_count > 0
2576: THEN
2577: l_loop_cnt :=1;
2578: LOOP
2585:
2586:
2587: -- DBMS_OUTPUT.PUT_LINE(l_data );
2588:
2589: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
2590: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
2591: UTL_FILE.NEW_LINE(l_outfile_handle);
2592:
2593: /*
2586:
2587: -- DBMS_OUTPUT.PUT_LINE(l_data );
2588:
2589: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
2590: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
2591: UTL_FILE.NEW_LINE(l_outfile_handle);
2592:
2593: /*
2594: IF l_status = 'E' OR
2587: -- DBMS_OUTPUT.PUT_LINE(l_data );
2588:
2589: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
2590: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
2591: UTL_FILE.NEW_LINE(l_outfile_handle);
2592:
2593: /*
2594: IF l_status = 'E' OR
2595: l_status = 'U'
2597: l_data := CONCAT('ERROR : ',l_data);
2598: END IF;
2599: */
2600:
2601: UTL_FILE.PUT_LINE(l_log_handle, l_data);
2602:
2603: /* Update error status */
2604: IF (l_status = 'U')
2605: THEN
2622: END IF;
2623:
2624: EXCEPTION
2625: WHEN OTHERS THEN
2626: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2627: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2628: l_return_status := 'U' ;
2629: END ;
2630:
2623:
2624: EXCEPTION
2625: WHEN OTHERS THEN
2626: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2627: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2628: l_return_status := 'U' ;
2629: END ;
2630:
2631: END LOOP;
2630:
2631: END LOOP;
2632:
2633: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2634: UTL_FILE.NEW_LINE(l_log_handle);
2635: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2636:
2637: /* Check if any messages generated. If so then decode and */
2638: /* output to error message flat file */
2631: END LOOP;
2632:
2633: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2634: UTL_FILE.NEW_LINE(l_log_handle);
2635: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2636:
2637: /* Check if any messages generated. If so then decode and */
2638: /* output to error message flat file */
2639:
2636:
2637: /* Check if any messages generated. If so then decode and */
2638: /* output to error message flat file */
2639:
2640: UTL_FILE.FCLOSE_ALL;
2641:
2642: RETURN l_return_status;
2643:
2644: EXCEPTION
2641:
2642: RETURN l_return_status;
2643:
2644: EXCEPTION
2645: WHEN UTL_FILE.INVALID_OPERATION THEN
2646: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
2647: UTL_FILE.FCLOSE_ALL;
2648: RETURN l_return_status;
2649:
2643:
2644: EXCEPTION
2645: WHEN UTL_FILE.INVALID_OPERATION THEN
2646: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
2647: UTL_FILE.FCLOSE_ALL;
2648: RETURN l_return_status;
2649:
2650: WHEN UTL_FILE.INVALID_PATH THEN
2651: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
2646: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
2647: UTL_FILE.FCLOSE_ALL;
2648: RETURN l_return_status;
2649:
2650: WHEN UTL_FILE.INVALID_PATH THEN
2651: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
2652: UTL_FILE.FCLOSE_ALL;
2653: RETURN l_return_status;
2654:
2648: RETURN l_return_status;
2649:
2650: WHEN UTL_FILE.INVALID_PATH THEN
2651: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
2652: UTL_FILE.FCLOSE_ALL;
2653: RETURN l_return_status;
2654:
2655: WHEN UTL_FILE.INVALID_MODE THEN
2656: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
2651: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
2652: UTL_FILE.FCLOSE_ALL;
2653: RETURN l_return_status;
2654:
2655: WHEN UTL_FILE.INVALID_MODE THEN
2656: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
2657: UTL_FILE.FCLOSE_ALL;
2658: RETURN l_return_status;
2659:
2653: RETURN l_return_status;
2654:
2655: WHEN UTL_FILE.INVALID_MODE THEN
2656: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
2657: UTL_FILE.FCLOSE_ALL;
2658: RETURN l_return_status;
2659:
2660: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
2661: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
2656: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
2657: UTL_FILE.FCLOSE_ALL;
2658: RETURN l_return_status;
2659:
2660: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
2661: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
2662: UTL_FILE.FCLOSE_ALL;
2663: RETURN l_return_status;
2664:
2658: RETURN l_return_status;
2659:
2660: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
2661: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
2662: UTL_FILE.FCLOSE_ALL;
2663: RETURN l_return_status;
2664:
2665: WHEN UTL_FILE.WRITE_ERROR THEN
2666: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
2661: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
2662: UTL_FILE.FCLOSE_ALL;
2663: RETURN l_return_status;
2664:
2665: WHEN UTL_FILE.WRITE_ERROR THEN
2666: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
2667: UTL_FILE.FCLOSE_ALL;
2668: RETURN l_return_status;
2669:
2663: RETURN l_return_status;
2664:
2665: WHEN UTL_FILE.WRITE_ERROR THEN
2666: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
2667: UTL_FILE.FCLOSE_ALL;
2668: RETURN l_return_status;
2669:
2670: WHEN UTL_FILE.READ_ERROR THEN
2671: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
2666: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
2667: UTL_FILE.FCLOSE_ALL;
2668: RETURN l_return_status;
2669:
2670: WHEN UTL_FILE.READ_ERROR THEN
2671: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
2672: UTL_FILE.FCLOSE_ALL;
2673: RETURN l_return_status;
2674:
2668: RETURN l_return_status;
2669:
2670: WHEN UTL_FILE.READ_ERROR THEN
2671: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
2672: UTL_FILE.FCLOSE_ALL;
2673: RETURN l_return_status;
2674:
2675: WHEN UTL_FILE.INTERNAL_ERROR THEN
2676: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
2671: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
2672: UTL_FILE.FCLOSE_ALL;
2673: RETURN l_return_status;
2674:
2675: WHEN UTL_FILE.INTERNAL_ERROR THEN
2676: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
2677: UTL_FILE.FCLOSE_ALL;
2678: RETURN l_return_status;
2679:
2673: RETURN l_return_status;
2674:
2675: WHEN UTL_FILE.INTERNAL_ERROR THEN
2676: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
2677: UTL_FILE.FCLOSE_ALL;
2678: RETURN l_return_status;
2679:
2680: WHEN OTHERS THEN
2681: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
2678: RETURN l_return_status;
2679:
2680: WHEN OTHERS THEN
2681: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
2682: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2683: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2684: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2685: UTL_FILE.FCLOSE_ALL;
2686: l_return_status := 'U' ;
2679:
2680: WHEN OTHERS THEN
2681: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
2682: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2683: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2684: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2685: UTL_FILE.FCLOSE_ALL;
2686: l_return_status := 'U' ;
2687: RETURN l_return_status;
2680: WHEN OTHERS THEN
2681: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
2682: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2683: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2684: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2685: UTL_FILE.FCLOSE_ALL;
2686: l_return_status := 'U' ;
2687: RETURN l_return_status;
2688:
2681: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
2682: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2683: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2684: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2685: UTL_FILE.FCLOSE_ALL;
2686: l_return_status := 'U' ;
2687: RETURN l_return_status;
2688:
2689: END Create_Alloc_Def;
2795: l_data VARCHAR2(2000);
2796: alloc_rec gmf_allocationdefinition_pub.Allocation_Definition_Rec_Type;
2797: l_p_dir VARCHAR2(150);
2798: l_output_file VARCHAR2(120);
2799: l_outfile_handle UTL_FILE.FILE_TYPE;
2800: l_input_file VARCHAR2(120);
2801: l_infile_handle UTL_FILE.FILE_TYPE;
2802: l_line VARCHAR2(1800);
2803: l_delimiter VARCHAR(11);
2797: l_p_dir VARCHAR2(150);
2798: l_output_file VARCHAR2(120);
2799: l_outfile_handle UTL_FILE.FILE_TYPE;
2800: l_input_file VARCHAR2(120);
2801: l_infile_handle UTL_FILE.FILE_TYPE;
2802: l_line VARCHAR2(1800);
2803: l_delimiter VARCHAR(11);
2804: l_log_dir VARCHAR2(150);
2805: l_log_name VARCHAR2(120) :='gmf_api_updalloc_wrapper';
2802: l_line VARCHAR2(1800);
2803: l_delimiter VARCHAR(11);
2804: l_log_dir VARCHAR2(150);
2805: l_log_name VARCHAR2(120) :='gmf_api_updalloc_wrapper';
2806: l_log_handle UTL_FILE.FILE_TYPE;
2807: l_global_file VARCHAR2(120);
2808:
2809: l_session_id VARCHAR2(110);
2810:
2833:
2834:
2835: /* Open The Wrapper File For Output And The Input File for Input. */
2836:
2837: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
2838: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
2839:
2840: /* Loop thru flat file and call Inventory Quantities API */
2841: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2834:
2835: /* Open The Wrapper File For Output And The Input File for Input. */
2836:
2837: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
2838: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
2839:
2840: /* Loop thru flat file and call Inventory Quantities API */
2841: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2842: -- DBMS_OUTPUT.PUT_LINE('Input Directory ' || l_p_dir );
2845: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
2846:
2847:
2848: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
2849: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2850: UTL_FILE.NEW_LINE(l_log_handle);
2851: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2852: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2853: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2846:
2847:
2848: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
2849: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2850: UTL_FILE.NEW_LINE(l_log_handle);
2851: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2852: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2853: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2854: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2847:
2848: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
2849: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2850: UTL_FILE.NEW_LINE(l_log_handle);
2851: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2852: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2853: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2854: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2855:
2848: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
2849: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2850: UTL_FILE.NEW_LINE(l_log_handle);
2851: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2852: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2853: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2854: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2855:
2856: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
2849: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2850: UTL_FILE.NEW_LINE(l_log_handle);
2851: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2852: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2853: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2854: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2855:
2856: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
2857:
2850: UTL_FILE.NEW_LINE(l_log_handle);
2851: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
2852: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2853: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2854: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2855:
2856: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
2857:
2858:
2852: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
2853: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
2854: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
2855:
2856: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
2857:
2858:
2859: LOOP
2860: l_record_count :=l_record_count+1;
2859: LOOP
2860: l_record_count :=l_record_count+1;
2861:
2862: BEGIN
2863: UTL_FILE.GET_LINE(l_infile_handle, l_line);
2864: EXCEPTION
2865: WHEN NO_DATA_FOUND THEN
2866: EXIT;
2867: END;
2866: EXIT;
2867: END;
2868:
2869: BEGIN
2870: UTL_FILE.NEW_LINE(l_log_handle);
2871: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
2872:
2873: alloc_rec.alloc_id := Get_Field(l_line,l_delimiter,1) ;
2874: alloc_rec.alloc_code := Get_Field(l_line,l_delimiter,2) ;
2867: END;
2868:
2869: BEGIN
2870: UTL_FILE.NEW_LINE(l_log_handle);
2871: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
2872:
2873: alloc_rec.alloc_id := Get_Field(l_line,l_delimiter,1) ;
2874: alloc_rec.alloc_code := Get_Field(l_line,l_delimiter,2) ;
2875: alloc_rec.legal_entity_id := Get_Field(l_line,l_delimiter,3) ;
2890: alloc_rec.analysis_code := Get_Field(l_line,l_delimiter,18) ;
2891: alloc_rec.delete_mark := Get_Field(l_line,l_delimiter,19) ;
2892: alloc_rec.user_name := Get_Field(l_line,l_delimiter,20) ;
2893:
2894: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_id = ' || alloc_rec.alloc_id) ;
2895: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
2896: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id = ' || alloc_rec.legal_entity_id) ;
2897: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
2898: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2891: alloc_rec.delete_mark := Get_Field(l_line,l_delimiter,19) ;
2892: alloc_rec.user_name := Get_Field(l_line,l_delimiter,20) ;
2893:
2894: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_id = ' || alloc_rec.alloc_id) ;
2895: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
2896: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id = ' || alloc_rec.legal_entity_id) ;
2897: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
2898: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2899: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2892: alloc_rec.user_name := Get_Field(l_line,l_delimiter,20) ;
2893:
2894: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_id = ' || alloc_rec.alloc_id) ;
2895: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
2896: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id = ' || alloc_rec.legal_entity_id) ;
2897: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
2898: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2899: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2900: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
2893:
2894: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_id = ' || alloc_rec.alloc_id) ;
2895: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
2896: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id = ' || alloc_rec.legal_entity_id) ;
2897: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
2898: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2899: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2900: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
2901: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2894: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_id = ' || alloc_rec.alloc_id) ;
2895: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
2896: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id = ' || alloc_rec.legal_entity_id) ;
2897: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
2898: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2899: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2900: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
2901: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2902: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2895: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
2896: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id = ' || alloc_rec.legal_entity_id) ;
2897: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
2898: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2899: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2900: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
2901: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2902: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2903: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2896: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id = ' || alloc_rec.legal_entity_id) ;
2897: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
2898: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2899: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2900: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
2901: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2902: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2903: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2904: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
2897: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
2898: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2899: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2900: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
2901: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2902: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2903: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2904: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
2905: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2898: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
2899: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2900: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
2901: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2902: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2903: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2904: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
2905: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2906: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2899: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
2900: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
2901: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2902: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2903: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2904: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
2905: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2906: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2907: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2900: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
2901: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2902: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2903: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2904: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
2905: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2906: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2907: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2908: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
2901: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
2902: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2903: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2904: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
2905: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2906: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2907: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2908: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
2909: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || alloc_rec.organization_id) ;
2902: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
2903: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2904: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
2905: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2906: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2907: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2908: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
2909: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || alloc_rec.organization_id) ;
2910: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || alloc_rec.organization_code) ;
2903: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
2904: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
2905: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2906: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2907: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2908: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
2909: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || alloc_rec.organization_id) ;
2910: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || alloc_rec.organization_code) ;
2911: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
2904: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
2905: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2906: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2907: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2908: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
2909: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || alloc_rec.organization_id) ;
2910: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || alloc_rec.organization_code) ;
2911: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
2912: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || alloc_rec.user_name) ;
2905: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
2906: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2907: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2908: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
2909: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || alloc_rec.organization_id) ;
2910: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || alloc_rec.organization_code) ;
2911: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
2912: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || alloc_rec.user_name) ;
2913:
2906: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
2907: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2908: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
2909: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || alloc_rec.organization_id) ;
2910: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || alloc_rec.organization_code) ;
2911: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
2912: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || alloc_rec.user_name) ;
2913:
2914: -- DBMS_OUTPUT.PUT_LINE('before calling Update API...');
2907: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
2908: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
2909: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || alloc_rec.organization_id) ;
2910: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || alloc_rec.organization_code) ;
2911: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
2912: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || alloc_rec.user_name) ;
2913:
2914: -- DBMS_OUTPUT.PUT_LINE('before calling Update API...');
2915: GMF_ALLOCATIONDEFINITION_PUB.Update_Allocation_Definition
2908: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
2909: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || alloc_rec.organization_id) ;
2910: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || alloc_rec.organization_code) ;
2911: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
2912: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || alloc_rec.user_name) ;
2913:
2914: -- DBMS_OUTPUT.PUT_LINE('before calling Update API...');
2915: GMF_ALLOCATIONDEFINITION_PUB.Update_Allocation_Definition
2916: ( p_api_version => 3.0
2923:
2924: , p_allocation_definition_rec => alloc_rec
2925: );
2926:
2927: UTL_FILE.PUT_LINE(l_log_handle, 'after API call. status := ' || l_status ||' cnt := ' || l_count );
2928: IF l_count > 0
2929: THEN
2930: l_loop_cnt :=1;
2931: LOOP
2938:
2939:
2940: -- DBMS_OUTPUT.PUT_LINE(l_data );
2941:
2942: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
2943: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
2944: UTL_FILE.NEW_LINE(l_outfile_handle);
2945:
2946:
2939:
2940: -- DBMS_OUTPUT.PUT_LINE(l_data );
2941:
2942: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
2943: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
2944: UTL_FILE.NEW_LINE(l_outfile_handle);
2945:
2946:
2947: /*
2940: -- DBMS_OUTPUT.PUT_LINE(l_data );
2941:
2942: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
2943: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
2944: UTL_FILE.NEW_LINE(l_outfile_handle);
2945:
2946:
2947: /*
2948: IF l_status = 'E' OR
2951: l_data := CONCAT('ERROR : ',l_data);
2952: END IF;
2953: */
2954:
2955: UTL_FILE.PUT_LINE(l_log_handle, l_data);
2956:
2957: /* Update error status */
2958: IF (l_status = 'U')
2959: THEN
2976: END IF;
2977:
2978: EXCEPTION
2979: WHEN OTHERS THEN
2980: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2981: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2982: l_return_status := 'U' ;
2983: END ;
2984:
2977:
2978: EXCEPTION
2979: WHEN OTHERS THEN
2980: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2981: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
2982: l_return_status := 'U' ;
2983: END ;
2984:
2985: END LOOP;
2983: END ;
2984:
2985: END LOOP;
2986: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2987: UTL_FILE.NEW_LINE(l_log_handle);
2988: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2989:
2990: /* Check if any messages generated. If so then decode and */
2991: /* output to error message flat file */
2984:
2985: END LOOP;
2986: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2987: UTL_FILE.NEW_LINE(l_log_handle);
2988: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
2989:
2990: /* Check if any messages generated. If so then decode and */
2991: /* output to error message flat file */
2992:
2989:
2990: /* Check if any messages generated. If so then decode and */
2991: /* output to error message flat file */
2992:
2993: UTL_FILE.FCLOSE_ALL;
2994:
2995: RETURN l_return_status;
2996:
2997: EXCEPTION
2994:
2995: RETURN l_return_status;
2996:
2997: EXCEPTION
2998: WHEN UTL_FILE.INVALID_OPERATION THEN
2999: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
3000: UTL_FILE.FCLOSE_ALL;
3001: RETURN l_return_status;
3002:
2996:
2997: EXCEPTION
2998: WHEN UTL_FILE.INVALID_OPERATION THEN
2999: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
3000: UTL_FILE.FCLOSE_ALL;
3001: RETURN l_return_status;
3002:
3003: WHEN UTL_FILE.INVALID_PATH THEN
3004: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
2999: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
3000: UTL_FILE.FCLOSE_ALL;
3001: RETURN l_return_status;
3002:
3003: WHEN UTL_FILE.INVALID_PATH THEN
3004: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
3005: UTL_FILE.FCLOSE_ALL;
3006: RETURN l_return_status;
3007:
3001: RETURN l_return_status;
3002:
3003: WHEN UTL_FILE.INVALID_PATH THEN
3004: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
3005: UTL_FILE.FCLOSE_ALL;
3006: RETURN l_return_status;
3007:
3008: WHEN UTL_FILE.INVALID_MODE THEN
3009: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
3004: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
3005: UTL_FILE.FCLOSE_ALL;
3006: RETURN l_return_status;
3007:
3008: WHEN UTL_FILE.INVALID_MODE THEN
3009: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
3010: UTL_FILE.FCLOSE_ALL;
3011: RETURN l_return_status;
3012:
3006: RETURN l_return_status;
3007:
3008: WHEN UTL_FILE.INVALID_MODE THEN
3009: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
3010: UTL_FILE.FCLOSE_ALL;
3011: RETURN l_return_status;
3012:
3013: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
3014: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
3009: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
3010: UTL_FILE.FCLOSE_ALL;
3011: RETURN l_return_status;
3012:
3013: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
3014: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
3015: UTL_FILE.FCLOSE_ALL;
3016: RETURN l_return_status;
3017:
3011: RETURN l_return_status;
3012:
3013: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
3014: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
3015: UTL_FILE.FCLOSE_ALL;
3016: RETURN l_return_status;
3017:
3018: WHEN UTL_FILE.WRITE_ERROR THEN
3019: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
3014: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
3015: UTL_FILE.FCLOSE_ALL;
3016: RETURN l_return_status;
3017:
3018: WHEN UTL_FILE.WRITE_ERROR THEN
3019: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
3020: UTL_FILE.FCLOSE_ALL;
3021: RETURN l_return_status;
3022:
3016: RETURN l_return_status;
3017:
3018: WHEN UTL_FILE.WRITE_ERROR THEN
3019: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
3020: UTL_FILE.FCLOSE_ALL;
3021: RETURN l_return_status;
3022:
3023: WHEN UTL_FILE.READ_ERROR THEN
3024: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
3019: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
3020: UTL_FILE.FCLOSE_ALL;
3021: RETURN l_return_status;
3022:
3023: WHEN UTL_FILE.READ_ERROR THEN
3024: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
3025: UTL_FILE.FCLOSE_ALL;
3026: RETURN l_return_status;
3027:
3021: RETURN l_return_status;
3022:
3023: WHEN UTL_FILE.READ_ERROR THEN
3024: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
3025: UTL_FILE.FCLOSE_ALL;
3026: RETURN l_return_status;
3027:
3028: WHEN UTL_FILE.INTERNAL_ERROR THEN
3029: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
3024: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
3025: UTL_FILE.FCLOSE_ALL;
3026: RETURN l_return_status;
3027:
3028: WHEN UTL_FILE.INTERNAL_ERROR THEN
3029: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
3030: UTL_FILE.FCLOSE_ALL;
3031: RETURN l_return_status;
3032:
3026: RETURN l_return_status;
3027:
3028: WHEN UTL_FILE.INTERNAL_ERROR THEN
3029: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
3030: UTL_FILE.FCLOSE_ALL;
3031: RETURN l_return_status;
3032:
3033: WHEN OTHERS THEN
3034: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
3031: RETURN l_return_status;
3032:
3033: WHEN OTHERS THEN
3034: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
3035: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3036: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3037: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3038: UTL_FILE.FCLOSE_ALL;
3039: l_return_status := 'U' ;
3032:
3033: WHEN OTHERS THEN
3034: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
3035: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3036: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3037: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3038: UTL_FILE.FCLOSE_ALL;
3039: l_return_status := 'U' ;
3040: RETURN l_return_status;
3033: WHEN OTHERS THEN
3034: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
3035: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3036: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3037: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3038: UTL_FILE.FCLOSE_ALL;
3039: l_return_status := 'U' ;
3040: RETURN l_return_status;
3041:
3034: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
3035: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3036: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3037: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3038: UTL_FILE.FCLOSE_ALL;
3039: l_return_status := 'U' ;
3040: RETURN l_return_status;
3041:
3042: END Update_Alloc_Def;
3148: l_data VARCHAR2(2000);
3149: alloc_rec gmf_allocationdefinition_pub.Allocation_Definition_Rec_Type;
3150: l_p_dir VARCHAR2(150);
3151: l_output_file VARCHAR2(120);
3152: l_outfile_handle UTL_FILE.FILE_TYPE;
3153: l_input_file VARCHAR2(120);
3154: l_infile_handle UTL_FILE.FILE_TYPE;
3155: l_line VARCHAR2(1800);
3156: l_delimiter VARCHAR(11);
3150: l_p_dir VARCHAR2(150);
3151: l_output_file VARCHAR2(120);
3152: l_outfile_handle UTL_FILE.FILE_TYPE;
3153: l_input_file VARCHAR2(120);
3154: l_infile_handle UTL_FILE.FILE_TYPE;
3155: l_line VARCHAR2(1800);
3156: l_delimiter VARCHAR(11);
3157: l_log_dir VARCHAR2(150);
3158: l_log_name VARCHAR2(120) :='gmf_api_delalloc_wrapper';
3155: l_line VARCHAR2(1800);
3156: l_delimiter VARCHAR(11);
3157: l_log_dir VARCHAR2(150);
3158: l_log_name VARCHAR2(120) :='gmf_api_delalloc_wrapper';
3159: l_log_handle UTL_FILE.FILE_TYPE;
3160: l_global_file VARCHAR2(120);
3161:
3162: l_session_id VARCHAR2(110);
3163:
3186:
3187:
3188: /* Open The Wrapper File For Output And The Input File for Input. */
3189:
3190: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
3191: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
3192:
3193: /* Loop thru flat file and call Inventory Quantities API */
3194: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3187:
3188: /* Open The Wrapper File For Output And The Input File for Input. */
3189:
3190: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
3191: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
3192:
3193: /* Loop thru flat file and call Inventory Quantities API */
3194: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3195: -- DBMS_OUTPUT.PUT_LINE('Input Directory ' || l_p_dir );
3198: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
3199:
3200:
3201: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
3202: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3203: UTL_FILE.NEW_LINE(l_log_handle);
3204: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
3205: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
3206: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
3199:
3200:
3201: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
3202: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3203: UTL_FILE.NEW_LINE(l_log_handle);
3204: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
3205: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
3206: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
3207: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
3200:
3201: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
3202: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3203: UTL_FILE.NEW_LINE(l_log_handle);
3204: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
3205: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
3206: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
3207: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
3208:
3201: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
3202: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3203: UTL_FILE.NEW_LINE(l_log_handle);
3204: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
3205: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
3206: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
3207: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
3208:
3209: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
3202: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3203: UTL_FILE.NEW_LINE(l_log_handle);
3204: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
3205: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
3206: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
3207: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
3208:
3209: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
3210:
3203: UTL_FILE.NEW_LINE(l_log_handle);
3204: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
3205: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
3206: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
3207: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
3208:
3209: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
3210:
3211:
3205: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
3206: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
3207: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
3208:
3209: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
3210:
3211:
3212: LOOP
3213: l_record_count :=l_record_count+1;
3212: LOOP
3213: l_record_count :=l_record_count+1;
3214:
3215: BEGIN
3216: UTL_FILE.GET_LINE(l_infile_handle, l_line);
3217: EXCEPTION
3218: WHEN NO_DATA_FOUND THEN
3219: EXIT;
3220: END;
3219: EXIT;
3220: END;
3221:
3222: BEGIN
3223: UTL_FILE.NEW_LINE(l_log_handle);
3224: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
3225:
3226: alloc_rec.alloc_id := Get_Field(l_line,l_delimiter,1) ;
3227: alloc_rec.alloc_code := Get_Field(l_line,l_delimiter,2) ;
3220: END;
3221:
3222: BEGIN
3223: UTL_FILE.NEW_LINE(l_log_handle);
3224: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
3225:
3226: alloc_rec.alloc_id := Get_Field(l_line,l_delimiter,1) ;
3227: alloc_rec.alloc_code := Get_Field(l_line,l_delimiter,2) ;
3228: alloc_rec.legal_entity_id := Get_Field(l_line,l_delimiter,3) ;
3243: alloc_rec.analysis_code := Get_Field(l_line,l_delimiter,18) ;
3244: alloc_rec.delete_mark := Get_Field(l_line,l_delimiter,19) ;
3245: alloc_rec.user_name := Get_Field(l_line,l_delimiter,20) ;
3246:
3247: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_id = ' || alloc_rec.alloc_id) ;
3248: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
3249: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id = ' || alloc_rec.legal_entity_id) ;
3250: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
3251: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
3244: alloc_rec.delete_mark := Get_Field(l_line,l_delimiter,19) ;
3245: alloc_rec.user_name := Get_Field(l_line,l_delimiter,20) ;
3246:
3247: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_id = ' || alloc_rec.alloc_id) ;
3248: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
3249: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id = ' || alloc_rec.legal_entity_id) ;
3250: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
3251: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
3252: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
3245: alloc_rec.user_name := Get_Field(l_line,l_delimiter,20) ;
3246:
3247: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_id = ' || alloc_rec.alloc_id) ;
3248: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
3249: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id = ' || alloc_rec.legal_entity_id) ;
3250: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
3251: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
3252: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
3253: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
3246:
3247: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_id = ' || alloc_rec.alloc_id) ;
3248: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
3249: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id = ' || alloc_rec.legal_entity_id) ;
3250: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
3251: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
3252: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
3253: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
3254: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
3247: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_id = ' || alloc_rec.alloc_id) ;
3248: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
3249: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id = ' || alloc_rec.legal_entity_id) ;
3250: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
3251: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
3252: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
3253: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
3254: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
3255: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
3248: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_code = ' || alloc_rec.alloc_code) ;
3249: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id = ' || alloc_rec.legal_entity_id) ;
3250: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
3251: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
3252: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
3253: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
3254: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
3255: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
3256: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
3249: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id = ' || alloc_rec.legal_entity_id) ;
3250: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
3251: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
3252: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
3253: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
3254: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
3255: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
3256: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
3257: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
3250: UTL_FILE.PUT_LINE(l_log_handle, 'alloc_method = ' || alloc_rec.alloc_method) ;
3251: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
3252: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
3253: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
3254: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
3255: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
3256: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
3257: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
3258: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
3251: UTL_FILE.PUT_LINE(l_log_handle, 'line_no = ' || alloc_rec.line_no) ;
3252: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
3253: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
3254: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
3255: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
3256: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
3257: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
3258: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
3259: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
3252: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || alloc_rec.item_id) ;
3253: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
3254: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
3255: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
3256: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
3257: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
3258: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
3259: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
3260: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
3253: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || alloc_rec.item_number) ;
3254: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
3255: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
3256: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
3257: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
3258: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
3259: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
3260: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
3261: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
3254: UTL_FILE.PUT_LINE(l_log_handle, 'basis_account_key = ' || alloc_rec.basis_account_key) ;
3255: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
3256: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
3257: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
3258: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
3259: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
3260: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
3261: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
3262: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || alloc_rec.organization_id) ;
3255: UTL_FILE.PUT_LINE(l_log_handle, 'balance_type = ' || alloc_rec.balance_type) ;
3256: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
3257: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
3258: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
3259: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
3260: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
3261: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
3262: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || alloc_rec.organization_id) ;
3263: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || alloc_rec.organization_code) ;
3256: UTL_FILE.PUT_LINE(l_log_handle, 'bas_ytd_ptd = ' || alloc_rec.bas_ytd_ptd) ;
3257: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
3258: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
3259: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
3260: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
3261: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
3262: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || alloc_rec.organization_id) ;
3263: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || alloc_rec.organization_code) ;
3264: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
3257: UTL_FILE.PUT_LINE(l_log_handle, 'basis_type = ' || alloc_rec.basis_type) ;
3258: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
3259: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
3260: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
3261: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
3262: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || alloc_rec.organization_id) ;
3263: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || alloc_rec.organization_code) ;
3264: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
3265: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || alloc_rec.user_name) ;
3258: UTL_FILE.PUT_LINE(l_log_handle, 'fixed_percent = ' || alloc_rec.fixed_percent) ;
3259: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
3260: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
3261: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
3262: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || alloc_rec.organization_id) ;
3263: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || alloc_rec.organization_code) ;
3264: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
3265: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || alloc_rec.user_name) ;
3266:
3259: UTL_FILE.PUT_LINE(l_log_handle, 'cmpntcls_id = ' || alloc_rec.cmpntcls_id) ;
3260: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
3261: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
3262: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || alloc_rec.organization_id) ;
3263: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || alloc_rec.organization_code) ;
3264: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
3265: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || alloc_rec.user_name) ;
3266:
3267: -- DBMS_OUTPUT.PUT_LINE('before calling Delete API...');
3260: UTL_FILE.PUT_LINE(l_log_handle, 'cost_cmpntcls_code = ' || alloc_rec.cost_cmpntcls_code) ;
3261: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
3262: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || alloc_rec.organization_id) ;
3263: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || alloc_rec.organization_code) ;
3264: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
3265: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || alloc_rec.user_name) ;
3266:
3267: -- DBMS_OUTPUT.PUT_LINE('before calling Delete API...');
3268: GMF_ALLOCATIONDEFINITION_PUB.Delete_Allocation_Definition
3261: UTL_FILE.PUT_LINE(l_log_handle, 'analysis_code = ' || alloc_rec.analysis_code) ;
3262: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || alloc_rec.organization_id) ;
3263: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || alloc_rec.organization_code) ;
3264: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || alloc_rec.delete_mark) ;
3265: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || alloc_rec.user_name) ;
3266:
3267: -- DBMS_OUTPUT.PUT_LINE('before calling Delete API...');
3268: GMF_ALLOCATIONDEFINITION_PUB.Delete_Allocation_Definition
3269: ( p_api_version => 3.0
3276:
3277: , p_allocation_definition_rec => alloc_rec
3278: );
3279:
3280: UTL_FILE.PUT_LINE(l_log_handle, 'after API call. status := ' || l_status ||' cnt := ' || l_count );
3281: IF l_count > 0
3282: THEN
3283: l_loop_cnt :=1;
3284: LOOP
3291:
3292:
3293: -- DBMS_OUTPUT.PUT_LINE(l_data );
3294:
3295: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
3296: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
3297: UTL_FILE.NEW_LINE(l_outfile_handle);
3298:
3299: UTL_FILE.PUT_LINE(l_log_handle, l_data);
3292:
3293: -- DBMS_OUTPUT.PUT_LINE(l_data );
3294:
3295: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
3296: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
3297: UTL_FILE.NEW_LINE(l_outfile_handle);
3298:
3299: UTL_FILE.PUT_LINE(l_log_handle, l_data);
3300:
3293: -- DBMS_OUTPUT.PUT_LINE(l_data );
3294:
3295: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
3296: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
3297: UTL_FILE.NEW_LINE(l_outfile_handle);
3298:
3299: UTL_FILE.PUT_LINE(l_log_handle, l_data);
3300:
3301: /* Update error status */
3295: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
3296: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
3297: UTL_FILE.NEW_LINE(l_outfile_handle);
3298:
3299: UTL_FILE.PUT_LINE(l_log_handle, l_data);
3300:
3301: /* Update error status */
3302: IF (l_status = 'U')
3303: THEN
3321:
3322: EXCEPTION
3323: WHEN OTHERS THEN
3324: -- DBMS_OUTPUT.PUT_LINE('Other Error...1');
3325: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3326: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3327: l_return_status := 'U' ;
3328: END ;
3329:
3322: EXCEPTION
3323: WHEN OTHERS THEN
3324: -- DBMS_OUTPUT.PUT_LINE('Other Error...1');
3325: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3326: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3327: l_return_status := 'U' ;
3328: END ;
3329:
3330: END LOOP;
3329:
3330: END LOOP;
3331:
3332: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3333: UTL_FILE.NEW_LINE(l_log_handle);
3334: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3335:
3336: /* Check if any messages generated. If so then decode and */
3337: /* output to error message flat file */
3330: END LOOP;
3331:
3332: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3333: UTL_FILE.NEW_LINE(l_log_handle);
3334: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3335:
3336: /* Check if any messages generated. If so then decode and */
3337: /* output to error message flat file */
3338:
3335:
3336: /* Check if any messages generated. If so then decode and */
3337: /* output to error message flat file */
3338:
3339: UTL_FILE.FCLOSE_ALL;
3340:
3341: RETURN l_return_status;
3342:
3343: EXCEPTION
3340:
3341: RETURN l_return_status;
3342:
3343: EXCEPTION
3344: WHEN UTL_FILE.INVALID_OPERATION THEN
3345: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
3346: UTL_FILE.FCLOSE_ALL;
3347: RETURN l_return_status;
3348:
3342:
3343: EXCEPTION
3344: WHEN UTL_FILE.INVALID_OPERATION THEN
3345: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
3346: UTL_FILE.FCLOSE_ALL;
3347: RETURN l_return_status;
3348:
3349: WHEN UTL_FILE.INVALID_PATH THEN
3350: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
3345: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
3346: UTL_FILE.FCLOSE_ALL;
3347: RETURN l_return_status;
3348:
3349: WHEN UTL_FILE.INVALID_PATH THEN
3350: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
3351: UTL_FILE.FCLOSE_ALL;
3352: RETURN l_return_status;
3353:
3347: RETURN l_return_status;
3348:
3349: WHEN UTL_FILE.INVALID_PATH THEN
3350: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
3351: UTL_FILE.FCLOSE_ALL;
3352: RETURN l_return_status;
3353:
3354: WHEN UTL_FILE.INVALID_MODE THEN
3355: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
3350: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
3351: UTL_FILE.FCLOSE_ALL;
3352: RETURN l_return_status;
3353:
3354: WHEN UTL_FILE.INVALID_MODE THEN
3355: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
3356: UTL_FILE.FCLOSE_ALL;
3357: RETURN l_return_status;
3358:
3352: RETURN l_return_status;
3353:
3354: WHEN UTL_FILE.INVALID_MODE THEN
3355: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
3356: UTL_FILE.FCLOSE_ALL;
3357: RETURN l_return_status;
3358:
3359: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
3360: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
3355: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
3356: UTL_FILE.FCLOSE_ALL;
3357: RETURN l_return_status;
3358:
3359: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
3360: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
3361: UTL_FILE.FCLOSE_ALL;
3362: RETURN l_return_status;
3363:
3357: RETURN l_return_status;
3358:
3359: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
3360: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
3361: UTL_FILE.FCLOSE_ALL;
3362: RETURN l_return_status;
3363:
3364: WHEN UTL_FILE.WRITE_ERROR THEN
3365: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
3360: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
3361: UTL_FILE.FCLOSE_ALL;
3362: RETURN l_return_status;
3363:
3364: WHEN UTL_FILE.WRITE_ERROR THEN
3365: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
3366: UTL_FILE.FCLOSE_ALL;
3367: RETURN l_return_status;
3368:
3362: RETURN l_return_status;
3363:
3364: WHEN UTL_FILE.WRITE_ERROR THEN
3365: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
3366: UTL_FILE.FCLOSE_ALL;
3367: RETURN l_return_status;
3368:
3369: WHEN UTL_FILE.READ_ERROR THEN
3370: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
3365: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
3366: UTL_FILE.FCLOSE_ALL;
3367: RETURN l_return_status;
3368:
3369: WHEN UTL_FILE.READ_ERROR THEN
3370: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
3371: UTL_FILE.FCLOSE_ALL;
3372: RETURN l_return_status;
3373:
3367: RETURN l_return_status;
3368:
3369: WHEN UTL_FILE.READ_ERROR THEN
3370: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
3371: UTL_FILE.FCLOSE_ALL;
3372: RETURN l_return_status;
3373:
3374: WHEN UTL_FILE.INTERNAL_ERROR THEN
3375: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
3370: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
3371: UTL_FILE.FCLOSE_ALL;
3372: RETURN l_return_status;
3373:
3374: WHEN UTL_FILE.INTERNAL_ERROR THEN
3375: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
3376: UTL_FILE.FCLOSE_ALL;
3377: RETURN l_return_status;
3378:
3372: RETURN l_return_status;
3373:
3374: WHEN UTL_FILE.INTERNAL_ERROR THEN
3375: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
3376: UTL_FILE.FCLOSE_ALL;
3377: RETURN l_return_status;
3378:
3379: WHEN OTHERS THEN
3380: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
3377: RETURN l_return_status;
3378:
3379: WHEN OTHERS THEN
3380: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
3381: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3382: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3383: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3384: UTL_FILE.FCLOSE_ALL;
3385: l_return_status := 'U' ;
3378:
3379: WHEN OTHERS THEN
3380: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
3381: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3382: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3383: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3384: UTL_FILE.FCLOSE_ALL;
3385: l_return_status := 'U' ;
3386: RETURN l_return_status;
3379: WHEN OTHERS THEN
3380: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
3381: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3382: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3383: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3384: UTL_FILE.FCLOSE_ALL;
3385: l_return_status := 'U' ;
3386: RETURN l_return_status;
3387:
3380: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
3381: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3382: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3383: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3384: UTL_FILE.FCLOSE_ALL;
3385: l_return_status := 'U' ;
3386: RETURN l_return_status;
3387:
3388: END Delete_Alloc_def;
3502: l_dtl_tbl GMF_LOTCOSTADJUSTMENT_PUB.Lc_Adjustment_Dtls_Tbl_Type;
3503:
3504: l_p_dir VARCHAR2(150);
3505: l_output_file VARCHAR2(120);
3506: l_outfile_handle UTL_FILE.FILE_TYPE;
3507: l_input_file VARCHAR2(120);
3508: l_infile_handle UTL_FILE.FILE_TYPE;
3509: l_line VARCHAR2(32767);
3510: l_delimiter VARCHAR(11);
3504: l_p_dir VARCHAR2(150);
3505: l_output_file VARCHAR2(120);
3506: l_outfile_handle UTL_FILE.FILE_TYPE;
3507: l_input_file VARCHAR2(120);
3508: l_infile_handle UTL_FILE.FILE_TYPE;
3509: l_line VARCHAR2(32767);
3510: l_delimiter VARCHAR(11);
3511: l_log_dir VARCHAR2(150);
3512: l_log_name VARCHAR2(120) ;--:='gmf_api_cric_wrapper';
3509: l_line VARCHAR2(32767);
3510: l_delimiter VARCHAR(11);
3511: l_log_dir VARCHAR2(150);
3512: l_log_name VARCHAR2(120) ;--:='gmf_api_cric_wrapper';
3513: l_log_handle UTL_FILE.FILE_TYPE;
3514: l_global_file VARCHAR2(120);
3515: l_idx NUMBER(10);
3516: l_idx1 NUMBER(10);
3517: l_type VARCHAR2(32767);
3552: /* Directory is now the same same as for the out file */
3553: l_log_dir := p_dir;
3554:
3555: /* Open The Wrapper File For Output And The Input File for Input. */
3556: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
3557: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
3558:
3559: /* Loop thru flat file and call Inventory Quantities API */
3560: /*
3553: l_log_dir := p_dir;
3554:
3555: /* Open The Wrapper File For Output And The Input File for Input. */
3556: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
3557: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
3558:
3559: /* Loop thru flat file and call Inventory Quantities API */
3560: /*
3561: DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3564: DBMS_OUTPUT.PUT_LINE('Delimiter ' || l_delimiter );
3565: DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
3566: */
3567:
3568: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3569: UTL_FILE.NEW_LINE(l_log_handle);
3570: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
3571: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
3572: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
3565: DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
3566: */
3567:
3568: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3569: UTL_FILE.NEW_LINE(l_log_handle);
3570: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
3571: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
3572: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
3573: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
3566: */
3567:
3568: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3569: UTL_FILE.NEW_LINE(l_log_handle);
3570: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
3571: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
3572: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
3573: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
3574:
3567:
3568: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3569: UTL_FILE.NEW_LINE(l_log_handle);
3570: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
3571: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
3572: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
3573: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
3574:
3575: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
3568: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3569: UTL_FILE.NEW_LINE(l_log_handle);
3570: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
3571: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
3572: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
3573: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
3574:
3575: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
3576:
3569: UTL_FILE.NEW_LINE(l_log_handle);
3570: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
3571: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
3572: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
3573: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
3574:
3575: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
3576:
3577:
3571: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
3572: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
3573: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
3574:
3575: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
3576:
3577:
3578: BEGIN
3579: <
3576:
3577:
3578: BEGIN
3579: <
3580: UTL_FILE.GET_LINE(l_infile_handle, l_line);
3581: l_type := Get_Field(l_line,l_delimiter,1) ; -- = 10 : header rec, 20 : detail record
3582: IF ( l_type <> '10' AND l_type <> '20' AND l_type IS NOT NULL) THEN
3583: GOTO TITLE_REPEAT;
3584: END IF;
3591: END;
3592:
3593: LOOP
3594: BEGIN
3595: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || to_char(l_record_count));
3596: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
3597:
3598: IF l_type = '10' THEN
3599:
3592:
3593: LOOP
3594: BEGIN
3595: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || to_char(l_record_count));
3596: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
3597:
3598: IF l_type = '10' THEN
3599:
3600: l_header_rec.adjustment_id := Get_Field(l_line,l_delimiter,2);
3657: l_skip_details := 'N' ;
3658: l_idx := 0 ;
3659:
3660: ELSIF l_type = '20' AND l_skip_details = 'Y' THEN
3661: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
3662: ELSIF l_type = '20' AND l_skip_details = 'N' THEN
3663:
3664: l_idx := l_idx + 1 ;
3665: l_dtl_tbl(l_idx).adjustment_dtl_id := Get_Field(l_line,l_delimiter,2);
3672: BEGIN
3673: l_dtl_tbl(l_idx).adjustment_cost := Get_Field(l_line,l_delimiter,7);
3674: EXCEPTION
3675: WHEN VALUE_ERROR THEN
3676: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : Invalid Adjustment Cost Specified');
3677: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Invalid Adjustment Cost Specified');
3678: END;
3679: -- Bug # 3755374 ANTHIYAG 12-Jul-2004 End
3680:
3673: l_dtl_tbl(l_idx).adjustment_cost := Get_Field(l_line,l_delimiter,7);
3674: EXCEPTION
3675: WHEN VALUE_ERROR THEN
3676: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : Invalid Adjustment Cost Specified');
3677: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Invalid Adjustment Cost Specified');
3678: END;
3679: -- Bug # 3755374 ANTHIYAG 12-Jul-2004 End
3680:
3681: -- Bug # 3778177 ANTHIYAG 20-Jul-2004 Start
3688:
3689: EXCEPTION
3690:
3691: WHEN OTHERS THEN
3692: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3693: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3694: IF l_type = '10' THEN
3695: l_skip_details := 'Y' ;
3696: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skip detail records.');
3689: EXCEPTION
3690:
3691: WHEN OTHERS THEN
3692: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3693: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3694: IF l_type = '10' THEN
3695: l_skip_details := 'Y' ;
3696: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skip detail records.');
3697: ELSIF l_type = '20' THEN
3692: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3693: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3694: IF l_type = '10' THEN
3695: l_skip_details := 'Y' ;
3696: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skip detail records.');
3697: ELSIF l_type = '20' THEN
3698: l_dtl_tbl.DELETE(l_idx);
3699: l_idx := l_idx-1;
3700: END IF ;
3702:
3703: BEGIN
3704:
3705: <
3706: UTL_FILE.GET_LINE(l_infile_handle, l_line);
3707: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : Header Record, 20 : Detail Record
3708: IF ( l_type <> '10' AND l_type <> '20' AND l_type IS NOT NULL) THEN
3709: GOTO TITLE_REPEAT1;
3710: END IF;
3708: IF ( l_type <> '10' AND l_type <> '20' AND l_type IS NOT NULL) THEN
3709: GOTO TITLE_REPEAT1;
3710: END IF;
3711: l_record_count :=l_record_count+1;
3712: UTL_FILE.NEW_LINE(l_log_handle);
3713:
3714: EXCEPTION
3715: WHEN NO_DATA_FOUND THEN
3716: IF l_skip_details = 'N' THEN
3713:
3714: EXCEPTION
3715: WHEN NO_DATA_FOUND THEN
3716: IF l_skip_details = 'N' THEN
3717: UTL_FILE.PUT_LINE(l_log_handle,'Final Call to Call_LotCost_API...');
3718:
3719: /* Call the Call Lot Cost API function */
3720: Call_LotCost_API
3721: (
3726: , x_count => l_count
3727: , x_data => l_data
3728: ) ;
3729:
3730: UTL_FILE.PUT_LINE(l_log_handle,'Final After call to Create_LotCost_Adjustment API.status := ' || l_status ||' cnt := ' || l_count );
3731: END IF;
3732: l_continue := 'N' ;
3733: GOTO GET_MSG_STACK ;
3734: END;
3733: GOTO GET_MSG_STACK ;
3734: END;
3735:
3736: IF (l_type = '10' AND l_record_count <> 1 AND l_skip_details = 'N') THEN
3737: UTL_FILE.PUT_LINE(l_log_handle,'Call to Create_LotCost_Adjustment API...');
3738:
3739: /* Call the Call Lot Cost API function */ --to change
3740: Call_LotCost_API
3741: (
3746: , x_count => l_count
3747: , x_data => l_data
3748: ) ;
3749:
3750: UTL_FILE.PUT_LINE(l_log_handle,' After call to Create_LotCost_Adjustment API.status := ' || l_status ||' cnt := ' || l_count );
3751: END IF;
3752:
3753: <
3754: null;
3765: p_data => l_data,
3766: p_encoded => FND_API.G_FALSE,
3767: p_msg_index_out => l_dummy_cnt);
3768:
3769: UTL_FILE.PUT_LINE(l_log_handle, l_data);
3770:
3771: /* Update error status */
3772: IF (l_status = 'U') THEN
3773: l_return_status :=l_status;
3793:
3794: END LOOP;
3795:
3796: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3797: UTL_FILE.NEW_LINE(l_log_handle);
3798: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3799: UTL_FILE.FCLOSE_ALL;
3800:
3801: RETURN l_return_status;
3794: END LOOP;
3795:
3796: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3797: UTL_FILE.NEW_LINE(l_log_handle);
3798: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3799: UTL_FILE.FCLOSE_ALL;
3800:
3801: RETURN l_return_status;
3802:
3795:
3796: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3797: UTL_FILE.NEW_LINE(l_log_handle);
3798: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3799: UTL_FILE.FCLOSE_ALL;
3800:
3801: RETURN l_return_status;
3802:
3803: EXCEPTION
3800:
3801: RETURN l_return_status;
3802:
3803: EXCEPTION
3804: WHEN UTL_FILE.INVALID_OPERATION THEN
3805: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
3806: UTL_FILE.FCLOSE_ALL;
3807: RETURN l_return_status;
3808:
3802:
3803: EXCEPTION
3804: WHEN UTL_FILE.INVALID_OPERATION THEN
3805: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
3806: UTL_FILE.FCLOSE_ALL;
3807: RETURN l_return_status;
3808:
3809: WHEN UTL_FILE.INVALID_PATH THEN
3810: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
3805: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
3806: UTL_FILE.FCLOSE_ALL;
3807: RETURN l_return_status;
3808:
3809: WHEN UTL_FILE.INVALID_PATH THEN
3810: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
3811: UTL_FILE.FCLOSE_ALL;
3812: RETURN l_return_status;
3813:
3807: RETURN l_return_status;
3808:
3809: WHEN UTL_FILE.INVALID_PATH THEN
3810: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
3811: UTL_FILE.FCLOSE_ALL;
3812: RETURN l_return_status;
3813:
3814: WHEN UTL_FILE.INVALID_MODE THEN
3815: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
3810: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
3811: UTL_FILE.FCLOSE_ALL;
3812: RETURN l_return_status;
3813:
3814: WHEN UTL_FILE.INVALID_MODE THEN
3815: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
3816: UTL_FILE.FCLOSE_ALL;
3817: RETURN l_return_status;
3818:
3812: RETURN l_return_status;
3813:
3814: WHEN UTL_FILE.INVALID_MODE THEN
3815: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
3816: UTL_FILE.FCLOSE_ALL;
3817: RETURN l_return_status;
3818:
3819: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
3820: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
3815: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
3816: UTL_FILE.FCLOSE_ALL;
3817: RETURN l_return_status;
3818:
3819: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
3820: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
3821: UTL_FILE.FCLOSE_ALL;
3822: RETURN l_return_status;
3823:
3817: RETURN l_return_status;
3818:
3819: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
3820: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
3821: UTL_FILE.FCLOSE_ALL;
3822: RETURN l_return_status;
3823:
3824: WHEN UTL_FILE.WRITE_ERROR THEN
3825: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
3820: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
3821: UTL_FILE.FCLOSE_ALL;
3822: RETURN l_return_status;
3823:
3824: WHEN UTL_FILE.WRITE_ERROR THEN
3825: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
3826: UTL_FILE.FCLOSE_ALL;
3827: RETURN l_return_status;
3828:
3822: RETURN l_return_status;
3823:
3824: WHEN UTL_FILE.WRITE_ERROR THEN
3825: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
3826: UTL_FILE.FCLOSE_ALL;
3827: RETURN l_return_status;
3828:
3829: WHEN UTL_FILE.READ_ERROR THEN
3830: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
3825: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
3826: UTL_FILE.FCLOSE_ALL;
3827: RETURN l_return_status;
3828:
3829: WHEN UTL_FILE.READ_ERROR THEN
3830: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
3831: UTL_FILE.FCLOSE_ALL;
3832: RETURN l_return_status;
3833:
3827: RETURN l_return_status;
3828:
3829: WHEN UTL_FILE.READ_ERROR THEN
3830: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
3831: UTL_FILE.FCLOSE_ALL;
3832: RETURN l_return_status;
3833:
3834: WHEN UTL_FILE.INTERNAL_ERROR THEN
3835: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
3830: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
3831: UTL_FILE.FCLOSE_ALL;
3832: RETURN l_return_status;
3833:
3834: WHEN UTL_FILE.INTERNAL_ERROR THEN
3835: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
3836: UTL_FILE.FCLOSE_ALL;
3837: RETURN l_return_status;
3838:
3832: RETURN l_return_status;
3833:
3834: WHEN UTL_FILE.INTERNAL_ERROR THEN
3835: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
3836: UTL_FILE.FCLOSE_ALL;
3837: RETURN l_return_status;
3838:
3839: WHEN OTHERS THEN
3840: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
3837: RETURN l_return_status;
3838:
3839: WHEN OTHERS THEN
3840: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
3841: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3842: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3843: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3844: UTL_FILE.FCLOSE_ALL;
3845: l_return_status := 'U' ;
3838:
3839: WHEN OTHERS THEN
3840: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
3841: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3842: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3843: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3844: UTL_FILE.FCLOSE_ALL;
3845: l_return_status := 'U' ;
3846: RETURN l_return_status;
3839: WHEN OTHERS THEN
3840: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
3841: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3842: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3843: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3844: UTL_FILE.FCLOSE_ALL;
3845: l_return_status := 'U' ;
3846: RETURN l_return_status;
3847:
3840: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
3841: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3842: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
3843: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
3844: UTL_FILE.FCLOSE_ALL;
3845: l_return_status := 'U' ;
3846: RETURN l_return_status;
3847:
3848: END Process_LotCost_Adjustment;
3983: l_dtl_tbl GMF_LOTCOSTADJUSTMENT_PUB.Lc_Adjustment_Dtls_Tbl_Type;
3984:
3985: l_p_dir VARCHAR2(150);
3986: l_output_file VARCHAR2(120);
3987: l_outfile_handle UTL_FILE.FILE_TYPE;
3988: l_input_file VARCHAR2(120);
3989: l_infile_handle UTL_FILE.FILE_TYPE;
3990: l_line VARCHAR2(1000);
3991: l_delimiter VARCHAR(11);
3985: l_p_dir VARCHAR2(150);
3986: l_output_file VARCHAR2(120);
3987: l_outfile_handle UTL_FILE.FILE_TYPE;
3988: l_input_file VARCHAR2(120);
3989: l_infile_handle UTL_FILE.FILE_TYPE;
3990: l_line VARCHAR2(1000);
3991: l_delimiter VARCHAR(11);
3992: l_log_dir VARCHAR2(150);
3993: l_log_name VARCHAR2(120) :='gmf_api_getlotcost_wrapper';
3990: l_line VARCHAR2(1000);
3991: l_delimiter VARCHAR(11);
3992: l_log_dir VARCHAR2(150);
3993: l_log_name VARCHAR2(120) :='gmf_api_getlotcost_wrapper';
3994: l_log_handle UTL_FILE.FILE_TYPE;
3995: l_global_file VARCHAR2(120);
3996: l_idx NUMBER(10);
3997: l_idx1 NUMBER(10);
3998: l_type VARCHAR2(32767);
4026:
4027:
4028: /* Open The Wrapper File For Output And The Input File for Input. */
4029:
4030: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
4031: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
4032:
4033: /* Loop thru flat file and call Inventory Quantities API */
4034: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4027:
4028: /* Open The Wrapper File For Output And The Input File for Input. */
4029:
4030: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
4031: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
4032:
4033: /* Loop thru flat file and call Inventory Quantities API */
4034: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4035: -- DBMS_OUTPUT.PUT_LINE('Input Directory ' || l_p_dir );
4038: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
4039:
4040:
4041: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
4042: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4043: UTL_FILE.NEW_LINE(l_log_handle);
4044: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4045: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4046: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4039:
4040:
4041: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
4042: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4043: UTL_FILE.NEW_LINE(l_log_handle);
4044: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4045: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4046: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4047: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4040:
4041: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
4042: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4043: UTL_FILE.NEW_LINE(l_log_handle);
4044: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4045: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4046: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4047: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4048:
4041: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
4042: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4043: UTL_FILE.NEW_LINE(l_log_handle);
4044: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4045: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4046: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4047: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4048:
4049: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
4042: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4043: UTL_FILE.NEW_LINE(l_log_handle);
4044: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4045: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4046: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4047: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4048:
4049: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
4050:
4043: UTL_FILE.NEW_LINE(l_log_handle);
4044: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4045: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4046: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4047: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4048:
4049: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
4050:
4051:
4045: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4046: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4047: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4048:
4049: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
4050:
4051:
4052: LOOP
4053: BEGIN
4051:
4052: LOOP
4053: BEGIN
4054: <
4055: UTL_FILE.GET_LINE(l_infile_handle, l_line);
4056: l_type := Get_Field(l_line,l_delimiter,1) ; -- = 10 : header rec, 20 : detail record
4057: IF ( l_type <> '10' AND l_type IS NOT NULL) THEN
4058: GOTO TITLE_REPEAT;
4059: END IF;
4064: EXIT ;
4065: END;
4066:
4067: BEGIN
4068: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
4069: -- empty the tables
4070: l_dtl_tbl.delete ;
4071:
4072: l_header_rec.adjustment_id := Get_Field(l_line,l_delimiter,2);
4142:
4143: , p_dtl_tbl => l_dtl_tbl
4144: );
4145:
4146: UTL_FILE.PUT_LINE(l_log_handle, 'after API call. status := ' || l_status ||' cnt := ' || l_count );
4147:
4148:
4149: /* Check if any messages generated. If so then decode and */
4150: /* output to error message flat file */
4159: p_encoded => FND_API.G_FALSE,
4160: p_msg_index_out => l_dummy_cnt);
4161:
4162: ---- DBMS_OUTPUT.PUT_LINE(l_data );
4163: UTL_FILE.PUT_LINE(l_log_handle, l_data);
4164:
4165: /* Update error status */
4166: IF (l_status = 'U') THEN
4167: l_return_status :=l_status;
4180: l_count := 0 ;
4181:
4182: END IF; -- if count of msg stack > 0
4183:
4184: UTL_FILE.NEW_LINE(l_log_handle);
4185: FOR i in 1..l_dtl_tbl.count
4186: LOOP
4187: UTL_FILE.PUT_LINE(l_log_handle,
4188: ' Adjustment Dtl Id : ' || l_dtl_tbl(i).adjustment_dtl_id ||
4183:
4184: UTL_FILE.NEW_LINE(l_log_handle);
4185: FOR i in 1..l_dtl_tbl.count
4186: LOOP
4187: UTL_FILE.PUT_LINE(l_log_handle,
4188: ' Adjustment Dtl Id : ' || l_dtl_tbl(i).adjustment_dtl_id ||
4189: ' Adjustment Id : ' || l_dtl_tbl(i).adjustment_id ||
4190: ' Cost Cmpntcls Id : ' || l_dtl_tbl(i).cost_cmpntcls_id ||
4191: ' Cost Cmpntcls Code : ' || l_dtl_tbl(i).cost_cmpntcls_code ||
4194: ' Text Code : ' || l_dtl_tbl(i).text_code
4195: );
4196: END LOOP ;
4197: l_dtl_tbl.delete ;
4198: UTL_FILE.NEW_LINE(l_log_handle);
4199: UTL_FILE.NEW_LINE(l_log_handle);
4200:
4201: EXCEPTION
4202: WHEN OTHERS THEN
4195: );
4196: END LOOP ;
4197: l_dtl_tbl.delete ;
4198: UTL_FILE.NEW_LINE(l_log_handle);
4199: UTL_FILE.NEW_LINE(l_log_handle);
4200:
4201: EXCEPTION
4202: WHEN OTHERS THEN
4203: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4199: UTL_FILE.NEW_LINE(l_log_handle);
4200:
4201: EXCEPTION
4202: WHEN OTHERS THEN
4203: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4204: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4205: END ;
4206:
4207: END LOOP;
4200:
4201: EXCEPTION
4202: WHEN OTHERS THEN
4203: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4204: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4205: END ;
4206:
4207: END LOOP;
4208:
4206:
4207: END LOOP;
4208:
4209: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4210: UTL_FILE.NEW_LINE(l_log_handle);
4211: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4212: UTL_FILE.FCLOSE_ALL;
4213:
4214: RETURN l_return_status;
4207: END LOOP;
4208:
4209: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4210: UTL_FILE.NEW_LINE(l_log_handle);
4211: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4212: UTL_FILE.FCLOSE_ALL;
4213:
4214: RETURN l_return_status;
4215:
4208:
4209: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4210: UTL_FILE.NEW_LINE(l_log_handle);
4211: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4212: UTL_FILE.FCLOSE_ALL;
4213:
4214: RETURN l_return_status;
4215:
4216: EXCEPTION
4213:
4214: RETURN l_return_status;
4215:
4216: EXCEPTION
4217: WHEN UTL_FILE.INVALID_OPERATION THEN
4218: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
4219: UTL_FILE.FCLOSE_ALL;
4220: RETURN l_return_status;
4221:
4215:
4216: EXCEPTION
4217: WHEN UTL_FILE.INVALID_OPERATION THEN
4218: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
4219: UTL_FILE.FCLOSE_ALL;
4220: RETURN l_return_status;
4221:
4222: WHEN UTL_FILE.INVALID_PATH THEN
4223: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
4218: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
4219: UTL_FILE.FCLOSE_ALL;
4220: RETURN l_return_status;
4221:
4222: WHEN UTL_FILE.INVALID_PATH THEN
4223: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
4224: UTL_FILE.FCLOSE_ALL;
4225: RETURN l_return_status;
4226:
4220: RETURN l_return_status;
4221:
4222: WHEN UTL_FILE.INVALID_PATH THEN
4223: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
4224: UTL_FILE.FCLOSE_ALL;
4225: RETURN l_return_status;
4226:
4227: WHEN UTL_FILE.INVALID_MODE THEN
4228: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
4223: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
4224: UTL_FILE.FCLOSE_ALL;
4225: RETURN l_return_status;
4226:
4227: WHEN UTL_FILE.INVALID_MODE THEN
4228: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
4229: UTL_FILE.FCLOSE_ALL;
4230: RETURN l_return_status;
4231:
4225: RETURN l_return_status;
4226:
4227: WHEN UTL_FILE.INVALID_MODE THEN
4228: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
4229: UTL_FILE.FCLOSE_ALL;
4230: RETURN l_return_status;
4231:
4232: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
4233: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
4228: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
4229: UTL_FILE.FCLOSE_ALL;
4230: RETURN l_return_status;
4231:
4232: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
4233: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
4234: UTL_FILE.FCLOSE_ALL;
4235: RETURN l_return_status;
4236:
4230: RETURN l_return_status;
4231:
4232: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
4233: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
4234: UTL_FILE.FCLOSE_ALL;
4235: RETURN l_return_status;
4236:
4237: WHEN UTL_FILE.WRITE_ERROR THEN
4238: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
4233: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
4234: UTL_FILE.FCLOSE_ALL;
4235: RETURN l_return_status;
4236:
4237: WHEN UTL_FILE.WRITE_ERROR THEN
4238: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
4239: UTL_FILE.FCLOSE_ALL;
4240: RETURN l_return_status;
4241:
4235: RETURN l_return_status;
4236:
4237: WHEN UTL_FILE.WRITE_ERROR THEN
4238: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
4239: UTL_FILE.FCLOSE_ALL;
4240: RETURN l_return_status;
4241:
4242: WHEN UTL_FILE.READ_ERROR THEN
4243: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
4238: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
4239: UTL_FILE.FCLOSE_ALL;
4240: RETURN l_return_status;
4241:
4242: WHEN UTL_FILE.READ_ERROR THEN
4243: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
4244: UTL_FILE.FCLOSE_ALL;
4245: RETURN l_return_status;
4246:
4240: RETURN l_return_status;
4241:
4242: WHEN UTL_FILE.READ_ERROR THEN
4243: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
4244: UTL_FILE.FCLOSE_ALL;
4245: RETURN l_return_status;
4246:
4247: WHEN UTL_FILE.INTERNAL_ERROR THEN
4248: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
4243: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
4244: UTL_FILE.FCLOSE_ALL;
4245: RETURN l_return_status;
4246:
4247: WHEN UTL_FILE.INTERNAL_ERROR THEN
4248: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
4249: UTL_FILE.FCLOSE_ALL;
4250: RETURN l_return_status;
4251:
4245: RETURN l_return_status;
4246:
4247: WHEN UTL_FILE.INTERNAL_ERROR THEN
4248: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
4249: UTL_FILE.FCLOSE_ALL;
4250: RETURN l_return_status;
4251:
4252: WHEN OTHERS THEN
4253: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
4250: RETURN l_return_status;
4251:
4252: WHEN OTHERS THEN
4253: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
4254: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4255: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4256: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4257: UTL_FILE.FCLOSE_ALL;
4258: l_return_status := 'U' ;
4251:
4252: WHEN OTHERS THEN
4253: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
4254: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4255: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4256: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4257: UTL_FILE.FCLOSE_ALL;
4258: l_return_status := 'U' ;
4259: RETURN l_return_status;
4252: WHEN OTHERS THEN
4253: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
4254: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4255: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4256: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4257: UTL_FILE.FCLOSE_ALL;
4258: l_return_status := 'U' ;
4259: RETURN l_return_status;
4260:
4253: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
4254: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4255: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4256: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4257: UTL_FILE.FCLOSE_ALL;
4258: l_return_status := 'U' ;
4259: RETURN l_return_status;
4260:
4261: END Get_LotCost_Adjustment;
4341: l_dtl_tbl GMF_BurdenDetails_PUB.Burden_Dtl_Tbl_Type;
4342: l_burdenline_ids GMF_BurdenDetails_PUB.Burdenline_Ids_Tbl_Type;
4343: l_p_dir VARCHAR2(150);
4344: l_output_file VARCHAR2(120);
4345: l_outfile_handle UTL_FILE.FILE_TYPE;
4346: l_input_file VARCHAR2(120);
4347: l_infile_handle UTL_FILE.FILE_TYPE;
4348: l_line VARCHAR2(1000);
4349: l_delimiter VARCHAR(11);
4343: l_p_dir VARCHAR2(150);
4344: l_output_file VARCHAR2(120);
4345: l_outfile_handle UTL_FILE.FILE_TYPE;
4346: l_input_file VARCHAR2(120);
4347: l_infile_handle UTL_FILE.FILE_TYPE;
4348: l_line VARCHAR2(1000);
4349: l_delimiter VARCHAR(11);
4350: l_log_dir VARCHAR2(150);
4351: l_log_name VARCHAR2(120) ; -- :='gmf_api_cric_wrapper';
4348: l_line VARCHAR2(1000);
4349: l_delimiter VARCHAR(11);
4350: l_log_dir VARCHAR2(150);
4351: l_log_name VARCHAR2(120) ; -- :='gmf_api_cric_wrapper';
4352: l_log_handle UTL_FILE.FILE_TYPE;
4353: l_global_file VARCHAR2(120);
4354: l_idx NUMBER(10);
4355: l_idx1 NUMBER(10);
4356: l_type NUMBER(10);
4392:
4393:
4394: /* Open The Wrapper File For Output And The Input File for Input. */
4395:
4396: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
4397: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
4398:
4399: /* Loop thru flat file and call Inventory Quantities API */
4400: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4393:
4394: /* Open The Wrapper File For Output And The Input File for Input. */
4395:
4396: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
4397: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
4398:
4399: /* Loop thru flat file and call Inventory Quantities API */
4400: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4401: -- DBMS_OUTPUT.PUT_LINE('Input Directory ' || l_p_dir );
4403: -- DBMS_OUTPUT.PUT_LINE('Delimiter ' || l_delimiter );
4404: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
4405:
4406: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
4407: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4408: UTL_FILE.NEW_LINE(l_log_handle);
4409: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4410: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4411: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4404: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
4405:
4406: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
4407: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4408: UTL_FILE.NEW_LINE(l_log_handle);
4409: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4410: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4411: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4412: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4405:
4406: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
4407: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4408: UTL_FILE.NEW_LINE(l_log_handle);
4409: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4410: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4411: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4412: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4413:
4406: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
4407: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4408: UTL_FILE.NEW_LINE(l_log_handle);
4409: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4410: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4411: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4412: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4413:
4414: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
4407: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4408: UTL_FILE.NEW_LINE(l_log_handle);
4409: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4410: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4411: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4412: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4413:
4414: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
4415:
4408: UTL_FILE.NEW_LINE(l_log_handle);
4409: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4410: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4411: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4412: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4413:
4414: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
4415:
4416: --zzz
4410: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4411: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4412: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4413:
4414: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
4415:
4416: --zzz
4417: BEGIN
4418: UTL_FILE.GET_LINE(l_infile_handle, l_line);
4414: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
4415:
4416: --zzz
4417: BEGIN
4418: UTL_FILE.GET_LINE(l_infile_handle, l_line);
4419: l_record_count :=l_record_count+1;
4420: l_type := Get_Field(l_line,l_delimiter,1) ; -- = 10 : header rec, 20 : detail record
4421: --l_first_rec := 'Y' ;
4422: EXCEPTION
4426:
4427:
4428: LOOP
4429: BEGIN
4430: UTL_FILE.PUT_LINE(l_log_handle, '--');
4431: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
4432: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
4433: IF l_type = 10 THEN
4434: -- empty the tables
4427:
4428: LOOP
4429: BEGIN
4430: UTL_FILE.PUT_LINE(l_log_handle, '--');
4431: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
4432: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
4433: IF l_type = 10 THEN
4434: -- empty the tables
4435: l_dtl_tbl.delete ;
4428: LOOP
4429: BEGIN
4430: UTL_FILE.PUT_LINE(l_log_handle, '--');
4431: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
4432: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
4433: IF l_type = 10 THEN
4434: -- empty the tables
4435: l_dtl_tbl.delete ;
4436: l_skip_details := 'N' ;
4445: l_header_rec.cost_mthd_code := Get_Field(l_line,l_delimiter,10) ;
4446: l_header_rec.user_name := Get_Field(l_line,l_delimiter,11) ;
4447: l_idx := 0 ;
4448: /*
4449: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
4450: UTL_FILE.PUT_LINE(l_log_handle, 'orgn_code = ' || l_header_rec.orgn_code) ;
4451: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
4452: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
4453: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
4446: l_header_rec.user_name := Get_Field(l_line,l_delimiter,11) ;
4447: l_idx := 0 ;
4448: /*
4449: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
4450: UTL_FILE.PUT_LINE(l_log_handle, 'orgn_code = ' || l_header_rec.orgn_code) ;
4451: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
4452: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
4453: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
4454: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
4447: l_idx := 0 ;
4448: /*
4449: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
4450: UTL_FILE.PUT_LINE(l_log_handle, 'orgn_code = ' || l_header_rec.orgn_code) ;
4451: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
4452: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
4453: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
4454: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
4455: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
4448: /*
4449: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
4450: UTL_FILE.PUT_LINE(l_log_handle, 'orgn_code = ' || l_header_rec.orgn_code) ;
4451: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
4452: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
4453: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
4454: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
4455: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
4456: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
4449: UTL_FILE.PUT_LINE(l_log_handle, 'Type = ' || l_type) ;
4450: UTL_FILE.PUT_LINE(l_log_handle, 'orgn_code = ' || l_header_rec.orgn_code) ;
4451: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
4452: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
4453: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
4454: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
4455: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
4456: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
4457: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
4450: UTL_FILE.PUT_LINE(l_log_handle, 'orgn_code = ' || l_header_rec.orgn_code) ;
4451: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
4452: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
4453: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
4454: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
4455: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
4456: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
4457: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
4458: */
4451: UTL_FILE.PUT_LINE(l_log_handle, 'item_id = ' || l_header_rec.item_id) ;
4452: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
4453: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
4454: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
4455: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
4456: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
4457: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
4458: */
4459: ELSIF l_type = 20 AND l_skip_details = 'Y' THEN
4452: UTL_FILE.PUT_LINE(l_log_handle, 'item_no = ' || l_header_rec.item_no) ;
4453: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
4454: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
4455: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
4456: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
4457: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
4458: */
4459: ELSIF l_type = 20 AND l_skip_details = 'Y' THEN
4460: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
4453: UTL_FILE.PUT_LINE(l_log_handle, 'whse_code = ' || l_header_rec.whse_code) ;
4454: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
4455: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
4456: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
4457: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
4458: */
4459: ELSIF l_type = 20 AND l_skip_details = 'Y' THEN
4460: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
4461: ELSIF l_type = 20 AND l_skip_details = 'N' THEN
4456: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
4457: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
4458: */
4459: ELSIF l_type = 20 AND l_skip_details = 'Y' THEN
4460: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skipping this record...');
4461: ELSIF l_type = 20 AND l_skip_details = 'N' THEN
4462: l_idx := l_idx + 1 ;
4463: l_dtl_tbl(l_idx).burdenline_id := Get_Field(l_line,l_delimiter,2) ;
4464: l_dtl_tbl(l_idx).resources := Get_Field(l_line,l_delimiter,3) ;
4471: l_dtl_tbl(l_idx).burden_qty := Get_Field(l_line,l_delimiter,10) ;
4472: l_dtl_tbl(l_idx).burden_uom := Get_Field(l_line,l_delimiter,11) ;
4473: l_dtl_tbl(l_idx).delete_mark := Get_Field(l_line,l_delimiter,12) ;
4474: /*
4475: UTL_FILE.PUT_LINE(l_log_handle, 'Populating details level table...' || l_idx ) ;
4476: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burdenline_id('||l_idx||') = '||l_dtl_tbl(l_idx).burdenline_id) ;
4477: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: resources('||l_idx||') = '||l_dtl_tbl(l_idx).resources) ;
4478: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_cmpntcls_id('||l_idx||') = '||l_dtl_tbl(l_idx).cost_cmpntcls_id) ;
4479: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_cmpntcls_code('||l_idx||') = '||
4472: l_dtl_tbl(l_idx).burden_uom := Get_Field(l_line,l_delimiter,11) ;
4473: l_dtl_tbl(l_idx).delete_mark := Get_Field(l_line,l_delimiter,12) ;
4474: /*
4475: UTL_FILE.PUT_LINE(l_log_handle, 'Populating details level table...' || l_idx ) ;
4476: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burdenline_id('||l_idx||') = '||l_dtl_tbl(l_idx).burdenline_id) ;
4477: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: resources('||l_idx||') = '||l_dtl_tbl(l_idx).resources) ;
4478: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_cmpntcls_id('||l_idx||') = '||l_dtl_tbl(l_idx).cost_cmpntcls_id) ;
4479: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_cmpntcls_code('||l_idx||') = '||
4480: l_dtl_tbl(l_idx).cost_cmpntcls_code) ;
4473: l_dtl_tbl(l_idx).delete_mark := Get_Field(l_line,l_delimiter,12) ;
4474: /*
4475: UTL_FILE.PUT_LINE(l_log_handle, 'Populating details level table...' || l_idx ) ;
4476: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burdenline_id('||l_idx||') = '||l_dtl_tbl(l_idx).burdenline_id) ;
4477: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: resources('||l_idx||') = '||l_dtl_tbl(l_idx).resources) ;
4478: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_cmpntcls_id('||l_idx||') = '||l_dtl_tbl(l_idx).cost_cmpntcls_id) ;
4479: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_cmpntcls_code('||l_idx||') = '||
4480: l_dtl_tbl(l_idx).cost_cmpntcls_code) ;
4481: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_analysis_code('||l_idx||') = '||
4474: /*
4475: UTL_FILE.PUT_LINE(l_log_handle, 'Populating details level table...' || l_idx ) ;
4476: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burdenline_id('||l_idx||') = '||l_dtl_tbl(l_idx).burdenline_id) ;
4477: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: resources('||l_idx||') = '||l_dtl_tbl(l_idx).resources) ;
4478: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_cmpntcls_id('||l_idx||') = '||l_dtl_tbl(l_idx).cost_cmpntcls_id) ;
4479: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_cmpntcls_code('||l_idx||') = '||
4480: l_dtl_tbl(l_idx).cost_cmpntcls_code) ;
4481: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_analysis_code('||l_idx||') = '||
4482: l_dtl_tbl(l_idx).cost_analysis_code) ;
4475: UTL_FILE.PUT_LINE(l_log_handle, 'Populating details level table...' || l_idx ) ;
4476: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burdenline_id('||l_idx||') = '||l_dtl_tbl(l_idx).burdenline_id) ;
4477: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: resources('||l_idx||') = '||l_dtl_tbl(l_idx).resources) ;
4478: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_cmpntcls_id('||l_idx||') = '||l_dtl_tbl(l_idx).cost_cmpntcls_id) ;
4479: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_cmpntcls_code('||l_idx||') = '||
4480: l_dtl_tbl(l_idx).cost_cmpntcls_code) ;
4481: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_analysis_code('||l_idx||') = '||
4482: l_dtl_tbl(l_idx).cost_analysis_code) ;
4483: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_usage('||l_idx||') = '||l_dtl_tbl(l_idx).burden_usage) ;
4477: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: resources('||l_idx||') = '||l_dtl_tbl(l_idx).resources) ;
4478: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_cmpntcls_id('||l_idx||') = '||l_dtl_tbl(l_idx).cost_cmpntcls_id) ;
4479: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_cmpntcls_code('||l_idx||') = '||
4480: l_dtl_tbl(l_idx).cost_cmpntcls_code) ;
4481: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_analysis_code('||l_idx||') = '||
4482: l_dtl_tbl(l_idx).cost_analysis_code) ;
4483: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_usage('||l_idx||') = '||l_dtl_tbl(l_idx).burden_usage) ;
4484: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: item_qty('||l_idx||') = '||l_dtl_tbl(l_idx).item_qty) ;
4485: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: item_um('||l_idx||') = '||l_dtl_tbl(l_idx).item_um) ;
4479: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_cmpntcls_code('||l_idx||') = '||
4480: l_dtl_tbl(l_idx).cost_cmpntcls_code) ;
4481: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_analysis_code('||l_idx||') = '||
4482: l_dtl_tbl(l_idx).cost_analysis_code) ;
4483: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_usage('||l_idx||') = '||l_dtl_tbl(l_idx).burden_usage) ;
4484: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: item_qty('||l_idx||') = '||l_dtl_tbl(l_idx).item_qty) ;
4485: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: item_um('||l_idx||') = '||l_dtl_tbl(l_idx).item_um) ;
4486: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_qty('||l_idx||') = '||l_dtl_tbl(l_idx).burden_qty) ;
4487: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_um('||l_idx||') = '||l_dtl_tbl(l_idx).burden_um) ;
4480: l_dtl_tbl(l_idx).cost_cmpntcls_code) ;
4481: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_analysis_code('||l_idx||') = '||
4482: l_dtl_tbl(l_idx).cost_analysis_code) ;
4483: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_usage('||l_idx||') = '||l_dtl_tbl(l_idx).burden_usage) ;
4484: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: item_qty('||l_idx||') = '||l_dtl_tbl(l_idx).item_qty) ;
4485: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: item_um('||l_idx||') = '||l_dtl_tbl(l_idx).item_um) ;
4486: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_qty('||l_idx||') = '||l_dtl_tbl(l_idx).burden_qty) ;
4487: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_um('||l_idx||') = '||l_dtl_tbl(l_idx).burden_um) ;
4488: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: delete_mark('||l_idx||') = '||l_dtl_tbl(l_idx).delete_mark) ;
4481: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: cost_analysis_code('||l_idx||') = '||
4482: l_dtl_tbl(l_idx).cost_analysis_code) ;
4483: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_usage('||l_idx||') = '||l_dtl_tbl(l_idx).burden_usage) ;
4484: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: item_qty('||l_idx||') = '||l_dtl_tbl(l_idx).item_qty) ;
4485: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: item_um('||l_idx||') = '||l_dtl_tbl(l_idx).item_um) ;
4486: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_qty('||l_idx||') = '||l_dtl_tbl(l_idx).burden_qty) ;
4487: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_um('||l_idx||') = '||l_dtl_tbl(l_idx).burden_um) ;
4488: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: delete_mark('||l_idx||') = '||l_dtl_tbl(l_idx).delete_mark) ;
4489: */
4482: l_dtl_tbl(l_idx).cost_analysis_code) ;
4483: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_usage('||l_idx||') = '||l_dtl_tbl(l_idx).burden_usage) ;
4484: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: item_qty('||l_idx||') = '||l_dtl_tbl(l_idx).item_qty) ;
4485: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: item_um('||l_idx||') = '||l_dtl_tbl(l_idx).item_um) ;
4486: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_qty('||l_idx||') = '||l_dtl_tbl(l_idx).burden_qty) ;
4487: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_um('||l_idx||') = '||l_dtl_tbl(l_idx).burden_um) ;
4488: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: delete_mark('||l_idx||') = '||l_dtl_tbl(l_idx).delete_mark) ;
4489: */
4490: END IF ;
4483: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_usage('||l_idx||') = '||l_dtl_tbl(l_idx).burden_usage) ;
4484: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: item_qty('||l_idx||') = '||l_dtl_tbl(l_idx).item_qty) ;
4485: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: item_um('||l_idx||') = '||l_dtl_tbl(l_idx).item_um) ;
4486: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_qty('||l_idx||') = '||l_dtl_tbl(l_idx).burden_qty) ;
4487: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_um('||l_idx||') = '||l_dtl_tbl(l_idx).burden_um) ;
4488: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: delete_mark('||l_idx||') = '||l_dtl_tbl(l_idx).delete_mark) ;
4489: */
4490: END IF ;
4491:
4484: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: item_qty('||l_idx||') = '||l_dtl_tbl(l_idx).item_qty) ;
4485: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: item_um('||l_idx||') = '||l_dtl_tbl(l_idx).item_um) ;
4486: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_qty('||l_idx||') = '||l_dtl_tbl(l_idx).burden_qty) ;
4487: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: burden_um('||l_idx||') = '||l_dtl_tbl(l_idx).burden_um) ;
4488: UTL_FILE.PUT_LINE(l_log_handle,'DtlRec: delete_mark('||l_idx||') = '||l_dtl_tbl(l_idx).delete_mark) ;
4489: */
4490: END IF ;
4491:
4492: EXCEPTION
4490: END IF ;
4491:
4492: EXCEPTION
4493: WHEN OTHERS THEN
4494: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4495: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4496: IF l_type = 10 THEN
4497: l_skip_details := 'Y' ;
4498: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skip detail records.');
4491:
4492: EXCEPTION
4493: WHEN OTHERS THEN
4494: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4495: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4496: IF l_type = 10 THEN
4497: l_skip_details := 'Y' ;
4498: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skip detail records.');
4499: ELSIF l_type = 20 THEN
4494: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4495: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4496: IF l_type = 10 THEN
4497: l_skip_details := 'Y' ;
4498: UTL_FILE.PUT_LINE(l_log_handle, 'Error : Skip detail records.');
4499: ELSIF l_type = 20 THEN
4500: l_dtl_tbl.delete(l_idx);
4501: l_idx := l_idx-1;
4502: END IF ;
4506: --IF l_record_count > 1 THEN -- to avoid calling API for the first record
4507: --l_first_rec := 'N' ;
4508: --END IF ;
4509:
4510: UTL_FILE.GET_LINE(l_infile_handle, l_line);
4511: l_record_count :=l_record_count+1;
4512: UTL_FILE.NEW_LINE(l_log_handle);
4513: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : Detail Record
4514: EXCEPTION
4508: --END IF ;
4509:
4510: UTL_FILE.GET_LINE(l_infile_handle, l_line);
4511: l_record_count :=l_record_count+1;
4512: UTL_FILE.NEW_LINE(l_log_handle);
4513: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : Detail Record
4514: EXCEPTION
4515: WHEN NO_DATA_FOUND THEN
4516: IF l_skip_details = 'N' THEN
4513: l_type := Get_Field(l_line,l_delimiter,1) ; -- 10 : header rec, 20 : Detail Record
4514: EXCEPTION
4515: WHEN NO_DATA_FOUND THEN
4516: IF l_skip_details = 'N' THEN
4517: UTL_FILE.PUT_LINE(l_log_handle,'In wrapper exception. Call to Call_Burden_API...');
4518: Call_Burden_API
4519: (
4520: p_burden_header => l_header_rec
4521: , p_burden_detail => l_dtl_tbl
4525: , x_count => l_count
4526: , x_data => l_data
4527: ) ;
4528:
4529: UTL_FILE.PUT_LINE(l_log_handle,'In wrapper exception. After call to Call_Burden_API.status := ' ||
4530: l_status ||' cnt := ' || l_count );
4531: l_continue := 'N' ;
4532: goto GET_MSG_STACK ;
4533: END IF ;
4535:
4536: -- DBMS_OUTPUT.PUT_LINE('Check to call Call_Burden_API...type - ' || l_type || ' count = ' || l_record_count);
4537:
4538: IF (l_type = 10 AND l_record_count <> 1 AND l_skip_details = 'N') THEN
4539: UTL_FILE.PUT_LINE(l_log_handle,'In wrapper exception. Call to Call_Burden_API...');
4540: Call_Burden_API
4541: (
4542: p_burden_header => l_header_rec
4543: , p_burden_detail => l_dtl_tbl
4546: , x_status => l_status
4547: , x_count => l_count
4548: , x_data => l_data
4549: ) ;
4550: UTL_FILE.PUT_LINE(l_log_handle,'In wrapper exception. After call to Call_Burden_API.status := ' ||
4551: l_status ||' cnt := ' || l_count );
4552: END IF;
4553:
4554: <
4567: p_encoded => FND_API.G_FALSE,
4568: p_msg_index_out => l_dummy_cnt);
4569:
4570: ---- DBMS_OUTPUT.PUT_LINE(l_data );
4571: UTL_FILE.PUT_LINE(l_log_handle, l_data);
4572:
4573: /* Update error status */
4574: IF (l_status = 'U') THEN
4575: l_return_status :=l_status;
4593: (l_continue = 'N')
4594: ) THEN
4595: FOR i in 1..l_burdenline_ids.count
4596: LOOP
4597: UTL_FILE.PUT_LINE(l_log_handle,'Resource : ' || l_burdenline_ids(i).resources ||
4598: ' CmpntClsId : ' || l_burdenline_ids(i).cost_cmpntcls_id ||
4599: ' Analysis Code : ' || l_burdenline_ids(i).cost_analysis_code ||
4600: ' BurdenLineID : ' || l_burdenline_ids(i).burdenline_id);
4601: END LOOP ;
4608:
4609: END LOOP;
4610:
4611: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4612: UTL_FILE.NEW_LINE(l_log_handle);
4613: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4614: UTL_FILE.FCLOSE_ALL;
4615:
4616: RETURN l_return_status;
4609: END LOOP;
4610:
4611: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4612: UTL_FILE.NEW_LINE(l_log_handle);
4613: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4614: UTL_FILE.FCLOSE_ALL;
4615:
4616: RETURN l_return_status;
4617:
4610:
4611: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4612: UTL_FILE.NEW_LINE(l_log_handle);
4613: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4614: UTL_FILE.FCLOSE_ALL;
4615:
4616: RETURN l_return_status;
4617:
4618: EXCEPTION
4615:
4616: RETURN l_return_status;
4617:
4618: EXCEPTION
4619: WHEN UTL_FILE.INVALID_OPERATION THEN
4620: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
4621: UTL_FILE.FCLOSE_ALL;
4622: RETURN l_return_status;
4623:
4617:
4618: EXCEPTION
4619: WHEN UTL_FILE.INVALID_OPERATION THEN
4620: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
4621: UTL_FILE.FCLOSE_ALL;
4622: RETURN l_return_status;
4623:
4624: WHEN UTL_FILE.INVALID_PATH THEN
4625: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
4620: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
4621: UTL_FILE.FCLOSE_ALL;
4622: RETURN l_return_status;
4623:
4624: WHEN UTL_FILE.INVALID_PATH THEN
4625: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
4626: UTL_FILE.FCLOSE_ALL;
4627: RETURN l_return_status;
4628:
4622: RETURN l_return_status;
4623:
4624: WHEN UTL_FILE.INVALID_PATH THEN
4625: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
4626: UTL_FILE.FCLOSE_ALL;
4627: RETURN l_return_status;
4628:
4629: WHEN UTL_FILE.INVALID_MODE THEN
4630: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
4625: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
4626: UTL_FILE.FCLOSE_ALL;
4627: RETURN l_return_status;
4628:
4629: WHEN UTL_FILE.INVALID_MODE THEN
4630: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
4631: UTL_FILE.FCLOSE_ALL;
4632: RETURN l_return_status;
4633:
4627: RETURN l_return_status;
4628:
4629: WHEN UTL_FILE.INVALID_MODE THEN
4630: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
4631: UTL_FILE.FCLOSE_ALL;
4632: RETURN l_return_status;
4633:
4634: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
4635: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
4630: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
4631: UTL_FILE.FCLOSE_ALL;
4632: RETURN l_return_status;
4633:
4634: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
4635: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
4636: UTL_FILE.FCLOSE_ALL;
4637: RETURN l_return_status;
4638:
4632: RETURN l_return_status;
4633:
4634: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
4635: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
4636: UTL_FILE.FCLOSE_ALL;
4637: RETURN l_return_status;
4638:
4639: WHEN UTL_FILE.WRITE_ERROR THEN
4640: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
4635: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
4636: UTL_FILE.FCLOSE_ALL;
4637: RETURN l_return_status;
4638:
4639: WHEN UTL_FILE.WRITE_ERROR THEN
4640: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
4641: UTL_FILE.FCLOSE_ALL;
4642: RETURN l_return_status;
4643:
4637: RETURN l_return_status;
4638:
4639: WHEN UTL_FILE.WRITE_ERROR THEN
4640: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
4641: UTL_FILE.FCLOSE_ALL;
4642: RETURN l_return_status;
4643:
4644: WHEN UTL_FILE.READ_ERROR THEN
4645: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
4640: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
4641: UTL_FILE.FCLOSE_ALL;
4642: RETURN l_return_status;
4643:
4644: WHEN UTL_FILE.READ_ERROR THEN
4645: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
4646: UTL_FILE.FCLOSE_ALL;
4647: RETURN l_return_status;
4648:
4642: RETURN l_return_status;
4643:
4644: WHEN UTL_FILE.READ_ERROR THEN
4645: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
4646: UTL_FILE.FCLOSE_ALL;
4647: RETURN l_return_status;
4648:
4649: WHEN UTL_FILE.INTERNAL_ERROR THEN
4650: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
4645: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
4646: UTL_FILE.FCLOSE_ALL;
4647: RETURN l_return_status;
4648:
4649: WHEN UTL_FILE.INTERNAL_ERROR THEN
4650: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
4651: UTL_FILE.FCLOSE_ALL;
4652: RETURN l_return_status;
4653:
4647: RETURN l_return_status;
4648:
4649: WHEN UTL_FILE.INTERNAL_ERROR THEN
4650: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
4651: UTL_FILE.FCLOSE_ALL;
4652: RETURN l_return_status;
4653:
4654: WHEN OTHERS THEN
4655: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
4652: RETURN l_return_status;
4653:
4654: WHEN OTHERS THEN
4655: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
4656: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4657: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4658: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4659: UTL_FILE.FCLOSE_ALL;
4660: l_return_status := 'U' ;
4653:
4654: WHEN OTHERS THEN
4655: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
4656: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4657: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4658: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4659: UTL_FILE.FCLOSE_ALL;
4660: l_return_status := 'U' ;
4661: RETURN l_return_status;
4654: WHEN OTHERS THEN
4655: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
4656: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4657: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4658: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4659: UTL_FILE.FCLOSE_ALL;
4660: l_return_status := 'U' ;
4661: RETURN l_return_status;
4662:
4655: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
4656: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4657: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4658: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4659: UTL_FILE.FCLOSE_ALL;
4660: l_return_status := 'U' ;
4661: RETURN l_return_status;
4662:
4663: END Process_Burden_details;
4773: l_header_rec GMF_BurdenDetails_PUB.Burden_Header_Rec_Type;
4774: l_dtl_tbl GMF_BurdenDetails_PUB.Burden_Dtl_Tbl_Type;
4775: l_p_dir VARCHAR2(150);
4776: l_output_file VARCHAR2(120);
4777: l_outfile_handle UTL_FILE.FILE_TYPE;
4778: l_input_file VARCHAR2(120);
4779: l_infile_handle UTL_FILE.FILE_TYPE;
4780: l_line VARCHAR2(1000);
4781: l_delimiter VARCHAR(11);
4775: l_p_dir VARCHAR2(150);
4776: l_output_file VARCHAR2(120);
4777: l_outfile_handle UTL_FILE.FILE_TYPE;
4778: l_input_file VARCHAR2(120);
4779: l_infile_handle UTL_FILE.FILE_TYPE;
4780: l_line VARCHAR2(1000);
4781: l_delimiter VARCHAR(11);
4782: l_log_dir VARCHAR2(150);
4783: l_log_name VARCHAR2(120) :='gmf_api_getbrdn_wrapper';
4780: l_line VARCHAR2(1000);
4781: l_delimiter VARCHAR(11);
4782: l_log_dir VARCHAR2(150);
4783: l_log_name VARCHAR2(120) :='gmf_api_getbrdn_wrapper';
4784: l_log_handle UTL_FILE.FILE_TYPE;
4785: l_global_file VARCHAR2(120);
4786: l_idx NUMBER(10);
4787: l_idx1 NUMBER(10);
4788: l_type NUMBER(10);
4814: l_log_dir := p_dir;
4815:
4816: /* Open The Wrapper File For Output And The Input File for Input. */
4817:
4818: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
4819: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
4820:
4821: /* Loop thru flat file and call Inventory Quantities API */
4822: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4815:
4816: /* Open The Wrapper File For Output And The Input File for Input. */
4817:
4818: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
4819: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
4820:
4821: /* Loop thru flat file and call Inventory Quantities API */
4822: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4823: -- DBMS_OUTPUT.PUT_LINE('Input Directory ' || l_p_dir );
4826: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
4827:
4828:
4829: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
4830: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4831: UTL_FILE.NEW_LINE(l_log_handle);
4832: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4833: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4834: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4827:
4828:
4829: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
4830: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4831: UTL_FILE.NEW_LINE(l_log_handle);
4832: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4833: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4834: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4835: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4828:
4829: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
4830: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4831: UTL_FILE.NEW_LINE(l_log_handle);
4832: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4833: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4834: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4835: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4836:
4829: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
4830: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4831: UTL_FILE.NEW_LINE(l_log_handle);
4832: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4833: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4834: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4835: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4836:
4837: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
4830: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4831: UTL_FILE.NEW_LINE(l_log_handle);
4832: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4833: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4834: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4835: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4836:
4837: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
4838:
4831: UTL_FILE.NEW_LINE(l_log_handle);
4832: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
4833: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4834: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4835: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4836:
4837: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
4838:
4839: LOOP
4833: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
4834: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
4835: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
4836:
4837: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
4838:
4839: LOOP
4840: BEGIN
4841: UTL_FILE.GET_LINE(l_infile_handle, l_line);
4837: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
4838:
4839: LOOP
4840: BEGIN
4841: UTL_FILE.GET_LINE(l_infile_handle, l_line);
4842: l_record_count :=l_record_count+1;
4843: EXCEPTION
4844: WHEN NO_DATA_FOUND THEN
4845: EXIT ;
4845: EXIT ;
4846: END;
4847:
4848: BEGIN
4849: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
4850: -- empty the tables
4851: l_dtl_tbl.delete ;
4852:
4853: l_header_rec.organization_id := Get_Field(l_line,l_delimiter,1) ;
4860: l_header_rec.cost_type_id := Get_Field(l_line,l_delimiter,8) ;
4861: l_header_rec.cost_mthd_code := Get_Field(l_line,l_delimiter,9) ;
4862: l_header_rec.user_name := Get_Field(l_line,l_delimiter,10) ;
4863:
4864: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || l_header_rec.organization_id) ;
4865: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || l_header_rec.organization_code) ;
4866: UTL_FILE.PUT_LINE(l_log_handle, 'inventory_item_id = ' || l_header_rec.inventory_item_id) ;
4867: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || l_header_rec.item_number) ;
4868: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || l_header_rec.period_id) ;
4861: l_header_rec.cost_mthd_code := Get_Field(l_line,l_delimiter,9) ;
4862: l_header_rec.user_name := Get_Field(l_line,l_delimiter,10) ;
4863:
4864: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || l_header_rec.organization_id) ;
4865: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || l_header_rec.organization_code) ;
4866: UTL_FILE.PUT_LINE(l_log_handle, 'inventory_item_id = ' || l_header_rec.inventory_item_id) ;
4867: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || l_header_rec.item_number) ;
4868: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || l_header_rec.period_id) ;
4869: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
4862: l_header_rec.user_name := Get_Field(l_line,l_delimiter,10) ;
4863:
4864: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || l_header_rec.organization_id) ;
4865: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || l_header_rec.organization_code) ;
4866: UTL_FILE.PUT_LINE(l_log_handle, 'inventory_item_id = ' || l_header_rec.inventory_item_id) ;
4867: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || l_header_rec.item_number) ;
4868: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || l_header_rec.period_id) ;
4869: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
4870: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
4863:
4864: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || l_header_rec.organization_id) ;
4865: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || l_header_rec.organization_code) ;
4866: UTL_FILE.PUT_LINE(l_log_handle, 'inventory_item_id = ' || l_header_rec.inventory_item_id) ;
4867: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || l_header_rec.item_number) ;
4868: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || l_header_rec.period_id) ;
4869: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
4870: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
4871: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id = ' || l_header_rec.cost_type_id) ;
4864: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id = ' || l_header_rec.organization_id) ;
4865: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || l_header_rec.organization_code) ;
4866: UTL_FILE.PUT_LINE(l_log_handle, 'inventory_item_id = ' || l_header_rec.inventory_item_id) ;
4867: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || l_header_rec.item_number) ;
4868: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || l_header_rec.period_id) ;
4869: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
4870: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
4871: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id = ' || l_header_rec.cost_type_id) ;
4872: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
4865: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code = ' || l_header_rec.organization_code) ;
4866: UTL_FILE.PUT_LINE(l_log_handle, 'inventory_item_id = ' || l_header_rec.inventory_item_id) ;
4867: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || l_header_rec.item_number) ;
4868: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || l_header_rec.period_id) ;
4869: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
4870: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
4871: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id = ' || l_header_rec.cost_type_id) ;
4872: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
4873: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
4866: UTL_FILE.PUT_LINE(l_log_handle, 'inventory_item_id = ' || l_header_rec.inventory_item_id) ;
4867: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || l_header_rec.item_number) ;
4868: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || l_header_rec.period_id) ;
4869: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
4870: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
4871: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id = ' || l_header_rec.cost_type_id) ;
4872: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
4873: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
4874:
4867: UTL_FILE.PUT_LINE(l_log_handle, 'item_number = ' || l_header_rec.item_number) ;
4868: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || l_header_rec.period_id) ;
4869: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
4870: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
4871: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id = ' || l_header_rec.cost_type_id) ;
4872: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
4873: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
4874:
4875: -- Invoke public get burden details
4868: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || l_header_rec.period_id) ;
4869: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
4870: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
4871: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id = ' || l_header_rec.cost_type_id) ;
4872: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
4873: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
4874:
4875: -- Invoke public get burden details
4876: GMF_BurdenDetails_PUB.Get_Burden_Details
4869: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || l_header_rec.calendar_code) ;
4870: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || l_header_rec.period_code) ;
4871: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id = ' || l_header_rec.cost_type_id) ;
4872: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code = ' || l_header_rec.cost_mthd_code) ;
4873: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || l_header_rec.user_name) ;
4874:
4875: -- Invoke public get burden details
4876: GMF_BurdenDetails_PUB.Get_Burden_Details
4877: (
4886:
4887: , x_dtl_tbl => l_dtl_tbl
4888: );
4889:
4890: UTL_FILE.PUT_LINE(l_log_handle, 'after API call. status := ' || l_status ||' cnt := ' || l_count );
4891:
4892: /* Check if any messages generated. If so then decode and */
4893: /* output to error message flat file */
4894:
4902: p_encoded => FND_API.G_FALSE,
4903: p_msg_index_out => l_dummy_cnt);
4904:
4905: ---- DBMS_OUTPUT.PUT_LINE(l_data );
4906: UTL_FILE.PUT_LINE(l_log_handle, l_data);
4907:
4908: /* Update error status */
4909: IF (l_status = 'U') THEN
4910: l_return_status :=l_status;
4923: l_count := 0 ;
4924:
4925: END IF; -- if count of msg stack > 0
4926:
4927: UTL_FILE.NEW_LINE(l_log_handle);
4928: FOR i in 1..l_dtl_tbl.count
4929: LOOP
4930: UTL_FILE.PUT_LINE(l_log_handle,
4931: 'Burdenline_Id : ' || l_dtl_tbl(i).Burdenline_Id ||
4926:
4927: UTL_FILE.NEW_LINE(l_log_handle);
4928: FOR i in 1..l_dtl_tbl.count
4929: LOOP
4930: UTL_FILE.PUT_LINE(l_log_handle,
4931: 'Burdenline_Id : ' || l_dtl_tbl(i).Burdenline_Id ||
4932: ' resources : ' || l_dtl_tbl(i).resources ||
4933: ' Cmpntcls Id : ' || l_dtl_tbl(i).cost_cmpntcls_id ||
4934: ' Cmpntcls Code : ' || l_dtl_tbl(i).cost_cmpntcls_id ||
4933: ' Cmpntcls Id : ' || l_dtl_tbl(i).cost_cmpntcls_id ||
4934: ' Cmpntcls Code : ' || l_dtl_tbl(i).cost_cmpntcls_id ||
4935: ' Alys Code : ' || l_dtl_tbl(i).cost_analysis_code
4936: );
4937: UTL_FILE.PUT_LINE(l_log_handle,
4938: ' Burden Usage : ' || l_dtl_tbl(i).Burden_Usage ||
4939: ' Item Qty : ' || l_dtl_tbl(i).item_qty ||
4940: ' Item UOM : ' || l_dtl_tbl(i).Item_UOM ||
4941: ' Burden Qty : ' || l_dtl_tbl(i).Burden_Qty ||
4944: ' Delete Mark : ' || l_dtl_tbl(i).Delete_Mark
4945: );
4946: END LOOP ;
4947: l_dtl_tbl.delete ;
4948: UTL_FILE.NEW_LINE(l_log_handle);
4949: UTL_FILE.NEW_LINE(l_log_handle);
4950:
4951: EXCEPTION
4952: WHEN OTHERS THEN
4945: );
4946: END LOOP ;
4947: l_dtl_tbl.delete ;
4948: UTL_FILE.NEW_LINE(l_log_handle);
4949: UTL_FILE.NEW_LINE(l_log_handle);
4950:
4951: EXCEPTION
4952: WHEN OTHERS THEN
4953: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4949: UTL_FILE.NEW_LINE(l_log_handle);
4950:
4951: EXCEPTION
4952: WHEN OTHERS THEN
4953: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4954: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4955: END ;
4956:
4957: END LOOP;
4950:
4951: EXCEPTION
4952: WHEN OTHERS THEN
4953: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4954: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
4955: END ;
4956:
4957: END LOOP;
4958:
4956:
4957: END LOOP;
4958:
4959: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4960: UTL_FILE.NEW_LINE(l_log_handle);
4961: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4962: UTL_FILE.FCLOSE_ALL;
4963:
4964: RETURN l_return_status;
4957: END LOOP;
4958:
4959: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4960: UTL_FILE.NEW_LINE(l_log_handle);
4961: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4962: UTL_FILE.FCLOSE_ALL;
4963:
4964: RETURN l_return_status;
4965:
4958:
4959: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4960: UTL_FILE.NEW_LINE(l_log_handle);
4961: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
4962: UTL_FILE.FCLOSE_ALL;
4963:
4964: RETURN l_return_status;
4965:
4966: EXCEPTION
4963:
4964: RETURN l_return_status;
4965:
4966: EXCEPTION
4967: WHEN UTL_FILE.INVALID_OPERATION THEN
4968: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
4969: UTL_FILE.FCLOSE_ALL;
4970: RETURN l_return_status;
4971:
4965:
4966: EXCEPTION
4967: WHEN UTL_FILE.INVALID_OPERATION THEN
4968: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
4969: UTL_FILE.FCLOSE_ALL;
4970: RETURN l_return_status;
4971:
4972: WHEN UTL_FILE.INVALID_PATH THEN
4973: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
4968: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
4969: UTL_FILE.FCLOSE_ALL;
4970: RETURN l_return_status;
4971:
4972: WHEN UTL_FILE.INVALID_PATH THEN
4973: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
4974: UTL_FILE.FCLOSE_ALL;
4975: RETURN l_return_status;
4976:
4970: RETURN l_return_status;
4971:
4972: WHEN UTL_FILE.INVALID_PATH THEN
4973: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
4974: UTL_FILE.FCLOSE_ALL;
4975: RETURN l_return_status;
4976:
4977: WHEN UTL_FILE.INVALID_MODE THEN
4978: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
4973: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
4974: UTL_FILE.FCLOSE_ALL;
4975: RETURN l_return_status;
4976:
4977: WHEN UTL_FILE.INVALID_MODE THEN
4978: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
4979: UTL_FILE.FCLOSE_ALL;
4980: RETURN l_return_status;
4981:
4975: RETURN l_return_status;
4976:
4977: WHEN UTL_FILE.INVALID_MODE THEN
4978: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
4979: UTL_FILE.FCLOSE_ALL;
4980: RETURN l_return_status;
4981:
4982: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
4983: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
4978: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
4979: UTL_FILE.FCLOSE_ALL;
4980: RETURN l_return_status;
4981:
4982: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
4983: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
4984: UTL_FILE.FCLOSE_ALL;
4985: RETURN l_return_status;
4986:
4980: RETURN l_return_status;
4981:
4982: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
4983: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
4984: UTL_FILE.FCLOSE_ALL;
4985: RETURN l_return_status;
4986:
4987: WHEN UTL_FILE.WRITE_ERROR THEN
4988: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
4983: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
4984: UTL_FILE.FCLOSE_ALL;
4985: RETURN l_return_status;
4986:
4987: WHEN UTL_FILE.WRITE_ERROR THEN
4988: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
4989: UTL_FILE.FCLOSE_ALL;
4990: RETURN l_return_status;
4991:
4985: RETURN l_return_status;
4986:
4987: WHEN UTL_FILE.WRITE_ERROR THEN
4988: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
4989: UTL_FILE.FCLOSE_ALL;
4990: RETURN l_return_status;
4991:
4992: WHEN UTL_FILE.READ_ERROR THEN
4993: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
4988: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
4989: UTL_FILE.FCLOSE_ALL;
4990: RETURN l_return_status;
4991:
4992: WHEN UTL_FILE.READ_ERROR THEN
4993: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
4994: UTL_FILE.FCLOSE_ALL;
4995: RETURN l_return_status;
4996:
4990: RETURN l_return_status;
4991:
4992: WHEN UTL_FILE.READ_ERROR THEN
4993: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
4994: UTL_FILE.FCLOSE_ALL;
4995: RETURN l_return_status;
4996:
4997: WHEN UTL_FILE.INTERNAL_ERROR THEN
4998: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
4993: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
4994: UTL_FILE.FCLOSE_ALL;
4995: RETURN l_return_status;
4996:
4997: WHEN UTL_FILE.INTERNAL_ERROR THEN
4998: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
4999: UTL_FILE.FCLOSE_ALL;
5000: RETURN l_return_status;
5001:
4995: RETURN l_return_status;
4996:
4997: WHEN UTL_FILE.INTERNAL_ERROR THEN
4998: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
4999: UTL_FILE.FCLOSE_ALL;
5000: RETURN l_return_status;
5001:
5002: WHEN OTHERS THEN
5003: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
5000: RETURN l_return_status;
5001:
5002: WHEN OTHERS THEN
5003: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
5004: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5005: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5006: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5007: UTL_FILE.FCLOSE_ALL;
5008: l_return_status := 'U' ;
5001:
5002: WHEN OTHERS THEN
5003: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
5004: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5005: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5006: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5007: UTL_FILE.FCLOSE_ALL;
5008: l_return_status := 'U' ;
5009: RETURN l_return_status;
5002: WHEN OTHERS THEN
5003: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
5004: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5005: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5006: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5007: UTL_FILE.FCLOSE_ALL;
5008: l_return_status := 'U' ;
5009: RETURN l_return_status;
5010:
5003: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
5004: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5005: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5006: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5007: UTL_FILE.FCLOSE_ALL;
5008: l_return_status := 'U' ;
5009: RETURN l_return_status;
5010:
5011: END Get_Burden_details;
5217: l_data VARCHAR2(1000);
5218: rsrc_rec GMF_ResourceCost_PUB.Resource_Cost_Rec_Type;
5219: l_p_dir VARCHAR2(150);
5220: l_output_file VARCHAR2(120);
5221: l_outfile_handle UTL_FILE.FILE_TYPE;
5222: l_input_file VARCHAR2(120);
5223: l_infile_handle UTL_FILE.FILE_TYPE;
5224: l_line VARCHAR2(1000);
5225: l_delimiter VARCHAR(11);
5219: l_p_dir VARCHAR2(150);
5220: l_output_file VARCHAR2(120);
5221: l_outfile_handle UTL_FILE.FILE_TYPE;
5222: l_input_file VARCHAR2(120);
5223: l_infile_handle UTL_FILE.FILE_TYPE;
5224: l_line VARCHAR2(1000);
5225: l_delimiter VARCHAR(11);
5226: l_log_dir VARCHAR2(150);
5227: l_log_name VARCHAR2(120) :='gmf_api_crrc_wrapper';
5224: l_line VARCHAR2(1000);
5225: l_delimiter VARCHAR(11);
5226: l_log_dir VARCHAR2(150);
5227: l_log_name VARCHAR2(120) :='gmf_api_crrc_wrapper';
5228: l_log_handle UTL_FILE.FILE_TYPE;
5229: l_global_file VARCHAR2(120);
5230:
5231: l_session_id VARCHAR2(110);
5232:
5252: l_log_dir := p_dir;
5253:
5254: /* Open The Wrapper File For Output And The Input File for Input. */
5255:
5256: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
5257: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
5258:
5259: /* Loop thru flat file and call Inventory Quantities API */
5260: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5253:
5254: /* Open The Wrapper File For Output And The Input File for Input. */
5255:
5256: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
5257: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
5258:
5259: /* Loop thru flat file and call Inventory Quantities API */
5260: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5261: -- DBMS_OUTPUT.PUT_LINE('Input Directory ' || l_p_dir );
5263: -- DBMS_OUTPUT.PUT_LINE('Delimiter ' || l_delimiter );
5264: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
5265:
5266: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
5267: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5268: UTL_FILE.NEW_LINE(l_log_handle);
5269: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5270: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5271: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5264: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
5265:
5266: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
5267: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5268: UTL_FILE.NEW_LINE(l_log_handle);
5269: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5270: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5271: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5272: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5265:
5266: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
5267: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5268: UTL_FILE.NEW_LINE(l_log_handle);
5269: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5270: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5271: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5272: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5273:
5266: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
5267: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5268: UTL_FILE.NEW_LINE(l_log_handle);
5269: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5270: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5271: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5272: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5273:
5274: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
5267: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5268: UTL_FILE.NEW_LINE(l_log_handle);
5269: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5270: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5271: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5272: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5273:
5274: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
5275:
5268: UTL_FILE.NEW_LINE(l_log_handle);
5269: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5270: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5271: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5272: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5273:
5274: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
5275:
5276:
5270: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5271: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5272: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5273:
5274: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
5275:
5276:
5277: LOOP
5278: l_record_count :=l_record_count+1;
5276:
5277: LOOP
5278: l_record_count :=l_record_count+1;
5279: BEGIN
5280: UTL_FILE.GET_LINE(l_infile_handle, l_line);
5281: EXCEPTION
5282: WHEN NO_DATA_FOUND THEN
5283: EXIT;
5284: END;
5283: EXIT;
5284: END;
5285:
5286: BEGIN
5287: UTL_FILE.NEW_LINE(l_log_handle);
5288: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
5289:
5290: rsrc_rec.resources := Get_Field(l_line,l_delimiter,1) ;
5291: rsrc_rec.legal_entity_id := Get_Field(l_line,l_delimiter,2) ;
5284: END;
5285:
5286: BEGIN
5287: UTL_FILE.NEW_LINE(l_log_handle);
5288: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
5289:
5290: rsrc_rec.resources := Get_Field(l_line,l_delimiter,1) ;
5291: rsrc_rec.legal_entity_id := Get_Field(l_line,l_delimiter,2) ;
5292: rsrc_rec.organization_id := Get_Field(l_line,l_delimiter,3) ;
5300: rsrc_rec.nominal_cost := Get_Field(l_line,l_delimiter,11) ;
5301: rsrc_rec.delete_mark := Get_Field(l_line,l_delimiter,12) ;
5302: rsrc_rec.user_name := Get_Field(l_line,l_delimiter,13) ;
5303:
5304: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
5305: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5306: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5307: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5308: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5301: rsrc_rec.delete_mark := Get_Field(l_line,l_delimiter,12) ;
5302: rsrc_rec.user_name := Get_Field(l_line,l_delimiter,13) ;
5303:
5304: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
5305: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5306: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5307: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5308: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5309: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5302: rsrc_rec.user_name := Get_Field(l_line,l_delimiter,13) ;
5303:
5304: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
5305: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5306: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5307: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5308: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5309: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5310: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5303:
5304: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
5305: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5306: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5307: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5308: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5309: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5310: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5311: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5304: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
5305: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5306: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5307: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5308: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5309: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5310: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5311: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5312: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5305: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5306: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5307: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5308: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5309: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5310: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5311: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5312: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5313: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5306: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5307: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5308: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5309: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5310: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5311: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5312: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5313: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5314: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
5307: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5308: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5309: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5310: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5311: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5312: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5313: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5314: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
5315: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
5308: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5309: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5310: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5311: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5312: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5313: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5314: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
5315: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
5316: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
5309: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5310: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5311: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5312: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5313: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5314: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
5315: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
5316: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
5317:
5310: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5311: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5312: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5313: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5314: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
5315: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
5316: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
5317:
5318: GMF_ResourceCost_PUB.Create_Resource_Cost
5311: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5312: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5313: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5314: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
5315: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
5316: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
5317:
5318: GMF_ResourceCost_PUB.Create_Resource_Cost
5319: ( p_api_version => 2.0
5312: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5313: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5314: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
5315: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
5316: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
5317:
5318: GMF_ResourceCost_PUB.Create_Resource_Cost
5319: ( p_api_version => 2.0
5320: , p_init_msg_list => FND_API.G_TRUE
5326:
5327: , p_Resource_Cost_rec => rsrc_rec
5328: );
5329:
5330: UTL_FILE.PUT_LINE(l_log_handle, 'after API call. status := ' || l_status ||' cnt := ' || l_count );
5331: IF l_count > 0
5332: THEN
5333: l_loop_cnt :=1;
5334: LOOP
5341:
5342:
5343: -- DBMS_OUTPUT.PUT_LINE(l_data );
5344:
5345: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
5346: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
5347: UTL_FILE.NEW_LINE(l_outfile_handle);
5348:
5349: /*
5342:
5343: -- DBMS_OUTPUT.PUT_LINE(l_data );
5344:
5345: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
5346: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
5347: UTL_FILE.NEW_LINE(l_outfile_handle);
5348:
5349: /*
5350: IF l_status = 'E' OR
5343: -- DBMS_OUTPUT.PUT_LINE(l_data );
5344:
5345: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
5346: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
5347: UTL_FILE.NEW_LINE(l_outfile_handle);
5348:
5349: /*
5350: IF l_status = 'E' OR
5351: l_status = 'U'
5353: l_data := CONCAT('ERROR : ',l_data);
5354: END IF;
5355: */
5356:
5357: UTL_FILE.PUT_LINE(l_log_handle, l_data);
5358:
5359: /* Update error status */
5360: IF (l_status = 'U')
5361: THEN
5378: END IF;
5379:
5380: EXCEPTION
5381: WHEN OTHERS THEN
5382: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5383: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5384: l_return_status := 'U' ;
5385: END ;
5386:
5379:
5380: EXCEPTION
5381: WHEN OTHERS THEN
5382: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5383: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5384: l_return_status := 'U' ;
5385: END ;
5386:
5387:
5386:
5387:
5388: END LOOP;
5389: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5390: UTL_FILE.NEW_LINE(l_log_handle);
5391: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5392:
5393: /* Check if any messages generated. If so then decode and */
5394: /* output to error message flat file */
5387:
5388: END LOOP;
5389: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5390: UTL_FILE.NEW_LINE(l_log_handle);
5391: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5392:
5393: /* Check if any messages generated. If so then decode and */
5394: /* output to error message flat file */
5395:
5392:
5393: /* Check if any messages generated. If so then decode and */
5394: /* output to error message flat file */
5395:
5396: UTL_FILE.FCLOSE_ALL;
5397:
5398: RETURN l_return_status;
5399:
5400: EXCEPTION
5397:
5398: RETURN l_return_status;
5399:
5400: EXCEPTION
5401: WHEN UTL_FILE.INVALID_OPERATION THEN
5402: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
5403: UTL_FILE.FCLOSE_ALL;
5404: RETURN l_return_status;
5405:
5399:
5400: EXCEPTION
5401: WHEN UTL_FILE.INVALID_OPERATION THEN
5402: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
5403: UTL_FILE.FCLOSE_ALL;
5404: RETURN l_return_status;
5405:
5406: WHEN UTL_FILE.INVALID_PATH THEN
5407: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
5402: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
5403: UTL_FILE.FCLOSE_ALL;
5404: RETURN l_return_status;
5405:
5406: WHEN UTL_FILE.INVALID_PATH THEN
5407: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
5408: UTL_FILE.FCLOSE_ALL;
5409: RETURN l_return_status;
5410:
5404: RETURN l_return_status;
5405:
5406: WHEN UTL_FILE.INVALID_PATH THEN
5407: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
5408: UTL_FILE.FCLOSE_ALL;
5409: RETURN l_return_status;
5410:
5411: WHEN UTL_FILE.INVALID_MODE THEN
5412: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
5407: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
5408: UTL_FILE.FCLOSE_ALL;
5409: RETURN l_return_status;
5410:
5411: WHEN UTL_FILE.INVALID_MODE THEN
5412: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
5413: UTL_FILE.FCLOSE_ALL;
5414: RETURN l_return_status;
5415:
5409: RETURN l_return_status;
5410:
5411: WHEN UTL_FILE.INVALID_MODE THEN
5412: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
5413: UTL_FILE.FCLOSE_ALL;
5414: RETURN l_return_status;
5415:
5416: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
5417: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
5412: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
5413: UTL_FILE.FCLOSE_ALL;
5414: RETURN l_return_status;
5415:
5416: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
5417: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
5418: UTL_FILE.FCLOSE_ALL;
5419: RETURN l_return_status;
5420:
5414: RETURN l_return_status;
5415:
5416: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
5417: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
5418: UTL_FILE.FCLOSE_ALL;
5419: RETURN l_return_status;
5420:
5421: WHEN UTL_FILE.WRITE_ERROR THEN
5422: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
5417: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
5418: UTL_FILE.FCLOSE_ALL;
5419: RETURN l_return_status;
5420:
5421: WHEN UTL_FILE.WRITE_ERROR THEN
5422: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
5423: UTL_FILE.FCLOSE_ALL;
5424: RETURN l_return_status;
5425:
5419: RETURN l_return_status;
5420:
5421: WHEN UTL_FILE.WRITE_ERROR THEN
5422: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
5423: UTL_FILE.FCLOSE_ALL;
5424: RETURN l_return_status;
5425:
5426: WHEN UTL_FILE.READ_ERROR THEN
5427: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
5422: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
5423: UTL_FILE.FCLOSE_ALL;
5424: RETURN l_return_status;
5425:
5426: WHEN UTL_FILE.READ_ERROR THEN
5427: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
5428: UTL_FILE.FCLOSE_ALL;
5429: RETURN l_return_status;
5430:
5424: RETURN l_return_status;
5425:
5426: WHEN UTL_FILE.READ_ERROR THEN
5427: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
5428: UTL_FILE.FCLOSE_ALL;
5429: RETURN l_return_status;
5430:
5431: WHEN UTL_FILE.INTERNAL_ERROR THEN
5432: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
5427: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
5428: UTL_FILE.FCLOSE_ALL;
5429: RETURN l_return_status;
5430:
5431: WHEN UTL_FILE.INTERNAL_ERROR THEN
5432: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
5433: UTL_FILE.FCLOSE_ALL;
5434: RETURN l_return_status;
5435:
5429: RETURN l_return_status;
5430:
5431: WHEN UTL_FILE.INTERNAL_ERROR THEN
5432: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
5433: UTL_FILE.FCLOSE_ALL;
5434: RETURN l_return_status;
5435:
5436: WHEN OTHERS THEN
5437: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
5434: RETURN l_return_status;
5435:
5436: WHEN OTHERS THEN
5437: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
5438: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5439: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5440: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5441: UTL_FILE.FCLOSE_ALL;
5442: l_return_status := 'U' ;
5435:
5436: WHEN OTHERS THEN
5437: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
5438: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5439: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5440: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5441: UTL_FILE.FCLOSE_ALL;
5442: l_return_status := 'U' ;
5443: RETURN l_return_status;
5436: WHEN OTHERS THEN
5437: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
5438: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5439: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5440: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5441: UTL_FILE.FCLOSE_ALL;
5442: l_return_status := 'U' ;
5443: RETURN l_return_status;
5444:
5437: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
5438: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5439: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5440: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5441: UTL_FILE.FCLOSE_ALL;
5442: l_return_status := 'U' ;
5443: RETURN l_return_status;
5444:
5445: END Create_resource_cost;
5554: l_data VARCHAR2(2000);
5555: rsrc_rec GMF_ResourceCost_PUB.Resource_Cost_Rec_Type;
5556: l_p_dir VARCHAR2(150);
5557: l_output_file VARCHAR2(120);
5558: l_outfile_handle UTL_FILE.FILE_TYPE;
5559: l_input_file VARCHAR2(120);
5560: l_infile_handle UTL_FILE.FILE_TYPE;
5561: l_line VARCHAR2(1800);
5562: l_delimiter VARCHAR(11);
5556: l_p_dir VARCHAR2(150);
5557: l_output_file VARCHAR2(120);
5558: l_outfile_handle UTL_FILE.FILE_TYPE;
5559: l_input_file VARCHAR2(120);
5560: l_infile_handle UTL_FILE.FILE_TYPE;
5561: l_line VARCHAR2(1800);
5562: l_delimiter VARCHAR(11);
5563: l_log_dir VARCHAR2(150);
5564: l_log_name VARCHAR2(120) :='gmf_api_updrc_wrapper';
5561: l_line VARCHAR2(1800);
5562: l_delimiter VARCHAR(11);
5563: l_log_dir VARCHAR2(150);
5564: l_log_name VARCHAR2(120) :='gmf_api_updrc_wrapper';
5565: l_log_handle UTL_FILE.FILE_TYPE;
5566: l_global_file VARCHAR2(120);
5567:
5568: l_session_id VARCHAR2(110);
5569:
5592:
5593:
5594: /* Open The Wrapper File For Output And The Input File for Input. */
5595:
5596: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
5597: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
5598:
5599: /* Loop thru flat file and call Inventory Quantities API */
5600: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5593:
5594: /* Open The Wrapper File For Output And The Input File for Input. */
5595:
5596: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
5597: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
5598:
5599: /* Loop thru flat file and call Inventory Quantities API */
5600: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5601: -- DBMS_OUTPUT.PUT_LINE('Input Directory ' || l_p_dir );
5604: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
5605:
5606:
5607: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
5608: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5609: UTL_FILE.NEW_LINE(l_log_handle);
5610: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5611: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5612: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5605:
5606:
5607: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
5608: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5609: UTL_FILE.NEW_LINE(l_log_handle);
5610: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5611: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5612: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5613: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5606:
5607: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
5608: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5609: UTL_FILE.NEW_LINE(l_log_handle);
5610: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5611: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5612: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5613: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5614:
5607: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
5608: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5609: UTL_FILE.NEW_LINE(l_log_handle);
5610: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5611: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5612: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5613: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5614:
5615: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
5608: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5609: UTL_FILE.NEW_LINE(l_log_handle);
5610: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5611: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5612: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5613: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5614:
5615: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
5616:
5609: UTL_FILE.NEW_LINE(l_log_handle);
5610: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5611: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5612: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5613: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5614:
5615: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
5616:
5617: LOOP
5611: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5612: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5613: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5614:
5615: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
5616:
5617: LOOP
5618: l_record_count :=l_record_count+1;
5619: BEGIN
5617: LOOP
5618: l_record_count :=l_record_count+1;
5619: BEGIN
5620: BEGIN
5621: UTL_FILE.NEW_LINE(l_log_handle);
5622: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
5623: UTL_FILE.GET_LINE(l_infile_handle, l_line);
5624: EXCEPTION
5625: WHEN NO_DATA_FOUND THEN
5618: l_record_count :=l_record_count+1;
5619: BEGIN
5620: BEGIN
5621: UTL_FILE.NEW_LINE(l_log_handle);
5622: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
5623: UTL_FILE.GET_LINE(l_infile_handle, l_line);
5624: EXCEPTION
5625: WHEN NO_DATA_FOUND THEN
5626: EXIT;
5619: BEGIN
5620: BEGIN
5621: UTL_FILE.NEW_LINE(l_log_handle);
5622: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
5623: UTL_FILE.GET_LINE(l_infile_handle, l_line);
5624: EXCEPTION
5625: WHEN NO_DATA_FOUND THEN
5626: EXIT;
5627: END;
5641: rsrc_rec.nominal_cost := Get_Field(l_line,l_delimiter,11) ;
5642: rsrc_rec.delete_mark := Get_Field(l_line,l_delimiter,12) ;
5643: rsrc_rec.user_name := Get_Field(l_line,l_delimiter,13) ;
5644:
5645: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
5646: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5647: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5648: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5649: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5642: rsrc_rec.delete_mark := Get_Field(l_line,l_delimiter,12) ;
5643: rsrc_rec.user_name := Get_Field(l_line,l_delimiter,13) ;
5644:
5645: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
5646: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5647: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5648: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5649: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5650: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5643: rsrc_rec.user_name := Get_Field(l_line,l_delimiter,13) ;
5644:
5645: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
5646: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5647: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5648: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5649: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5650: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5651: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5644:
5645: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
5646: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5647: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5648: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5649: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5650: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5651: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5652: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5645: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
5646: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5647: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5648: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5649: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5650: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5651: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5652: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5653: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5646: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5647: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5648: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5649: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5650: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5651: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5652: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5653: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5654: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5647: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5648: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5649: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5650: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5651: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5652: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5653: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5654: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5655: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
5648: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5649: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5650: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5651: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5652: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5653: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5654: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5655: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
5656: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
5649: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5650: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5651: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5652: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5653: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5654: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5655: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
5656: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
5657: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
5650: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5651: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5652: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5653: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5654: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5655: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
5656: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
5657: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
5658:
5651: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5652: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5653: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5654: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5655: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
5656: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
5657: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
5658:
5659: -- DBMS_OUTPUT.PUT_LINE('before calling Update API...');
5652: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5653: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5654: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5655: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
5656: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
5657: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
5658:
5659: -- DBMS_OUTPUT.PUT_LINE('before calling Update API...');
5660: GMF_ResourceCost_PUB.Update_Resource_Cost
5653: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5654: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5655: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
5656: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
5657: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
5658:
5659: -- DBMS_OUTPUT.PUT_LINE('before calling Update API...');
5660: GMF_ResourceCost_PUB.Update_Resource_Cost
5661: ( p_api_version => 2.0
5668:
5669: , p_Resource_Cost_rec => rsrc_rec
5670: );
5671:
5672: UTL_FILE.PUT_LINE(l_log_handle, 'after API call. status := ' || l_status ||' cnt := ' || l_count );
5673: IF l_count > 0
5674: THEN
5675: l_loop_cnt :=1;
5676: LOOP
5683:
5684:
5685: -- DBMS_OUTPUT.PUT_LINE(l_data );
5686:
5687: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
5688: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
5689: UTL_FILE.NEW_LINE(l_outfile_handle);
5690:
5691:
5684:
5685: -- DBMS_OUTPUT.PUT_LINE(l_data );
5686:
5687: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
5688: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
5689: UTL_FILE.NEW_LINE(l_outfile_handle);
5690:
5691:
5692: /*
5685: -- DBMS_OUTPUT.PUT_LINE(l_data );
5686:
5687: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
5688: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
5689: UTL_FILE.NEW_LINE(l_outfile_handle);
5690:
5691:
5692: /*
5693: IF l_status = 'E' OR
5696: l_data := CONCAT('ERROR : ',l_data);
5697: END IF;
5698: */
5699:
5700: UTL_FILE.PUT_LINE(l_log_handle, l_data);
5701:
5702: /* Update error status */
5703: IF (l_status = 'U')
5704: THEN
5723:
5724:
5725: EXCEPTION
5726: WHEN OTHERS THEN
5727: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5728: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5729: l_return_status := 'U' ;
5730: END ;
5731:
5724:
5725: EXCEPTION
5726: WHEN OTHERS THEN
5727: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5728: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5729: l_return_status := 'U' ;
5730: END ;
5731:
5732: END LOOP;
5730: END ;
5731:
5732: END LOOP;
5733: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5734: UTL_FILE.NEW_LINE(l_log_handle);
5735: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5736:
5737: /* Check if any messages generated. If so then decode and */
5738: /* output to error message flat file */
5731:
5732: END LOOP;
5733: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5734: UTL_FILE.NEW_LINE(l_log_handle);
5735: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5736:
5737: /* Check if any messages generated. If so then decode and */
5738: /* output to error message flat file */
5739:
5736:
5737: /* Check if any messages generated. If so then decode and */
5738: /* output to error message flat file */
5739:
5740: UTL_FILE.FCLOSE_ALL;
5741:
5742: RETURN l_return_status;
5743:
5744: EXCEPTION
5741:
5742: RETURN l_return_status;
5743:
5744: EXCEPTION
5745: WHEN UTL_FILE.INVALID_OPERATION THEN
5746: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
5747: UTL_FILE.FCLOSE_ALL;
5748: RETURN l_return_status;
5749:
5743:
5744: EXCEPTION
5745: WHEN UTL_FILE.INVALID_OPERATION THEN
5746: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
5747: UTL_FILE.FCLOSE_ALL;
5748: RETURN l_return_status;
5749:
5750: WHEN UTL_FILE.INVALID_PATH THEN
5751: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
5746: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
5747: UTL_FILE.FCLOSE_ALL;
5748: RETURN l_return_status;
5749:
5750: WHEN UTL_FILE.INVALID_PATH THEN
5751: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
5752: UTL_FILE.FCLOSE_ALL;
5753: RETURN l_return_status;
5754:
5748: RETURN l_return_status;
5749:
5750: WHEN UTL_FILE.INVALID_PATH THEN
5751: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
5752: UTL_FILE.FCLOSE_ALL;
5753: RETURN l_return_status;
5754:
5755: WHEN UTL_FILE.INVALID_MODE THEN
5756: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
5751: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
5752: UTL_FILE.FCLOSE_ALL;
5753: RETURN l_return_status;
5754:
5755: WHEN UTL_FILE.INVALID_MODE THEN
5756: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
5757: UTL_FILE.FCLOSE_ALL;
5758: RETURN l_return_status;
5759:
5753: RETURN l_return_status;
5754:
5755: WHEN UTL_FILE.INVALID_MODE THEN
5756: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
5757: UTL_FILE.FCLOSE_ALL;
5758: RETURN l_return_status;
5759:
5760: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
5761: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
5756: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
5757: UTL_FILE.FCLOSE_ALL;
5758: RETURN l_return_status;
5759:
5760: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
5761: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
5762: UTL_FILE.FCLOSE_ALL;
5763: RETURN l_return_status;
5764:
5758: RETURN l_return_status;
5759:
5760: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
5761: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
5762: UTL_FILE.FCLOSE_ALL;
5763: RETURN l_return_status;
5764:
5765: WHEN UTL_FILE.WRITE_ERROR THEN
5766: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
5761: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
5762: UTL_FILE.FCLOSE_ALL;
5763: RETURN l_return_status;
5764:
5765: WHEN UTL_FILE.WRITE_ERROR THEN
5766: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
5767: UTL_FILE.FCLOSE_ALL;
5768: RETURN l_return_status;
5769:
5763: RETURN l_return_status;
5764:
5765: WHEN UTL_FILE.WRITE_ERROR THEN
5766: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
5767: UTL_FILE.FCLOSE_ALL;
5768: RETURN l_return_status;
5769:
5770: WHEN UTL_FILE.READ_ERROR THEN
5771: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
5766: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
5767: UTL_FILE.FCLOSE_ALL;
5768: RETURN l_return_status;
5769:
5770: WHEN UTL_FILE.READ_ERROR THEN
5771: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
5772: UTL_FILE.FCLOSE_ALL;
5773: RETURN l_return_status;
5774:
5768: RETURN l_return_status;
5769:
5770: WHEN UTL_FILE.READ_ERROR THEN
5771: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
5772: UTL_FILE.FCLOSE_ALL;
5773: RETURN l_return_status;
5774:
5775: WHEN UTL_FILE.INTERNAL_ERROR THEN
5776: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
5771: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
5772: UTL_FILE.FCLOSE_ALL;
5773: RETURN l_return_status;
5774:
5775: WHEN UTL_FILE.INTERNAL_ERROR THEN
5776: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
5777: UTL_FILE.FCLOSE_ALL;
5778: RETURN l_return_status;
5779:
5773: RETURN l_return_status;
5774:
5775: WHEN UTL_FILE.INTERNAL_ERROR THEN
5776: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
5777: UTL_FILE.FCLOSE_ALL;
5778: RETURN l_return_status;
5779:
5780: WHEN OTHERS THEN
5781: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
5778: RETURN l_return_status;
5779:
5780: WHEN OTHERS THEN
5781: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
5782: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5783: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5784: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5785: UTL_FILE.FCLOSE_ALL;
5786: l_return_status := 'U' ;
5779:
5780: WHEN OTHERS THEN
5781: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
5782: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5783: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5784: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5785: UTL_FILE.FCLOSE_ALL;
5786: l_return_status := 'U' ;
5787: RETURN l_return_status;
5780: WHEN OTHERS THEN
5781: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
5782: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5783: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5784: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5785: UTL_FILE.FCLOSE_ALL;
5786: l_return_status := 'U' ;
5787: RETURN l_return_status;
5788:
5781: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
5782: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5783: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
5784: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5785: UTL_FILE.FCLOSE_ALL;
5786: l_return_status := 'U' ;
5787: RETURN l_return_status;
5788:
5789: END Update_resource_cost;
5897: l_data VARCHAR2(2000);
5898: rsrc_rec GMF_ResourceCost_PUB.Resource_Cost_Rec_Type;
5899: l_p_dir VARCHAR2(150);
5900: l_output_file VARCHAR2(120);
5901: l_outfile_handle UTL_FILE.FILE_TYPE;
5902: l_input_file VARCHAR2(120);
5903: l_infile_handle UTL_FILE.FILE_TYPE;
5904: l_line VARCHAR2(1800);
5905: l_delimiter VARCHAR(11);
5899: l_p_dir VARCHAR2(150);
5900: l_output_file VARCHAR2(120);
5901: l_outfile_handle UTL_FILE.FILE_TYPE;
5902: l_input_file VARCHAR2(120);
5903: l_infile_handle UTL_FILE.FILE_TYPE;
5904: l_line VARCHAR2(1800);
5905: l_delimiter VARCHAR(11);
5906: l_log_dir VARCHAR2(150);
5907: l_log_name VARCHAR2(120) :='gmf_api_delrc_wrapper';
5904: l_line VARCHAR2(1800);
5905: l_delimiter VARCHAR(11);
5906: l_log_dir VARCHAR2(150);
5907: l_log_name VARCHAR2(120) :='gmf_api_delrc_wrapper';
5908: l_log_handle UTL_FILE.FILE_TYPE;
5909: l_global_file VARCHAR2(120);
5910:
5911: l_session_id VARCHAR2(110);
5912:
5935:
5936:
5937: /* Open The Wrapper File For Output And The Input File for Input. */
5938:
5939: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
5940: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
5941:
5942: /* Loop thru flat file and call Inventory Quantities API */
5943: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5936:
5937: /* Open The Wrapper File For Output And The Input File for Input. */
5938:
5939: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
5940: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
5941:
5942: /* Loop thru flat file and call Inventory Quantities API */
5943: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5944: -- DBMS_OUTPUT.PUT_LINE('Input Directory ' || l_p_dir );
5947: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
5948:
5949:
5950: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
5951: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5952: UTL_FILE.NEW_LINE(l_log_handle);
5953: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5954: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5955: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5948:
5949:
5950: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
5951: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5952: UTL_FILE.NEW_LINE(l_log_handle);
5953: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5954: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5955: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5956: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5949:
5950: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
5951: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5952: UTL_FILE.NEW_LINE(l_log_handle);
5953: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5954: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5955: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5956: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5957:
5950: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
5951: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5952: UTL_FILE.NEW_LINE(l_log_handle);
5953: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5954: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5955: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5956: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5957:
5958: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
5951: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
5952: UTL_FILE.NEW_LINE(l_log_handle);
5953: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5954: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5955: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5956: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5957:
5958: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
5959:
5952: UTL_FILE.NEW_LINE(l_log_handle);
5953: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
5954: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5955: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5956: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5957:
5958: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
5959:
5960:
5954: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
5955: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
5956: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
5957:
5958: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
5959:
5960:
5961: LOOP
5962: l_record_count :=l_record_count+1;
5961: LOOP
5962: l_record_count :=l_record_count+1;
5963:
5964: BEGIN
5965: UTL_FILE.GET_LINE(l_infile_handle, l_line);
5966: EXCEPTION
5967: WHEN NO_DATA_FOUND THEN
5968: EXIT;
5969: END;
5968: EXIT;
5969: END;
5970:
5971: BEGIN
5972: UTL_FILE.NEW_LINE(l_log_handle);
5973: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
5974:
5975: rsrc_rec.resources := Get_Field(l_line,l_delimiter,1) ;
5976: rsrc_rec.legal_entity_id := Get_Field(l_line,l_delimiter,2) ;
5969: END;
5970:
5971: BEGIN
5972: UTL_FILE.NEW_LINE(l_log_handle);
5973: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
5974:
5975: rsrc_rec.resources := Get_Field(l_line,l_delimiter,1) ;
5976: rsrc_rec.legal_entity_id := Get_Field(l_line,l_delimiter,2) ;
5977: rsrc_rec.organization_id := Get_Field(l_line,l_delimiter,3) ;
5985: rsrc_rec.nominal_cost := Get_Field(l_line,l_delimiter,11) ;
5986: rsrc_rec.delete_mark := Get_Field(l_line,l_delimiter,12) ;
5987: rsrc_rec.user_name := Get_Field(l_line,l_delimiter,13) ;
5988:
5989: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
5990: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5991: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5992: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5993: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5986: rsrc_rec.delete_mark := Get_Field(l_line,l_delimiter,12) ;
5987: rsrc_rec.user_name := Get_Field(l_line,l_delimiter,13) ;
5988:
5989: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
5990: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5991: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5992: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5993: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5994: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5987: rsrc_rec.user_name := Get_Field(l_line,l_delimiter,13) ;
5988:
5989: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
5990: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5991: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5992: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5993: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5994: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5995: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5988:
5989: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
5990: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5991: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5992: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5993: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5994: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5995: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5996: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5989: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
5990: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5991: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5992: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5993: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5994: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5995: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5996: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5997: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5990: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
5991: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5992: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5993: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5994: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5995: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5996: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5997: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5998: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5991: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
5992: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5993: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5994: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5995: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5996: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5997: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5998: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5999: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
5992: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
5993: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5994: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5995: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5996: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5997: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5998: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5999: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
6000: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
5993: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
5994: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5995: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5996: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5997: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5998: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5999: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
6000: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
6001: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
5994: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
5995: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5996: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5997: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5998: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5999: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
6000: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
6001: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
6002:
5995: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
5996: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5997: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5998: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5999: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
6000: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
6001: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
6002:
6003: -- DBMS_OUTPUT.PUT_LINE('before calling Delete API...');
5996: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
5997: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5998: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5999: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
6000: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
6001: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
6002:
6003: -- DBMS_OUTPUT.PUT_LINE('before calling Delete API...');
6004: GMF_ResourceCost_PUB.Delete_Resource_Cost
5997: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
5998: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
5999: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
6000: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
6001: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
6002:
6003: -- DBMS_OUTPUT.PUT_LINE('before calling Delete API...');
6004: GMF_ResourceCost_PUB.Delete_Resource_Cost
6005: ( p_api_version => 2.0
6012:
6013: , p_Resource_Cost_rec => rsrc_rec
6014: );
6015:
6016: UTL_FILE.PUT_LINE(l_log_handle, 'after API call. status := ' || l_status ||' cnt := ' || l_count );
6017: IF l_count > 0
6018: THEN
6019: l_loop_cnt :=1;
6020: LOOP
6027:
6028:
6029: -- DBMS_OUTPUT.PUT_LINE(l_data );
6030:
6031: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
6032: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
6033: UTL_FILE.NEW_LINE(l_outfile_handle);
6034:
6035: UTL_FILE.PUT_LINE(l_log_handle, l_data);
6028:
6029: -- DBMS_OUTPUT.PUT_LINE(l_data );
6030:
6031: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
6032: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
6033: UTL_FILE.NEW_LINE(l_outfile_handle);
6034:
6035: UTL_FILE.PUT_LINE(l_log_handle, l_data);
6036:
6029: -- DBMS_OUTPUT.PUT_LINE(l_data );
6030:
6031: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
6032: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
6033: UTL_FILE.NEW_LINE(l_outfile_handle);
6034:
6035: UTL_FILE.PUT_LINE(l_log_handle, l_data);
6036:
6037: /* Update error status */
6031: UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
6032: UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
6033: UTL_FILE.NEW_LINE(l_outfile_handle);
6034:
6035: UTL_FILE.PUT_LINE(l_log_handle, l_data);
6036:
6037: /* Update error status */
6038: IF (l_status = 'U')
6039: THEN
6056: END IF;
6057:
6058: EXCEPTION
6059: WHEN OTHERS THEN
6060: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6061: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6062: l_return_status := 'U' ;
6063: END ;
6064:
6057:
6058: EXCEPTION
6059: WHEN OTHERS THEN
6060: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6061: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6062: l_return_status := 'U' ;
6063: END ;
6064:
6065:
6064:
6065:
6066: END LOOP;
6067: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6068: UTL_FILE.NEW_LINE(l_log_handle);
6069: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6070:
6071: /* Check if any messages generated. If so then decode and */
6072: /* output to error message flat file */
6065:
6066: END LOOP;
6067: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6068: UTL_FILE.NEW_LINE(l_log_handle);
6069: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6070:
6071: /* Check if any messages generated. If so then decode and */
6072: /* output to error message flat file */
6073:
6070:
6071: /* Check if any messages generated. If so then decode and */
6072: /* output to error message flat file */
6073:
6074: UTL_FILE.FCLOSE_ALL;
6075:
6076: RETURN l_return_status;
6077:
6078: EXCEPTION
6075:
6076: RETURN l_return_status;
6077:
6078: EXCEPTION
6079: WHEN UTL_FILE.INVALID_OPERATION THEN
6080: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
6081: UTL_FILE.FCLOSE_ALL;
6082: RETURN l_return_status;
6083:
6077:
6078: EXCEPTION
6079: WHEN UTL_FILE.INVALID_OPERATION THEN
6080: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
6081: UTL_FILE.FCLOSE_ALL;
6082: RETURN l_return_status;
6083:
6084: WHEN UTL_FILE.INVALID_PATH THEN
6085: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
6080: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
6081: UTL_FILE.FCLOSE_ALL;
6082: RETURN l_return_status;
6083:
6084: WHEN UTL_FILE.INVALID_PATH THEN
6085: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
6086: UTL_FILE.FCLOSE_ALL;
6087: RETURN l_return_status;
6088:
6082: RETURN l_return_status;
6083:
6084: WHEN UTL_FILE.INVALID_PATH THEN
6085: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
6086: UTL_FILE.FCLOSE_ALL;
6087: RETURN l_return_status;
6088:
6089: WHEN UTL_FILE.INVALID_MODE THEN
6090: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
6085: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
6086: UTL_FILE.FCLOSE_ALL;
6087: RETURN l_return_status;
6088:
6089: WHEN UTL_FILE.INVALID_MODE THEN
6090: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
6091: UTL_FILE.FCLOSE_ALL;
6092: RETURN l_return_status;
6093:
6087: RETURN l_return_status;
6088:
6089: WHEN UTL_FILE.INVALID_MODE THEN
6090: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
6091: UTL_FILE.FCLOSE_ALL;
6092: RETURN l_return_status;
6093:
6094: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
6095: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
6090: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
6091: UTL_FILE.FCLOSE_ALL;
6092: RETURN l_return_status;
6093:
6094: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
6095: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
6096: UTL_FILE.FCLOSE_ALL;
6097: RETURN l_return_status;
6098:
6092: RETURN l_return_status;
6093:
6094: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
6095: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
6096: UTL_FILE.FCLOSE_ALL;
6097: RETURN l_return_status;
6098:
6099: WHEN UTL_FILE.WRITE_ERROR THEN
6100: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
6095: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
6096: UTL_FILE.FCLOSE_ALL;
6097: RETURN l_return_status;
6098:
6099: WHEN UTL_FILE.WRITE_ERROR THEN
6100: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
6101: UTL_FILE.FCLOSE_ALL;
6102: RETURN l_return_status;
6103:
6097: RETURN l_return_status;
6098:
6099: WHEN UTL_FILE.WRITE_ERROR THEN
6100: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
6101: UTL_FILE.FCLOSE_ALL;
6102: RETURN l_return_status;
6103:
6104: WHEN UTL_FILE.READ_ERROR THEN
6105: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
6100: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
6101: UTL_FILE.FCLOSE_ALL;
6102: RETURN l_return_status;
6103:
6104: WHEN UTL_FILE.READ_ERROR THEN
6105: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
6106: UTL_FILE.FCLOSE_ALL;
6107: RETURN l_return_status;
6108:
6102: RETURN l_return_status;
6103:
6104: WHEN UTL_FILE.READ_ERROR THEN
6105: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
6106: UTL_FILE.FCLOSE_ALL;
6107: RETURN l_return_status;
6108:
6109: WHEN UTL_FILE.INTERNAL_ERROR THEN
6110: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
6105: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
6106: UTL_FILE.FCLOSE_ALL;
6107: RETURN l_return_status;
6108:
6109: WHEN UTL_FILE.INTERNAL_ERROR THEN
6110: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
6111: UTL_FILE.FCLOSE_ALL;
6112: RETURN l_return_status;
6113:
6107: RETURN l_return_status;
6108:
6109: WHEN UTL_FILE.INTERNAL_ERROR THEN
6110: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
6111: UTL_FILE.FCLOSE_ALL;
6112: RETURN l_return_status;
6113:
6114: WHEN OTHERS THEN
6115: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
6112: RETURN l_return_status;
6113:
6114: WHEN OTHERS THEN
6115: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
6116: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6117: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6118: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6119: UTL_FILE.FCLOSE_ALL;
6120: l_return_status := 'U' ;
6113:
6114: WHEN OTHERS THEN
6115: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
6116: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6117: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6118: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6119: UTL_FILE.FCLOSE_ALL;
6120: l_return_status := 'U' ;
6121: RETURN l_return_status;
6114: WHEN OTHERS THEN
6115: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
6116: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6117: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6118: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6119: UTL_FILE.FCLOSE_ALL;
6120: l_return_status := 'U' ;
6121: RETURN l_return_status;
6122:
6115: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
6116: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6117: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6118: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6119: UTL_FILE.FCLOSE_ALL;
6120: l_return_status := 'U' ;
6121: RETURN l_return_status;
6122:
6123: END Delete_resource_cost;
6231: rsrc_rec GMF_ResourceCost_PUB.Resource_Cost_Rec_Type;
6232: x_rsrc_rec GMF_ResourceCost_PUB.Resource_Cost_Rec_Type;
6233: l_p_dir VARCHAR2(150);
6234: l_output_file VARCHAR2(120);
6235: l_outfile_handle UTL_FILE.FILE_TYPE;
6236: l_input_file VARCHAR2(120);
6237: l_infile_handle UTL_FILE.FILE_TYPE;
6238: l_line VARCHAR2(1800);
6239: l_delimiter VARCHAR(11);
6233: l_p_dir VARCHAR2(150);
6234: l_output_file VARCHAR2(120);
6235: l_outfile_handle UTL_FILE.FILE_TYPE;
6236: l_input_file VARCHAR2(120);
6237: l_infile_handle UTL_FILE.FILE_TYPE;
6238: l_line VARCHAR2(1800);
6239: l_delimiter VARCHAR(11);
6240: l_log_dir VARCHAR2(150);
6241: l_log_name VARCHAR2(120) :='gmf_api_getrc_wrapper';
6238: l_line VARCHAR2(1800);
6239: l_delimiter VARCHAR(11);
6240: l_log_dir VARCHAR2(150);
6241: l_log_name VARCHAR2(120) :='gmf_api_getrc_wrapper';
6242: l_log_handle UTL_FILE.FILE_TYPE;
6243: l_global_file VARCHAR2(120);
6244:
6245: l_session_id VARCHAR2(110);
6246:
6269:
6270:
6271: /* Open The Wrapper File For Output And The Input File for Input. */
6272:
6273: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
6274: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
6275:
6276: /* Loop thru flat file and call Inventory Quantities API */
6277: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6270:
6271: /* Open The Wrapper File For Output And The Input File for Input. */
6272:
6273: l_log_handle :=UTL_FILE.FOPEN(l_log_dir, l_log_name, 'w');
6274: l_infile_handle :=UTL_FILE.FOPEN(l_p_dir, l_input_file, 'r');
6275:
6276: /* Loop thru flat file and call Inventory Quantities API */
6277: -- DBMS_OUTPUT.PUT_LINE('Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6278: -- DBMS_OUTPUT.PUT_LINE('Input Directory ' || l_p_dir );
6281: -- DBMS_OUTPUT.PUT_LINE('Output File ' || l_output_file );
6282:
6283:
6284: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
6285: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6286: UTL_FILE.NEW_LINE(l_log_handle);
6287: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
6288: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
6289: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
6282:
6283:
6284: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
6285: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6286: UTL_FILE.NEW_LINE(l_log_handle);
6287: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
6288: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
6289: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
6290: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
6283:
6284: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
6285: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6286: UTL_FILE.NEW_LINE(l_log_handle);
6287: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
6288: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
6289: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
6290: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
6291:
6284: /* -- DBMS_OUTPUT.PUT_LINE('Start Processing'); */
6285: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6286: UTL_FILE.NEW_LINE(l_log_handle);
6287: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
6288: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
6289: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
6290: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
6291:
6292: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
6285: UTL_FILE.PUT_LINE(l_log_handle, 'Process Started at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6286: UTL_FILE.NEW_LINE(l_log_handle);
6287: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
6288: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
6289: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
6290: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
6291:
6292: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
6293:
6286: UTL_FILE.NEW_LINE(l_log_handle);
6287: UTL_FILE.PUT_LINE(l_log_handle, 'Input Directory ' || l_p_dir );
6288: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
6289: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
6290: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
6291:
6292: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
6293:
6294:
6288: UTL_FILE.PUT_LINE(l_log_handle, 'Input File ' || l_input_file );
6289: UTL_FILE.PUT_LINE(l_log_handle, 'Record Type ' || l_delimiter );
6290: UTL_FILE.PUT_LINE(l_log_handle, 'Output File ' || l_output_file );
6291:
6292: l_outfile_handle :=UTL_FILE.FOPEN(l_p_dir, l_output_file, 'w');
6293:
6294:
6295: LOOP
6296: l_record_count :=l_record_count+1;
6295: LOOP
6296: l_record_count :=l_record_count+1;
6297:
6298: BEGIN
6299: UTL_FILE.GET_LINE(l_infile_handle, l_line);
6300: EXCEPTION
6301: WHEN NO_DATA_FOUND THEN
6302: EXIT;
6303: END;
6302: EXIT;
6303: END;
6304:
6305: BEGIN
6306: UTL_FILE.NEW_LINE(l_log_handle);
6307: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
6308:
6309: rsrc_rec.resources := Get_Field(l_line,l_delimiter,1) ;
6310: rsrc_rec.legal_entity_id := Get_Field(l_line,l_delimiter,2) ;
6303: END;
6304:
6305: BEGIN
6306: UTL_FILE.NEW_LINE(l_log_handle);
6307: UTL_FILE.PUT_LINE(l_log_handle, 'Reading Record...' || l_record_count );
6308:
6309: rsrc_rec.resources := Get_Field(l_line,l_delimiter,1) ;
6310: rsrc_rec.legal_entity_id := Get_Field(l_line,l_delimiter,2) ;
6311: rsrc_rec.organization_id := Get_Field(l_line,l_delimiter,3) ;
6319: rsrc_rec.nominal_cost := Get_Field(l_line,l_delimiter,11) ;
6320: rsrc_rec.delete_mark := Get_Field(l_line,l_delimiter,12) ;
6321: rsrc_rec.user_name := Get_Field(l_line,l_delimiter,13) ;
6322:
6323: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
6324: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
6325: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
6326: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
6327: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
6320: rsrc_rec.delete_mark := Get_Field(l_line,l_delimiter,12) ;
6321: rsrc_rec.user_name := Get_Field(l_line,l_delimiter,13) ;
6322:
6323: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
6324: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
6325: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
6326: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
6327: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
6328: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
6321: rsrc_rec.user_name := Get_Field(l_line,l_delimiter,13) ;
6322:
6323: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
6324: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
6325: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
6326: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
6327: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
6328: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
6329: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
6322:
6323: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
6324: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
6325: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
6326: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
6327: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
6328: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
6329: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
6330: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
6323: UTL_FILE.PUT_LINE(l_log_handle, 'resources = ' || rsrc_rec.resources);
6324: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
6325: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
6326: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
6327: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
6328: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
6329: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
6330: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
6331: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
6324: UTL_FILE.PUT_LINE(l_log_handle, 'legal_entity_id= ' || rsrc_rec.legal_entity_id);
6325: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
6326: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
6327: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
6328: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
6329: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
6330: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
6331: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
6332: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
6325: UTL_FILE.PUT_LINE(l_log_handle, 'organization_id= ' || rsrc_rec.organization_id);
6326: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
6327: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
6328: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
6329: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
6330: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
6331: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
6332: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
6333: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
6326: UTL_FILE.PUT_LINE(l_log_handle, 'organization_code= ' || rsrc_rec.organization_code);
6327: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
6328: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
6329: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
6330: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
6331: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
6332: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
6333: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
6334: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
6327: UTL_FILE.PUT_LINE(l_log_handle, 'period_id = ' || rsrc_rec.period_id);
6328: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
6329: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
6330: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
6331: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
6332: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
6333: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
6334: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
6335: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
6328: UTL_FILE.PUT_LINE(l_log_handle, 'calendar_code = ' || rsrc_rec.calendar_code);
6329: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
6330: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
6331: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
6332: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
6333: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
6334: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
6335: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
6336:
6329: UTL_FILE.PUT_LINE(l_log_handle, 'period_code = ' || rsrc_rec.period_code);
6330: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
6331: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
6332: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
6333: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
6334: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
6335: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
6336:
6337: -- DBMS_OUTPUT.PUT_LINE('before calling Get Resource Cost Public API...');
6330: UTL_FILE.PUT_LINE(l_log_handle, 'cost_type_id= ' || rsrc_rec.cost_type_id);
6331: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
6332: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
6333: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
6334: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
6335: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
6336:
6337: -- DBMS_OUTPUT.PUT_LINE('before calling Get Resource Cost Public API...');
6338: GMF_ResourceCost_PUB.Get_Resource_Cost
6331: UTL_FILE.PUT_LINE(l_log_handle, 'cost_mthd_code= ' || rsrc_rec.cost_mthd_code);
6332: UTL_FILE.PUT_LINE(l_log_handle, 'usage_uom = ' || rsrc_rec.usage_uom);
6333: UTL_FILE.PUT_LINE(l_log_handle, 'nominal_cost = ' || rsrc_rec.nominal_cost);
6334: UTL_FILE.PUT_LINE(l_log_handle, 'delete_mark = ' || rsrc_rec.delete_mark);
6335: UTL_FILE.PUT_LINE(l_log_handle, 'user_name = ' || rsrc_rec.user_name);
6336:
6337: -- DBMS_OUTPUT.PUT_LINE('before calling Get Resource Cost Public API...');
6338: GMF_ResourceCost_PUB.Get_Resource_Cost
6339: ( p_api_version => 2.0
6346: , p_Resource_Cost_rec => rsrc_rec
6347: , x_Resource_Cost_rec => x_rsrc_rec
6348: );
6349:
6350: UTL_FILE.PUT_LINE(l_log_handle, 'after API call. status := ' || l_status ||' cnt := ' || l_count );
6351: IF l_count > 0
6352: THEN
6353: l_loop_cnt :=1;
6354: LOOP
6360: p_msg_index_out => l_dummy_cnt);
6361:
6362:
6363: -- DBMS_OUTPUT.PUT_LINE(l_data );
6364: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
6365: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
6366: --UTL_FILE.NEW_LINE(l_outfile_handle);
6367:
6368: UTL_FILE.PUT_LINE(l_log_handle, l_data);
6361:
6362:
6363: -- DBMS_OUTPUT.PUT_LINE(l_data );
6364: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
6365: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
6366: --UTL_FILE.NEW_LINE(l_outfile_handle);
6367:
6368: UTL_FILE.PUT_LINE(l_log_handle, l_data);
6369:
6362:
6363: -- DBMS_OUTPUT.PUT_LINE(l_data );
6364: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
6365: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
6366: --UTL_FILE.NEW_LINE(l_outfile_handle);
6367:
6368: UTL_FILE.PUT_LINE(l_log_handle, l_data);
6369:
6370: /* Update error status */
6364: --UTL_FILE.PUT_LINE(l_outfile_handle, 'Record = ' ||l_record_count );
6365: --UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
6366: --UTL_FILE.NEW_LINE(l_outfile_handle);
6367:
6368: UTL_FILE.PUT_LINE(l_log_handle, l_data);
6369:
6370: /* Update error status */
6371: IF (l_status = 'U')
6372: THEN
6389:
6390: IF (x_rsrc_rec.usage_uom <> FND_API.G_MISS_CHAR) OR
6391: (x_rsrc_rec.nominal_cost <> FND_API.G_MISS_NUM) THEN
6392:
6393: UTL_FILE.PUT_LINE( l_log_handle,
6394: 'Usage_uom : ' || x_rsrc_rec.usage_uom ||
6395: ' Nominal Cost : ' || x_rsrc_rec.nominal_cost ||
6396: ' Delete Mark : ' || x_rsrc_rec.delete_mark ||
6397: ' User Name : ' || x_rsrc_rec.user_name
6399: END IF ;
6400:
6401: EXCEPTION
6402: WHEN OTHERS THEN
6403: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6404: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6405: l_return_status := 'U' ;
6406: END ;
6407:
6400:
6401: EXCEPTION
6402: WHEN OTHERS THEN
6403: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6404: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6405: l_return_status := 'U' ;
6406: END ;
6407:
6408: END LOOP ;
6407:
6408: END LOOP ;
6409:
6410: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6411: UTL_FILE.NEW_LINE(l_log_handle);
6412: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6413: UTL_FILE.FCLOSE_ALL;
6414:
6415: RETURN l_return_status;
6408: END LOOP ;
6409:
6410: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6411: UTL_FILE.NEW_LINE(l_log_handle);
6412: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6413: UTL_FILE.FCLOSE_ALL;
6414:
6415: RETURN l_return_status;
6416:
6409:
6410: -- DBMS_OUTPUT.PUT_LINE('Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6411: UTL_FILE.NEW_LINE(l_log_handle);
6412: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6413: UTL_FILE.FCLOSE_ALL;
6414:
6415: RETURN l_return_status;
6416:
6417: EXCEPTION
6414:
6415: RETURN l_return_status;
6416:
6417: EXCEPTION
6418: WHEN UTL_FILE.INVALID_OPERATION THEN
6419: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
6420: UTL_FILE.FCLOSE_ALL;
6421: RETURN l_return_status;
6422:
6416:
6417: EXCEPTION
6418: WHEN UTL_FILE.INVALID_OPERATION THEN
6419: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
6420: UTL_FILE.FCLOSE_ALL;
6421: RETURN l_return_status;
6422:
6423: WHEN UTL_FILE.INVALID_PATH THEN
6424: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
6419: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Operation For '|| l_global_file); */
6420: UTL_FILE.FCLOSE_ALL;
6421: RETURN l_return_status;
6422:
6423: WHEN UTL_FILE.INVALID_PATH THEN
6424: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
6425: UTL_FILE.FCLOSE_ALL;
6426: RETURN l_return_status;
6427:
6421: RETURN l_return_status;
6422:
6423: WHEN UTL_FILE.INVALID_PATH THEN
6424: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
6425: UTL_FILE.FCLOSE_ALL;
6426: RETURN l_return_status;
6427:
6428: WHEN UTL_FILE.INVALID_MODE THEN
6429: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
6424: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Path For '|| l_global_file); */
6425: UTL_FILE.FCLOSE_ALL;
6426: RETURN l_return_status;
6427:
6428: WHEN UTL_FILE.INVALID_MODE THEN
6429: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
6430: UTL_FILE.FCLOSE_ALL;
6431: RETURN l_return_status;
6432:
6426: RETURN l_return_status;
6427:
6428: WHEN UTL_FILE.INVALID_MODE THEN
6429: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
6430: UTL_FILE.FCLOSE_ALL;
6431: RETURN l_return_status;
6432:
6433: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
6434: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
6429: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Mode For '|| l_global_file); */
6430: UTL_FILE.FCLOSE_ALL;
6431: RETURN l_return_status;
6432:
6433: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
6434: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
6435: UTL_FILE.FCLOSE_ALL;
6436: RETURN l_return_status;
6437:
6431: RETURN l_return_status;
6432:
6433: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
6434: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
6435: UTL_FILE.FCLOSE_ALL;
6436: RETURN l_return_status;
6437:
6438: WHEN UTL_FILE.WRITE_ERROR THEN
6439: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
6434: /* -- DBMS_OUTPUT.PUT_LINE('Invalid File Handle '|| l_global_file); */
6435: UTL_FILE.FCLOSE_ALL;
6436: RETURN l_return_status;
6437:
6438: WHEN UTL_FILE.WRITE_ERROR THEN
6439: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
6440: UTL_FILE.FCLOSE_ALL;
6441: RETURN l_return_status;
6442:
6436: RETURN l_return_status;
6437:
6438: WHEN UTL_FILE.WRITE_ERROR THEN
6439: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
6440: UTL_FILE.FCLOSE_ALL;
6441: RETURN l_return_status;
6442:
6443: WHEN UTL_FILE.READ_ERROR THEN
6444: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
6439: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Write Error '|| l_global_file); */
6440: UTL_FILE.FCLOSE_ALL;
6441: RETURN l_return_status;
6442:
6443: WHEN UTL_FILE.READ_ERROR THEN
6444: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
6445: UTL_FILE.FCLOSE_ALL;
6446: RETURN l_return_status;
6447:
6441: RETURN l_return_status;
6442:
6443: WHEN UTL_FILE.READ_ERROR THEN
6444: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
6445: UTL_FILE.FCLOSE_ALL;
6446: RETURN l_return_status;
6447:
6448: WHEN UTL_FILE.INTERNAL_ERROR THEN
6449: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
6444: /* -- DBMS_OUTPUT.PUT_LINE('Invalid Read Error '|| l_global_file); */
6445: UTL_FILE.FCLOSE_ALL;
6446: RETURN l_return_status;
6447:
6448: WHEN UTL_FILE.INTERNAL_ERROR THEN
6449: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
6450: UTL_FILE.FCLOSE_ALL;
6451: RETURN l_return_status;
6452:
6446: RETURN l_return_status;
6447:
6448: WHEN UTL_FILE.INTERNAL_ERROR THEN
6449: /* -- DBMS_OUTPUT.PUT_LINE('Internal Error'); */
6450: UTL_FILE.FCLOSE_ALL;
6451: RETURN l_return_status;
6452:
6453: WHEN OTHERS THEN
6454: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
6451: RETURN l_return_status;
6452:
6453: WHEN OTHERS THEN
6454: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
6455: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6456: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6457: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6458: UTL_FILE.FCLOSE_ALL;
6459: l_return_status := 'U' ;
6452:
6453: WHEN OTHERS THEN
6454: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
6455: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6456: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6457: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6458: UTL_FILE.FCLOSE_ALL;
6459: l_return_status := 'U' ;
6460: RETURN l_return_status;
6453: WHEN OTHERS THEN
6454: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
6455: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6456: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6457: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6458: UTL_FILE.FCLOSE_ALL;
6459: l_return_status := 'U' ;
6460: RETURN l_return_status;
6461:
6454: /* -- DBMS_OUTPUT.PUT_LINE('Other Error'); */
6455: UTL_FILE.PUT_LINE(l_outfile_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6456: UTL_FILE.PUT_LINE(l_log_handle, 'Error : ' || to_char(SQLCODE) || ' ' || SQLERRM);
6457: UTL_FILE.PUT_LINE(l_log_handle, 'Process Completed at ' || to_char(SYSDATE,'DD-MON-YY HH24:MI:SS'));
6458: UTL_FILE.FCLOSE_ALL;
6459: l_return_status := 'U' ;
6460: RETURN l_return_status;
6461:
6462: END Get_Resource_Cost;