DBA Data[Home] [Help]

APPS.GME_CREATE_BATCH_PVT dependencies on GME_COMMON_PVT

Line 23: /* ERES constants that are added to gme_common_pvt instead*/

19: /* to the Routing uom and then Compare it with l_temp_qty.*/
20: /* Kapil M. Bug# 5458674 */
21: /* Changes to Support LCF Batches for GMO */
22: /* Archana Mundhe Bug 5763818 Modified the code to use */
23: /* ERES constants that are added to gme_common_pvt instead*/
24: /* of using the hardcoded ERES event names such as */
25: /* 'oracle.apps.gme...' */
26: /* Swapna K Bug#6398619 calls to validate_wip_entity are changed */
27: /* for the manual doc ordering */

Line 75: l_count := gme_common_pvt.g_error_count;

71: || l_api_name);
72: END IF;
73:
74: /* Create defaults for mandatory columns that have not been specified */
75: l_count := gme_common_pvt.g_error_count;
76: x_batch_header_rec := p_batch_header_rec;
77:
78: IF x_batch_header_rec.organization_id IS NULL THEN
79: fnd_message.set_name ('INV', 'INV_INT_ORGCODE');

Line 87: NVL (x_batch_header_rec.plan_start_date, gme_common_pvt.g_timestamp);

83: x_batch_header_rec.prod_id := NVL (x_batch_header_rec.prod_id, 0);
84: x_batch_header_rec.prod_sequence :=
85: NVL (x_batch_header_rec.prod_sequence, 0);
86: x_batch_header_rec.plan_start_date :=
87: NVL (x_batch_header_rec.plan_start_date, gme_common_pvt.g_timestamp);
88: x_batch_header_rec.plan_cmplt_date :=
89: NVL (x_batch_header_rec.plan_cmplt_date, gme_common_pvt.g_timestamp);
90: x_batch_header_rec.due_date :=
91: NVL (x_batch_header_rec.due_date, gme_common_pvt.g_timestamp);

Line 89: NVL (x_batch_header_rec.plan_cmplt_date, gme_common_pvt.g_timestamp);

85: NVL (x_batch_header_rec.prod_sequence, 0);
86: x_batch_header_rec.plan_start_date :=
87: NVL (x_batch_header_rec.plan_start_date, gme_common_pvt.g_timestamp);
88: x_batch_header_rec.plan_cmplt_date :=
89: NVL (x_batch_header_rec.plan_cmplt_date, gme_common_pvt.g_timestamp);
90: x_batch_header_rec.due_date :=
91: NVL (x_batch_header_rec.due_date, gme_common_pvt.g_timestamp);
92: x_batch_header_rec.batch_status := gme_common_pvt.G_BATCH_PENDING;
93: x_batch_header_rec.priority_value :=

Line 91: NVL (x_batch_header_rec.due_date, gme_common_pvt.g_timestamp);

87: NVL (x_batch_header_rec.plan_start_date, gme_common_pvt.g_timestamp);
88: x_batch_header_rec.plan_cmplt_date :=
89: NVL (x_batch_header_rec.plan_cmplt_date, gme_common_pvt.g_timestamp);
90: x_batch_header_rec.due_date :=
91: NVL (x_batch_header_rec.due_date, gme_common_pvt.g_timestamp);
92: x_batch_header_rec.batch_status := gme_common_pvt.G_BATCH_PENDING;
93: x_batch_header_rec.priority_value :=
94: NVL (x_batch_header_rec.priority_value, 0);
95: x_batch_header_rec.priority_code :=

Line 92: x_batch_header_rec.batch_status := gme_common_pvt.G_BATCH_PENDING;

88: x_batch_header_rec.plan_cmplt_date :=
89: NVL (x_batch_header_rec.plan_cmplt_date, gme_common_pvt.g_timestamp);
90: x_batch_header_rec.due_date :=
91: NVL (x_batch_header_rec.due_date, gme_common_pvt.g_timestamp);
92: x_batch_header_rec.batch_status := gme_common_pvt.G_BATCH_PENDING;
93: x_batch_header_rec.priority_value :=
94: NVL (x_batch_header_rec.priority_value, 0);
95: x_batch_header_rec.priority_code :=
96: NVL (x_batch_header_rec.priority_code, 0);

Line 104: IF l_count <> gme_common_pvt.g_error_count THEN

100: x_batch_header_rec.gl_posted_ind := 0;
101: x_batch_header_rec.delete_mark := 0;
102: x_batch_header_rec.automatic_step_calculation := 1;
103:
104: IF l_count <> gme_common_pvt.g_error_count THEN
105: RETURN FALSE;
106: ELSE
107: RETURN TRUE;
108: END IF;

Line 149: gme_common_pvt.log_message('GME_WIP_ENTITY_EXISTS');

145: CLOSE Cur_wip_entity;
146: EXCEPTION
147: WHEN duplicate_wip_entity THEN
148: x_return_status := fnd_api.g_ret_sts_error;
149: gme_common_pvt.log_message('GME_WIP_ENTITY_EXISTS');
150: WHEN OTHERS THEN
151: IF g_debug <= gme_debug.g_log_unexpected THEN
152: gme_debug.put_line ( 'When others exception in '
153: || g_pkg_name

Line 165: := gme_common_pvt.g_max_errors

161: END validate_wip_entity;
162:
163: PROCEDURE create_batch (
164: p_validation_level IN NUMBER
165: := gme_common_pvt.g_max_errors
166: ,p_batch_header_rec IN gme_batch_header%ROWTYPE
167: ,p_batch_size IN NUMBER
168: ,p_batch_size_uom IN VARCHAR2
169: ,p_creation_mode IN VARCHAR2

Line 177: ,x_exception_material_tbl OUT NOCOPY gme_common_pvt.exceptions_tab

173: ,p_contiguity_override IN VARCHAR2
174: ,p_is_phantom IN VARCHAR2 DEFAULT 'N'
175: ,p_use_least_cost_validity_rule IN VARCHAR2 := fnd_api.g_false
176: ,x_batch_header_rec OUT NOCOPY gme_batch_header%ROWTYPE
177: ,x_exception_material_tbl OUT NOCOPY gme_common_pvt.exceptions_tab
178: ,x_return_status OUT NOCOPY VARCHAR2)
179: IS
180: l_in_batch_header gme_batch_header%ROWTYPE;
181: l_formula_master fm_form_mst%ROWTYPE;

Line 188: l_material_details gme_common_pvt.material_details_tab;

184: l_item_master mtl_system_items_kfv%ROWTYPE;
185: l_gme_material_detail gme_material_details%ROWTYPE;
186: l_text_header gme_text_header%ROWTYPE;
187: l_text_string gme_text_table.text%TYPE;
188: l_material_details gme_common_pvt.material_details_tab;
189: p_material_details gme_common_pvt.material_details_tab;
190: l_in_material_details gme_common_pvt.material_details_tab;
191: l_material_details_in gme_material_details%ROWTYPE;
192: l_item_masters gme_common_pvt.item_masters_tab;

Line 189: p_material_details gme_common_pvt.material_details_tab;

185: l_gme_material_detail gme_material_details%ROWTYPE;
186: l_text_header gme_text_header%ROWTYPE;
187: l_text_string gme_text_table.text%TYPE;
188: l_material_details gme_common_pvt.material_details_tab;
189: p_material_details gme_common_pvt.material_details_tab;
190: l_in_material_details gme_common_pvt.material_details_tab;
191: l_material_details_in gme_material_details%ROWTYPE;
192: l_item_masters gme_common_pvt.item_masters_tab;
193: l_text_table gme_common_pvt.text_tab;

Line 190: l_in_material_details gme_common_pvt.material_details_tab;

186: l_text_header gme_text_header%ROWTYPE;
187: l_text_string gme_text_table.text%TYPE;
188: l_material_details gme_common_pvt.material_details_tab;
189: p_material_details gme_common_pvt.material_details_tab;
190: l_in_material_details gme_common_pvt.material_details_tab;
191: l_material_details_in gme_material_details%ROWTYPE;
192: l_item_masters gme_common_pvt.item_masters_tab;
193: l_text_table gme_common_pvt.text_tab;
194: l_recipe gmd_recipes%ROWTYPE;

Line 192: l_item_masters gme_common_pvt.item_masters_tab;

188: l_material_details gme_common_pvt.material_details_tab;
189: p_material_details gme_common_pvt.material_details_tab;
190: l_in_material_details gme_common_pvt.material_details_tab;
191: l_material_details_in gme_material_details%ROWTYPE;
192: l_item_masters gme_common_pvt.item_masters_tab;
193: l_text_table gme_common_pvt.text_tab;
194: l_recipe gmd_recipes%ROWTYPE;
195: l_from_uom mtl_units_of_measure.uom_code%TYPE;
196: l_to_uom mtl_units_of_measure.uom_code%TYPE;

Line 193: l_text_table gme_common_pvt.text_tab;

189: p_material_details gme_common_pvt.material_details_tab;
190: l_in_material_details gme_common_pvt.material_details_tab;
191: l_material_details_in gme_material_details%ROWTYPE;
192: l_item_masters gme_common_pvt.item_masters_tab;
193: l_text_table gme_common_pvt.text_tab;
194: l_recipe gmd_recipes%ROWTYPE;
195: l_from_uom mtl_units_of_measure.uom_code%TYPE;
196: l_to_uom mtl_units_of_measure.uom_code%TYPE;
197: l_prim_item_um mtl_units_of_measure.uom_code%TYPE;

Line 244: l_exception_material_tbl gme_common_pvt.exceptions_tab;

240: l_excp_tbl_ptr NUMBER; -- nsinghi bug#5200395
241: l_return BOOLEAN;
242: l_no_prod_rule_found BOOLEAN;
243: l_prim_prod_found BOOLEAN;
244: l_exception_material_tbl gme_common_pvt.exceptions_tab;
245: l_trolin_tbl inv_move_order_pub.trolin_tbl_type;
246: l_phantom_exc_material_tbl gme_common_pvt.exceptions_tab; -- nsinghi bug#5200395
247: l_phantom_exc_material_tbl_out gme_common_pvt.exceptions_tab; -- nsinghi bug#5200395
248: l_batch_header_rec gme_batch_header%ROWTYPE;

Line 246: l_phantom_exc_material_tbl gme_common_pvt.exceptions_tab; -- nsinghi bug#5200395

242: l_no_prod_rule_found BOOLEAN;
243: l_prim_prod_found BOOLEAN;
244: l_exception_material_tbl gme_common_pvt.exceptions_tab;
245: l_trolin_tbl inv_move_order_pub.trolin_tbl_type;
246: l_phantom_exc_material_tbl gme_common_pvt.exceptions_tab; -- nsinghi bug#5200395
247: l_phantom_exc_material_tbl_out gme_common_pvt.exceptions_tab; -- nsinghi bug#5200395
248: l_batch_header_rec gme_batch_header%ROWTYPE;
249: l_batchstep_rec gme_batch_steps%ROWTYPE;
250: x_batchstep_rec gme_batch_steps%ROWTYPE;

Line 247: l_phantom_exc_material_tbl_out gme_common_pvt.exceptions_tab; -- nsinghi bug#5200395

243: l_prim_prod_found BOOLEAN;
244: l_exception_material_tbl gme_common_pvt.exceptions_tab;
245: l_trolin_tbl inv_move_order_pub.trolin_tbl_type;
246: l_phantom_exc_material_tbl gme_common_pvt.exceptions_tab; -- nsinghi bug#5200395
247: l_phantom_exc_material_tbl_out gme_common_pvt.exceptions_tab; -- nsinghi bug#5200395
248: l_batch_header_rec gme_batch_header%ROWTYPE;
249: l_batchstep_rec gme_batch_steps%ROWTYPE;
250: x_batchstep_rec gme_batch_steps%ROWTYPE;
251: l_in_material_detail gme_material_details%ROWTYPE;

Line 346: AND line_type = gme_common_pvt.g_line_type_prod

342: SELECT plan_qty, dtl_um
343: FROM gme_material_details
344: WHERE batch_id = v_batch_id
345: AND inventory_item_id = v_inventory_item_id
346: AND line_type = gme_common_pvt.g_line_type_prod
347: ORDER BY line_no ASC;
348:
349: -- Bug 6665602 Back out 5484529... Reinstate original cursor.
350: --sunitha bug # 5484529 selecting the sum of the plan quantity without converting

Line 364: AND line_type = gme_common_pvt.g_line_type_prod;

360: ,NULL) )
361: FROM gme_material_details
362: WHERE batch_id = v_batch_id
363: AND inventory_item_id = v_inventory_item_id
364: AND line_type = gme_common_pvt.g_line_type_prod;
365: /*CURSOR cur_batch_qty (v_batch_id NUMBER, v_inventory_item_id NUMBER)
366: IS
367: SELECT SUM (plan_qty )
368: FROM gme_material_details

Line 371: AND line_type = gme_common_pvt.g_line_type_prod; */

367: SELECT SUM (plan_qty )
368: FROM gme_material_details
369: WHERE batch_id = v_batch_id
370: AND inventory_item_id = v_inventory_item_id
371: AND line_type = gme_common_pvt.g_line_type_prod; */
372:
373: CURSOR cur_item_no (v_inventory_item_id NUMBER, v_org_id NUMBER)
374: IS
375: SELECT concatenated_segments

Line 428: gme_common_pvt.log_message ('GME_API_QTY_CANT_BE_ZERO');

424:
425: IF ( p_creation_mode <> 'RECIPE'
426: AND NVL (p_batch_size, 0) = 0
427: AND p_is_phantom <> 'Y') THEN
428: gme_common_pvt.log_message ('GME_API_QTY_CANT_BE_ZERO');
429: RAISE expected_error;
430: END IF;
431:
432: IF x_batch_header_rec.batch_type NOT IN (0, 10) THEN

Line 433: gme_common_pvt.log_message ('GME_INVALID_BATCH_TYPE');

429: RAISE expected_error;
430: END IF;
431:
432: IF x_batch_header_rec.batch_type NOT IN (0, 10) THEN
433: gme_common_pvt.log_message ('GME_INVALID_BATCH_TYPE');
434: RAISE expected_error;
435: END IF;
436:
437: OPEN cur_get_doc_ord (x_batch_header_rec.organization_id

Line 471: IF (gme_common_pvt.g_lab_ind = 1 AND gme_common_pvt.g_plant_ind = 1) THEN

467: gme_debug.put_line ('before laboratory check' || g_pkg_name || '.'
468: || l_api_name);
469: END IF;
470:
471: IF (gme_common_pvt.g_lab_ind = 1 AND gme_common_pvt.g_plant_ind = 1) THEN
472: IF p_batch_header_rec.laboratory_ind = 1 THEN
473: x_batch_header_rec.laboratory_ind := 1;
474: x_batch_header_rec.update_inventory_ind :=
475: p_batch_header_rec.update_inventory_ind;

Line 480: ELSIF (gme_common_pvt.g_lab_ind = 1) THEN

476: ELSE
477: x_batch_header_rec.laboratory_ind := 0;
478: x_batch_header_rec.update_inventory_ind := 'Y';
479: END IF;
480: ELSIF (gme_common_pvt.g_lab_ind = 1) THEN
481: x_batch_header_rec.laboratory_ind := 1;
482: x_batch_header_rec.update_inventory_ind :=
483: p_batch_header_rec.update_inventory_ind;
484: ELSIF (gme_common_pvt.g_plant_ind = 1) THEN

Line 484: ELSIF (gme_common_pvt.g_plant_ind = 1) THEN

480: ELSIF (gme_common_pvt.g_lab_ind = 1) THEN
481: x_batch_header_rec.laboratory_ind := 1;
482: x_batch_header_rec.update_inventory_ind :=
483: p_batch_header_rec.update_inventory_ind;
484: ELSIF (gme_common_pvt.g_plant_ind = 1) THEN
485: x_batch_header_rec.laboratory_ind := 0;
486: x_batch_header_rec.update_inventory_ind := 'Y';
487: END IF;
488: IF g_debug <= gme_debug.g_log_procedure THEN

Line 535: gme_common_pvt.log_message ('GME_API_INVALID_RULE');

531:
532: CLOSE recipe_cursor;
533:
534: IF l_recipe.recipe_id IS NULL THEN
535: gme_common_pvt.log_message ('GME_API_INVALID_RULE');
536: RAISE expected_error;
537: END IF;
538:
539: IF g_debug <= gme_debug.g_log_statement THEN

Line 555: ,x_recipe_rout_tbl => gme_common_pvt.routings

551: ,x_return_status => l_return_status
552: ,x_msg_count => l_message_count
553: ,x_msg_data => l_message_list
554: ,x_return_code => l_return_code
555: ,x_recipe_rout_tbl => gme_common_pvt.routings
556: ,x_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
557: ,x_recipe_step_out => gme_common_pvt.steps
558: ,x_routing_depd_tbl => gme_common_pvt.step_dependencies
559: ,x_oprn_act_out => gme_common_pvt.activities

Line 556: ,x_recipe_rout_matl_tbl => gme_common_pvt.routing_materials

552: ,x_msg_count => l_message_count
553: ,x_msg_data => l_message_list
554: ,x_return_code => l_return_code
555: ,x_recipe_rout_tbl => gme_common_pvt.routings
556: ,x_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
557: ,x_recipe_step_out => gme_common_pvt.steps
558: ,x_routing_depd_tbl => gme_common_pvt.step_dependencies
559: ,x_oprn_act_out => gme_common_pvt.activities
560: ,x_oprn_resc_rec => gme_common_pvt.resources

Line 557: ,x_recipe_step_out => gme_common_pvt.steps

553: ,x_msg_data => l_message_list
554: ,x_return_code => l_return_code
555: ,x_recipe_rout_tbl => gme_common_pvt.routings
556: ,x_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
557: ,x_recipe_step_out => gme_common_pvt.steps
558: ,x_routing_depd_tbl => gme_common_pvt.step_dependencies
559: ,x_oprn_act_out => gme_common_pvt.activities
560: ,x_oprn_resc_rec => gme_common_pvt.resources
561: ,x_formula_header_rec => l_formula_master

Line 558: ,x_routing_depd_tbl => gme_common_pvt.step_dependencies

554: ,x_return_code => l_return_code
555: ,x_recipe_rout_tbl => gme_common_pvt.routings
556: ,x_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
557: ,x_recipe_step_out => gme_common_pvt.steps
558: ,x_routing_depd_tbl => gme_common_pvt.step_dependencies
559: ,x_oprn_act_out => gme_common_pvt.activities
560: ,x_oprn_resc_rec => gme_common_pvt.resources
561: ,x_formula_header_rec => l_formula_master
562: ,x_formula_dtl_tbl => gme_common_pvt.materials

Line 559: ,x_oprn_act_out => gme_common_pvt.activities

555: ,x_recipe_rout_tbl => gme_common_pvt.routings
556: ,x_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
557: ,x_recipe_step_out => gme_common_pvt.steps
558: ,x_routing_depd_tbl => gme_common_pvt.step_dependencies
559: ,x_oprn_act_out => gme_common_pvt.activities
560: ,x_oprn_resc_rec => gme_common_pvt.resources
561: ,x_formula_header_rec => l_formula_master
562: ,x_formula_dtl_tbl => gme_common_pvt.materials
563: ,x_recp_resc_proc_param_tbl => gme_common_pvt.process_parameters);

Line 560: ,x_oprn_resc_rec => gme_common_pvt.resources

556: ,x_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
557: ,x_recipe_step_out => gme_common_pvt.steps
558: ,x_routing_depd_tbl => gme_common_pvt.step_dependencies
559: ,x_oprn_act_out => gme_common_pvt.activities
560: ,x_oprn_resc_rec => gme_common_pvt.resources
561: ,x_formula_header_rec => l_formula_master
562: ,x_formula_dtl_tbl => gme_common_pvt.materials
563: ,x_recp_resc_proc_param_tbl => gme_common_pvt.process_parameters);
564: IF g_debug <= gme_debug.g_log_statement THEN

Line 562: ,x_formula_dtl_tbl => gme_common_pvt.materials

558: ,x_routing_depd_tbl => gme_common_pvt.step_dependencies
559: ,x_oprn_act_out => gme_common_pvt.activities
560: ,x_oprn_resc_rec => gme_common_pvt.resources
561: ,x_formula_header_rec => l_formula_master
562: ,x_formula_dtl_tbl => gme_common_pvt.materials
563: ,x_recp_resc_proc_param_tbl => gme_common_pvt.process_parameters);
564: IF g_debug <= gme_debug.g_log_statement THEN
565: gme_debug.put_line
566: ( g_pkg_name

Line 563: ,x_recp_resc_proc_param_tbl => gme_common_pvt.process_parameters);

559: ,x_oprn_act_out => gme_common_pvt.activities
560: ,x_oprn_resc_rec => gme_common_pvt.resources
561: ,x_formula_header_rec => l_formula_master
562: ,x_formula_dtl_tbl => gme_common_pvt.materials
563: ,x_recp_resc_proc_param_tbl => gme_common_pvt.process_parameters);
564: IF g_debug <= gme_debug.g_log_statement THEN
565: gme_debug.put_line
566: ( g_pkg_name
567: || '.'

Line 577: gme_common_pvt.materials (1).inventory_item_id;

573: ELSE /* p_creation_mode = 'LCF' */
574: /* Setup following variables so that rest of the program goes through */
575: l_return_status := fnd_api.g_ret_sts_success;
576: l_recipe_validity_rule.inventory_item_id :=
577: gme_common_pvt.materials (1).inventory_item_id;
578: l_formula_master.text_code := NULL;
579: l_formula_master.scale_type := 0;
580: l_recipe.calculate_step_quantity := 0;
581: IF gme_common_pvt.routings.COUNT > 0 THEN

Line 581: IF gme_common_pvt.routings.COUNT > 0 THEN

577: gme_common_pvt.materials (1).inventory_item_id;
578: l_formula_master.text_code := NULL;
579: l_formula_master.scale_type := 0;
580: l_recipe.calculate_step_quantity := 0;
581: IF gme_common_pvt.routings.COUNT > 0 THEN
582: l_recipe.routing_id := gme_common_pvt.routings(1).routing_id;
583: END IF;
584: END IF; /* IF p_creation_mode <> 'LCF' THEN */
585:

Line 582: l_recipe.routing_id := gme_common_pvt.routings(1).routing_id;

578: l_formula_master.text_code := NULL;
579: l_formula_master.scale_type := 0;
580: l_recipe.calculate_step_quantity := 0;
581: IF gme_common_pvt.routings.COUNT > 0 THEN
582: l_recipe.routing_id := gme_common_pvt.routings(1).routing_id;
583: END IF;
584: END IF; /* IF p_creation_mode <> 'LCF' THEN */
585:
586: IF (g_debug = gme_debug.g_log_statement) THEN

Line 597: || TO_CHAR (gme_common_pvt.steps.COUNT) );

593: || p_batch_size_uom);
594: gme_debug.put_line ('Return Status was ' || l_return_status);
595: gme_debug.put_line ('return_code = ' || TO_CHAR (l_return_code) );
596: gme_debug.put_line ( '# of Steps = '
597: || TO_CHAR (gme_common_pvt.steps.COUNT) );
598: gme_debug.put_line ( '# of Acts = '
599: || TO_CHAR (gme_common_pvt.activities.COUNT) );
600: gme_debug.put_line ( '# of Rsrc = '
601: || TO_CHAR (gme_common_pvt.resources.COUNT) );

Line 599: || TO_CHAR (gme_common_pvt.activities.COUNT) );

595: gme_debug.put_line ('return_code = ' || TO_CHAR (l_return_code) );
596: gme_debug.put_line ( '# of Steps = '
597: || TO_CHAR (gme_common_pvt.steps.COUNT) );
598: gme_debug.put_line ( '# of Acts = '
599: || TO_CHAR (gme_common_pvt.activities.COUNT) );
600: gme_debug.put_line ( '# of Rsrc = '
601: || TO_CHAR (gme_common_pvt.resources.COUNT) );
602: gme_debug.put_line ( '# of Matl = '
603: || TO_CHAR

Line 601: || TO_CHAR (gme_common_pvt.resources.COUNT) );

597: || TO_CHAR (gme_common_pvt.steps.COUNT) );
598: gme_debug.put_line ( '# of Acts = '
599: || TO_CHAR (gme_common_pvt.activities.COUNT) );
600: gme_debug.put_line ( '# of Rsrc = '
601: || TO_CHAR (gme_common_pvt.resources.COUNT) );
602: gme_debug.put_line ( '# of Matl = '
603: || TO_CHAR
604: (gme_common_pvt.routing_materials.COUNT) );
605: gme_debug.put_line ( '# of Depd = '

Line 604: (gme_common_pvt.routing_materials.COUNT) );

600: gme_debug.put_line ( '# of Rsrc = '
601: || TO_CHAR (gme_common_pvt.resources.COUNT) );
602: gme_debug.put_line ( '# of Matl = '
603: || TO_CHAR
604: (gme_common_pvt.routing_materials.COUNT) );
605: gme_debug.put_line ( '# of Depd = '
606: || TO_CHAR
607: (gme_common_pvt.step_dependencies.COUNT) );
608: gme_debug.put_line ( '# of Lines = '

Line 607: (gme_common_pvt.step_dependencies.COUNT) );

603: || TO_CHAR
604: (gme_common_pvt.routing_materials.COUNT) );
605: gme_debug.put_line ( '# of Depd = '
606: || TO_CHAR
607: (gme_common_pvt.step_dependencies.COUNT) );
608: gme_debug.put_line ( '# of Lines = '
609: || TO_CHAR (gme_common_pvt.materials.COUNT) );
610: END IF;
611:

Line 609: || TO_CHAR (gme_common_pvt.materials.COUNT) );

605: gme_debug.put_line ( '# of Depd = '
606: || TO_CHAR
607: (gme_common_pvt.step_dependencies.COUNT) );
608: gme_debug.put_line ( '# of Lines = '
609: || TO_CHAR (gme_common_pvt.materials.COUNT) );
610: END IF;
611:
612: IF l_return_status <> fnd_api.g_ret_sts_success THEN
613: IF l_return_code = 4 THEN

Line 621: gme_common_pvt.log_message ('GME_BAD_RECIPE_RETRIEVAL');

617: fnd_message.set_name ('GMD', 'GMD_CIRCULAR_DEPEN_DETECT');
618: fnd_msg_pub.ADD;
619: RAISE invalid_recipe;
620: ELSE
621: gme_common_pvt.log_message ('GME_BAD_RECIPE_RETRIEVAL');
622: RAISE invalid_recipe;
623: END IF;
624: END IF;
625:

Line 626: IF gme_common_pvt.routings.COUNT > 0 THEN

622: RAISE invalid_recipe;
623: END IF;
624: END IF;
625:
626: IF gme_common_pvt.routings.COUNT > 0 THEN
627: x_batch_header_rec.enforce_step_dependency :=
628: NVL (gme_common_pvt.routings (1).enforce_step_dependency, 0);
629: END IF;
630:

Line 628: NVL (gme_common_pvt.routings (1).enforce_step_dependency, 0);

624: END IF;
625:
626: IF gme_common_pvt.routings.COUNT > 0 THEN
627: x_batch_header_rec.enforce_step_dependency :=
628: NVL (gme_common_pvt.routings (1).enforce_step_dependency, 0);
629: END IF;
630:
631: IF p_creation_mode <> 'LCF' THEN
632: IF l_formula_master.formula_id IS NULL

Line 635: gme_common_pvt.log_message ('GME_API_INVALID_FORMULA');

631: IF p_creation_mode <> 'LCF' THEN
632: IF l_formula_master.formula_id IS NULL
633: OR l_formula_master.delete_mark = 1
634: OR l_formula_master.inactive_ind = 1 THEN
635: gme_common_pvt.log_message ('GME_API_INVALID_FORMULA');
636: RAISE expected_error;
637: END IF;
638: END IF; /* IF p_creation_mode <> 'LCF' */
639:

Line 652: FOR i IN 1 .. gme_common_pvt.materials.COUNT LOOP

648: || l_api_name
649: || 'Start material processing');
650: END IF;
651:
652: FOR i IN 1 .. gme_common_pvt.materials.COUNT LOOP
653: l_formula_material := gme_common_pvt.materials (i);
654: -- pawan kumar changed this cursor for bug 4917631
655: OPEN item_master_cursor (l_formula_material.inventory_item_id
656: ,x_batch_header_rec.organization_id);

Line 653: l_formula_material := gme_common_pvt.materials (i);

649: || 'Start material processing');
650: END IF;
651:
652: FOR i IN 1 .. gme_common_pvt.materials.COUNT LOOP
653: l_formula_material := gme_common_pvt.materials (i);
654: -- pawan kumar changed this cursor for bug 4917631
655: OPEN item_master_cursor (l_formula_material.inventory_item_id
656: ,x_batch_header_rec.organization_id);
657: FETCH item_master_cursor

Line 667: gme_common_pvt.log_message ('GME_API_INVALID_ITEM'

663: IF l_item_master.inventory_item_id IS NULL
664: OR l_item_master.process_execution_enabled_flag = 'N'
665: OR ( l_item_master.eng_item_flag = 'Y'
666: AND x_batch_header_rec.laboratory_ind = 0) THEN
667: gme_common_pvt.log_message ('GME_API_INVALID_ITEM'
668: ,'ITEM_NO'
669: ,l_item_master.concatenated_segments);
670: RAISE error_count_exceeded;
671: ELSE

Line 677: gme_common_pvt.g_line_type_prod THEN

673: l_item_masters (l_number_of_formula_lines) := l_item_master;
674:
675: IF l_formula_material.line_type > 0 THEN
676: IF l_formula_material.line_type =
677: gme_common_pvt.g_line_type_prod THEN
678: l_number_of_product_lines := l_number_of_product_lines + 1;
679:
680:
681:

Line 694: gme_common_pvt.construct_material_detail

690:
691:
692: -- Construct the material detail row
693:
694: gme_common_pvt.construct_material_detail
695: (p_formula_detail_rec => l_formula_material
696: ,p_item_master_rec => l_item_master
697: ,p_batch_header_rec => x_batch_header_rec
698: ,x_material_detail_rec => l_gme_material_detail

Line 728: gme_common_pvt.g_line_type_ing )

724: l_material_details (l_number_of_formula_lines).original_primary_qty :=
725: l_temp_qty;
726: /* --Pawan changes for GMO
727: IF (l_material_details (l_number_of_formula_lines).line_type =
728: gme_common_pvt.g_line_type_ing )
729: AND (l_material_details (l_number_of_formula_lines).phantom_type = 0 ) THEN
730:
731: GMO_DISPENSE_GRP.IS_DISPENSE_ITEM (p_api_version => 1.0,
732: p_init_msg_list => fnd_api.g_false ,

Line 764: gme_common_pvt.log_message ('GME_API_INVALID_FORMULA');

760:
761: IF l_number_of_formula_lines = 0
762: OR l_number_of_ingredient_lines = 0
763: OR l_number_of_product_lines = 0 THEN
764: gme_common_pvt.log_message ('GME_API_INVALID_FORMULA');
765: RAISE error_count_exceeded;
766: END IF;
767:
768: -- We now need to sort out the scaling. If the formula is marked as scalable

Line 811: ,x_output_ratio => gme_common_pvt.g_batch_scale_factor);

807: ,p_batch_output => p_batch_size
808: ,p_formula_output => l_total_output_qty
809: ,p_yield_um => l_uom
810: ,x_return_status => l_return_status
811: ,x_output_ratio => gme_common_pvt.g_batch_scale_factor);
812:
813: IF l_return_status <> fnd_api.g_ret_sts_success THEN
814: RAISE expected_error;
815: END IF;

Line 833: gme_common_pvt.g_line_type_prod

829:
830: /* Let's convert formula product quantity in the requested UOM */
831: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
832: IF l_material_details (loop_count).line_type =
833: gme_common_pvt.g_line_type_prod
834: AND l_material_details (loop_count).inventory_item_id =
835: l_recipe_validity_rule.inventory_item_id THEN
836:
837: -- bug#5373369 nsinghi rework. While determining the scale factor, give higher precision, otherwise when converting back to batch UOM, there is decimal dust issue and batch creation fails.

Line 874: gme_common_pvt.log_message ('GME_API_PROD_QTY_CANT_ZERO');

870:
871: l_primaries := 'OUTPUTS';
872:
873: IF l_total_output_qty = 0 THEN
874: gme_common_pvt.log_message ('GME_API_PROD_QTY_CANT_ZERO');
875: RAISE expected_error;
876: END IF;
877:
878: -- Bug 7284242 - This can only happen if the fixed product qty sum is greater

Line 885: gme_common_pvt.g_batch_scale_factor :=

881: RAISE create_by_product_failure;
882: END IF;
883:
884: -- Bug 7284242 - Let's subtract the fixed products total from the batch size to derive scale factor.
885: gme_common_pvt.g_batch_scale_factor :=
886: (p_batch_size - l_total_output_qty_fixed) / l_total_output_qty;
887:
888: ELSIF p_creation_mode = 'RECIPE' THEN
889: -- Batch is being created by Recipe and Version

Line 904: gme_common_pvt.g_batch_scale_factor := 1;

900: INTO l_production_rule_qty, l_production_um;
901:
902: IF production_rules_cursor%NOTFOUND THEN
903: l_primaries := 'OUTPUTS';
904: gme_common_pvt.g_batch_scale_factor := 1;
905:
906: IF (g_debug = gme_debug.g_log_statement) THEN
907: gme_debug.put_line
908: ('CREATING BY RECIPE/VERSION WITHOUT SCALING');

Line 915: (gme_common_pvt.g_line_type_prod

911: l_total_output_qty := 0;
912:
913: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
914: IF l_material_details (loop_count).line_type IN
915: (gme_common_pvt.g_line_type_prod
916: ,gme_common_pvt.g_line_type_byprod)
917: AND l_material_details (loop_count).inventory_item_id =
918: l_recipe_validity_rule.inventory_item_id THEN
919:

Line 916: ,gme_common_pvt.g_line_type_byprod)

912:
913: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
914: IF l_material_details (loop_count).line_type IN
915: (gme_common_pvt.g_line_type_prod
916: ,gme_common_pvt.g_line_type_byprod)
917: AND l_material_details (loop_count).inventory_item_id =
918: l_recipe_validity_rule.inventory_item_id THEN
919:
920: -- bug#5373369 nsinghi rework. While determining the scale factor, give higher precision, otherwise when converting back to batch UOM, there is decimal dust issue and batch creation fails.

Line 951: gme_common_pvt.log_message ('GME_API_PROD_QTY_CANT_ZERO');

947: /* l_material_details(loop_count).line_type IN (1, 2) AND */
948: END LOOP; /* loop_count IN 1 .. l_number_of_formula_lines */
949:
950: IF l_total_output_qty = 0 THEN
951: gme_common_pvt.log_message ('GME_API_PROD_QTY_CANT_ZERO');
952: RAISE expected_error;
953: END IF;
954:
955: gme_common_pvt.g_batch_scale_factor :=

Line 955: gme_common_pvt.g_batch_scale_factor :=

951: gme_common_pvt.log_message ('GME_API_PROD_QTY_CANT_ZERO');
952: RAISE expected_error;
953: END IF;
954:
955: gme_common_pvt.g_batch_scale_factor :=
956: l_production_rule_qty / l_total_output_qty;
957: END IF; /* IF production_rules_cursor%NOTFOUND */
958:
959: CLOSE production_rules_cursor;

Line 994: ,x_batchformula_ratio => gme_common_pvt.g_batch_scale_factor);

990: ,p_batch_input => p_batch_size
991: ,p_formula_input => l_total_input_qty
992: ,p_yield_um => l_uom
993: ,x_return_status => l_return_status
994: ,x_batchformula_ratio => gme_common_pvt.g_batch_scale_factor);
995:
996: IF l_return_status <> fnd_api.g_ret_sts_success THEN
997: RAISE expected_error;
998: END IF;

Line 1006: gme_common_pvt.log_message ('GME_API_UNSUPPORTED_MODE'

1002: -- No need to do anything, but this is a valid creation mode
1003: NULL;
1004: ELSE
1005: -- Batch is being created by means unknown
1006: gme_common_pvt.log_message ('GME_API_UNSUPPORTED_MODE'
1007: ,'MODE'
1008: ,p_creation_mode);
1009: RAISE expected_error;
1010: END IF;

Line 1012: IF gme_common_pvt.routings.COUNT <> 0 THEN

1008: ,p_creation_mode);
1009: RAISE expected_error;
1010: END IF;
1011:
1012: IF gme_common_pvt.routings.COUNT <> 0 THEN
1013: l_total_output_qty_c := 0;
1014:
1015: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
1016: IF l_material_details (loop_count).line_type IN

Line 1017: (gme_common_pvt.g_line_type_prod

1013: l_total_output_qty_c := 0;
1014:
1015: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
1016: IF l_material_details (loop_count).line_type IN
1017: (gme_common_pvt.g_line_type_prod
1018: ,gme_common_pvt.g_line_type_byprod) THEN
1019: IF l_material_details (loop_count).dtl_um =
1020: gme_common_pvt.routings (1).routing_uom THEN
1021: l_total_output_qty_c :=

Line 1018: ,gme_common_pvt.g_line_type_byprod) THEN

1014:
1015: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
1016: IF l_material_details (loop_count).line_type IN
1017: (gme_common_pvt.g_line_type_prod
1018: ,gme_common_pvt.g_line_type_byprod) THEN
1019: IF l_material_details (loop_count).dtl_um =
1020: gme_common_pvt.routings (1).routing_uom THEN
1021: l_total_output_qty_c :=
1022: l_total_output_qty_c

Line 1020: gme_common_pvt.routings (1).routing_uom THEN

1016: IF l_material_details (loop_count).line_type IN
1017: (gme_common_pvt.g_line_type_prod
1018: ,gme_common_pvt.g_line_type_byprod) THEN
1019: IF l_material_details (loop_count).dtl_um =
1020: gme_common_pvt.routings (1).routing_uom THEN
1021: l_total_output_qty_c :=
1022: l_total_output_qty_c
1023: + l_material_details (loop_count).plan_qty;
1024: ELSE

Line 1031: ,gme_common_pvt.routings (1).routing_uom

1027: (l_material_details (loop_count).inventory_item_id
1028: ,5
1029: ,l_material_details (loop_count).plan_qty
1030: ,l_material_details (loop_count).dtl_um
1031: ,gme_common_pvt.routings (1).routing_uom
1032: ,NULL
1033: ,NULL);
1034:
1035: IF l_temp_qty < 0 THEN

Line 1044: l_to_uom := gme_common_pvt.routings (1).routing_uom;

1040:
1041: l_item_id :=
1042: l_material_details (loop_count).inventory_item_id;
1043: l_from_uom := l_material_details (loop_count).dtl_um;
1044: l_to_uom := gme_common_pvt.routings (1).routing_uom;
1045: RAISE conversion_failure;
1046: ELSE
1047: l_total_output_qty_c :=
1048: l_total_output_qty_c + l_temp_qty;

Line 1059: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */

1055: IF (g_debug = gme_debug.g_log_statement) THEN
1056: gme_debug.put_line ( 'tot_output before scaling is '
1057: || TO_CHAR (l_total_output_qty_c) );
1058: END IF;
1059: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */
1060:
1061: IF gme_common_pvt.g_batch_scale_factor <> 1 THEN
1062: IF (g_debug = gme_debug.g_log_statement) THEN
1063: gme_debug.put_line

Line 1061: IF gme_common_pvt.g_batch_scale_factor <> 1 THEN

1057: || TO_CHAR (l_total_output_qty_c) );
1058: END IF;
1059: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */
1060:
1061: IF gme_common_pvt.g_batch_scale_factor <> 1 THEN
1062: IF (g_debug = gme_debug.g_log_statement) THEN
1063: gme_debug.put_line
1064: ( 'scale factor is '
1065: || TO_CHAR

Line 1066: (gme_common_pvt.g_batch_scale_factor) );

1062: IF (g_debug = gme_debug.g_log_statement) THEN
1063: gme_debug.put_line
1064: ( 'scale factor is '
1065: || TO_CHAR
1066: (gme_common_pvt.g_batch_scale_factor) );
1067: END IF;
1068:
1069: /* Following line is added, because the scale_batch is expecting the
1070: batch status to be 0. We will reset it to 1 as soon as scaling is done */

Line 1079: ,p_scale_factor => gme_common_pvt.g_batch_scale_factor

1075: l_in_material_details := l_material_details;
1076: gme_scale_batch_pvt.scale_batch
1077: (p_batch_header_rec => x_batch_header_rec
1078: ,p_material_tbl => l_in_material_details
1079: ,p_scale_factor => gme_common_pvt.g_batch_scale_factor
1080: ,p_primaries => l_primaries
1081: ,p_qty_type => 1
1082: ,p_validity_rule_id => l_recipe_validity_rule.recipe_validity_rule_id
1083: ,p_enforce_vldt_check => fnd_api.g_true

Line 1093: x_batch_header_rec.batch_status := gme_common_pvt.g_batch_pending;

1089: ,x_batch_header_rec => l_in_batch_header
1090: ,
1091: /* Create batch does not need any values from here so dummy variable */
1092: x_return_status => x_return_status);
1093: x_batch_header_rec.batch_status := gme_common_pvt.g_batch_pending;
1094:
1095: IF (g_debug = gme_debug.g_log_statement) THEN
1096: gme_debug.put_line ( 'return from scale_batch is: '
1097: || x_return_status);

Line 1132: IF gme_common_pvt.routings.COUNT <> 0 THEN

1128:
1129: -- Scaling worked OK, so we now need to caculate the total scaled
1130: -- formula output in the Routing UOM so that we can look up a few
1131: -- things in the process loss table.
1132: IF gme_common_pvt.routings.COUNT <> 0 THEN
1133: l_total_output_qty_b := 0;
1134:
1135: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
1136: IF l_material_details (loop_count).line_type IN

Line 1137: (gme_common_pvt.g_line_type_prod

1133: l_total_output_qty_b := 0;
1134:
1135: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
1136: IF l_material_details (loop_count).line_type IN
1137: (gme_common_pvt.g_line_type_prod
1138: ,gme_common_pvt.g_line_type_byprod) THEN
1139: IF l_material_details (loop_count).dtl_um =
1140: gme_common_pvt.routings (1).routing_uom THEN
1141: l_total_output_qty_b :=

Line 1138: ,gme_common_pvt.g_line_type_byprod) THEN

1134:
1135: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
1136: IF l_material_details (loop_count).line_type IN
1137: (gme_common_pvt.g_line_type_prod
1138: ,gme_common_pvt.g_line_type_byprod) THEN
1139: IF l_material_details (loop_count).dtl_um =
1140: gme_common_pvt.routings (1).routing_uom THEN
1141: l_total_output_qty_b :=
1142: l_total_output_qty_b

Line 1140: gme_common_pvt.routings (1).routing_uom THEN

1136: IF l_material_details (loop_count).line_type IN
1137: (gme_common_pvt.g_line_type_prod
1138: ,gme_common_pvt.g_line_type_byprod) THEN
1139: IF l_material_details (loop_count).dtl_um =
1140: gme_common_pvt.routings (1).routing_uom THEN
1141: l_total_output_qty_b :=
1142: l_total_output_qty_b
1143: + l_material_details (loop_count).plan_qty;
1144: ELSE

Line 1151: ,gme_common_pvt.routings (1).routing_uom

1147: (l_material_details (loop_count).inventory_item_id
1148: ,5
1149: ,l_material_details (loop_count).plan_qty
1150: ,l_material_details (loop_count).dtl_um
1151: ,gme_common_pvt.routings (1).routing_uom
1152: ,NULL
1153: ,NULL);
1154:
1155: IF l_temp_qty < 0 THEN

Line 1165: l_to_uom := gme_common_pvt.routings (1).routing_uom;

1161: l_item_id :=
1162: l_material_details (loop_count).inventory_item_id;
1163: l_from_uom :=
1164: l_material_details (loop_count).dtl_um;
1165: l_to_uom := gme_common_pvt.routings (1).routing_uom;
1166: RAISE conversion_failure;
1167: ELSE
1168: l_total_output_qty_b :=
1169: l_total_output_qty_b + l_temp_qty;

Line 1179: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */

1175: IF (g_debug = gme_debug.g_log_statement) THEN
1176: gme_debug.put_line ( 'Total Output after scaling is '
1177: || TO_CHAR (l_total_output_qty_b) );
1178: END IF;
1179: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */
1180: END IF; /* IF gme_common_pvt.g_batch_scale_factor <> 1 */
1181:
1182: IF p_creation_mode <> 'LCF' THEN
1183: -- Batch has been scaled OK so we now need to determine and apply the process loss.

Line 1180: END IF; /* IF gme_common_pvt.g_batch_scale_factor <> 1 */

1176: gme_debug.put_line ( 'Total Output after scaling is '
1177: || TO_CHAR (l_total_output_qty_b) );
1178: END IF;
1179: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */
1180: END IF; /* IF gme_common_pvt.g_batch_scale_factor <> 1 */
1181:
1182: IF p_creation_mode <> 'LCF' THEN
1183: -- Batch has been scaled OK so we now need to determine and apply the process loss.
1184: l_process_loss :=

Line 1185: gme_common_pvt.get_process_loss

1181:
1182: IF p_creation_mode <> 'LCF' THEN
1183: -- Batch has been scaled OK so we now need to determine and apply the process loss.
1184: l_process_loss :=
1185: gme_common_pvt.get_process_loss
1186: (p_validity_rule_id => l_recipe_validity_rule.recipe_validity_rule_id
1187: ,p_organization_id => x_batch_header_rec.organization_id
1188: ,p_total_output_qty_scaled => l_total_output_qty_b
1189: ,p_total_output_qty_pre_scale => l_total_output_qty_c);

Line 1226: IF gme_common_pvt.routings.COUNT <> 0 THEN

1222: || TO_CHAR (l_total_output_qty_b) );
1223: END IF;
1224: END IF; /* IF p_creation_mode <> 'LCF' THEN */
1225:
1226: IF gme_common_pvt.routings.COUNT <> 0 THEN
1227: -- Accumulate the total output of the batch in the ROUTING UOM
1228: l_requested_qty := 0;
1229:
1230: IF (l_total_output_qty_b IS NULL OR l_total_output_qty_b = 0)

Line 1237: gme_common_pvt.routings (1).routing_uom THEN

1233:
1234: FOR l_row_count IN 1 .. l_number_of_formula_lines LOOP
1235: IF l_material_details (l_row_count).line_type > 0 THEN
1236: IF l_material_details (l_row_count).dtl_um =
1237: gme_common_pvt.routings (1).routing_uom THEN
1238: l_total_output_qty_b :=
1239: l_total_output_qty_b
1240: + l_material_details (l_row_count).plan_qty;
1241: ELSE

Line 1248: ,gme_common_pvt.routings (1).routing_uom

1244: (l_material_details (l_row_count).inventory_item_id
1245: ,5
1246: ,l_material_details (l_row_count).plan_qty
1247: ,l_material_details (l_row_count).dtl_um
1248: ,gme_common_pvt.routings (1).routing_uom
1249: ,NULL
1250: ,NULL);
1251:
1252: IF l_temp_qty < 0 THEN

Line 1258: gme_common_pvt.routings (1).routing_uom;

1254: l_material_details (l_row_count).inventory_item_id;
1255: l_from_uom :=
1256: l_material_details (l_row_count).dtl_um;
1257: l_to_uom :=
1258: gme_common_pvt.routings (1).routing_uom;
1259: RAISE conversion_failure;
1260: ELSE
1261: l_total_output_qty_b :=
1262: l_total_output_qty_b + l_temp_qty;

Line 1270: gme_common_pvt.log_message ('GME_API_PROD_QTY_CANT_ZERO');

1266: END LOOP; -- l_row_count IN 1 .. l_number_of_formula_lines
1267: END IF; /* b_total_output_qty_b IS NULL */
1268:
1269: IF l_total_output_qty_c = 0 THEN
1270: gme_common_pvt.log_message ('GME_API_PROD_QTY_CANT_ZERO');
1271: RAISE expected_error;
1272: END IF;
1273:
1274: gme_common_pvt.g_routing_scale_factor :=

Line 1274: gme_common_pvt.g_routing_scale_factor :=

1270: gme_common_pvt.log_message ('GME_API_PROD_QTY_CANT_ZERO');
1271: RAISE expected_error;
1272: END IF;
1273:
1274: gme_common_pvt.g_routing_scale_factor :=
1275: l_total_output_qty_b / l_total_output_qty_c;
1276:
1277: IF (g_debug = gme_debug.g_log_statement) THEN
1278: gme_debug.put_line ( 'Routing scale factor is '

Line 1279: || gme_common_pvt.g_routing_scale_factor);

1275: l_total_output_qty_b / l_total_output_qty_c;
1276:
1277: IF (g_debug = gme_debug.g_log_statement) THEN
1278: gme_debug.put_line ( 'Routing scale factor is '
1279: || gme_common_pvt.g_routing_scale_factor);
1280: END IF;
1281: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */
1282: ELSE /* IF l_formula_master.scale_type <> 1 */
1283: -- Formula cannot be scaled

Line 1281: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */

1277: IF (g_debug = gme_debug.g_log_statement) THEN
1278: gme_debug.put_line ( 'Routing scale factor is '
1279: || gme_common_pvt.g_routing_scale_factor);
1280: END IF;
1281: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */
1282: ELSE /* IF l_formula_master.scale_type <> 1 */
1283: -- Formula cannot be scaled
1284: gme_common_pvt.g_batch_scale_factor := 1;
1285: gme_common_pvt.g_routing_scale_factor := 1;

Line 1284: gme_common_pvt.g_batch_scale_factor := 1;

1280: END IF;
1281: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */
1282: ELSE /* IF l_formula_master.scale_type <> 1 */
1283: -- Formula cannot be scaled
1284: gme_common_pvt.g_batch_scale_factor := 1;
1285: gme_common_pvt.g_routing_scale_factor := 1;
1286: END IF;
1287:
1288: -- Fixed Process Loss ME

Line 1285: gme_common_pvt.g_routing_scale_factor := 1;

1281: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */
1282: ELSE /* IF l_formula_master.scale_type <> 1 */
1283: -- Formula cannot be scaled
1284: gme_common_pvt.g_batch_scale_factor := 1;
1285: gme_common_pvt.g_routing_scale_factor := 1;
1286: END IF;
1287:
1288: -- Fixed Process Loss ME
1289:

Line 1328: -- IF gme_common_pvt.g_error_count > 0 THEN

1324: gme_debug.put_line ('fnd return is ' || fnd_api.g_ret_sts_success);
1325: END IF;
1326:
1327: -- If we've found any errors, don't start the updates.
1328: -- IF gme_common_pvt.g_error_count > 0 THEN
1329: -- RAISE expected_error;
1330: -- END IF;
1331:
1332: IF g_debug <= gme_debug.g_log_statement THEN

Line 1346: gme_common_pvt.create_document_no (l_in_batch_header

1342: -- From here on all errors are fatal so the validation level is not checked.
1343: l_in_batch_header := x_batch_header_rec;
1344: /*5698727 rework Begin we use timestamp initially as its unique. later we update
1345: with actual batch_no
1346: gme_common_pvt.create_document_no (l_in_batch_header
1347: ,x_batch_header_rec);*/
1348: SELECT trim(TO_CHAR(systimestamp,'DD:MM:YYYY HH24:MI:SS:FF6')) INTO l_doc_timestamp FROM DUAL;
1349:
1350: IF g_debug <= gme_debug.g_log_statement THEN

Line 1357: IF l_doc_numbering = gme_common_pvt.g_auto_doc_numbering THEN

1353: || l_api_name
1354: || 'Initial Doc No(timestamp): '||l_doc_timestamp);
1355: END IF;
1356:
1357: IF l_doc_numbering = gme_common_pvt.g_auto_doc_numbering THEN
1358: x_batch_header_rec.batch_no := l_doc_timestamp;
1359: END IF;
1360: --5698727 rework End
1361:

Line 1375: IF l_doc_numbering <> gme_common_pvt.g_auto_doc_numbering THEN

1371: /*5698727 rework commented the following code. We will validate the wip entity
1372: when we are updating the wip_entities table later once the actual doc_no is available */
1373: /* Bug6398619 we have to validate the batch no for the manual doc ordering as
1374: the time stamp is not created for the manual ordering */
1375: IF l_doc_numbering <> gme_common_pvt.g_auto_doc_numbering THEN
1376: validate_wip_entity(p_organization_id => x_batch_header_rec.organization_id,
1377: p_batch_no => l_prefix||x_batch_header_rec.batch_no,
1378: x_return_status => l_return_status);
1379: IF l_return_status <> fnd_api.g_ret_sts_success THEN

Line 1390: gme_debug.put_line ('copy_formula_text_ind = '||gme_common_pvt.g_copy_formula_text_ind);

1386: l_number_of_text_lines := 0;
1387:
1388: --Bug#5112133 add some debug messages for copy formula text GME Parameter
1389: IF (g_debug = gme_debug.g_log_statement) THEN
1390: gme_debug.put_line ('copy_formula_text_ind = '||gme_common_pvt.g_copy_formula_text_ind);
1391: END IF;
1392: -- If the formula has text and we have to copy it then generate
1393: -- the text header row first as database constraints impose this
1394: IF gme_common_pvt.g_copy_formula_text_ind = 1

Line 1394: IF gme_common_pvt.g_copy_formula_text_ind = 1

1390: gme_debug.put_line ('copy_formula_text_ind = '||gme_common_pvt.g_copy_formula_text_ind);
1391: END IF;
1392: -- If the formula has text and we have to copy it then generate
1393: -- the text header row first as database constraints impose this
1394: IF gme_common_pvt.g_copy_formula_text_ind = 1
1395: AND l_formula_master.text_code IS NOT NULL THEN
1396: l_return :=
1397: gme_text_dbl.insert_header_row (l_text_header, l_text_header);
1398:

Line 1502: AND gme_common_pvt.g_copy_formula_text_ind = 1 THEN

1498: IF (g_debug = gme_debug.g_log_statement) THEN
1499: gme_debug.put_line ('l text code is '||l_material_details (l_row_count).text_code);
1500: END IF;
1501: IF l_material_details (l_row_count).text_code IS NOT NULL
1502: AND gme_common_pvt.g_copy_formula_text_ind = 1 THEN
1503: l_text_code := l_material_details (l_row_count).text_code;
1504: l_return :=
1505: gme_text_dbl.insert_header_row (l_text_header
1506: ,l_text_header);

Line 1573: gme_common_pvt.g_line_type_ing )

1569: END IF;
1570: --FPBug#4395561 End
1571: --Pawan changes for GMO
1572: IF (l_material_details (l_row_count).line_type =
1573: gme_common_pvt.g_line_type_ing )
1574: AND (l_material_details (l_row_count).phantom_type = 0 )
1575: --Pawan Kumar add for bug 5365883
1576: -- Kapil M. Bug# 5458674. Reverted back the changes to support LCF Batches.
1577: -- AND (p_creation_mode <> 'LCF')

Line 1687: IF gme_common_pvt.routings.COUNT <> 0 THEN

1683: || l_api_name
1684: || 'Start step processing');
1685: END IF;
1686:
1687: IF gme_common_pvt.routings.COUNT <> 0 THEN
1688: gme_create_step_pvt.create_batch_steps
1689: (p_recipe_rout_step_tbl => gme_common_pvt.steps
1690: ,p_recipe_rout_act_tbl => gme_common_pvt.activities
1691: ,p_recipe_rout_resc_tbl => gme_common_pvt.resources

Line 1689: (p_recipe_rout_step_tbl => gme_common_pvt.steps

1685: END IF;
1686:
1687: IF gme_common_pvt.routings.COUNT <> 0 THEN
1688: gme_create_step_pvt.create_batch_steps
1689: (p_recipe_rout_step_tbl => gme_common_pvt.steps
1690: ,p_recipe_rout_act_tbl => gme_common_pvt.activities
1691: ,p_recipe_rout_resc_tbl => gme_common_pvt.resources
1692: ,p_resc_parameters_tbl => gme_common_pvt.process_parameters
1693: ,p_recipe_rout_matl_tbl => gme_common_pvt.routing_materials

Line 1690: ,p_recipe_rout_act_tbl => gme_common_pvt.activities

1686:
1687: IF gme_common_pvt.routings.COUNT <> 0 THEN
1688: gme_create_step_pvt.create_batch_steps
1689: (p_recipe_rout_step_tbl => gme_common_pvt.steps
1690: ,p_recipe_rout_act_tbl => gme_common_pvt.activities
1691: ,p_recipe_rout_resc_tbl => gme_common_pvt.resources
1692: ,p_resc_parameters_tbl => gme_common_pvt.process_parameters
1693: ,p_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
1694: ,p_routing_depd_tbl => gme_common_pvt.step_dependencies

Line 1691: ,p_recipe_rout_resc_tbl => gme_common_pvt.resources

1687: IF gme_common_pvt.routings.COUNT <> 0 THEN
1688: gme_create_step_pvt.create_batch_steps
1689: (p_recipe_rout_step_tbl => gme_common_pvt.steps
1690: ,p_recipe_rout_act_tbl => gme_common_pvt.activities
1691: ,p_recipe_rout_resc_tbl => gme_common_pvt.resources
1692: ,p_resc_parameters_tbl => gme_common_pvt.process_parameters
1693: ,p_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
1694: ,p_routing_depd_tbl => gme_common_pvt.step_dependencies
1695: ,p_gme_batch_header_rec => x_batch_header_rec

Line 1692: ,p_resc_parameters_tbl => gme_common_pvt.process_parameters

1688: gme_create_step_pvt.create_batch_steps
1689: (p_recipe_rout_step_tbl => gme_common_pvt.steps
1690: ,p_recipe_rout_act_tbl => gme_common_pvt.activities
1691: ,p_recipe_rout_resc_tbl => gme_common_pvt.resources
1692: ,p_resc_parameters_tbl => gme_common_pvt.process_parameters
1693: ,p_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
1694: ,p_routing_depd_tbl => gme_common_pvt.step_dependencies
1695: ,p_gme_batch_header_rec => x_batch_header_rec
1696: ,p_use_workday_cal => p_use_workday_cal

Line 1693: ,p_recipe_rout_matl_tbl => gme_common_pvt.routing_materials

1689: (p_recipe_rout_step_tbl => gme_common_pvt.steps
1690: ,p_recipe_rout_act_tbl => gme_common_pvt.activities
1691: ,p_recipe_rout_resc_tbl => gme_common_pvt.resources
1692: ,p_resc_parameters_tbl => gme_common_pvt.process_parameters
1693: ,p_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
1694: ,p_routing_depd_tbl => gme_common_pvt.step_dependencies
1695: ,p_gme_batch_header_rec => x_batch_header_rec
1696: ,p_use_workday_cal => p_use_workday_cal
1697: ,p_contiguity_override => p_contiguity_override

Line 1694: ,p_routing_depd_tbl => gme_common_pvt.step_dependencies

1690: ,p_recipe_rout_act_tbl => gme_common_pvt.activities
1691: ,p_recipe_rout_resc_tbl => gme_common_pvt.resources
1692: ,p_resc_parameters_tbl => gme_common_pvt.process_parameters
1693: ,p_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
1694: ,p_routing_depd_tbl => gme_common_pvt.step_dependencies
1695: ,p_gme_batch_header_rec => x_batch_header_rec
1696: ,p_use_workday_cal => p_use_workday_cal
1697: ,p_contiguity_override => p_contiguity_override
1698: ,p_ignore_qty_below_cap => p_ignore_qty_below_cap

Line 1729: IF (gme_common_pvt.calc_date_from_prod_rule

1725: l_to_uom := l_prim_item_um;
1726: RAISE conversion_failure;
1727: END IF;
1728:
1729: IF (gme_common_pvt.calc_date_from_prod_rule
1730: (p_organization_id => x_batch_header_rec.organization_id
1731: ,p_inventory_item_id => l_recipe_validity_rule.inventory_item_id
1732: ,p_item_qty => l_temp_qty
1733: ,p_start_date => x_batch_header_rec.plan_start_date

Line 1758: gme_common_pvt.g_timestamp;

1754: x_batch_header_rec.plan_cmplt_date;
1755: ELSIF x_batch_header_rec.plan_start_date IS NULL
1756: AND x_batch_header_rec.plan_cmplt_date IS NULL THEN
1757: x_batch_header_rec.plan_start_date :=
1758: gme_common_pvt.g_timestamp;
1759: x_batch_header_rec.plan_cmplt_date :=
1760: gme_common_pvt.g_timestamp;
1761: END IF;
1762:

Line 1760: gme_common_pvt.g_timestamp;

1756: AND x_batch_header_rec.plan_cmplt_date IS NULL THEN
1757: x_batch_header_rec.plan_start_date :=
1758: gme_common_pvt.g_timestamp;
1759: x_batch_header_rec.plan_cmplt_date :=
1760: gme_common_pvt.g_timestamp;
1761: END IF;
1762:
1763: IF (g_debug = gme_debug.g_log_statement) THEN
1764: gme_debug.put_line

Line 1796: || gme_common_pvt.g_calendar_code);

1792: END IF;
1793:
1794: IF (g_debug = gme_debug.g_log_statement) THEN
1795: gme_debug.put_line ( 'Calendar code found '
1796: || gme_common_pvt.g_calendar_code);
1797: gme_debug.put_line ('Cont ID found ' || l_cont_ind);
1798: END IF;
1799:
1800: l_duration :=

Line 1819: ,p_calendar_code => gme_common_pvt.g_calendar_code

1815: ,p_start_date => NVL
1816: (p_batch_header_rec.plan_start_date
1817: ,x_batch_header_rec.plan_start_date)
1818: ,p_end_date => NULL
1819: ,p_calendar_code => gme_common_pvt.g_calendar_code
1820: ,p_duration => l_duration
1821: ,p_output_tbl => l_contig_period_tbl
1822: ,x_return_status => l_return_status);
1823:

Line 1852: ,p_calendar_code => gme_common_pvt.g_calendar_code

1848: (p_api_version => 1
1849: ,p_init_msg_list => FALSE
1850: ,p_start_date => NULL
1851: ,p_end_date => p_batch_header_rec.plan_cmplt_date
1852: ,p_calendar_code => gme_common_pvt.g_calendar_code
1853: ,p_duration => l_duration
1854: ,p_output_tbl => l_contig_period_tbl
1855: ,x_return_status => l_return_status);
1856:

Line 1893: gme_common_pvt.create_document_no (l_in_batch_header1

1889: WHERE batch_id = x_batch_header_rec.batch_id;
1890: END IF;
1891: --5698727
1892: l_in_batch_header1 := x_batch_header_rec ;
1893: gme_common_pvt.create_document_no (l_in_batch_header1
1894: ,x_batch_header_rec);
1895: --5698727 rework
1896: /*Bug#6398619 the validation here is required only for the automatic doc numbering */
1897: IF l_doc_numbering = gme_common_pvt.g_auto_doc_numbering THEN

Line 1897: IF l_doc_numbering = gme_common_pvt.g_auto_doc_numbering THEN

1893: gme_common_pvt.create_document_no (l_in_batch_header1
1894: ,x_batch_header_rec);
1895: --5698727 rework
1896: /*Bug#6398619 the validation here is required only for the automatic doc numbering */
1897: IF l_doc_numbering = gme_common_pvt.g_auto_doc_numbering THEN
1898: validate_wip_entity(p_organization_id => x_batch_header_rec.organization_id,
1899: p_batch_no => l_prefix||x_batch_header_rec.batch_no,
1900: x_return_status => l_return_status);
1901:

Line 1932: IF (gme_common_pvt.routings.COUNT <> 0) THEN

1928: IF ( p_batch_header_rec.plan_start_date IS NOT NULL
1929: AND p_batch_header_rec.plan_cmplt_date IS NOT NULL) THEN
1930: -- IF routings exists and calculated date is greater than the date entered,
1931: -- then truncate all the dates to dates entered
1932: IF (gme_common_pvt.routings.COUNT <> 0) THEN
1933: IF (x_batch_header_rec.plan_cmplt_date >
1934: p_batch_header_rec.plan_cmplt_date) THEN
1935: x_batch_header_rec.plan_start_date :=
1936: p_batch_header_rec.plan_start_date;

Line 1956: ,last_updated_by = gme_common_pvt.g_user_ident

1952: SET plan_cmplt_date = p_batch_header_rec.plan_cmplt_date
1953: ,due_date =
1954: NVL (x_batch_header_rec.due_date
1955: ,p_batch_header_rec.plan_cmplt_date)
1956: ,last_updated_by = gme_common_pvt.g_user_ident
1957: ,last_update_date = gme_common_pvt.g_timestamp
1958: ,last_update_login = gme_common_pvt.g_login_id
1959: WHERE batch_id = x_batch_header_rec.batch_id;
1960: END IF;

Line 1957: ,last_update_date = gme_common_pvt.g_timestamp

1953: ,due_date =
1954: NVL (x_batch_header_rec.due_date
1955: ,p_batch_header_rec.plan_cmplt_date)
1956: ,last_updated_by = gme_common_pvt.g_user_ident
1957: ,last_update_date = gme_common_pvt.g_timestamp
1958: ,last_update_login = gme_common_pvt.g_login_id
1959: WHERE batch_id = x_batch_header_rec.batch_id;
1960: END IF;
1961: END IF; -- End gme_common_pvt.routings.COUNT <> 0

Line 1958: ,last_update_login = gme_common_pvt.g_login_id

1954: NVL (x_batch_header_rec.due_date
1955: ,p_batch_header_rec.plan_cmplt_date)
1956: ,last_updated_by = gme_common_pvt.g_user_ident
1957: ,last_update_date = gme_common_pvt.g_timestamp
1958: ,last_update_login = gme_common_pvt.g_login_id
1959: WHERE batch_id = x_batch_header_rec.batch_id;
1960: END IF;
1961: END IF; -- End gme_common_pvt.routings.COUNT <> 0
1962:

Line 1961: END IF; -- End gme_common_pvt.routings.COUNT <> 0

1957: ,last_update_date = gme_common_pvt.g_timestamp
1958: ,last_update_login = gme_common_pvt.g_login_id
1959: WHERE batch_id = x_batch_header_rec.batch_id;
1960: END IF;
1961: END IF; -- End gme_common_pvt.routings.COUNT <> 0
1962:
1963: UPDATE gme_batch_header
1964: SET plan_cmplt_date = p_batch_header_rec.plan_cmplt_date
1965: ,due_date =

Line 1968: ,last_updated_by = gme_common_pvt.g_user_ident

1964: SET plan_cmplt_date = p_batch_header_rec.plan_cmplt_date
1965: ,due_date =
1966: NVL (x_batch_header_rec.due_date
1967: ,p_batch_header_rec.plan_cmplt_date)
1968: ,last_updated_by = gme_common_pvt.g_user_ident
1969: ,last_update_date = gme_common_pvt.g_timestamp
1970: ,last_update_login = gme_common_pvt.g_login_id
1971: WHERE batch_id = x_batch_header_rec.batch_id;
1972: END IF; -- End start and completion dates not null.

Line 1969: ,last_update_date = gme_common_pvt.g_timestamp

1965: ,due_date =
1966: NVL (x_batch_header_rec.due_date
1967: ,p_batch_header_rec.plan_cmplt_date)
1968: ,last_updated_by = gme_common_pvt.g_user_ident
1969: ,last_update_date = gme_common_pvt.g_timestamp
1970: ,last_update_login = gme_common_pvt.g_login_id
1971: WHERE batch_id = x_batch_header_rec.batch_id;
1972: END IF; -- End start and completion dates not null.
1973:

Line 1970: ,last_update_login = gme_common_pvt.g_login_id

1966: NVL (x_batch_header_rec.due_date
1967: ,p_batch_header_rec.plan_cmplt_date)
1968: ,last_updated_by = gme_common_pvt.g_user_ident
1969: ,last_update_date = gme_common_pvt.g_timestamp
1970: ,last_update_login = gme_common_pvt.g_login_id
1971: WHERE batch_id = x_batch_header_rec.batch_id;
1972: END IF; -- End start and completion dates not null.
1973:
1974: IF NOT (gme_batch_header_dbl.fetch_row (x_batch_header_rec

Line 1988: gme_common_pvt.calc_mtl_req_date

1984: END IF;
1985:
1986: l_item_substituted := FALSE;
1987: FOR l_row_count IN 1 .. l_number_of_formula_lines LOOP
1988: gme_common_pvt.calc_mtl_req_date
1989: (p_batch_header_rec => x_batch_header_rec
1990: ,p_batchstep_rec => NULL
1991: ,p_mtl_dtl_rec => l_material_details (l_row_count)
1992: ,x_mtl_req_date => l_material_details (l_row_count).material_requirement_date

Line 2011: IF gme_common_pvt.g_ingr_sub_date = 2 THEN

2007: -- Pass the ingredient substitution date rather than the material requirement date.
2008: -- At this point, steps table is not updated. Hence need to have similar logic here too
2009: -- as in gme_api_grp.get_ingr_sub_date.
2010:
2011: IF gme_common_pvt.g_ingr_sub_date = 2 THEN
2012: l_ingred_req_date := l_material_details (l_row_count).material_requirement_date;
2013: ELSIF gme_common_pvt.g_ingr_sub_date = 1 THEN
2014: l_ingred_req_date := NVL(p_batch_header_rec.plan_start_date, x_batch_header_rec.plan_start_date);
2015: ELSIF gme_common_pvt.g_ingr_sub_date = 3 THEN

Line 2013: ELSIF gme_common_pvt.g_ingr_sub_date = 1 THEN

2009: -- as in gme_api_grp.get_ingr_sub_date.
2010:
2011: IF gme_common_pvt.g_ingr_sub_date = 2 THEN
2012: l_ingred_req_date := l_material_details (l_row_count).material_requirement_date;
2013: ELSIF gme_common_pvt.g_ingr_sub_date = 1 THEN
2014: l_ingred_req_date := NVL(p_batch_header_rec.plan_start_date, x_batch_header_rec.plan_start_date);
2015: ELSIF gme_common_pvt.g_ingr_sub_date = 3 THEN
2016: l_ingred_req_date := NVL(p_batch_header_rec.plan_cmplt_date, x_batch_header_rec.plan_cmplt_date);
2017: END IF;

Line 2015: ELSIF gme_common_pvt.g_ingr_sub_date = 3 THEN

2011: IF gme_common_pvt.g_ingr_sub_date = 2 THEN
2012: l_ingred_req_date := l_material_details (l_row_count).material_requirement_date;
2013: ELSIF gme_common_pvt.g_ingr_sub_date = 1 THEN
2014: l_ingred_req_date := NVL(p_batch_header_rec.plan_start_date, x_batch_header_rec.plan_start_date);
2015: ELSIF gme_common_pvt.g_ingr_sub_date = 3 THEN
2016: l_ingred_req_date := NVL(p_batch_header_rec.plan_cmplt_date, x_batch_header_rec.plan_cmplt_date);
2017: END IF;
2018:
2019: IF g_debug <= gme_debug.g_log_statement THEN

Line 2183: ,last_updated_by = gme_common_pvt.g_user_ident

2179: END IF;
2180: UPDATE gme_batch_header
2181: SET due_date =
2182: x_batch_header_rec.plan_cmplt_date
2183: ,last_updated_by = gme_common_pvt.g_user_ident
2184: ,last_update_date = gme_common_pvt.g_timestamp
2185: ,last_update_login = gme_common_pvt.g_login_id
2186: WHERE batch_id = x_batch_header_rec.batch_id;
2187:

Line 2184: ,last_update_date = gme_common_pvt.g_timestamp

2180: UPDATE gme_batch_header
2181: SET due_date =
2182: x_batch_header_rec.plan_cmplt_date
2183: ,last_updated_by = gme_common_pvt.g_user_ident
2184: ,last_update_date = gme_common_pvt.g_timestamp
2185: ,last_update_login = gme_common_pvt.g_login_id
2186: WHERE batch_id = x_batch_header_rec.batch_id;
2187:
2188: END IF; /* ASQC */

Line 2185: ,last_update_login = gme_common_pvt.g_login_id

2181: SET due_date =
2182: x_batch_header_rec.plan_cmplt_date
2183: ,last_updated_by = gme_common_pvt.g_user_ident
2184: ,last_update_date = gme_common_pvt.g_timestamp
2185: ,last_update_login = gme_common_pvt.g_login_id
2186: WHERE batch_id = x_batch_header_rec.batch_id;
2187:
2188: END IF; /* ASQC */
2189: END IF; /* Update inventory*/

Line 2258: IF (NOT gme_common_pvt.check_validity_rule_dates

2254: gme_debug.put_line ('Checking dates against validity rule');
2255: END IF;
2256:
2257: IF p_creation_mode <> 'LCF' THEN
2258: IF (NOT gme_common_pvt.check_validity_rule_dates
2259: (l_recipe_validity_rule.recipe_validity_rule_id
2260: ,x_batch_header_rec.plan_start_date
2261: ,x_batch_header_rec.plan_cmplt_date) ) THEN
2262: x_return_status := fnd_api.g_ret_sts_error;

Line 2279: IF gme_common_pvt.routings.COUNT <> 0 THEN

2275: WHERE wip_entity_id = x_batch_header_rec.batch_id;
2276:
2277: -- Rajesh Patangya Bug # 6752637
2278: /* Now its time to calculate the MTQ for steps based on the product */
2279: IF gme_common_pvt.routings.COUNT <> 0 THEN
2280: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
2281: gme_debug.put_line ( g_pkg_name
2282: || '.'
2283: || l_api_name

Line 2354: IF (gme_common_pvt.g_check_shortages_ind = 1 AND g_no_phant_short_check = 0) THEN

2350: -- for shortage checking only. Unfortunately it stopped all the other logic for phantom batches.
2351: -- Now invisible move orders and high level reservations will get created for phantom batches.
2352: IF x_batch_header_rec.batch_type = 0 AND NVL (x_batch_header_rec.update_inventory_ind, 'Y') = 'Y' THEN
2353: /* Check inventory shortages */
2354: IF (gme_common_pvt.g_check_shortages_ind = 1 AND g_no_phant_short_check = 0) THEN
2355: IF g_debug <= gme_debug.g_log_statement THEN
2356: gme_debug.put_line ( g_pkg_name || '.'|| l_api_name|| ' Calling shortages ');
2357: END IF;
2358: gme_common_pvt.get_batch_shortages

Line 2358: gme_common_pvt.get_batch_shortages

2354: IF (gme_common_pvt.g_check_shortages_ind = 1 AND g_no_phant_short_check = 0) THEN
2355: IF g_debug <= gme_debug.g_log_statement THEN
2356: gme_debug.put_line ( g_pkg_name || '.'|| l_api_name|| ' Calling shortages ');
2357: END IF;
2358: gme_common_pvt.get_batch_shortages
2359: (p_organization_id => x_batch_header_rec.organization_id
2360: ,p_batch_id => x_batch_header_rec.batch_id
2361: ,p_invoke_mode => 'O'
2362: ,p_tree_mode => gme_common_pvt.g_tree_reservation_mode

Line 2362: ,p_tree_mode => gme_common_pvt.g_tree_reservation_mode

2358: gme_common_pvt.get_batch_shortages
2359: (p_organization_id => x_batch_header_rec.organization_id
2360: ,p_batch_id => x_batch_header_rec.batch_id
2361: ,p_invoke_mode => 'O'
2362: ,p_tree_mode => gme_common_pvt.g_tree_reservation_mode
2363: ,x_return_status => l_return_status
2364: ,x_exception_tbl => x_exception_material_tbl);
2365: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2366: RAISE inventory_shortage;

Line 2379: x_return_status := gme_common_pvt.g_inv_short_err;

2375: END LOOP;
2376: END IF;
2377: */
2378: IF (x_exception_material_tbl.COUNT > 0) THEN
2379: x_return_status := gme_common_pvt.g_inv_short_err;
2380: END IF;
2381: END IF;
2382:
2383: /* Create invisible move order */

Line 2390: ,p_move_order_type => gme_common_pvt.g_invis_move_order_type

2386: END IF;
2387:
2388: gme_move_orders_pvt.create_move_order_hdr
2389: (p_organization_id => x_batch_header_rec.organization_id
2390: ,p_move_order_type => gme_common_pvt.g_invis_move_order_type
2391: ,x_move_order_header_id => x_batch_header_rec.move_order_header_id
2392: ,x_return_status => l_return_status);
2393:
2394: IF g_debug <= gme_debug.g_log_statement THEN

Line 2408: ,p_move_order_type => gme_common_pvt.g_invis_move_order_type

2404:
2405: l_in_material_details := l_material_details;
2406: gme_move_orders_pvt.create_move_order_lines
2407: (p_move_order_header_id => x_batch_header_rec.move_order_header_id
2408: ,p_move_order_type => gme_common_pvt.g_invis_move_order_type
2409: ,p_material_details_tbl => l_in_material_details
2410: ,x_material_details_tbl => l_material_details
2411: ,x_trolin_tbl => l_trolin_tbl
2412: ,x_return_status => l_return_status);

Line 2435: IF (gme_common_pvt.g_create_high_level_resv_ind = 1) THEN

2431: gme_material_details_dbl.update_row (l_material_details (i) );
2432: END LOOP;
2433:
2434: /* Create High Level Reservations */
2435: IF (gme_common_pvt.g_create_high_level_resv_ind = 1) THEN
2436: IF g_debug <= gme_debug.g_log_statement THEN
2437: gme_debug.put_line ( g_pkg_name|| '.'|| l_api_name|| ' Creating reservations for batch id '|| x_batch_header_rec.batch_id);
2438: END IF;
2439:

Line 2442: ,p_timefence => gme_common_pvt.g_reservation_timefence

2438: END IF;
2439:
2440: gme_reservations_pvt.create_batch_reservations
2441: (p_batch_id => x_batch_header_rec.batch_id
2442: ,p_timefence => gme_common_pvt.g_reservation_timefence
2443: ,x_return_status => l_return_status);
2444:
2445: IF g_debug <= gme_debug.g_log_statement THEN
2446: gme_debug.put_line ( g_pkg_name

Line 2455: IF (gme_common_pvt.g_create_move_orders_ind = 1) THEN

2451: END IF;
2452: END IF;
2453:
2454: /* Create Move Order */
2455: IF (gme_common_pvt.g_create_move_orders_ind = 1) THEN
2456: IF g_debug <= gme_debug.g_log_statement THEN
2457: gme_debug.put_line ( g_pkg_name
2458: || '.'
2459: || l_api_name

Line 2501: wf_event.RAISE (p_event_name => gme_common_pvt.G_BATCH_CREATED

2497: END IF;
2498: END IF ;
2499: /*Bug#7493614 moved the workflow event call to the end of the batch
2500: create procedure */
2501: wf_event.RAISE (p_event_name => gme_common_pvt.G_BATCH_CREATED
2502: ,p_event_key => x_batch_header_rec.batch_id);
2503: IF g_debug <= gme_debug.g_log_procedure THEN
2504: gme_debug.put_line ('Exiting api ' || g_pkg_name || '.' || l_api_name);
2505: END IF;

Line 2509: gme_common_pvt.log_message ('GME_DOC_NUM_NOT_PASSED');

2505: END IF;
2506: EXCEPTION
2507: WHEN doc_num_is_not_passed THEN
2508: x_return_status := fnd_api.g_ret_sts_error;
2509: gme_common_pvt.log_message ('GME_DOC_NUM_NOT_PASSED');
2510: WHEN gme_duplicate_batch THEN
2511: x_return_status := fnd_api.g_ret_sts_error;
2512: --FPBug#4898641
2513: IF x_batch_header_rec.batch_type = 0 THEN

Line 2514: gme_common_pvt.log_message ('GME_DUP_BATCH');

2510: WHEN gme_duplicate_batch THEN
2511: x_return_status := fnd_api.g_ret_sts_error;
2512: --FPBug#4898641
2513: IF x_batch_header_rec.batch_type = 0 THEN
2514: gme_common_pvt.log_message ('GME_DUP_BATCH');
2515: ELSE
2516: gme_common_pvt.log_message ('GME_DUP_FPO');
2517: END IF;
2518: WHEN steps_creation_failure THEN

Line 2516: gme_common_pvt.log_message ('GME_DUP_FPO');

2512: --FPBug#4898641
2513: IF x_batch_header_rec.batch_type = 0 THEN
2514: gme_common_pvt.log_message ('GME_DUP_BATCH');
2515: ELSE
2516: gme_common_pvt.log_message ('GME_DUP_FPO');
2517: END IF;
2518: WHEN steps_creation_failure THEN
2519: NULL;
2520: WHEN error_create_phantom OR invalid_header_values OR invalid_recipe THEN

Line 2536: gme_common_pvt.log_message ('GME_NON_CONTIGUOUS_TIME');

2532: IF (g_debug = gme_debug.g_log_statement) THEN
2533: gme_debug.put_line ('Contiguity period ... not found');
2534: END IF;
2535:
2536: gme_common_pvt.log_message ('GME_NON_CONTIGUOUS_TIME');
2537: x_return_status := 'C';
2538: WHEN conversion_failure THEN
2539: IF l_item_no IS NULL THEN
2540: OPEN cur_item_no (l_item_id, x_batch_header_rec.organization_id);

Line 2559: gme_common_pvt.log_message ('GME_API_CREATE_BY_PROD_FAIL');

2555: IF (g_debug = gme_debug.g_log_statement) THEN
2556: gme_debug.put_line ('Failed to apply FPL');
2557: END IF;
2558: WHEN create_by_product_failure THEN
2559: gme_common_pvt.log_message ('GME_API_CREATE_BY_PROD_FAIL');
2560: x_return_status := fnd_api.g_ret_sts_error;
2561:
2562: IF (g_debug = gme_debug.g_log_statement) THEN
2563: gme_debug.put_line ('GME_API_CREATE_BY_PROD_FAIL');