186: l_M_count NUMBER := 0;
187: l_B_count NUMBER := 0;
188: BEGIN
189: IF (NVL (g_debug, 0) IN
190: (gme_debug.g_log_statement, gme_debug.g_log_procedure) ) THEN
191: gme_debug.put_line (g_pkg_name || '.' || l_api_name || ':'
192: || 'Entering');
193: END IF;
194:
187: l_B_count NUMBER := 0;
188: BEGIN
189: IF (NVL (g_debug, 0) IN
190: (gme_debug.g_log_statement, gme_debug.g_log_procedure) ) THEN
191: gme_debug.put_line (g_pkg_name || '.' || l_api_name || ':'
192: || 'Entering');
193: END IF;
194:
195: /* Set the return status tosuccess initially */
194:
195: /* Set the return status tosuccess initially */
196: x_return_status := fnd_api.g_ret_sts_success;
197:
198: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
199: gme_debug.put_line ( 'Trying to reschedule to '
200: || TO_CHAR (p_batch_header_rec.plan_start_date
201: ,'MM/DD/YYYY HH24:MI:SS')
202: || ' and '
195: /* Set the return status tosuccess initially */
196: x_return_status := fnd_api.g_ret_sts_success;
197:
198: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
199: gme_debug.put_line ( 'Trying to reschedule to '
200: || TO_CHAR (p_batch_header_rec.plan_start_date
201: ,'MM/DD/YYYY HH24:MI:SS')
202: || ' and '
203: || TO_CHAR (p_batch_header_rec.plan_cmplt_date
255: /* Check validity rule if not LCF batch */
256: IF x_batch_header_rec.recipe_validity_rule_id IS NOT NULL THEN
257:
258:
259: IF (NVL (g_debug, 0) = gme_debug.g_log_statement) THEN
260: gme_debug.put_line ( g_pkg_name
261: || '.'
262: || l_api_name
263: || ':'
256: IF x_batch_header_rec.recipe_validity_rule_id IS NOT NULL THEN
257:
258:
259: IF (NVL (g_debug, 0) = gme_debug.g_log_statement) THEN
260: gme_debug.put_line ( g_pkg_name
261: || '.'
262: || l_api_name
263: || ':'
264: || 'Calling Check Validity Rule Dates');
273: x_return_status := fnd_api.g_ret_sts_error;
274: RAISE date_exceed_validity_rule;
275: END IF;
276:
277: IF (NVL (g_debug, 0) = gme_debug.g_log_statement) THEN
278: gme_debug.put_line
279: ( 'Came back from Check Validity Rule Dates. Trying to reschedule From '
280: || TO_CHAR (x_batch_header_rec.plan_start_date
281: ,'MM/DD/YYYY HH24:MI:SS')
274: RAISE date_exceed_validity_rule;
275: END IF;
276:
277: IF (NVL (g_debug, 0) = gme_debug.g_log_statement) THEN
278: gme_debug.put_line
279: ( 'Came back from Check Validity Rule Dates. Trying to reschedule From '
280: || TO_CHAR (x_batch_header_rec.plan_start_date
281: ,'MM/DD/YYYY HH24:MI:SS')
282: || ' and '
283: || TO_CHAR (x_batch_header_rec.plan_cmplt_date
284: ,'MM/DD/YYYY HH24:MI:SS') );
285: END IF;
286: ELSE /* x_batch_header_rec.recipe_validity_rule_id IS NULL */
287: IF (NVL (g_debug, 0) = gme_debug.g_log_statement) THEN
288: gme_debug.put_line ( g_pkg_name
289: || '.'
290: || l_api_name
291: || ':'
284: ,'MM/DD/YYYY HH24:MI:SS') );
285: END IF;
286: ELSE /* x_batch_header_rec.recipe_validity_rule_id IS NULL */
287: IF (NVL (g_debug, 0) = gme_debug.g_log_statement) THEN
288: gme_debug.put_line ( g_pkg_name
289: || '.'
290: || l_api_name
291: || ':'
292: || 'Do not Check Validity Rule Dates as this is LCF batch');
298: ELSE
299: l_doc_type := 'FPO';
300: END IF;
301:
302: IF (NVL (g_debug, 0) <= gme_debug.g_log_procedure) THEN
303: gme_debug.put_line ('Delete all the pending resource transactions');
304: END IF;
305:
306: -- delete all the pending resource transactions
299: l_doc_type := 'FPO';
300: END IF;
301:
302: IF (NVL (g_debug, 0) <= gme_debug.g_log_procedure) THEN
303: gme_debug.put_line ('Delete all the pending resource transactions');
304: END IF;
305:
306: -- delete all the pending resource transactions
307: IF x_batch_header_rec.update_inventory_ind = 'Y' THEN
403: ,x_batch_header_rec) ) THEN
404: RAISE batch_header_fetch_error;
405: END IF;
406: ELSE /* no routing */
407: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
408: gme_debug.put_line ('No Routing');
409: END IF;
410: /* GO to validity rule is not an LCF batch */
411: IF l_batch_header_rec.recipe_validity_rule_id IS NOT NULL THEN
404: RAISE batch_header_fetch_error;
405: END IF;
406: ELSE /* no routing */
407: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
408: gme_debug.put_line ('No Routing');
409: END IF;
410: /* GO to validity rule is not an LCF batch */
411: IF l_batch_header_rec.recipe_validity_rule_id IS NOT NULL THEN
412: OPEN recipe_validity_rule_cursor
498: l_no_prod_rule_found := TRUE;
499: END IF; /* l_prim_prod_found */
500:
501: IF l_no_prod_rule_found THEN
502: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
503: gme_debug.put_line ('No Rules');
504: END IF;
505:
506: IF p_batch_header_rec.plan_start_date IS NOT NULL
499: END IF; /* l_prim_prod_found */
500:
501: IF l_no_prod_rule_found THEN
502: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
503: gme_debug.put_line ('No Rules');
504: END IF;
505:
506: IF p_batch_header_rec.plan_start_date IS NOT NULL
507: AND p_batch_header_rec.plan_cmplt_date IS NULL THEN
528: x_batch_header_rec.plan_cmplt_date :=
529: p_batch_header_rec.plan_cmplt_date;
530: END IF; /*plan_start_date NOT NULL*/
531:
532: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
533: gme_debug.put_line
534: ( 'Production rule start_date '
535: || TO_CHAR (x_batch_header_rec.plan_start_date
536: ,'yyyy/mon/dd hh24:mi:ss')
529: p_batch_header_rec.plan_cmplt_date;
530: END IF; /*plan_start_date NOT NULL*/
531:
532: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
533: gme_debug.put_line
534: ( 'Production rule start_date '
535: || TO_CHAR (x_batch_header_rec.plan_start_date
536: ,'yyyy/mon/dd hh24:mi:ss')
537: || ' Production rule end_date '
546: ,p_recipe_validity_rule_id => l_batch_header_rec.recipe_validity_rule_id
547: ,x_contiguous_ind => l_contiguous_ind
548: ,x_return_status => l_return_status);
549:
550: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
551: gme_debug.put_line ( 'l_contiguous_ind found '
552: || l_contiguous_ind);
553: END IF;
554:
547: ,x_contiguous_ind => l_contiguous_ind
548: ,x_return_status => l_return_status);
549:
550: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
551: gme_debug.put_line ( 'l_contiguous_ind found '
552: || l_contiguous_ind);
553: END IF;
554:
555: l_duration :=
556: ( x_batch_header_rec.plan_cmplt_date
557: - x_batch_header_rec.plan_start_date)
558: * 24;
559:
560: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
561: gme_debug.put_line ('l duration ' || l_duration);
562: END IF;
563:
564: IF p_batch_header_rec.plan_start_date IS NOT NULL
557: - x_batch_header_rec.plan_start_date)
558: * 24;
559:
560: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
561: gme_debug.put_line ('l duration ' || l_duration);
562: END IF;
563:
564: IF p_batch_header_rec.plan_start_date IS NOT NULL
565: OR ( p_batch_header_rec.plan_start_date IS NULL
575: ,p_duration => l_duration
576: ,p_output_tbl => l_contig_period_tbl
577: ,x_return_status => l_return_status);
578:
579: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
580: gme_debug.put_line
581: ( 'Came back from Get Contiguous Periods with status '
582: || l_return_status);
583: END IF;
576: ,p_output_tbl => l_contig_period_tbl
577: ,x_return_status => l_return_status);
578:
579: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
580: gme_debug.put_line
581: ( 'Came back from Get Contiguous Periods with status '
582: || l_return_status);
583: END IF;
584:
587: END IF;
588:
589: l_cal_count := l_contig_period_tbl.COUNT;
590:
591: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
592: gme_debug.put_line ('l cal_count ' || l_cal_count);
593: gme_debug.put_line ( 'p_contiguity_override '
594: || p_contiguity_override);
595: END IF;
588:
589: l_cal_count := l_contig_period_tbl.COUNT;
590:
591: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
592: gme_debug.put_line ('l cal_count ' || l_cal_count);
593: gme_debug.put_line ( 'p_contiguity_override '
594: || p_contiguity_override);
595: END IF;
596:
589: l_cal_count := l_contig_period_tbl.COUNT;
590:
591: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
592: gme_debug.put_line ('l cal_count ' || l_cal_count);
593: gme_debug.put_line ( 'p_contiguity_override '
594: || p_contiguity_override);
595: END IF;
596:
597: IF l_contiguous_ind = 1
605: ,x_batch_header_rec.plan_start_date);
606: x_batch_header_rec.plan_cmplt_date :=
607: l_contig_period_tbl (l_cal_count).end_date;
608:
609: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
610: gme_debug.put_line
611: ( 'x_batch_header_rec.plan_cmplt_date '
612: || TO_CHAR
613: (x_batch_header_rec.plan_cmplt_date
606: x_batch_header_rec.plan_cmplt_date :=
607: l_contig_period_tbl (l_cal_count).end_date;
608:
609: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
610: gme_debug.put_line
611: ( 'x_batch_header_rec.plan_cmplt_date '
612: || TO_CHAR
613: (x_batch_header_rec.plan_cmplt_date
614: ,'yyyy/mon/dd hh24:mi:ss') );
624: ,p_duration => l_duration
625: ,p_output_tbl => l_contig_period_tbl
626: ,x_return_status => l_return_status);
627:
628: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
629: gme_debug.put_line
630: ( 'Plan start date is null. Came back from Get Contiguous Periods with status '
631: || l_return_status);
632: END IF;
625: ,p_output_tbl => l_contig_period_tbl
626: ,x_return_status => l_return_status);
627:
628: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
629: gme_debug.put_line
630: ( 'Plan start date is null. Came back from Get Contiguous Periods with status '
631: || l_return_status);
632: END IF;
633:
636: END IF;
637:
638: l_cal_count := l_contig_period_tbl.COUNT;
639:
640: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
641: gme_debug.put_line ('l cal_count ' || l_cal_count);
642: gme_debug.put_line ( 'p_contiguity_override '
643: || p_contiguity_override);
644: END IF;
637:
638: l_cal_count := l_contig_period_tbl.COUNT;
639:
640: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
641: gme_debug.put_line ('l cal_count ' || l_cal_count);
642: gme_debug.put_line ( 'p_contiguity_override '
643: || p_contiguity_override);
644: END IF;
645:
638: l_cal_count := l_contig_period_tbl.COUNT;
639:
640: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
641: gme_debug.put_line ('l cal_count ' || l_cal_count);
642: gme_debug.put_line ( 'p_contiguity_override '
643: || p_contiguity_override);
644: END IF;
645:
646: IF l_contiguous_ind = 1
653: p_batch_header_rec.plan_cmplt_date;
654: x_batch_header_rec.plan_start_date :=
655: l_contig_period_tbl (l_cal_count).start_date;
656:
657: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
658: gme_debug.put_line
659: ( 'x_batch_header_rec.plan_start_date '
660: || TO_CHAR
661: (x_batch_header_rec.plan_start_date
654: x_batch_header_rec.plan_start_date :=
655: l_contig_period_tbl (l_cal_count).start_date;
656:
657: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
658: gme_debug.put_line
659: ( 'x_batch_header_rec.plan_start_date '
660: || TO_CHAR
661: (x_batch_header_rec.plan_start_date
662: ,'yyyy/mon/dd hh24:mi:ss') );
672: END IF; /* p_use_workday_cal = FND_API.G_TRUE */
673: END IF; /* l_no_prod_found*/
674:
675: IF (NVL (g_debug, 0) IN
676: (gme_debug.g_log_statement, gme_debug.g_log_procedure) ) THEN
677: gme_debug.put_line ('Update gme_batch_header.');
678: END IF;
679:
680: UPDATE gme_batch_header
673: END IF; /* l_no_prod_found*/
674:
675: IF (NVL (g_debug, 0) IN
676: (gme_debug.g_log_statement, gme_debug.g_log_procedure) ) THEN
677: gme_debug.put_line ('Update gme_batch_header.');
678: END IF;
679:
680: UPDATE gme_batch_header
681: SET plan_start_date = x_batch_header_rec.plan_start_date
688: ,last_update_login = gme_common_pvt.g_login_id
689: WHERE batch_id = x_batch_header_rec.batch_id;
690: END IF;
691:
692: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
693: gme_debug.put_line
694: ( ' After update gme_batch_header. Final plan_start_date '
695: || TO_CHAR (x_batch_header_rec.plan_start_date
696: ,'yyyy/mon/dd hh24:mi:ss')
689: WHERE batch_id = x_batch_header_rec.batch_id;
690: END IF;
691:
692: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
693: gme_debug.put_line
694: ( ' After update gme_batch_header. Final plan_start_date '
695: || TO_CHAR (x_batch_header_rec.plan_start_date
696: ,'yyyy/mon/dd hh24:mi:ss')
697: || ' Final plan_cmplt_date '
739: END IF;
740:
741: IF ( (x_batch_header_rec.plan_start_date IS NOT NULL)
742: AND (x_batch_header_rec.plan_cmplt_date IS NOT NULL) ) THEN
743: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
744: gme_debug.put_line ( 'max_date '
745: || TO_CHAR (max_cmplt_date
746: ,'yyyy/mon/dd hh24:mi:ss') );
747: gme_debug.put_line ( 'required batch end_date '
740:
741: IF ( (x_batch_header_rec.plan_start_date IS NOT NULL)
742: AND (x_batch_header_rec.plan_cmplt_date IS NOT NULL) ) THEN
743: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
744: gme_debug.put_line ( 'max_date '
745: || TO_CHAR (max_cmplt_date
746: ,'yyyy/mon/dd hh24:mi:ss') );
747: gme_debug.put_line ( 'required batch end_date '
748: || TO_CHAR
743: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
744: gme_debug.put_line ( 'max_date '
745: || TO_CHAR (max_cmplt_date
746: ,'yyyy/mon/dd hh24:mi:ss') );
747: gme_debug.put_line ( 'required batch end_date '
748: || TO_CHAR
749: (p_batch_header_rec.plan_cmplt_date
750: ,'yyyy/mon/dd hh24:mi:ss') );
751: END IF;
749: (p_batch_header_rec.plan_cmplt_date
750: ,'yyyy/mon/dd hh24:mi:ss') );
751: END IF;
752:
753: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
754: gme_debug.put_line ( 'p_plan_cmplt_date '
755: || TO_CHAR
756: (p_batch_header_rec.plan_cmplt_date
757: ,'yyyy/mon/dd hh24:mi:ss') );
750: ,'yyyy/mon/dd hh24:mi:ss') );
751: END IF;
752:
753: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
754: gme_debug.put_line ( 'p_plan_cmplt_date '
755: || TO_CHAR
756: (p_batch_header_rec.plan_cmplt_date
757: ,'yyyy/mon/dd hh24:mi:ss') );
758: gme_debug.put_line ( 'x_plan_cmplt_date '
754: gme_debug.put_line ( 'p_plan_cmplt_date '
755: || TO_CHAR
756: (p_batch_header_rec.plan_cmplt_date
757: ,'yyyy/mon/dd hh24:mi:ss') );
758: gme_debug.put_line ( 'x_plan_cmplt_date '
759: || TO_CHAR
760: (x_batch_header_rec.plan_cmplt_date
761: ,'yyyy/mon/dd hh24:mi:ss') );
762: END IF;
773: END IF;
774: ELSIF p_batch_header_rec.plan_cmplt_date >
775: x_batch_header_rec.plan_cmplt_date THEN
776: IF (NVL (g_debug, 0) IN
777: (gme_debug.g_log_statement, gme_debug.g_log_procedure) ) THEN
778: gme_debug.put_line
779: ('User supplied plan completion date is greater than what system calculated User wants to leave gaps.');
780: END IF;
781:
774: ELSIF p_batch_header_rec.plan_cmplt_date >
775: x_batch_header_rec.plan_cmplt_date THEN
776: IF (NVL (g_debug, 0) IN
777: (gme_debug.g_log_statement, gme_debug.g_log_procedure) ) THEN
778: gme_debug.put_line
779: ('User supplied plan completion date is greater than what system calculated User wants to leave gaps.');
780: END IF;
781:
782: UPDATE gme_batch_header
795: END IF;
796:
797: -- Checking of batch dates with validity rules dates after the reschedule
798: -- Pawan Kumar added code for bug 3088739
799: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
800: gme_debug.put_line ( 'affinal plan_start_date '
801: || TO_CHAR (x_batch_header_rec.plan_start_date
802: ,'yyyy/mon/dd hh24:mi:ss') );
803: gme_debug.put_line ( 'affinal plan_cmplt_date '
796:
797: -- Checking of batch dates with validity rules dates after the reschedule
798: -- Pawan Kumar added code for bug 3088739
799: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
800: gme_debug.put_line ( 'affinal plan_start_date '
801: || TO_CHAR (x_batch_header_rec.plan_start_date
802: ,'yyyy/mon/dd hh24:mi:ss') );
803: gme_debug.put_line ( 'affinal plan_cmplt_date '
804: || TO_CHAR (x_batch_header_rec.plan_cmplt_date
799: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
800: gme_debug.put_line ( 'affinal plan_start_date '
801: || TO_CHAR (x_batch_header_rec.plan_start_date
802: ,'yyyy/mon/dd hh24:mi:ss') );
803: gme_debug.put_line ( 'affinal plan_cmplt_date '
804: || TO_CHAR (x_batch_header_rec.plan_cmplt_date
805: ,'yyyy/mon/dd hh24:mi:ss') );
806: END IF;
807:
820: /* Load all the transactions and resources to the temporary table */
821: /* for the current batch if the update inventory ind is set for the batch */
822: IF x_batch_header_rec.update_inventory_ind = 'Y' THEN
823: IF (NVL (g_debug, 0) IN
824: (gme_debug.g_log_statement, gme_debug.g_log_procedure) ) THEN
825: gme_debug.put_line
826: ('Load all the transactions and resources to the temporary table.');
827: END IF;
828:
821: /* for the current batch if the update inventory ind is set for the batch */
822: IF x_batch_header_rec.update_inventory_ind = 'Y' THEN
823: IF (NVL (g_debug, 0) IN
824: (gme_debug.g_log_statement, gme_debug.g_log_procedure) ) THEN
825: gme_debug.put_line
826: ('Load all the transactions and resources to the temporary table.');
827: END IF;
828:
829: gme_trans_engine_util.load_rsrc_trans
830: (p_batch_row => x_batch_header_rec
831: ,x_rsc_row_count => l_rsrc_trans_count
832: ,x_return_status => l_return_status);
833:
834: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
835: gme_debug.put_line
836: ( 'Came back after loading all the transactions and resources to the temporary table with status '
837: || l_return_status);
838: END IF;
831: ,x_rsc_row_count => l_rsrc_trans_count
832: ,x_return_status => l_return_status);
833:
834: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
835: gme_debug.put_line
836: ( 'Came back after loading all the transactions and resources to the temporary table with status '
837: || l_return_status);
838: END IF;
839:
859: l_in_batch_header_rec.plan_cmplt_date :=
860: x_batch_header_rec.plan_start_date;
861: END IF;
862:
863: IF (NVL (g_debug, 0) = gme_debug.g_log_statement) THEN
864: gme_debug.put_line
865: ( g_pkg_name
866: || '.'
867: || l_api_name
860: x_batch_header_rec.plan_start_date;
861: END IF;
862:
863: IF (NVL (g_debug, 0) = gme_debug.g_log_statement) THEN
864: gme_debug.put_line
865: ( g_pkg_name
866: || '.'
867: || l_api_name
868: || ':'
876: ,p_contiguity_override => p_contiguity_override
877: ,x_batch_header_rec => l_batch_header_rec
878: ,x_return_status => l_return_status);
879:
880: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
881: gme_debug.put_line
882: ( 'Came back from Reschedule Batch with status '
883: || l_return_status);
884: END IF;
877: ,x_batch_header_rec => l_batch_header_rec
878: ,x_return_status => l_return_status);
879:
880: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
881: gme_debug.put_line
882: ( 'Came back from Reschedule Batch with status '
883: || l_return_status);
884: END IF;
885:
942: -- Update the material required date with the associated plan cmplt Date;
943: l_material_date := l_cmplt_date;
944: END IF;
945:
946: IF (NVL (g_debug, 0) = gme_debug.g_log_statement) THEN
947: gme_debug.put_line
948: ( 'Calling Material Date Change for batch_id : '
949: || x_batch_header_rec.batch_id
950: || ' Material_detail_id : '
943: l_material_date := l_cmplt_date;
944: END IF;
945:
946: IF (NVL (g_debug, 0) = gme_debug.g_log_statement) THEN
947: gme_debug.put_line
948: ( 'Calling Material Date Change for batch_id : '
949: || x_batch_header_rec.batch_id
950: || ' Material_detail_id : '
951: || l_material_detail_ids (i)
959: (i)
960: ,p_material_date => l_material_date
961: ,x_return_status => l_return_status);
962:
963: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
964: gme_debug.put_line
965: ( 'Came back from material_date_change with status '
966: || l_return_status);
967: END IF;
960: ,p_material_date => l_material_date
961: ,x_return_status => l_return_status);
962:
963: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
964: gme_debug.put_line
965: ( 'Came back from material_date_change with status '
966: || l_return_status);
967: END IF;
968: --FPBug#4585491 Begin
1045: x_batch_header_rec.last_updated_by := gme_common_pvt.g_user_ident;
1046: x_batch_header_rec.last_update_login := gme_common_pvt.g_login_id;
1047:
1048: IF (NVL (g_debug, 0) IN
1049: (gme_debug.g_log_statement, gme_debug.g_log_procedure) ) THEN
1050: gme_debug.put_line ( g_pkg_name
1051: || '.'
1052: || l_api_name
1053: || ':'
1046: x_batch_header_rec.last_update_login := gme_common_pvt.g_login_id;
1047:
1048: IF (NVL (g_debug, 0) IN
1049: (gme_debug.g_log_statement, gme_debug.g_log_procedure) ) THEN
1050: gme_debug.put_line ( g_pkg_name
1051: || '.'
1052: || l_api_name
1053: || ':'
1054: || 'Exiting with '
1071: x_return_status := l_return_status;
1072: WHEN cmplt_less_start OR cannot_reschedule_start OR date_is_less_than_actual THEN
1073: x_return_status := fnd_api.g_ret_sts_error;
1074: WHEN error_cont_period THEN
1075: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
1076: gme_debug.put_line ('Contiguity period ... _failed');
1077: END IF;
1078:
1079: x_return_status := l_return_status;
1072: WHEN cmplt_less_start OR cannot_reschedule_start OR date_is_less_than_actual THEN
1073: x_return_status := fnd_api.g_ret_sts_error;
1074: WHEN error_cont_period THEN
1075: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
1076: gme_debug.put_line ('Contiguity period ... _failed');
1077: END IF;
1078:
1079: x_return_status := l_return_status;
1080: WHEN clear_chg_dates_error THEN
1079: x_return_status := l_return_status;
1080: WHEN clear_chg_dates_error THEN
1081: x_return_status := fnd_api.g_ret_sts_error;
1082: WHEN error_non_contiguious THEN
1083: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
1084: gme_debug.put_line ('Contiguity period ... not found');
1085: END IF;
1086:
1087: gme_common_pvt.log_message ('GME_NON_CONTIGUOUS_TIME');
1080: WHEN clear_chg_dates_error THEN
1081: x_return_status := fnd_api.g_ret_sts_error;
1082: WHEN error_non_contiguious THEN
1083: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
1084: gme_debug.put_line ('Contiguity period ... not found');
1085: END IF;
1086:
1087: gme_common_pvt.log_message ('GME_NON_CONTIGUOUS_TIME');
1088: x_return_status := 'C';
1106: x_return_status := fnd_api.g_ret_sts_unexp_error;
1107: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1108:
1109: IF (NVL (g_debug, 0) > 0) THEN
1110: gme_debug.put_line ( g_pkg_name
1111: || '.'
1112: || l_api_name
1113: || ':'
1114: || ' OTHERS:'
1148: l_api_name CONSTANT VARCHAR2 (30) := 'UPDATE_TRANSACTION';
1149: l_batch_id NUMBER := 0;
1150: l_doc_type VARCHAR2 (4);
1151: BEGIN
1152: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
1153: gme_debug.put_line (g_pkg_name || '.' || l_api_name || ':'
1154: || 'Entering');
1155: END IF;
1156:
1149: l_batch_id NUMBER := 0;
1150: l_doc_type VARCHAR2 (4);
1151: BEGIN
1152: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
1153: gme_debug.put_line (g_pkg_name || '.' || l_api_name || ':'
1154: || 'Entering');
1155: END IF;
1156:
1157: /* Set the return status to success initially */
1163: ELSE
1164: l_doc_type := 'FPO';
1165: END IF;
1166:
1167: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
1168: gme_debug.put_line ('batch_id=' || l_batch_id);
1169: END IF;
1170:
1171: IF p_date = 0 THEN
1164: l_doc_type := 'FPO';
1165: END IF;
1166:
1167: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
1168: gme_debug.put_line ('batch_id=' || l_batch_id);
1169: END IF;
1170:
1171: IF p_date = 0 THEN
1172: --update batch start date
1433: x_return_status := fnd_api.g_ret_sts_unexp_error;
1434: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1435:
1436: IF (NVL (g_debug, 0) > 0) THEN
1437: gme_debug.put_line ( g_pkg_name
1438: || '.'
1439: || l_api_name
1440: || ':'
1441: || ' OTHERS:'