DBA Data[Home] [Help]

APPS.QPR_SPECIAL_ETL dependencies on FND_FILE

Line 214: fnd_file.put_line(fnd_file.log, 'Handle kit items...');

210: and m2.attribute_4 = m1.attribute_4;
211:
212: procedure handle_kit_items is
213: begin
214: fnd_file.put_line(fnd_file.log, 'Handle kit items...');
215: open c_kit;
216: loop
217: t_ord_val.delete;
218: t_meas_id.delete;

Line 229: fnd_file.put_line(fnd_file.log, 'Records to process:'||t_ord_val.count);

225: t_ord_val, t_meas_id,t_cost_level, t_cost
226: limit l_rows;
227: exit when t_ord_val.count=0;
228:
229: fnd_file.put_line(fnd_file.log, 'Records to process:'||t_ord_val.count);
230:
231: for i in 1..t_ord_val.count loop
232: if t_ord_meas.exists(t_ord_val(i)) then
233: t_meas_id(i) := t_ord_meas(t_ord_val(i));

Line 239: fnd_file.put_line(fnd_file.log, 'Updating kit items...');

235: end if;
236: end loop;
237:
238: if l_ctr > 0 then
239: fnd_file.put_line(fnd_file.log, 'Updating kit items...');
240: FORALL I IN 1..t_ord_val.COUNT
241: update qpr_measure_data
242: set measure15_number = t_cost(i),
243: cos_level_value = t_cost_level(i),

Line 251: fnd_file.put_line(fnd_file.log, 'No Sales data found');

247: request_id = l_request_id
248: where measure_value_id = t_meas_id(i)
249: and t_meas_id(i) is not null;
250: else
251: fnd_file.put_line(fnd_file.log, 'No Sales data found');
252: end if;
253: end loop;
254: close c_kit;
255: exception

Line 257: fnd_file.put_line(fnd_file.log, 'Error in kit item cost updation');

253: end loop;
254: close c_kit;
255: exception
256: when OTHERS then
257: fnd_file.put_line(fnd_file.log, 'Error in kit item cost updation');
258: fnd_file.put_line(fnd_file.log, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
259: raise;
260: end handle_kit_items;
261:

Line 258: fnd_file.put_line(fnd_file.log, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);

254: close c_kit;
255: exception
256: when OTHERS then
257: fnd_file.put_line(fnd_file.log, 'Error in kit item cost updation');
258: fnd_file.put_line(fnd_file.log, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
259: raise;
260: end handle_kit_items;
261:
262: procedure handle_ato_items is

Line 264: fnd_file.put_line(fnd_file.log, 'Handle ato model items...');

260: end handle_kit_items;
261:
262: procedure handle_ato_items is
263: begin
264: fnd_file.put_line(fnd_file.log, 'Handle ato model items...');
265: open c_ato(l_cost_alloc_perc);
266: loop
267: t_ord_val.delete;
268: t_meas_id.delete;

Line 279: fnd_file.put_line(fnd_file.log, 'Records to process:'||t_ord_val.count);

275: t_ord_val, t_meas_id,t_cost_level, t_cost
276: limit l_rows;
277: exit when t_ord_val.count=0;
278:
279: fnd_file.put_line(fnd_file.log, 'Records to process:'||t_ord_val.count);
280:
281: for i in 1..t_ord_val.count loop
282: if t_ord_meas.exists(t_ord_val(i)) then
283: t_meas_id(i) := t_ord_meas(t_ord_val(i));

Line 289: fnd_file.put_line(fnd_file.log, 'Updating ato model items...');

285: end if;
286: end loop;
287:
288: if l_ctr > 0 then
289: fnd_file.put_line(fnd_file.log, 'Updating ato model items...');
290: FORALL I IN 1..t_ord_val.COUNT
291: update qpr_measure_data
292: set measure15_number = t_cost(i),
293: cos_level_value = t_cost_level(i),

Line 301: fnd_file.put_line(fnd_file.log, 'No Sales data found');

297: request_id = l_request_id
298: where measure_value_id = t_meas_id(i)
299: and t_meas_id(i) is not null;
300: else
301: fnd_file.put_line(fnd_file.log, 'No Sales data found');
302: end if;
303: end loop;
304: close c_ato;
305: exception

Line 307: fnd_file.put_line(fnd_file.log, 'Error in ato model item cost updation');

303: end loop;
304: close c_ato;
305: exception
306: when OTHERS then
307: fnd_file.put_line(fnd_file.log, 'Error in ato model item cost updation');
308: fnd_file.put_line(fnd_file.log, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
309: raise;
310: end handle_ato_items;
311:

Line 308: fnd_file.put_line(fnd_file.log, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);

304: close c_ato;
305: exception
306: when OTHERS then
307: fnd_file.put_line(fnd_file.log, 'Error in ato model item cost updation');
308: fnd_file.put_line(fnd_file.log, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
309: raise;
310: end handle_ato_items;
311:
312: procedure handle_pto_items is

Line 314: fnd_file.put_line(fnd_file.log, 'Handle pto model items...');

310: end handle_ato_items;
311:
312: procedure handle_pto_items is
313: begin
314: fnd_file.put_line(fnd_file.log, 'Handle pto model items...');
315: open c_pto(l_cost_alloc_perc);
316: loop
317: t_ord_val.delete;
318: t_meas_id.delete;

Line 329: fnd_file.put_line(fnd_file.log, 'Records to process:'||t_ord_val.count);

325: t_ord_val, t_meas_id,t_cost_level, t_cost
326: limit l_rows;
327: exit when t_ord_val.count=0;
328:
329: fnd_file.put_line(fnd_file.log, 'Records to process:'||t_ord_val.count);
330:
331: for i in 1..t_ord_val.count loop
332: if t_ord_meas.exists(t_ord_val(i)) then
333: t_meas_id(i) := t_ord_meas(t_ord_val(i));

Line 339: fnd_file.put_line(fnd_file.log, 'Updating pto model items...');

335: end if;
336: end loop;
337:
338: if l_ctr > 0 then
339: fnd_file.put_line(fnd_file.log, 'Updating pto model items...');
340: FORALL I IN 1..t_ord_val.COUNT
341: update qpr_measure_data
342: set measure15_number = t_cost(i),
343: cos_level_value = t_cost_level(i),

Line 351: fnd_file.put_line(fnd_file.log, 'No Sales data found');

347: request_id = l_request_id
348: where measure_value_id = t_meas_id(i)
349: and t_meas_id(i) is not null;
350: else
351: fnd_file.put_line(fnd_file.log, 'No Sales data found');
352: end if;
353: end loop;
354: close c_pto;
355: exception

Line 357: fnd_file.put_line(fnd_file.log, 'Error in pto model item cost updation');

353: end loop;
354: close c_pto;
355: exception
356: when OTHERS then
357: fnd_file.put_line(fnd_file.log, 'Error in pto model item cost updation');
358: fnd_file.put_line(fnd_file.log, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
359: raise;
360: end handle_pto_items;
361:

Line 358: fnd_file.put_line(fnd_file.log, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);

354: close c_pto;
355: exception
356: when OTHERS then
357: fnd_file.put_line(fnd_file.log, 'Error in pto model item cost updation');
358: fnd_file.put_line(fnd_file.log, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
359: raise;
360: end handle_pto_items;
361:
362: /* main method begins*/

Line 374: fnd_file.put_line(fnd_file.log, 'Process Standard and service items..');

370: ' from qpr_sr_cost_data_v'|| qpr_sr_util.get_dblink(p_instance_id)||
371: ' where booked_date between :1 and :2 ' ||
372: ' and item_type_code in (''STANDARD'',''SERVICE'')';
373:
374: fnd_file.put_line(fnd_file.log, 'Process Standard and service items..');
375: open c_sales(date_from, date_to);
376: fetch c_sales bulk collect into t_meas_id, t_ord_val;
377: close c_sales;
378:

Line 388: fnd_file.put_line(fnd_file.log, 'Sales Records to update:' || t_ord_meas.count);

384: t_ord_val.delete;
385: end if;
386:
387: if t_ord_meas.count > 0 then
388: fnd_file.put_line(fnd_file.log, 'Sales Records to update:' || t_ord_meas.count);
389: open c_measures for l_sql using date_from, date_to;
390: loop
391: c_cost_data.ord_level_value.delete;
392: c_cost_data.booked_date.delete;

Line 422: fnd_file.put_line(fnd_file.log,

418: c_cost_data.ord_quantity
419: limit l_rows;
420:
421: exit when c_cost_data.ord_level_value.count=0;
422: fnd_file.put_line(fnd_file.log,
423: 'Iteration...Records to process:' ||c_cost_data.ord_level_value.count);
424:
425: ----- Insert Dimension ----
426: FOR I IN 1..c_cost_data.ord_level_value.count LOOP

Line 435: fnd_file.put_line(fnd_file.log,'Cost dim present');

431: where dim_code = 'COS'
432: and hierarchy_code = 'COSTING'
433: and level1_value = c_cost_data.cos_level_value(I)
434: and instance_id = p_instance_id;
435: fnd_file.put_line(fnd_file.log,'Cost dim present');
436: exception
437: WHEN NO_DATA_FOUND THEN
438: begin
439: fnd_file.put_line(fnd_file.log,

Line 439: fnd_file.put_line(fnd_file.log,

435: fnd_file.put_line(fnd_file.log,'Cost dim present');
436: exception
437: WHEN NO_DATA_FOUND THEN
438: begin
439: fnd_file.put_line(fnd_file.log,
440: 'Inserting Cost dim :' || c_cost_data.cos_level_value(I));
441: INSERT INTO
442: qpr_dimension_values(instance_id,
443: dim_value_id,

Line 478: fnd_file.put_line(fnd_file.log,

474: exception
475: when others then
476: retcode := 2;
477: errbuf := FND_MESSAGE.GET;
478: fnd_file.put_line(fnd_file.log,
479: dbms_utility.format_error_backtrace);
480: return;
481: end;
482: end;

Line 488: fnd_file.put_line(fnd_file.log,'Associating order and measure value id...');

484: end if;
485: exit when first_time=0;
486: end loop;
487:
488: fnd_file.put_line(fnd_file.log,'Associating order and measure value id...');
489: for i in c_cost_data.ord_level_value.first..
490: c_cost_data.ord_level_value.last loop
491: if t_ord_meas.exists(c_cost_data.ord_level_value(i)) then
492: c_cost_data.measure_val_id(i) := t_ord_meas(

Line 499: fnd_file.put_line(fnd_file.log,'Updating sales data with cost measure...');

495: end if;
496: end loop;
497:
498: if l_ctr > 0 then
499: fnd_file.put_line(fnd_file.log,'Updating sales data with cost measure...');
500: FORALL I IN 1..c_cost_data.ord_level_value.COUNT
501: update qpr_measure_data
502: set measure15_number = (c_cost_data.cost_value(I) *
503: c_cost_data.ord_quantity(I)),

Line 512: fnd_file.put_line(fnd_file.log, 'Sales data not found.No update done');

508: request_id = l_request_id
509: where measure_value_id = c_cost_data.measure_val_id(i)
510: and c_cost_data.measure_val_id(i) is not null;
511: else
512: fnd_file.put_line(fnd_file.log, 'Sales data not found.No update done');
513: end if;
514: end loop;
515: close c_measures;
516: else

Line 523: fnd_file.put_line(fnd_file.log, 'Process Model and kit items..');

519: t_ord_meas.delete;
520:
521: commit;
522:
523: fnd_file.put_line(fnd_file.log, 'Process Model and kit items..');
524:
525: l_sql:= ' select ord_level_value, booked_date, cos_level_value, unit_cost, '||
526: ' unit_list_price, top_model_line_id, link_to_line_id, item_type_code, '||
527: ' inventory_item_id, component_code, ato_line_id , order_quantity' ||

Line 545: fnd_file.put_line(fnd_file.log,

541: t_ord_val.delete;
542: else
543: if b_data_present = false then
544: retcode := 1;
545: fnd_file.put_line(fnd_file.log,
546: 'Salesdata measures not found.Cost measures cannot be updated.');
547: fnd_file.put_line(fnd_file.log,
548: 'Try again after extracting Salesdata measures for given date range.');
549: return;

Line 547: fnd_file.put_line(fnd_file.log,

543: if b_data_present = false then
544: retcode := 1;
545: fnd_file.put_line(fnd_file.log,
546: 'Salesdata measures not found.Cost measures cannot be updated.');
547: fnd_file.put_line(fnd_file.log,
548: 'Try again after extracting Salesdata measures for given date range.');
549: return;
550: end if;
551: end if;

Line 554: fnd_file.put_line(fnd_file.log, 'Sales Records to update:' || t_ord_meas.count);

550: end if;
551: end if;
552:
553: if t_ord_meas.count > 0 then
554: fnd_file.put_line(fnd_file.log, 'Sales Records to update:' || t_ord_meas.count);
555: open c_measures for l_sql using date_from, date_to;
556: loop
557: c_cost_data.ord_level_value.delete;
558: c_cost_data.booked_date.delete;

Line 588: fnd_file.put_line(fnd_file.log,

584: c_cost_data.ord_quantity
585: limit l_rows;
586:
587: exit when c_cost_data.ord_level_value.count=0;
588: fnd_file.put_line(fnd_file.log,
589: 'Iteration...records to process:'||c_cost_data.ord_level_value.count);
590:
591: ----- Insert Dimension ----
592: FOR I IN 1..c_cost_data.ord_level_value.count LOOP

Line 601: fnd_file.put_line(fnd_file.log,'Cost dim present');

597: where dim_code = 'COS'
598: and hierarchy_code = 'COSTING'
599: and level1_value = c_cost_data.cos_level_value(I)
600: and instance_id = p_instance_id;
601: fnd_file.put_line(fnd_file.log,'Cost dim present');
602: exception
603: WHEN NO_DATA_FOUND THEN
604: begin
605: fnd_file.put_line(fnd_file.log,

Line 605: fnd_file.put_line(fnd_file.log,

601: fnd_file.put_line(fnd_file.log,'Cost dim present');
602: exception
603: WHEN NO_DATA_FOUND THEN
604: begin
605: fnd_file.put_line(fnd_file.log,
606: 'Inserting Cost dim :' || c_cost_data.cos_level_value(I));
607: INSERT INTO
608: qpr_dimension_values(instance_id,
609: dim_value_id,

Line 644: fnd_file.put_line(fnd_file.log,

640: exception
641: when others then
642: retcode := 2;
643: errbuf := FND_MESSAGE.GET;
644: fnd_file.put_line(fnd_file.log,
645: dbms_utility.format_error_backtrace);
646: return;
647: end;
648: end;

Line 654: fnd_file.put_line(fnd_file.log, 'Inserting fact records in staging table');

650: end if;
651: exit when first_time=0;
652: end loop;
653:
654: fnd_file.put_line(fnd_file.log, 'Inserting fact records in staging table');
655: forall i in c_cost_data.ord_level_value.first..
656: c_cost_data.ord_level_value.last
657: insert into qpr_plan_measures(price_plan_data_id,
658: price_plan_id,

Line 703: fnd_file.put_line(fnd_file.log, 'Staging complete...');

699: l_request_id);
700: end loop;
701: commit;
702: close c_measures;
703: fnd_file.put_line(fnd_file.log, 'Staging complete...');
704:
705: fnd_file.put_line(fnd_file.log, 'Calculate costs for model/kit items...');
706: l_cost_alloc_perc := to_number(nvl(qpr_sr_util.read_parameter(
707: 'QPR_MODEL_COST_MRG_PERC'),0))/100;

Line 705: fnd_file.put_line(fnd_file.log, 'Calculate costs for model/kit items...');

701: commit;
702: close c_measures;
703: fnd_file.put_line(fnd_file.log, 'Staging complete...');
704:
705: fnd_file.put_line(fnd_file.log, 'Calculate costs for model/kit items...');
706: l_cost_alloc_perc := to_number(nvl(qpr_sr_util.read_parameter(
707: 'QPR_MODEL_COST_MRG_PERC'),0))/100;
708: handle_kit_items;
709: handle_ato_items;

Line 715: fnd_file.put_line(fnd_file.log, 'Deleting staging table records ..');

711:
712: commit;
713: t_ord_meas.delete;
714:
715: fnd_file.put_line(fnd_file.log, 'Deleting staging table records ..');
716: begin
717: delete qpr_plan_measures temp
718: where temp.price_plan_meas_grp_id=999
719: and temp.price_plan_id = l_request_id;

Line 720: fnd_file.put_line(fnd_file.log, 'Deleted '||sql%rowcount ||'records');

716: begin
717: delete qpr_plan_measures temp
718: where temp.price_plan_meas_grp_id=999
719: and temp.price_plan_id = l_request_id;
720: fnd_file.put_line(fnd_file.log, 'Deleted '||sql%rowcount ||'records');
721: end;
722:
723: commit;
724: end if;

Line 729: fnd_file.put_line(fnd_file.log, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);

725: exception
726: when OTHERS then
727: retcode := 2;
728: errbuf := 'ERROR: ' || substr(sqlerrm, 1, 1000);
729: fnd_file.put_line(fnd_file.log, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
730: end collect_cost;
731:
732:
733: procedure collect_offadj(

Line 787: fnd_file.put_line(fnd_file.log,'SQL: '||l_sql);

783: end if;
784: if p_l_reason_code is not null then
785: l_sql:= l_sql|| ' and L_REASON_CODE = '||''''||p_l_reason_code||'''';
786: end if;
787: fnd_file.put_line(fnd_file.log,'SQL: '||l_sql);
788:
789: open c_measures for l_sql;
790: loop
791: c_offadj_data.level1_value.delete;

Line 823: fnd_file.put_line(fnd_file.log,'Iteration...' || l_iterator);

819: limit l_rows;
820:
821: exit when c_offadj_data.level1_value.count = 0;
822: l_iterator := l_iterator + 1;
823: fnd_file.put_line(fnd_file.log,'Iteration...' || l_iterator);
824: ----- Insert Dimension ----
825: fnd_file.put_line(fnd_file.log,
826: 'Deleting overlapping dimension values...');
827: FORALL I IN 1..c_offadj_data.level1_value.count

Line 825: fnd_file.put_line(fnd_file.log,

821: exit when c_offadj_data.level1_value.count = 0;
822: l_iterator := l_iterator + 1;
823: fnd_file.put_line(fnd_file.log,'Iteration...' || l_iterator);
824: ----- Insert Dimension ----
825: fnd_file.put_line(fnd_file.log,
826: 'Deleting overlapping dimension values...');
827: FORALL I IN 1..c_offadj_data.level1_value.count
828: delete qpr_dimension_values
829: where dim_code = 'OAD'

Line 834: fnd_file.put_line(fnd_file.log,

830: and hierarchy_code = 'OFFINVADJ'
831: and level1_value = c_offadj_data.level1_value(I)
832: and instance_id = p_instance_id;
833:
834: fnd_file.put_line(fnd_file.log,
835: 'Inserting Offinvoice Adjustment dimension values...');
836: FORALL I IN 1..c_offadj_data.level1_value.count
837: INSERT INTO qpr_dimension_values(instance_id,
838: dim_value_id,

Line 890: fnd_file.put_line(fnd_file.log,'Staging Measure data...');

886:
887:
888:
889: ----- Update Measure data ---
890: fnd_file.put_line(fnd_file.log,'Staging Measure data...');
891: FORALL I IN
892: c_offadj_data.level1_value.FIRST..c_offadj_data.level1_value.LAST
893: insert into QPR_MEASURE_DATA(MEASURE_VALUE_ID,
894: INSTANCE_ID,

Line 927: fnd_file.put_line(fnd_file.log,'No of rows processed: '||sql%rowcount);

923: d_sysdate,
924: l_user_id,
925: l_login_id,
926: l_request_id);
927: fnd_file.put_line(fnd_file.log,'No of rows processed: '||sql%rowcount);
928: commit;
929: end loop;
930:
931: allocate_offinvoice_adj(errbuf, retcode,

Line 940: fnd_file.put_line(fnd_file.log,'Unexpected error '||substr(sqlerrm,1200));

936: exception
937: WHEN NO_DATA_FOUND THEN
938: retcode := 2;
939: errbuf := FND_MESSAGE.GET;
940: fnd_file.put_line(fnd_file.log,'Unexpected error '||substr(sqlerrm,1200));
941: end;
942:
943: procedure allocate_offinvoice_adj(
944: errbuf OUT NOCOPY VARCHAR2,

Line 993: fnd_file.put_line(fnd_file.log,'Allocation ');

989: l_login_id number:= FND_GLOBAL.LOGIN_ID;
990: l_request_id number:= FND_GLOBAL.conc_request_id;
991:
992: begin
993: fnd_file.put_line(fnd_file.log,'Allocation ');
994:
995: open c_offadj ;
996: loop
997: c_offadj_data.level1_value.delete;

Line 1034: fnd_file.put_line(fnd_file.log,

1030: c_offadj_data.measure4_value,
1031: c_offadj_data.measure5_value,
1032: c_offadj_data.measure6_value
1033: limit l_rows;
1034: fnd_file.put_line(fnd_file.log,
1035: 'Number of rows fetched- '||c_offadj_data.level1_value.count);
1036: if c_offadj_data.level1_value.count>0 then
1037: fnd_file.put_line(fnd_file.log,'Deleting measures if exists ');
1038: begin

Line 1037: fnd_file.put_line(fnd_file.log,'Deleting measures if exists ');

1033: limit l_rows;
1034: fnd_file.put_line(fnd_file.log,
1035: 'Number of rows fetched- '||c_offadj_data.level1_value.count);
1036: if c_offadj_data.level1_value.count>0 then
1037: fnd_file.put_line(fnd_file.log,'Deleting measures if exists ');
1038: begin
1039: forall I in 1..c_offadj_data.level1_value.count
1040: delete qpr_measure_data
1041: where instance_id=p_instance_id

Line 1045: fnd_file.put_line(fnd_file.log, 'Deleted '||

1041: where instance_id=p_instance_id
1042: and measure_type_code= 'OFFADJDATA'
1043: and ord_level_value=c_offadj_data.level2_value(I)
1044: and adj_level_value=c_offadj_data.level1_value(I);
1045: fnd_file.put_line(fnd_file.log, 'Deleted '||
1046: sql%rowcount ||' records');
1047: exception
1048: when others then
1049: null;

Line 1052: fnd_file.put_line(fnd_file.log,'Inserting measures ');

1048: when others then
1049: null;
1050: end;
1051: begin
1052: fnd_file.put_line(fnd_file.log,'Inserting measures ');
1053: forall I in 1..c_offadj_data.level1_value.count
1054: insert into QPR_MEASURE_DATA(
1055: MEASURE_VALUE_ID,
1056: MEASURE_TYPE_CODE,

Line 1099: fnd_file.put_line(fnd_file.log, 'Inserted '||

1095: d_sysdate,
1096: l_user_id,
1097: l_login_id,
1098: l_request_id);
1099: fnd_file.put_line(fnd_file.log, 'Inserted '||
1100: sql%rowcount ||' records');
1101: exception
1102: when others then
1103: errbuf := substr(SQLERRM,1,150);

Line 1105: fnd_file.put_line(fnd_file.log, substr(SQLERRM, 1, 1000));

1101: exception
1102: when others then
1103: errbuf := substr(SQLERRM,1,150);
1104: retcode := -1;
1105: fnd_file.put_line(fnd_file.log, substr(SQLERRM, 1, 1000));
1106: end;
1107: end if;
1108: commit;
1109:

Line 1120: fnd_file.put_line(fnd_file.log, 'Deleted '|| sql%rowcount ||' temp records');

1116: delete qpr_measure_data temp
1117: where temp.instance_id=-999
1118: and temp.measure_type_code = 'OFFADJDATA'
1119: and temp.request_id = l_request_id;
1120: fnd_file.put_line(fnd_file.log, 'Deleted '|| sql%rowcount ||' temp records');
1121: end;
1122: commit;
1123: exception
1124: WHEN NO_DATA_FOUND THEN

Line 1127: fnd_file.put_line(fnd_file.log,'Unexpected error '||substr(sqlerrm,1200));

1123: exception
1124: WHEN NO_DATA_FOUND THEN
1125: retcode := 2;
1126: errbuf := FND_MESSAGE.GET;
1127: fnd_file.put_line(fnd_file.log,'Unexpected error '||substr(sqlerrm,1200));
1128: End;
1129:
1130: procedure consolidate_upd_sales_meas(
1131: errbuf OUT NOCOPY VARCHAR2,

Line 1189: fnd_file.put_line(fnd_file.log,

1185:
1186: rec_mrg_det sales_rec;
1187: rec_upd_det sales_rec;
1188: begin
1189: fnd_file.put_line(fnd_file.log,
1190: 'Consolidating offinvoice adjustments & updating relevant sales measures ...');
1191: open c_get_margin_det;
1192: loop
1193: fetch c_get_margin_det bulk collect into rec_mrg_det limit lrows;

Line 1222: fnd_file.put_line(fnd_file.log,

1218: rec_upd_det.measure4(lctr) := rec_mrg_det.measure6(i);
1219: lctr := lctr + 1;
1220: end loop;
1221:
1222: fnd_file.put_line(fnd_file.log,
1223: 'Updated Records=' || rec_upd_det.measure_value_id.count);
1224: forall i in rec_upd_det.measure_value_id.first..rec_upd_det.measure_value_id.last
1225: update qpr_measure_data
1226: set measure5_number = rec_upd_det.measure1(i),

Line 1257: fnd_file.put_line(fnd_file.log,

1253: exception
1254: when OTHERS then
1255: retcode := 2;
1256: errbuf := 'ERROR: ' || substr(SQLERRM,1,1000);
1257: fnd_file.put_line(fnd_file.log,
1258: 'Unable to update sales measures');
1259: fnd_file.put_line(fnd_file.log, 'ERROR: ' || substr(SQLERRM,1,1000));
1260: fnd_file.put_line(fnd_file.log, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
1261: rollback;

Line 1259: fnd_file.put_line(fnd_file.log, 'ERROR: ' || substr(SQLERRM,1,1000));

1255: retcode := 2;
1256: errbuf := 'ERROR: ' || substr(SQLERRM,1,1000);
1257: fnd_file.put_line(fnd_file.log,
1258: 'Unable to update sales measures');
1259: fnd_file.put_line(fnd_file.log, 'ERROR: ' || substr(SQLERRM,1,1000));
1260: fnd_file.put_line(fnd_file.log, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
1261: rollback;
1262: end consolidate_upd_sales_meas;
1263:

Line 1260: fnd_file.put_line(fnd_file.log, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);

1256: errbuf := 'ERROR: ' || substr(SQLERRM,1,1000);
1257: fnd_file.put_line(fnd_file.log,
1258: 'Unable to update sales measures');
1259: fnd_file.put_line(fnd_file.log, 'ERROR: ' || substr(SQLERRM,1,1000));
1260: fnd_file.put_line(fnd_file.log, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);
1261: rollback;
1262: end consolidate_upd_sales_meas;
1263:
1264: procedure update_pr_segment(

Line 1318: fnd_file.put_line(fnd_file.log, 'count: ' || t_meas_val_id.count);

1314: loop
1315: fetch c_measures bulk collect into t_meas_val_id, t_cus, t_geo, t_org,
1316: t_prd, t_chn, t_rep, t_ord, t_time limit l_rows;
1317: exit when t_meas_val_id.count = 0;
1318: fnd_file.put_line(fnd_file.log, 'count: ' || t_meas_val_id.count);
1319: for i in t_meas_val_id.first..t_meas_val_id.last loop
1320:
1321: if l_prev_cus = t_cus(i)
1322: and l_prev_geo = t_geo(i)

Line 1354: fnd_file.put_line(fnd_file.log,'inserting psg:' || l_pr_segment_id);

1350: and instance_id = p_instance_id
1351: and rownum < 2;
1352: exception
1353: WHEN NO_DATA_FOUND THEN
1354: fnd_file.put_line(fnd_file.log,'inserting psg:' || l_pr_segment_id);
1355: begin
1356: select name into l_pr_segment_desc
1357: from qpr_pr_segments_vl
1358: where pr_segment_id = l_pr_segment_id

Line 1401: fnd_file.put_line(fnd_file.log,

1397: l_prev_chn := t_chn(i);
1398: l_prev_rep := t_rep(i);
1399: end loop;
1400:
1401: fnd_file.put_line(fnd_file.log,
1402: 'updating pricing segments for measuretype:salesdata');
1403: forall i in t_meas_val_id.first..t_meas_val_id.last
1404: update qpr_measure_data set psg_level_value = t_psg_val(i),
1405: last_update_date = sysdate,

Line 1411: fnd_file.put_line(fnd_file.log,'Updating measuretypes:ADJUSTMENT,OFFADJDATA');

1407: last_update_login = fnd_global.login_id,
1408: request_id = fnd_global.conc_request_id
1409: where measure_value_id = t_meas_val_id(i);
1410:
1411: fnd_file.put_line(fnd_file.log,'Updating measuretypes:ADJUSTMENT,OFFADJDATA');
1412: forall i in t_meas_val_id.first..t_meas_val_id.last
1413: update qpr_measure_data set psg_level_value = t_psg_val(i),
1414: last_update_date = sysdate,
1415: last_updated_by = fnd_global.user_id,

Line 1439: fnd_file.put_line(fnd_file.log, 'Unable to update pricing segment');

1435: exception
1436: when others then
1437: errbuf := sqlerrm;
1438: retcode := 2;
1439: fnd_file.put_line(fnd_file.log, 'Unable to update pricing segment');
1440: fnd_file.put_line(fnd_file.log, dbms_utility.format_error_backtrace);
1441: end update_pr_segment;
1442:
1443:

Line 1440: fnd_file.put_line(fnd_file.log, dbms_utility.format_error_backtrace);

1436: when others then
1437: errbuf := sqlerrm;
1438: retcode := 2;
1439: fnd_file.put_line(fnd_file.log, 'Unable to update pricing segment');
1440: fnd_file.put_line(fnd_file.log, dbms_utility.format_error_backtrace);
1441: end update_pr_segment;
1442:
1443:
1444: END QPR_SPECIAL_ETL;