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 145: l_count := gme_common_pvt.g_error_count;

141: || l_api_name);
142: END IF;
143:
144: /* Create defaults for mandatory columns that have not been specified */
145: l_count := gme_common_pvt.g_error_count;
146: x_batch_header_rec := p_batch_header_rec;
147:
148: IF x_batch_header_rec.organization_id IS NULL THEN
149: fnd_message.set_name ('INV', 'INV_INT_ORGCODE');

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

153: x_batch_header_rec.prod_id := NVL (x_batch_header_rec.prod_id, 0);
154: x_batch_header_rec.prod_sequence :=
155: NVL (x_batch_header_rec.prod_sequence, 0);
156: x_batch_header_rec.plan_start_date :=
157: NVL (x_batch_header_rec.plan_start_date, gme_common_pvt.g_timestamp);
158: x_batch_header_rec.plan_cmplt_date :=
159: NVL (x_batch_header_rec.plan_cmplt_date, gme_common_pvt.g_timestamp);
160: x_batch_header_rec.due_date :=
161: NVL (x_batch_header_rec.due_date, gme_common_pvt.g_timestamp);

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

155: NVL (x_batch_header_rec.prod_sequence, 0);
156: x_batch_header_rec.plan_start_date :=
157: NVL (x_batch_header_rec.plan_start_date, gme_common_pvt.g_timestamp);
158: x_batch_header_rec.plan_cmplt_date :=
159: NVL (x_batch_header_rec.plan_cmplt_date, gme_common_pvt.g_timestamp);
160: x_batch_header_rec.due_date :=
161: NVL (x_batch_header_rec.due_date, gme_common_pvt.g_timestamp);
162: x_batch_header_rec.batch_status := gme_common_pvt.G_BATCH_PENDING;
163: x_batch_header_rec.priority_value :=

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

157: NVL (x_batch_header_rec.plan_start_date, gme_common_pvt.g_timestamp);
158: x_batch_header_rec.plan_cmplt_date :=
159: NVL (x_batch_header_rec.plan_cmplt_date, gme_common_pvt.g_timestamp);
160: x_batch_header_rec.due_date :=
161: NVL (x_batch_header_rec.due_date, gme_common_pvt.g_timestamp);
162: x_batch_header_rec.batch_status := gme_common_pvt.G_BATCH_PENDING;
163: x_batch_header_rec.priority_value :=
164: NVL (x_batch_header_rec.priority_value, 0);
165: x_batch_header_rec.priority_code :=

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

158: x_batch_header_rec.plan_cmplt_date :=
159: NVL (x_batch_header_rec.plan_cmplt_date, gme_common_pvt.g_timestamp);
160: x_batch_header_rec.due_date :=
161: NVL (x_batch_header_rec.due_date, gme_common_pvt.g_timestamp);
162: x_batch_header_rec.batch_status := gme_common_pvt.G_BATCH_PENDING;
163: x_batch_header_rec.priority_value :=
164: NVL (x_batch_header_rec.priority_value, 0);
165: x_batch_header_rec.priority_code :=
166: NVL (x_batch_header_rec.priority_code, 0);

Line 174: IF l_count <> gme_common_pvt.g_error_count THEN

170: x_batch_header_rec.gl_posted_ind := 0;
171: x_batch_header_rec.delete_mark := 0;
172: x_batch_header_rec.automatic_step_calculation := 1;
173:
174: IF l_count <> gme_common_pvt.g_error_count THEN
175: RETURN FALSE;
176: ELSE
177: RETURN TRUE;
178: END IF;

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

215: CLOSE Cur_wip_entity;
216: EXCEPTION
217: WHEN duplicate_wip_entity THEN
218: x_return_status := fnd_api.g_ret_sts_error;
219: gme_common_pvt.log_message('GME_WIP_ENTITY_EXISTS');
220: WHEN OTHERS THEN
221: IF g_debug <= gme_debug.g_log_unexpected THEN
222: gme_debug.put_line ( 'When others exception in '
223: || g_pkg_name

Line 235: := gme_common_pvt.g_max_errors

231: END validate_wip_entity;
232:
233: PROCEDURE create_batch (
234: p_validation_level IN NUMBER
235: := gme_common_pvt.g_max_errors
236: ,p_batch_header_rec IN gme_batch_header%ROWTYPE
237: ,p_batch_size IN NUMBER
238: ,p_batch_size_uom IN VARCHAR2
239: ,p_creation_mode IN VARCHAR2

Line 248: ,x_exception_material_tbl OUT NOCOPY gme_common_pvt.exceptions_tab

244: ,p_is_phantom IN VARCHAR2 DEFAULT 'N'
245: ,p_sum_all_prod_lines IN VARCHAR2 DEFAULT 'A'
246: ,p_use_least_cost_validity_rule IN VARCHAR2 := fnd_api.g_false
247: ,x_batch_header_rec OUT NOCOPY gme_batch_header%ROWTYPE
248: ,x_exception_material_tbl OUT NOCOPY gme_common_pvt.exceptions_tab
249: ,x_return_status OUT NOCOPY VARCHAR2)
250: IS
251: l_in_batch_header gme_batch_header%ROWTYPE;
252: l_formula_master fm_form_mst%ROWTYPE;

Line 259: l_material_details gme_common_pvt.material_details_tab;

255: l_item_master mtl_system_items_kfv%ROWTYPE;
256: l_gme_material_detail gme_material_details%ROWTYPE;
257: l_text_header gme_text_header%ROWTYPE;
258: l_text_string gme_text_table.text%TYPE;
259: l_material_details gme_common_pvt.material_details_tab;
260: p_material_details gme_common_pvt.material_details_tab;
261: l_in_material_details gme_common_pvt.material_details_tab;
262: l_material_details_in gme_material_details%ROWTYPE;
263: l_item_masters gme_common_pvt.item_masters_tab;

Line 260: p_material_details gme_common_pvt.material_details_tab;

256: l_gme_material_detail gme_material_details%ROWTYPE;
257: l_text_header gme_text_header%ROWTYPE;
258: l_text_string gme_text_table.text%TYPE;
259: l_material_details gme_common_pvt.material_details_tab;
260: p_material_details gme_common_pvt.material_details_tab;
261: l_in_material_details gme_common_pvt.material_details_tab;
262: l_material_details_in gme_material_details%ROWTYPE;
263: l_item_masters gme_common_pvt.item_masters_tab;
264: l_text_table gme_common_pvt.text_tab;

Line 261: l_in_material_details gme_common_pvt.material_details_tab;

257: l_text_header gme_text_header%ROWTYPE;
258: l_text_string gme_text_table.text%TYPE;
259: l_material_details gme_common_pvt.material_details_tab;
260: p_material_details gme_common_pvt.material_details_tab;
261: l_in_material_details gme_common_pvt.material_details_tab;
262: l_material_details_in gme_material_details%ROWTYPE;
263: l_item_masters gme_common_pvt.item_masters_tab;
264: l_text_table gme_common_pvt.text_tab;
265: l_recipe gmd_recipes%ROWTYPE;

Line 263: l_item_masters gme_common_pvt.item_masters_tab;

259: l_material_details gme_common_pvt.material_details_tab;
260: p_material_details gme_common_pvt.material_details_tab;
261: l_in_material_details gme_common_pvt.material_details_tab;
262: l_material_details_in gme_material_details%ROWTYPE;
263: l_item_masters gme_common_pvt.item_masters_tab;
264: l_text_table gme_common_pvt.text_tab;
265: l_recipe gmd_recipes%ROWTYPE;
266: l_from_uom mtl_units_of_measure.uom_code%TYPE;
267: l_to_uom mtl_units_of_measure.uom_code%TYPE;

Line 264: l_text_table gme_common_pvt.text_tab;

260: p_material_details gme_common_pvt.material_details_tab;
261: l_in_material_details gme_common_pvt.material_details_tab;
262: l_material_details_in gme_material_details%ROWTYPE;
263: l_item_masters gme_common_pvt.item_masters_tab;
264: l_text_table gme_common_pvt.text_tab;
265: l_recipe gmd_recipes%ROWTYPE;
266: l_from_uom mtl_units_of_measure.uom_code%TYPE;
267: l_to_uom mtl_units_of_measure.uom_code%TYPE;
268: l_prim_item_um mtl_units_of_measure.uom_code%TYPE;

Line 317: l_exception_material_tbl gme_common_pvt.exceptions_tab;

313: l_excp_tbl_ptr NUMBER; -- nsinghi bug#5200395
314: l_return BOOLEAN;
315: l_no_prod_rule_found BOOLEAN;
316: l_prim_prod_found BOOLEAN;
317: l_exception_material_tbl gme_common_pvt.exceptions_tab;
318: l_trolin_tbl inv_move_order_pub.trolin_tbl_type;
319: l_phantom_exc_material_tbl gme_common_pvt.exceptions_tab; -- nsinghi bug#5200395
320: l_phantom_exc_material_tbl_out gme_common_pvt.exceptions_tab; -- nsinghi bug#5200395
321: l_batch_header_rec gme_batch_header%ROWTYPE;

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

315: l_no_prod_rule_found BOOLEAN;
316: l_prim_prod_found BOOLEAN;
317: l_exception_material_tbl gme_common_pvt.exceptions_tab;
318: l_trolin_tbl inv_move_order_pub.trolin_tbl_type;
319: l_phantom_exc_material_tbl gme_common_pvt.exceptions_tab; -- nsinghi bug#5200395
320: l_phantom_exc_material_tbl_out gme_common_pvt.exceptions_tab; -- nsinghi bug#5200395
321: l_batch_header_rec gme_batch_header%ROWTYPE;
322: l_batchstep_rec gme_batch_steps%ROWTYPE;
323: x_batchstep_rec gme_batch_steps%ROWTYPE;

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

316: l_prim_prod_found BOOLEAN;
317: l_exception_material_tbl gme_common_pvt.exceptions_tab;
318: l_trolin_tbl inv_move_order_pub.trolin_tbl_type;
319: l_phantom_exc_material_tbl gme_common_pvt.exceptions_tab; -- nsinghi bug#5200395
320: l_phantom_exc_material_tbl_out gme_common_pvt.exceptions_tab; -- nsinghi bug#5200395
321: l_batch_header_rec gme_batch_header%ROWTYPE;
322: l_batchstep_rec gme_batch_steps%ROWTYPE;
323: x_batchstep_rec gme_batch_steps%ROWTYPE;
324: l_in_material_detail gme_material_details%ROWTYPE;

Line 455: AND line_type = gme_common_pvt.g_line_type_prod

451: SELECT plan_qty, dtl_um
452: FROM gme_material_details
453: WHERE batch_id = v_batch_id
454: AND inventory_item_id = v_inventory_item_id
455: AND line_type = gme_common_pvt.g_line_type_prod
456: ORDER BY line_no ASC;
457:
458: -- Bug 6665602 Back out 5484529... Reinstate original cursor.
459: --sunitha bug # 5484529 selecting the sum of the plan quantity without converting

Line 476: AND line_type = gme_common_pvt.g_line_type_prod

472: ,NULL) ), 1 as line_no
473: FROM gme_material_details
474: WHERE batch_id = v_batch_id
475: AND inventory_item_id = v_inventory_item_id
476: AND line_type = gme_common_pvt.g_line_type_prod
477: AND v_sum_all_prod_lines = 'A'
478: UNION
479: SELECT inv_convert.inv_um_convert (v_inventory_item_id
480: ,5

Line 489: AND line_type = gme_common_pvt.g_line_type_prod

485: ,NULL), line_no
486: FROM gme_material_details
487: WHERE batch_id = v_batch_id
488: AND inventory_item_id = v_inventory_item_id
489: AND line_type = gme_common_pvt.g_line_type_prod
490: AND v_sum_all_prod_lines <> 'A'
491: ORDER BY line_no;
492:
493: /*CURSOR cur_batch_qty (v_batch_id NUMBER, v_inventory_item_id NUMBER)

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

495: SELECT SUM (plan_qty )
496: FROM gme_material_details
497: WHERE batch_id = v_batch_id
498: AND inventory_item_id = v_inventory_item_id
499: AND line_type = gme_common_pvt.g_line_type_prod; */
500:
501: CURSOR cur_item_no (v_inventory_item_id NUMBER, v_org_id NUMBER)
502: IS
503: SELECT concatenated_segments

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

552:
553: IF ( p_creation_mode <> 'RECIPE'
554: AND NVL (p_batch_size, 0) = 0
555: AND p_is_phantom <> 'Y') THEN
556: gme_common_pvt.log_message ('GME_API_QTY_CANT_BE_ZERO');
557: RAISE expected_error;
558: END IF;
559:
560: IF x_batch_header_rec.batch_type NOT IN (0, 10) THEN

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

557: RAISE expected_error;
558: END IF;
559:
560: IF x_batch_header_rec.batch_type NOT IN (0, 10) THEN
561: gme_common_pvt.log_message ('GME_INVALID_BATCH_TYPE');
562: RAISE expected_error;
563: END IF;
564:
565: OPEN cur_get_doc_ord (x_batch_header_rec.organization_id

Line 581: IF NVL(gme_common_pvt.g_bulk_validation_done, 'N') = 'N' THEN

577: IF x_batch_header_rec.batch_no IS NULL THEN
578: RAISE doc_num_is_not_passed;
579: ELSE
580: --added by qzeng no need to check if done in bulk validation
581: IF NVL(gme_common_pvt.g_bulk_validation_done, 'N') = 'N' THEN
582: OPEN cur_val_batch (x_batch_header_rec.organization_id
583: ,x_batch_header_rec.batch_no
584: ,x_batch_header_rec.batch_type);
585:

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

598: gme_debug.put_line ('before laboratory check' || g_pkg_name || '.'
599: || l_api_name);
600: END IF;
601:
602: IF (gme_common_pvt.g_lab_ind = 1 AND gme_common_pvt.g_plant_ind = 1) THEN
603: IF p_batch_header_rec.laboratory_ind = 1 THEN
604: x_batch_header_rec.laboratory_ind := 1;
605: x_batch_header_rec.update_inventory_ind :=
606: p_batch_header_rec.update_inventory_ind;

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

607: ELSE
608: x_batch_header_rec.laboratory_ind := 0;
609: x_batch_header_rec.update_inventory_ind := 'Y';
610: END IF;
611: ELSIF (gme_common_pvt.g_lab_ind = 1) THEN
612: x_batch_header_rec.laboratory_ind := 1;
613: x_batch_header_rec.update_inventory_ind :=
614: p_batch_header_rec.update_inventory_ind;
615: ELSIF (gme_common_pvt.g_plant_ind = 1) THEN

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

611: ELSIF (gme_common_pvt.g_lab_ind = 1) THEN
612: x_batch_header_rec.laboratory_ind := 1;
613: x_batch_header_rec.update_inventory_ind :=
614: p_batch_header_rec.update_inventory_ind;
615: ELSIF (gme_common_pvt.g_plant_ind = 1) THEN
616: x_batch_header_rec.laboratory_ind := 0;
617: x_batch_header_rec.update_inventory_ind := 'Y';
618: END IF;
619: IF g_debug <= gme_debug.g_log_procedure THEN

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

662:
663: CLOSE recipe_cursor;
664:
665: IF l_recipe.recipe_id IS NULL THEN
666: gme_common_pvt.log_message ('GME_API_INVALID_RULE');
667: RAISE expected_error;
668: END IF;
669:
670: IF g_debug <= gme_debug.g_log_statement THEN

Line 686: ,x_recipe_rout_tbl => gme_common_pvt.routings

682: ,x_return_status => l_return_status
683: ,x_msg_count => l_message_count
684: ,x_msg_data => l_message_list
685: ,x_return_code => l_return_code
686: ,x_recipe_rout_tbl => gme_common_pvt.routings
687: ,x_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
688: ,x_recipe_step_out => gme_common_pvt.steps
689: ,x_routing_depd_tbl => gme_common_pvt.step_dependencies
690: ,x_oprn_act_out => gme_common_pvt.activities

Line 687: ,x_recipe_rout_matl_tbl => gme_common_pvt.routing_materials

683: ,x_msg_count => l_message_count
684: ,x_msg_data => l_message_list
685: ,x_return_code => l_return_code
686: ,x_recipe_rout_tbl => gme_common_pvt.routings
687: ,x_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
688: ,x_recipe_step_out => gme_common_pvt.steps
689: ,x_routing_depd_tbl => gme_common_pvt.step_dependencies
690: ,x_oprn_act_out => gme_common_pvt.activities
691: ,x_oprn_resc_rec => gme_common_pvt.resources

Line 688: ,x_recipe_step_out => gme_common_pvt.steps

684: ,x_msg_data => l_message_list
685: ,x_return_code => l_return_code
686: ,x_recipe_rout_tbl => gme_common_pvt.routings
687: ,x_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
688: ,x_recipe_step_out => gme_common_pvt.steps
689: ,x_routing_depd_tbl => gme_common_pvt.step_dependencies
690: ,x_oprn_act_out => gme_common_pvt.activities
691: ,x_oprn_resc_rec => gme_common_pvt.resources
692: ,x_formula_header_rec => l_formula_master

Line 689: ,x_routing_depd_tbl => gme_common_pvt.step_dependencies

685: ,x_return_code => l_return_code
686: ,x_recipe_rout_tbl => gme_common_pvt.routings
687: ,x_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
688: ,x_recipe_step_out => gme_common_pvt.steps
689: ,x_routing_depd_tbl => gme_common_pvt.step_dependencies
690: ,x_oprn_act_out => gme_common_pvt.activities
691: ,x_oprn_resc_rec => gme_common_pvt.resources
692: ,x_formula_header_rec => l_formula_master
693: ,x_formula_dtl_tbl => gme_common_pvt.materials

Line 690: ,x_oprn_act_out => gme_common_pvt.activities

686: ,x_recipe_rout_tbl => gme_common_pvt.routings
687: ,x_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
688: ,x_recipe_step_out => gme_common_pvt.steps
689: ,x_routing_depd_tbl => gme_common_pvt.step_dependencies
690: ,x_oprn_act_out => gme_common_pvt.activities
691: ,x_oprn_resc_rec => gme_common_pvt.resources
692: ,x_formula_header_rec => l_formula_master
693: ,x_formula_dtl_tbl => gme_common_pvt.materials
694: ,x_recp_resc_proc_param_tbl => gme_common_pvt.process_parameters);

Line 691: ,x_oprn_resc_rec => gme_common_pvt.resources

687: ,x_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
688: ,x_recipe_step_out => gme_common_pvt.steps
689: ,x_routing_depd_tbl => gme_common_pvt.step_dependencies
690: ,x_oprn_act_out => gme_common_pvt.activities
691: ,x_oprn_resc_rec => gme_common_pvt.resources
692: ,x_formula_header_rec => l_formula_master
693: ,x_formula_dtl_tbl => gme_common_pvt.materials
694: ,x_recp_resc_proc_param_tbl => gme_common_pvt.process_parameters);
695: IF g_debug <= gme_debug.g_log_statement THEN

Line 693: ,x_formula_dtl_tbl => gme_common_pvt.materials

689: ,x_routing_depd_tbl => gme_common_pvt.step_dependencies
690: ,x_oprn_act_out => gme_common_pvt.activities
691: ,x_oprn_resc_rec => gme_common_pvt.resources
692: ,x_formula_header_rec => l_formula_master
693: ,x_formula_dtl_tbl => gme_common_pvt.materials
694: ,x_recp_resc_proc_param_tbl => gme_common_pvt.process_parameters);
695: IF g_debug <= gme_debug.g_log_statement THEN
696: gme_debug.put_line
697: ( g_pkg_name

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

690: ,x_oprn_act_out => gme_common_pvt.activities
691: ,x_oprn_resc_rec => gme_common_pvt.resources
692: ,x_formula_header_rec => l_formula_master
693: ,x_formula_dtl_tbl => gme_common_pvt.materials
694: ,x_recp_resc_proc_param_tbl => gme_common_pvt.process_parameters);
695: IF g_debug <= gme_debug.g_log_statement THEN
696: gme_debug.put_line
697: ( g_pkg_name
698: || '.'

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

704: ELSE /* p_creation_mode = 'LCF' */
705: /* Setup following variables so that rest of the program goes through */
706: l_return_status := fnd_api.g_ret_sts_success;
707: l_recipe_validity_rule.inventory_item_id :=
708: gme_common_pvt.materials (1).inventory_item_id;
709: l_formula_master.text_code := NULL;
710: l_formula_master.scale_type := 0;
711: l_recipe.calculate_step_quantity := 0;
712: IF gme_common_pvt.routings.COUNT > 0 THEN

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

708: gme_common_pvt.materials (1).inventory_item_id;
709: l_formula_master.text_code := NULL;
710: l_formula_master.scale_type := 0;
711: l_recipe.calculate_step_quantity := 0;
712: IF gme_common_pvt.routings.COUNT > 0 THEN
713: l_recipe.routing_id := gme_common_pvt.routings(1).routing_id;
714: END IF;
715: END IF; /* IF p_creation_mode <> 'LCF' THEN */
716:

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

709: l_formula_master.text_code := NULL;
710: l_formula_master.scale_type := 0;
711: l_recipe.calculate_step_quantity := 0;
712: IF gme_common_pvt.routings.COUNT > 0 THEN
713: l_recipe.routing_id := gme_common_pvt.routings(1).routing_id;
714: END IF;
715: END IF; /* IF p_creation_mode <> 'LCF' THEN */
716:
717: IF (g_debug = gme_debug.g_log_statement) THEN

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

724: || p_batch_size_uom);
725: gme_debug.put_line ('Return Status was ' || l_return_status);
726: gme_debug.put_line ('return_code = ' || TO_CHAR (l_return_code) );
727: gme_debug.put_line ( '# of Steps = '
728: || TO_CHAR (gme_common_pvt.steps.COUNT) );
729: gme_debug.put_line ( '# of Acts = '
730: || TO_CHAR (gme_common_pvt.activities.COUNT) );
731: gme_debug.put_line ( '# of Rsrc = '
732: || TO_CHAR (gme_common_pvt.resources.COUNT) );

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

726: gme_debug.put_line ('return_code = ' || TO_CHAR (l_return_code) );
727: gme_debug.put_line ( '# of Steps = '
728: || TO_CHAR (gme_common_pvt.steps.COUNT) );
729: gme_debug.put_line ( '# of Acts = '
730: || TO_CHAR (gme_common_pvt.activities.COUNT) );
731: gme_debug.put_line ( '# of Rsrc = '
732: || TO_CHAR (gme_common_pvt.resources.COUNT) );
733: gme_debug.put_line ( '# of Matl = '
734: || TO_CHAR

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

728: || TO_CHAR (gme_common_pvt.steps.COUNT) );
729: gme_debug.put_line ( '# of Acts = '
730: || TO_CHAR (gme_common_pvt.activities.COUNT) );
731: gme_debug.put_line ( '# of Rsrc = '
732: || TO_CHAR (gme_common_pvt.resources.COUNT) );
733: gme_debug.put_line ( '# of Matl = '
734: || TO_CHAR
735: (gme_common_pvt.routing_materials.COUNT) );
736: gme_debug.put_line ( '# of Depd = '

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

731: gme_debug.put_line ( '# of Rsrc = '
732: || TO_CHAR (gme_common_pvt.resources.COUNT) );
733: gme_debug.put_line ( '# of Matl = '
734: || TO_CHAR
735: (gme_common_pvt.routing_materials.COUNT) );
736: gme_debug.put_line ( '# of Depd = '
737: || TO_CHAR
738: (gme_common_pvt.step_dependencies.COUNT) );
739: gme_debug.put_line ( '# of Lines = '

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

734: || TO_CHAR
735: (gme_common_pvt.routing_materials.COUNT) );
736: gme_debug.put_line ( '# of Depd = '
737: || TO_CHAR
738: (gme_common_pvt.step_dependencies.COUNT) );
739: gme_debug.put_line ( '# of Lines = '
740: || TO_CHAR (gme_common_pvt.materials.COUNT) );
741: END IF;
742:

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

736: gme_debug.put_line ( '# of Depd = '
737: || TO_CHAR
738: (gme_common_pvt.step_dependencies.COUNT) );
739: gme_debug.put_line ( '# of Lines = '
740: || TO_CHAR (gme_common_pvt.materials.COUNT) );
741: END IF;
742:
743: IF l_return_status <> fnd_api.g_ret_sts_success THEN
744: IF l_return_code = 4 THEN

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

748: fnd_message.set_name ('GMD', 'GMD_CIRCULAR_DEPEN_DETECT');
749: fnd_msg_pub.ADD;
750: RAISE invalid_recipe;
751: ELSE
752: gme_common_pvt.log_message ('GME_BAD_RECIPE_RETRIEVAL');
753: RAISE invalid_recipe;
754: END IF;
755: END IF;
756:

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

753: RAISE invalid_recipe;
754: END IF;
755: END IF;
756:
757: IF gme_common_pvt.routings.COUNT > 0 THEN
758: x_batch_header_rec.enforce_step_dependency :=
759: NVL (gme_common_pvt.routings (1).enforce_step_dependency, 0);
760: END IF;
761:

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

755: END IF;
756:
757: IF gme_common_pvt.routings.COUNT > 0 THEN
758: x_batch_header_rec.enforce_step_dependency :=
759: NVL (gme_common_pvt.routings (1).enforce_step_dependency, 0);
760: END IF;
761:
762: IF p_creation_mode <> 'LCF' THEN
763: IF l_formula_master.formula_id IS NULL

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

762: IF p_creation_mode <> 'LCF' THEN
763: IF l_formula_master.formula_id IS NULL
764: OR l_formula_master.delete_mark = 1
765: OR l_formula_master.inactive_ind = 1 THEN
766: gme_common_pvt.log_message ('GME_API_INVALID_FORMULA');
767: RAISE expected_error;
768: END IF;
769: END IF; /* IF p_creation_mode <> 'LCF' */
770:

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

779: || l_api_name
780: || 'Start material processing');
781: END IF;
782:
783: FOR i IN 1 .. gme_common_pvt.materials.COUNT LOOP
784: l_formula_material := gme_common_pvt.materials (i);
785:
786: -- Bug 11815699 - get item status code.
787: -- pawan kumar changed this cursor for bug 4917631

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

780: || 'Start material processing');
781: END IF;
782:
783: FOR i IN 1 .. gme_common_pvt.materials.COUNT LOOP
784: l_formula_material := gme_common_pvt.materials (i);
785:
786: -- Bug 11815699 - get item status code.
787: -- pawan kumar changed this cursor for bug 4917631
788: -- Bug 7578476 - Fetch primary uom code also.

Line 806: gme_common_pvt.log_message (p_product_code => 'GMD'

802: FETCH item_master_descr_cursor INTO l_item_master.concatenated_segments;
803: CLOSE item_master_descr_cursor;
804:
805:
806: gme_common_pvt.log_message (p_product_code => 'GMD'
807: ,p_message_code => 'GMD_RCP_ITEMORG_NOT_FOUND'
808: ,p_token1_name => 'ORGN'
809: ,p_token1_value => gme_common_pvt.g_organization_code
810: ,p_token2_name => 'ITEM'

Line 809: ,p_token1_value => gme_common_pvt.g_organization_code

805:
806: gme_common_pvt.log_message (p_product_code => 'GMD'
807: ,p_message_code => 'GMD_RCP_ITEMORG_NOT_FOUND'
808: ,p_token1_name => 'ORGN'
809: ,p_token1_value => gme_common_pvt.g_organization_code
810: ,p_token2_name => 'ITEM'
811: ,p_token2_value => l_item_master.concatenated_segments);
812:
813: RAISE error_count_exceeded;

Line 833: gme_common_pvt.log_message ('GME_API_INVALID_ITEM'

829: OR l_item_master.process_execution_enabled_flag = 'N'
830: OR l_status_exec_enabled = 'N'
831: OR ( l_item_master.eng_item_flag = 'Y'
832: AND x_batch_header_rec.laboratory_ind = 0) THEN
833: gme_common_pvt.log_message ('GME_API_INVALID_ITEM'
834: ,'ITEM_NO'
835: ,l_item_master.concatenated_segments);
836: RAISE error_count_exceeded;
837: ELSE

Line 843: gme_common_pvt.g_line_type_prod THEN

839: l_item_masters (l_number_of_formula_lines) := l_item_master;
840:
841: IF l_formula_material.line_type > 0 THEN
842: IF l_formula_material.line_type =
843: gme_common_pvt.g_line_type_prod THEN
844: l_number_of_product_lines := l_number_of_product_lines + 1;
845:
846:
847:

Line 860: gme_common_pvt.construct_material_detail

856:
857:
858: -- Construct the material detail row
859:
860: gme_common_pvt.construct_material_detail
861: (p_formula_detail_rec => l_formula_material
862: ,p_item_master_rec => l_item_master
863: ,p_batch_header_rec => x_batch_header_rec
864: ,x_material_detail_rec => l_gme_material_detail

Line 901: gme_common_pvt.g_line_type_ing )

897: l_material_details (l_number_of_formula_lines).original_primary_qty :=
898: l_temp_qty;
899: /* --Pawan changes for GMO
900: IF (l_material_details (l_number_of_formula_lines).line_type =
901: gme_common_pvt.g_line_type_ing )
902: AND (l_material_details (l_number_of_formula_lines).phantom_type = 0 ) THEN
903:
904: GMO_DISPENSE_GRP.IS_DISPENSE_ITEM (p_api_version => 1.0,
905: p_init_msg_list => fnd_api.g_false ,

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

933:
934: IF l_number_of_formula_lines = 0
935: OR l_number_of_ingredient_lines = 0
936: OR l_number_of_product_lines = 0 THEN
937: gme_common_pvt.log_message ('GME_API_INVALID_FORMULA');
938: RAISE error_count_exceeded;
939: END IF;
940:
941: -- We now need to sort out the scaling. If the formula is marked as scalable

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

980: ,p_batch_output => p_batch_size
981: ,p_formula_output => l_total_output_qty
982: ,p_yield_um => l_uom
983: ,x_return_status => l_return_status
984: ,x_output_ratio => gme_common_pvt.g_batch_scale_factor);
985:
986: IF l_return_status <> fnd_api.g_ret_sts_success THEN
987: RAISE expected_error;
988: END IF;

Line 1003: gme_common_pvt.g_line_type_prod

999:
1000: /* Let's convert formula product quantity in the requested UOM */
1001: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
1002: IF l_material_details (loop_count).line_type =
1003: gme_common_pvt.g_line_type_prod
1004: AND l_material_details (loop_count).inventory_item_id =
1005: l_recipe_validity_rule.inventory_item_id THEN
1006:
1007: -- bug#5373369 nsinghi rework. While determining the scale factor, give higher precision,

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

1040:
1041: l_primaries := 'OUTPUTS';
1042:
1043: IF l_total_output_qty = 0 THEN
1044: gme_common_pvt.log_message ('GME_API_PROD_QTY_CANT_ZERO');
1045: RAISE expected_error;
1046: END IF;
1047:
1048: -- Bug 7565054 - Back out 7284242

Line 1050: gme_common_pvt.g_batch_scale_factor :=

1046: END IF;
1047:
1048: -- Bug 7565054 - Back out 7284242
1049: -- reinstate original calculation but total output may not include all product lines now.
1050: gme_common_pvt.g_batch_scale_factor :=
1051: p_batch_size / l_total_output_qty;
1052:
1053: ELSIF p_creation_mode = 'RECIPE' THEN
1054: -- Batch is being created by Recipe and Version

Line 1069: gme_common_pvt.g_batch_scale_factor := 1;

1065: INTO l_production_rule_qty, l_production_um;
1066:
1067: IF production_rules_cursor%NOTFOUND THEN
1068: l_primaries := 'OUTPUTS';
1069: gme_common_pvt.g_batch_scale_factor := 1;
1070:
1071: IF (g_debug = gme_debug.g_log_statement) THEN
1072: gme_debug.put_line
1073: ('CREATING BY RECIPE/VERSION WITHOUT SCALING');

Line 1080: (gme_common_pvt.g_line_type_prod

1076: l_total_output_qty := 0;
1077:
1078: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
1079: IF l_material_details (loop_count).line_type IN
1080: (gme_common_pvt.g_line_type_prod
1081: ,gme_common_pvt.g_line_type_byprod)
1082: AND l_material_details (loop_count).inventory_item_id =
1083: l_recipe_validity_rule.inventory_item_id THEN
1084:

Line 1081: ,gme_common_pvt.g_line_type_byprod)

1077:
1078: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
1079: IF l_material_details (loop_count).line_type IN
1080: (gme_common_pvt.g_line_type_prod
1081: ,gme_common_pvt.g_line_type_byprod)
1082: AND l_material_details (loop_count).inventory_item_id =
1083: l_recipe_validity_rule.inventory_item_id THEN
1084:
1085: -- 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 1116: gme_common_pvt.log_message ('GME_API_PROD_QTY_CANT_ZERO');

1112: /* l_material_details(loop_count).line_type IN (1, 2) AND */
1113: END LOOP; /* loop_count IN 1 .. l_number_of_formula_lines */
1114:
1115: IF l_total_output_qty = 0 THEN
1116: gme_common_pvt.log_message ('GME_API_PROD_QTY_CANT_ZERO');
1117: RAISE expected_error;
1118: END IF;
1119:
1120: gme_common_pvt.g_batch_scale_factor :=

Line 1120: gme_common_pvt.g_batch_scale_factor :=

1116: gme_common_pvt.log_message ('GME_API_PROD_QTY_CANT_ZERO');
1117: RAISE expected_error;
1118: END IF;
1119:
1120: gme_common_pvt.g_batch_scale_factor :=
1121: l_production_rule_qty / l_total_output_qty;
1122: END IF; /* IF production_rules_cursor%NOTFOUND */
1123:
1124: CLOSE production_rules_cursor;

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

1155: ,p_batch_input => p_batch_size
1156: ,p_formula_input => l_total_input_qty
1157: ,p_yield_um => l_uom
1158: ,x_return_status => l_return_status
1159: ,x_batchformula_ratio => gme_common_pvt.g_batch_scale_factor);
1160:
1161: IF l_return_status <> fnd_api.g_ret_sts_success THEN
1162: RAISE expected_error;
1163: END IF;

Line 1171: gme_common_pvt.log_message ('GME_API_UNSUPPORTED_MODE'

1167: -- No need to do anything, but this is a valid creation mode
1168: NULL;
1169: ELSE
1170: -- Batch is being created by means unknown
1171: gme_common_pvt.log_message ('GME_API_UNSUPPORTED_MODE'
1172: ,'MODE'
1173: ,p_creation_mode);
1174: RAISE expected_error;
1175: END IF;

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

1173: ,p_creation_mode);
1174: RAISE expected_error;
1175: END IF;
1176:
1177: IF gme_common_pvt.routings.COUNT <> 0 THEN
1178: l_total_output_qty_c := 0;
1179:
1180: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
1181: IF l_material_details (loop_count).line_type IN

Line 1182: (gme_common_pvt.g_line_type_prod

1178: l_total_output_qty_c := 0;
1179:
1180: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
1181: IF l_material_details (loop_count).line_type IN
1182: (gme_common_pvt.g_line_type_prod
1183: ,gme_common_pvt.g_line_type_byprod) THEN
1184: IF l_material_details (loop_count).dtl_um =
1185: gme_common_pvt.routings (1).routing_uom THEN
1186: l_total_output_qty_c :=

Line 1183: ,gme_common_pvt.g_line_type_byprod) THEN

1179:
1180: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
1181: IF l_material_details (loop_count).line_type IN
1182: (gme_common_pvt.g_line_type_prod
1183: ,gme_common_pvt.g_line_type_byprod) THEN
1184: IF l_material_details (loop_count).dtl_um =
1185: gme_common_pvt.routings (1).routing_uom THEN
1186: l_total_output_qty_c :=
1187: l_total_output_qty_c

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

1181: IF l_material_details (loop_count).line_type IN
1182: (gme_common_pvt.g_line_type_prod
1183: ,gme_common_pvt.g_line_type_byprod) THEN
1184: IF l_material_details (loop_count).dtl_um =
1185: gme_common_pvt.routings (1).routing_uom THEN
1186: l_total_output_qty_c :=
1187: l_total_output_qty_c
1188: + l_material_details (loop_count).plan_qty;
1189: ELSE

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

1192: (l_material_details (loop_count).inventory_item_id
1193: ,32 -- Bug 16474091 - change precision from 5 to 32
1194: ,l_material_details (loop_count).plan_qty
1195: ,l_material_details (loop_count).dtl_um
1196: ,gme_common_pvt.routings (1).routing_uom
1197: ,NULL
1198: ,NULL);
1199:
1200: IF l_temp_qty < 0 THEN

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

1205:
1206: l_item_id :=
1207: l_material_details (loop_count).inventory_item_id;
1208: l_from_uom := l_material_details (loop_count).dtl_um;
1209: l_to_uom := gme_common_pvt.routings (1).routing_uom;
1210: RAISE conversion_failure;
1211: ELSE
1212: l_total_output_qty_c :=
1213: l_total_output_qty_c + l_temp_qty;

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

1220: IF (g_debug = gme_debug.g_log_statement) THEN
1221: gme_debug.put_line ( 'tot_output before scaling is '
1222: || TO_CHAR (l_total_output_qty_c) );
1223: END IF;
1224: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */
1225:
1226: -- Bug 10624995 - rearrange logic as to handle integer scale items for non scaled batches.
1227: l_change_made := 0;
1228: IF gme_common_pvt.g_batch_scale_factor <> 1 THEN

Line 1228: IF gme_common_pvt.g_batch_scale_factor <> 1 THEN

1224: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */
1225:
1226: -- Bug 10624995 - rearrange logic as to handle integer scale items for non scaled batches.
1227: l_change_made := 0;
1228: IF gme_common_pvt.g_batch_scale_factor <> 1 THEN
1229: IF (g_debug = gme_debug.g_log_statement) THEN
1230: gme_debug.put_line
1231: ( 'scale factor is '
1232: || TO_CHAR

Line 1233: (gme_common_pvt.g_batch_scale_factor) );

1229: IF (g_debug = gme_debug.g_log_statement) THEN
1230: gme_debug.put_line
1231: ( 'scale factor is '
1232: || TO_CHAR
1233: (gme_common_pvt.g_batch_scale_factor) );
1234: END IF;
1235:
1236: l_change_made := 1;
1237:

Line 1248: ,p_scale_factor => gme_common_pvt.g_batch_scale_factor

1244: l_in_material_details := l_material_details;
1245: gme_scale_batch_pvt.scale_batch
1246: (p_batch_header_rec => x_batch_header_rec
1247: ,p_material_tbl => l_in_material_details
1248: ,p_scale_factor => gme_common_pvt.g_batch_scale_factor
1249: ,p_primaries => l_primaries
1250: ,p_qty_type => 1
1251: ,p_validity_rule_id => l_recipe_validity_rule.recipe_validity_rule_id
1252: ,p_enforce_vldt_check => fnd_api.g_true

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

1259: ,
1260: /* Create batch does not need any values from here so dummy variable */
1261: x_return_status => x_return_status);
1262:
1263: x_batch_header_rec.batch_status := gme_common_pvt.g_batch_pending;
1264:
1265: IF (g_debug = gme_debug.g_log_statement) THEN
1266: gme_debug.put_line ( 'return from scale_batch is: '
1267: || x_return_status);

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

1330: END IF;
1331: END IF; /* l_material_detail_rec.scale_type = 2 */
1332: END LOOP;
1333: -- End herbal life fix.
1334: END IF; /* IF gme_common_pvt.g_batch_scale_factor <> 1 */
1335:
1336: -- If scaling or integer logic made a change then calculate values for process loss.
1337: IF l_change_made = 1 THEN
1338: -- We now need to calculate the total scaled formula output in the Routing

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

1336: -- If scaling or integer logic made a change then calculate values for process loss.
1337: IF l_change_made = 1 THEN
1338: -- We now need to calculate the total scaled formula output in the Routing
1339: -- UOM so that we can look up a few things in the process loss table.
1340: IF gme_common_pvt.routings.COUNT <> 0 THEN
1341: l_total_output_qty_b := 0;
1342:
1343: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
1344: IF l_material_details (loop_count).line_type IN

Line 1345: (gme_common_pvt.g_line_type_prod

1341: l_total_output_qty_b := 0;
1342:
1343: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
1344: IF l_material_details (loop_count).line_type IN
1345: (gme_common_pvt.g_line_type_prod
1346: ,gme_common_pvt.g_line_type_byprod) THEN
1347: IF l_material_details (loop_count).dtl_um =
1348: gme_common_pvt.routings (1).routing_uom THEN
1349: l_total_output_qty_b :=

Line 1346: ,gme_common_pvt.g_line_type_byprod) THEN

1342:
1343: FOR loop_count IN 1 .. l_number_of_formula_lines LOOP
1344: IF l_material_details (loop_count).line_type IN
1345: (gme_common_pvt.g_line_type_prod
1346: ,gme_common_pvt.g_line_type_byprod) THEN
1347: IF l_material_details (loop_count).dtl_um =
1348: gme_common_pvt.routings (1).routing_uom THEN
1349: l_total_output_qty_b :=
1350: l_total_output_qty_b

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

1344: IF l_material_details (loop_count).line_type IN
1345: (gme_common_pvt.g_line_type_prod
1346: ,gme_common_pvt.g_line_type_byprod) THEN
1347: IF l_material_details (loop_count).dtl_um =
1348: gme_common_pvt.routings (1).routing_uom THEN
1349: l_total_output_qty_b :=
1350: l_total_output_qty_b
1351: + l_material_details (loop_count).plan_qty;
1352: ELSE

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

1355: (l_material_details (loop_count).inventory_item_id
1356: ,32 -- Bug 16474091 - change precision from 5 to 32
1357: ,l_material_details (loop_count).plan_qty
1358: ,l_material_details (loop_count).dtl_um
1359: ,gme_common_pvt.routings (1).routing_uom
1360: ,NULL
1361: ,NULL);
1362:
1363: IF l_temp_qty < 0 THEN

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

1369: l_item_id :=
1370: l_material_details (loop_count).inventory_item_id;
1371: l_from_uom :=
1372: l_material_details (loop_count).dtl_um;
1373: l_to_uom := gme_common_pvt.routings (1).routing_uom;
1374: RAISE conversion_failure;
1375: ELSE
1376: l_total_output_qty_b :=
1377: l_total_output_qty_b + l_temp_qty;

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

1383: IF (g_debug = gme_debug.g_log_statement) THEN
1384: gme_debug.put_line ( 'Total Output after scaling is '
1385: || TO_CHAR (l_total_output_qty_b) );
1386: END IF;
1387: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */
1388: END IF; /* IF l_change_made */
1389:
1390: IF p_creation_mode <> 'LCF' THEN
1391: -- Batch has been scaled OK so we now need to determine and apply the process loss.

Line 1393: gme_common_pvt.get_process_loss

1389:
1390: IF p_creation_mode <> 'LCF' THEN
1391: -- Batch has been scaled OK so we now need to determine and apply the process loss.
1392: l_process_loss :=
1393: gme_common_pvt.get_process_loss
1394: (p_validity_rule_id => l_recipe_validity_rule.recipe_validity_rule_id
1395: ,p_organization_id => x_batch_header_rec.organization_id
1396: ,p_total_output_qty_scaled => l_total_output_qty_b
1397: ,p_total_output_qty_pre_scale => l_total_output_qty_c);

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

1451: || TO_CHAR (l_total_output_qty_b) );
1452: END IF;
1453: END IF; /* IF p_creation_mode <> 'LCF' THEN */
1454:
1455: IF gme_common_pvt.routings.COUNT <> 0 THEN
1456: -- Accumulate the total output of the batch in the ROUTING UOM
1457: l_requested_qty := 0;
1458:
1459: IF (l_total_output_qty_b IS NULL OR l_total_output_qty_b = 0)

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

1462:
1463: FOR l_row_count IN 1 .. l_number_of_formula_lines LOOP
1464: IF l_material_details (l_row_count).line_type > 0 THEN
1465: IF l_material_details (l_row_count).dtl_um =
1466: gme_common_pvt.routings (1).routing_uom THEN
1467: l_total_output_qty_b :=
1468: l_total_output_qty_b
1469: + l_material_details (l_row_count).plan_qty;
1470: ELSE

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

1473: (l_material_details (l_row_count).inventory_item_id
1474: ,5
1475: ,l_material_details (l_row_count).plan_qty
1476: ,l_material_details (l_row_count).dtl_um
1477: ,gme_common_pvt.routings (1).routing_uom
1478: ,NULL
1479: ,NULL);
1480:
1481: IF l_temp_qty < 0 THEN

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

1483: l_material_details (l_row_count).inventory_item_id;
1484: l_from_uom :=
1485: l_material_details (l_row_count).dtl_um;
1486: l_to_uom :=
1487: gme_common_pvt.routings (1).routing_uom;
1488: RAISE conversion_failure;
1489: ELSE
1490: l_total_output_qty_b :=
1491: l_total_output_qty_b + l_temp_qty;

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

1495: END LOOP; -- l_row_count IN 1 .. l_number_of_formula_lines
1496: END IF; /* b_total_output_qty_b IS NULL */
1497:
1498: IF l_total_output_qty_c = 0 THEN
1499: gme_common_pvt.log_message ('GME_API_PROD_QTY_CANT_ZERO');
1500: RAISE expected_error;
1501: END IF;
1502:
1503: gme_common_pvt.g_routing_scale_factor :=

Line 1503: gme_common_pvt.g_routing_scale_factor :=

1499: gme_common_pvt.log_message ('GME_API_PROD_QTY_CANT_ZERO');
1500: RAISE expected_error;
1501: END IF;
1502:
1503: gme_common_pvt.g_routing_scale_factor :=
1504: l_total_output_qty_b / l_total_output_qty_c;
1505:
1506: IF (g_debug = gme_debug.g_log_statement) THEN
1507: gme_debug.put_line ( 'Routing scale factor is '

Line 1508: || gme_common_pvt.g_routing_scale_factor);

1504: l_total_output_qty_b / l_total_output_qty_c;
1505:
1506: IF (g_debug = gme_debug.g_log_statement) THEN
1507: gme_debug.put_line ( 'Routing scale factor is '
1508: || gme_common_pvt.g_routing_scale_factor);
1509: END IF;
1510: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */
1511: ELSE /* IF l_formula_master.scale_type <> 1 */
1512: -- Formula cannot be scaled

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

1506: IF (g_debug = gme_debug.g_log_statement) THEN
1507: gme_debug.put_line ( 'Routing scale factor is '
1508: || gme_common_pvt.g_routing_scale_factor);
1509: END IF;
1510: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */
1511: ELSE /* IF l_formula_master.scale_type <> 1 */
1512: -- Formula cannot be scaled
1513: gme_common_pvt.g_batch_scale_factor := 1;
1514: gme_common_pvt.g_routing_scale_factor := 1;

Line 1513: gme_common_pvt.g_batch_scale_factor := 1;

1509: END IF;
1510: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */
1511: ELSE /* IF l_formula_master.scale_type <> 1 */
1512: -- Formula cannot be scaled
1513: gme_common_pvt.g_batch_scale_factor := 1;
1514: gme_common_pvt.g_routing_scale_factor := 1;
1515: END IF;
1516:
1517: -- Fixed Process Loss ME

Line 1514: gme_common_pvt.g_routing_scale_factor := 1;

1510: END IF; /* IF gme_common_pvt.routings.COUNT <> 0 */
1511: ELSE /* IF l_formula_master.scale_type <> 1 */
1512: -- Formula cannot be scaled
1513: gme_common_pvt.g_batch_scale_factor := 1;
1514: gme_common_pvt.g_routing_scale_factor := 1;
1515: END IF;
1516:
1517: -- Fixed Process Loss ME
1518:

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

1553: gme_debug.put_line ('fnd return is ' || fnd_api.g_ret_sts_success);
1554: END IF;
1555:
1556: -- If we've found any errors, don't start the updates.
1557: -- IF gme_common_pvt.g_error_count > 0 THEN
1558: -- RAISE expected_error;
1559: -- END IF;
1560:
1561: IF g_debug <= gme_debug.g_log_statement THEN

Line 1575: gme_common_pvt.create_document_no (l_in_batch_header

1571: -- From here on all errors are fatal so the validation level is not checked.
1572: l_in_batch_header := x_batch_header_rec;
1573: /*5698727 rework Begin we use timestamp initially as its unique. later we update
1574: with actual batch_no
1575: gme_common_pvt.create_document_no (l_in_batch_header
1576: ,x_batch_header_rec);*/
1577: SELECT trim(TO_CHAR(systimestamp,'DD:MM:YYYY HH24:MI:SS:FF6')) INTO l_doc_timestamp FROM DUAL;
1578:
1579: IF g_debug <= gme_debug.g_log_statement THEN

Line 1586: IF l_doc_numbering = gme_common_pvt.g_auto_doc_numbering THEN

1582: || l_api_name
1583: || 'Initial Doc No(timestamp): '||l_doc_timestamp);
1584: END IF;
1585:
1586: IF l_doc_numbering = gme_common_pvt.g_auto_doc_numbering THEN
1587: x_batch_header_rec.batch_no := l_doc_timestamp;
1588: END IF;
1589: --5698727 rework End
1590:

Line 1604: IF l_doc_numbering <> gme_common_pvt.g_auto_doc_numbering THEN

1600: /*5698727 rework commented the following code. We will validate the wip entity
1601: when we are updating the wip_entities table later once the actual doc_no is available */
1602: /* Bug6398619 we have to validate the batch no for the manual doc ordering as
1603: the time stamp is not created for the manual ordering */
1604: IF l_doc_numbering <> gme_common_pvt.g_auto_doc_numbering THEN
1605: validate_wip_entity(p_organization_id => x_batch_header_rec.organization_id,
1606: p_batch_no => l_prefix||x_batch_header_rec.batch_no,
1607: x_return_status => l_return_status);
1608: IF l_return_status <> fnd_api.g_ret_sts_success THEN

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

1615: l_number_of_text_lines := 0;
1616:
1617: --Bug#5112133 add some debug messages for copy formula text GME Parameter
1618: IF (g_debug = gme_debug.g_log_statement) THEN
1619: gme_debug.put_line ('copy_formula_text_ind = '||gme_common_pvt.g_copy_formula_text_ind);
1620: END IF;
1621: -- If the formula has text and we have to copy it then generate
1622: -- the text header row first as database constraints impose this
1623: IF gme_common_pvt.g_copy_formula_text_ind = 1

Line 1623: IF gme_common_pvt.g_copy_formula_text_ind = 1

1619: gme_debug.put_line ('copy_formula_text_ind = '||gme_common_pvt.g_copy_formula_text_ind);
1620: END IF;
1621: -- If the formula has text and we have to copy it then generate
1622: -- the text header row first as database constraints impose this
1623: IF gme_common_pvt.g_copy_formula_text_ind = 1
1624: AND l_formula_master.text_code IS NOT NULL THEN
1625: l_return :=
1626: gme_text_dbl.insert_header_row (l_text_header, l_text_header);
1627:

Line 1731: AND gme_common_pvt.g_copy_formula_text_ind = 1 THEN

1727: IF (g_debug = gme_debug.g_log_statement) THEN
1728: gme_debug.put_line ('l text code is '||l_material_details (l_row_count).text_code);
1729: END IF;
1730: IF l_material_details (l_row_count).text_code IS NOT NULL
1731: AND gme_common_pvt.g_copy_formula_text_ind = 1 THEN
1732: l_text_code := l_material_details (l_row_count).text_code;
1733: l_return :=
1734: gme_text_dbl.insert_header_row (l_text_header
1735: ,l_text_header);

Line 1802: gme_common_pvt.g_line_type_ing )

1798: END IF;
1799: --FPBug#4395561 End
1800: --Pawan changes for GMO
1801: IF (l_material_details (l_row_count).line_type =
1802: gme_common_pvt.g_line_type_ing )
1803: AND (l_material_details (l_row_count).phantom_type = 0 )
1804: --Pawan Kumar add for bug 5365883
1805: -- Kapil M. Bug# 5458674. Reverted back the changes to support LCF Batches.
1806: -- AND (p_creation_mode <> 'LCF')

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

1912: || l_api_name
1913: || 'Start step processing');
1914: END IF;
1915:
1916: IF gme_common_pvt.routings.COUNT <> 0 THEN
1917: gme_create_step_pvt.create_batch_steps
1918: (p_recipe_rout_step_tbl => gme_common_pvt.steps
1919: ,p_recipe_rout_act_tbl => gme_common_pvt.activities
1920: ,p_recipe_rout_resc_tbl => gme_common_pvt.resources

Line 1918: (p_recipe_rout_step_tbl => gme_common_pvt.steps

1914: END IF;
1915:
1916: IF gme_common_pvt.routings.COUNT <> 0 THEN
1917: gme_create_step_pvt.create_batch_steps
1918: (p_recipe_rout_step_tbl => gme_common_pvt.steps
1919: ,p_recipe_rout_act_tbl => gme_common_pvt.activities
1920: ,p_recipe_rout_resc_tbl => gme_common_pvt.resources
1921: ,p_resc_parameters_tbl => gme_common_pvt.process_parameters
1922: ,p_recipe_rout_matl_tbl => gme_common_pvt.routing_materials

Line 1919: ,p_recipe_rout_act_tbl => gme_common_pvt.activities

1915:
1916: IF gme_common_pvt.routings.COUNT <> 0 THEN
1917: gme_create_step_pvt.create_batch_steps
1918: (p_recipe_rout_step_tbl => gme_common_pvt.steps
1919: ,p_recipe_rout_act_tbl => gme_common_pvt.activities
1920: ,p_recipe_rout_resc_tbl => gme_common_pvt.resources
1921: ,p_resc_parameters_tbl => gme_common_pvt.process_parameters
1922: ,p_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
1923: ,p_routing_depd_tbl => gme_common_pvt.step_dependencies

Line 1920: ,p_recipe_rout_resc_tbl => gme_common_pvt.resources

1916: IF gme_common_pvt.routings.COUNT <> 0 THEN
1917: gme_create_step_pvt.create_batch_steps
1918: (p_recipe_rout_step_tbl => gme_common_pvt.steps
1919: ,p_recipe_rout_act_tbl => gme_common_pvt.activities
1920: ,p_recipe_rout_resc_tbl => gme_common_pvt.resources
1921: ,p_resc_parameters_tbl => gme_common_pvt.process_parameters
1922: ,p_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
1923: ,p_routing_depd_tbl => gme_common_pvt.step_dependencies
1924: ,p_gme_batch_header_rec => x_batch_header_rec

Line 1921: ,p_resc_parameters_tbl => gme_common_pvt.process_parameters

1917: gme_create_step_pvt.create_batch_steps
1918: (p_recipe_rout_step_tbl => gme_common_pvt.steps
1919: ,p_recipe_rout_act_tbl => gme_common_pvt.activities
1920: ,p_recipe_rout_resc_tbl => gme_common_pvt.resources
1921: ,p_resc_parameters_tbl => gme_common_pvt.process_parameters
1922: ,p_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
1923: ,p_routing_depd_tbl => gme_common_pvt.step_dependencies
1924: ,p_gme_batch_header_rec => x_batch_header_rec
1925: ,p_use_workday_cal => p_use_workday_cal

Line 1922: ,p_recipe_rout_matl_tbl => gme_common_pvt.routing_materials

1918: (p_recipe_rout_step_tbl => gme_common_pvt.steps
1919: ,p_recipe_rout_act_tbl => gme_common_pvt.activities
1920: ,p_recipe_rout_resc_tbl => gme_common_pvt.resources
1921: ,p_resc_parameters_tbl => gme_common_pvt.process_parameters
1922: ,p_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
1923: ,p_routing_depd_tbl => gme_common_pvt.step_dependencies
1924: ,p_gme_batch_header_rec => x_batch_header_rec
1925: ,p_use_workday_cal => p_use_workday_cal
1926: ,p_contiguity_override => p_contiguity_override

Line 1923: ,p_routing_depd_tbl => gme_common_pvt.step_dependencies

1919: ,p_recipe_rout_act_tbl => gme_common_pvt.activities
1920: ,p_recipe_rout_resc_tbl => gme_common_pvt.resources
1921: ,p_resc_parameters_tbl => gme_common_pvt.process_parameters
1922: ,p_recipe_rout_matl_tbl => gme_common_pvt.routing_materials
1923: ,p_routing_depd_tbl => gme_common_pvt.step_dependencies
1924: ,p_gme_batch_header_rec => x_batch_header_rec
1925: ,p_use_workday_cal => p_use_workday_cal
1926: ,p_contiguity_override => p_contiguity_override
1927: ,p_ignore_qty_below_cap => p_ignore_qty_below_cap

Line 1958: IF (gme_common_pvt.calc_date_from_prod_rule

1954: l_to_uom := l_prim_item_um;
1955: RAISE conversion_failure;
1956: END IF;
1957:
1958: IF (gme_common_pvt.calc_date_from_prod_rule
1959: (p_organization_id => x_batch_header_rec.organization_id
1960: ,p_inventory_item_id => l_recipe_validity_rule.inventory_item_id
1961: ,p_item_qty => l_temp_qty
1962: ,p_start_date => x_batch_header_rec.plan_start_date

Line 1987: gme_common_pvt.g_timestamp;

1983: x_batch_header_rec.plan_cmplt_date;
1984: ELSIF x_batch_header_rec.plan_start_date IS NULL
1985: AND x_batch_header_rec.plan_cmplt_date IS NULL THEN
1986: x_batch_header_rec.plan_start_date :=
1987: gme_common_pvt.g_timestamp;
1988: x_batch_header_rec.plan_cmplt_date :=
1989: gme_common_pvt.g_timestamp;
1990: END IF;
1991:

Line 1989: gme_common_pvt.g_timestamp;

1985: AND x_batch_header_rec.plan_cmplt_date IS NULL THEN
1986: x_batch_header_rec.plan_start_date :=
1987: gme_common_pvt.g_timestamp;
1988: x_batch_header_rec.plan_cmplt_date :=
1989: gme_common_pvt.g_timestamp;
1990: END IF;
1991:
1992: IF (g_debug = gme_debug.g_log_statement) THEN
1993: gme_debug.put_line

Line 2025: || gme_common_pvt.g_calendar_code);

2021: END IF;
2022:
2023: IF (g_debug = gme_debug.g_log_statement) THEN
2024: gme_debug.put_line ( 'Calendar code found '
2025: || gme_common_pvt.g_calendar_code);
2026: gme_debug.put_line ('Cont ID found ' || l_cont_ind);
2027: END IF;
2028:
2029: l_duration :=

Line 2048: ,p_calendar_code => gme_common_pvt.g_calendar_code

2044: ,p_start_date => NVL
2045: (p_batch_header_rec.plan_start_date
2046: ,x_batch_header_rec.plan_start_date)
2047: ,p_end_date => NULL
2048: ,p_calendar_code => gme_common_pvt.g_calendar_code
2049: ,p_duration => l_duration
2050: ,p_output_tbl => l_contig_period_tbl
2051: ,x_return_status => l_return_status);
2052:

Line 2081: ,p_calendar_code => gme_common_pvt.g_calendar_code

2077: (p_api_version => 1
2078: ,p_init_msg_list => FALSE
2079: ,p_start_date => NULL
2080: ,p_end_date => p_batch_header_rec.plan_cmplt_date
2081: ,p_calendar_code => gme_common_pvt.g_calendar_code
2082: ,p_duration => l_duration
2083: ,p_output_tbl => l_contig_period_tbl
2084: ,x_return_status => l_return_status);
2085:

Line 2119: ,last_updated_by = gme_common_pvt.g_user_ident

2115: ,due_date =
2116: NVL (x_batch_header_rec.due_date
2117: ,x_batch_header_rec.plan_cmplt_date)
2118: -- Bug 13256866
2119: ,last_updated_by = gme_common_pvt.g_user_ident
2120: ,last_update_date = gme_common_pvt.g_timestamp
2121: ,last_update_login = gme_common_pvt.g_login_id
2122: WHERE batch_id = x_batch_header_rec.batch_id;
2123: END IF;

Line 2120: ,last_update_date = gme_common_pvt.g_timestamp

2116: NVL (x_batch_header_rec.due_date
2117: ,x_batch_header_rec.plan_cmplt_date)
2118: -- Bug 13256866
2119: ,last_updated_by = gme_common_pvt.g_user_ident
2120: ,last_update_date = gme_common_pvt.g_timestamp
2121: ,last_update_login = gme_common_pvt.g_login_id
2122: WHERE batch_id = x_batch_header_rec.batch_id;
2123: END IF;
2124:

Line 2121: ,last_update_login = gme_common_pvt.g_login_id

2117: ,x_batch_header_rec.plan_cmplt_date)
2118: -- Bug 13256866
2119: ,last_updated_by = gme_common_pvt.g_user_ident
2120: ,last_update_date = gme_common_pvt.g_timestamp
2121: ,last_update_login = gme_common_pvt.g_login_id
2122: WHERE batch_id = x_batch_header_rec.batch_id;
2123: END IF;
2124:
2125: -- 5698727

Line 2127: gme_common_pvt.create_document_no (l_in_batch_header1

2123: END IF;
2124:
2125: -- 5698727
2126: l_in_batch_header1 := x_batch_header_rec ;
2127: gme_common_pvt.create_document_no (l_in_batch_header1
2128: ,x_batch_header_rec);
2129: -- 5698727 rework
2130: /*Bug#6398619 the validation here is required only for the automatic doc numbering */
2131: IF l_doc_numbering = gme_common_pvt.g_auto_doc_numbering THEN

Line 2131: IF l_doc_numbering = gme_common_pvt.g_auto_doc_numbering THEN

2127: gme_common_pvt.create_document_no (l_in_batch_header1
2128: ,x_batch_header_rec);
2129: -- 5698727 rework
2130: /*Bug#6398619 the validation here is required only for the automatic doc numbering */
2131: IF l_doc_numbering = gme_common_pvt.g_auto_doc_numbering THEN
2132:
2133: -- Bug 13785754/13815190 - try 20 times if necessary to get a unique batch number.
2134: l_doc_count := 1;
2135: WHILE l_doc_count < 20 LOOP

Line 2146: gme_common_pvt.create_document_no (l_in_batch_header1

2142: IF l_doc_count > 18 THEN
2143: RAISE wip_entity_err;
2144: ELSE
2145: l_doc_count := l_doc_count + 1;
2146: gme_common_pvt.create_document_no (l_in_batch_header1
2147: ,x_batch_header_rec);
2148: END IF;
2149: ELSE
2150: -- Force loop to stop.

Line 2159: ,last_updated_by = gme_common_pvt.g_user_ident

2155: /* update the batch_no with the actual value */
2156: UPDATE gme_batch_header
2157: SET batch_no = x_batch_header_rec.batch_no
2158: -- Bug 13256866
2159: ,last_updated_by = gme_common_pvt.g_user_ident
2160: ,last_update_date = gme_common_pvt.g_timestamp
2161: ,last_update_login = gme_common_pvt.g_login_id
2162: WHERE batch_id = x_batch_header_rec.batch_id;
2163:

Line 2160: ,last_update_date = gme_common_pvt.g_timestamp

2156: UPDATE gme_batch_header
2157: SET batch_no = x_batch_header_rec.batch_no
2158: -- Bug 13256866
2159: ,last_updated_by = gme_common_pvt.g_user_ident
2160: ,last_update_date = gme_common_pvt.g_timestamp
2161: ,last_update_login = gme_common_pvt.g_login_id
2162: WHERE batch_id = x_batch_header_rec.batch_id;
2163:
2164: /*5698727 rework update the wip_entities table with actual batch no*/

Line 2161: ,last_update_login = gme_common_pvt.g_login_id

2157: SET batch_no = x_batch_header_rec.batch_no
2158: -- Bug 13256866
2159: ,last_updated_by = gme_common_pvt.g_user_ident
2160: ,last_update_date = gme_common_pvt.g_timestamp
2161: ,last_update_login = gme_common_pvt.g_login_id
2162: WHERE batch_id = x_batch_header_rec.batch_id;
2163:
2164: /*5698727 rework update the wip_entities table with actual batch no*/
2165: UPDATE wip_entities

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

2181: IF ( p_batch_header_rec.plan_start_date IS NOT NULL
2182: AND p_batch_header_rec.plan_cmplt_date IS NOT NULL) THEN
2183: -- IF routings exists and calculated date is greater than the date entered,
2184: -- then truncate all the dates to dates entered
2185: IF (gme_common_pvt.routings.COUNT <> 0) THEN
2186: IF (x_batch_header_rec.plan_cmplt_date >
2187: p_batch_header_rec.plan_cmplt_date) THEN
2188: x_batch_header_rec.plan_start_date :=
2189: p_batch_header_rec.plan_start_date;

Line 2209: ,last_updated_by = gme_common_pvt.g_user_ident

2205: SET plan_cmplt_date = p_batch_header_rec.plan_cmplt_date
2206: ,due_date =
2207: NVL (x_batch_header_rec.due_date
2208: ,p_batch_header_rec.plan_cmplt_date)
2209: ,last_updated_by = gme_common_pvt.g_user_ident
2210: ,last_update_date = gme_common_pvt.g_timestamp
2211: ,last_update_login = gme_common_pvt.g_login_id
2212: WHERE batch_id = x_batch_header_rec.batch_id;
2213: END IF;

Line 2210: ,last_update_date = gme_common_pvt.g_timestamp

2206: ,due_date =
2207: NVL (x_batch_header_rec.due_date
2208: ,p_batch_header_rec.plan_cmplt_date)
2209: ,last_updated_by = gme_common_pvt.g_user_ident
2210: ,last_update_date = gme_common_pvt.g_timestamp
2211: ,last_update_login = gme_common_pvt.g_login_id
2212: WHERE batch_id = x_batch_header_rec.batch_id;
2213: END IF;
2214: END IF; -- End gme_common_pvt.routings.COUNT <> 0

Line 2211: ,last_update_login = gme_common_pvt.g_login_id

2207: NVL (x_batch_header_rec.due_date
2208: ,p_batch_header_rec.plan_cmplt_date)
2209: ,last_updated_by = gme_common_pvt.g_user_ident
2210: ,last_update_date = gme_common_pvt.g_timestamp
2211: ,last_update_login = gme_common_pvt.g_login_id
2212: WHERE batch_id = x_batch_header_rec.batch_id;
2213: END IF;
2214: END IF; -- End gme_common_pvt.routings.COUNT <> 0
2215:

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

2210: ,last_update_date = gme_common_pvt.g_timestamp
2211: ,last_update_login = gme_common_pvt.g_login_id
2212: WHERE batch_id = x_batch_header_rec.batch_id;
2213: END IF;
2214: END IF; -- End gme_common_pvt.routings.COUNT <> 0
2215:
2216: UPDATE gme_batch_header
2217: SET plan_cmplt_date = p_batch_header_rec.plan_cmplt_date
2218: ,due_date =

Line 2221: ,last_updated_by = gme_common_pvt.g_user_ident

2217: SET plan_cmplt_date = p_batch_header_rec.plan_cmplt_date
2218: ,due_date =
2219: NVL (x_batch_header_rec.due_date
2220: ,p_batch_header_rec.plan_cmplt_date)
2221: ,last_updated_by = gme_common_pvt.g_user_ident
2222: ,last_update_date = gme_common_pvt.g_timestamp
2223: ,last_update_login = gme_common_pvt.g_login_id
2224: WHERE batch_id = x_batch_header_rec.batch_id;
2225: END IF; -- End start and completion dates not null.

Line 2222: ,last_update_date = gme_common_pvt.g_timestamp

2218: ,due_date =
2219: NVL (x_batch_header_rec.due_date
2220: ,p_batch_header_rec.plan_cmplt_date)
2221: ,last_updated_by = gme_common_pvt.g_user_ident
2222: ,last_update_date = gme_common_pvt.g_timestamp
2223: ,last_update_login = gme_common_pvt.g_login_id
2224: WHERE batch_id = x_batch_header_rec.batch_id;
2225: END IF; -- End start and completion dates not null.
2226:

Line 2223: ,last_update_login = gme_common_pvt.g_login_id

2219: NVL (x_batch_header_rec.due_date
2220: ,p_batch_header_rec.plan_cmplt_date)
2221: ,last_updated_by = gme_common_pvt.g_user_ident
2222: ,last_update_date = gme_common_pvt.g_timestamp
2223: ,last_update_login = gme_common_pvt.g_login_id
2224: WHERE batch_id = x_batch_header_rec.batch_id;
2225: END IF; -- End start and completion dates not null.
2226:
2227: IF NOT (gme_batch_header_dbl.fetch_row (x_batch_header_rec

Line 2241: gme_common_pvt.calc_mtl_req_date

2237: END IF;
2238:
2239: l_item_substituted := FALSE;
2240: FOR l_row_count IN 1 .. l_number_of_formula_lines LOOP
2241: gme_common_pvt.calc_mtl_req_date
2242: (p_batch_header_rec => x_batch_header_rec
2243: ,p_batchstep_rec => NULL
2244: ,p_mtl_dtl_rec => l_material_details (l_row_count)
2245: ,x_mtl_req_date => l_material_details (l_row_count).material_requirement_date

Line 2264: IF gme_common_pvt.g_ingr_sub_date = 2 THEN

2260: -- Pass the ingredient substitution date rather than the material requirement date.
2261: -- At this point, steps table is not updated. Hence need to have similar logic here too
2262: -- as in gme_api_grp.get_ingr_sub_date.
2263:
2264: IF gme_common_pvt.g_ingr_sub_date = 2 THEN
2265: l_ingred_req_date := l_material_details (l_row_count).material_requirement_date;
2266: ELSIF gme_common_pvt.g_ingr_sub_date = 1 THEN
2267: l_ingred_req_date := NVL(p_batch_header_rec.plan_start_date, x_batch_header_rec.plan_start_date);
2268: ELSIF gme_common_pvt.g_ingr_sub_date = 3 THEN

Line 2266: ELSIF gme_common_pvt.g_ingr_sub_date = 1 THEN

2262: -- as in gme_api_grp.get_ingr_sub_date.
2263:
2264: IF gme_common_pvt.g_ingr_sub_date = 2 THEN
2265: l_ingred_req_date := l_material_details (l_row_count).material_requirement_date;
2266: ELSIF gme_common_pvt.g_ingr_sub_date = 1 THEN
2267: l_ingred_req_date := NVL(p_batch_header_rec.plan_start_date, x_batch_header_rec.plan_start_date);
2268: ELSIF gme_common_pvt.g_ingr_sub_date = 3 THEN
2269: l_ingred_req_date := NVL(p_batch_header_rec.plan_cmplt_date, x_batch_header_rec.plan_cmplt_date);
2270: END IF;

Line 2268: ELSIF gme_common_pvt.g_ingr_sub_date = 3 THEN

2264: IF gme_common_pvt.g_ingr_sub_date = 2 THEN
2265: l_ingred_req_date := l_material_details (l_row_count).material_requirement_date;
2266: ELSIF gme_common_pvt.g_ingr_sub_date = 1 THEN
2267: l_ingred_req_date := NVL(p_batch_header_rec.plan_start_date, x_batch_header_rec.plan_start_date);
2268: ELSIF gme_common_pvt.g_ingr_sub_date = 3 THEN
2269: l_ingred_req_date := NVL(p_batch_header_rec.plan_cmplt_date, x_batch_header_rec.plan_cmplt_date);
2270: END IF;
2271:
2272: IF g_debug <= gme_debug.g_log_statement THEN

Line 2443: ,last_updated_by = gme_common_pvt.g_user_ident

2439: END IF;
2440: UPDATE gme_batch_header
2441: SET due_date =
2442: x_batch_header_rec.plan_cmplt_date
2443: ,last_updated_by = gme_common_pvt.g_user_ident
2444: ,last_update_date = gme_common_pvt.g_timestamp
2445: ,last_update_login = gme_common_pvt.g_login_id
2446: WHERE batch_id = x_batch_header_rec.batch_id;
2447:

Line 2444: ,last_update_date = gme_common_pvt.g_timestamp

2440: UPDATE gme_batch_header
2441: SET due_date =
2442: x_batch_header_rec.plan_cmplt_date
2443: ,last_updated_by = gme_common_pvt.g_user_ident
2444: ,last_update_date = gme_common_pvt.g_timestamp
2445: ,last_update_login = gme_common_pvt.g_login_id
2446: WHERE batch_id = x_batch_header_rec.batch_id;
2447:
2448: END IF; /* ASQC */

Line 2445: ,last_update_login = gme_common_pvt.g_login_id

2441: SET due_date =
2442: x_batch_header_rec.plan_cmplt_date
2443: ,last_updated_by = gme_common_pvt.g_user_ident
2444: ,last_update_date = gme_common_pvt.g_timestamp
2445: ,last_update_login = gme_common_pvt.g_login_id
2446: WHERE batch_id = x_batch_header_rec.batch_id;
2447:
2448: END IF; /* ASQC */
2449: END IF; /* Update inventory*/

Line 2530: IF (NOT gme_common_pvt.check_validity_rule_dates

2526: gme_debug.put_line ('Checking dates against validity rule');
2527: END IF;
2528:
2529: IF p_creation_mode <> 'LCF' THEN
2530: IF (NOT gme_common_pvt.check_validity_rule_dates
2531: (l_recipe_validity_rule.recipe_validity_rule_id
2532: ,x_batch_header_rec.plan_start_date
2533: ,x_batch_header_rec.plan_cmplt_date) ) THEN
2534: x_return_status := fnd_api.g_ret_sts_error;

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

2547: WHERE wip_entity_id = x_batch_header_rec.batch_id;
2548:
2549: -- Rajesh Patangya Bug # 6752637
2550: /* Now its time to calculate the MTQ for steps based on the product */
2551: IF gme_common_pvt.routings.COUNT <> 0 THEN
2552: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
2553: gme_debug.put_line ( g_pkg_name
2554: || '.'
2555: || l_api_name

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

2626: -- for shortage checking only. Unfortunately it stopped all the other logic for phantom batches.
2627: -- Now invisible move orders and high level reservations will get created for phantom batches.
2628: IF x_batch_header_rec.batch_type = 0 AND NVL (x_batch_header_rec.update_inventory_ind, 'Y') = 'Y' THEN
2629: /* Check inventory shortages */
2630: IF (gme_common_pvt.g_check_shortages_ind = 1 AND g_no_phant_short_check = 0) THEN
2631: IF g_debug <= gme_debug.g_log_statement THEN
2632: gme_debug.put_line ( g_pkg_name || '.'|| l_api_name|| ' Calling shortages ');
2633: END IF;
2634: gme_common_pvt.get_batch_shortages

Line 2634: gme_common_pvt.get_batch_shortages

2630: IF (gme_common_pvt.g_check_shortages_ind = 1 AND g_no_phant_short_check = 0) THEN
2631: IF g_debug <= gme_debug.g_log_statement THEN
2632: gme_debug.put_line ( g_pkg_name || '.'|| l_api_name|| ' Calling shortages ');
2633: END IF;
2634: gme_common_pvt.get_batch_shortages
2635: (p_organization_id => x_batch_header_rec.organization_id
2636: ,p_batch_id => x_batch_header_rec.batch_id
2637: ,p_invoke_mode => 'O'
2638: ,p_tree_mode => gme_common_pvt.g_tree_reservation_mode

Line 2638: ,p_tree_mode => gme_common_pvt.g_tree_reservation_mode

2634: gme_common_pvt.get_batch_shortages
2635: (p_organization_id => x_batch_header_rec.organization_id
2636: ,p_batch_id => x_batch_header_rec.batch_id
2637: ,p_invoke_mode => 'O'
2638: ,p_tree_mode => gme_common_pvt.g_tree_reservation_mode
2639: ,x_return_status => l_return_status
2640: ,x_exception_tbl => x_exception_material_tbl);
2641: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2642: RAISE inventory_shortage;

Line 2655: x_return_status := gme_common_pvt.g_inv_short_err;

2651: END LOOP;
2652: END IF;
2653: */
2654: IF (x_exception_material_tbl.COUNT > 0) THEN
2655: x_return_status := gme_common_pvt.g_inv_short_err;
2656: END IF;
2657: END IF;
2658:
2659: /* Create invisible move order */

Line 2666: ,p_move_order_type => gme_common_pvt.g_invis_move_order_type

2662: END IF;
2663:
2664: gme_move_orders_pvt.create_move_order_hdr
2665: (p_organization_id => x_batch_header_rec.organization_id
2666: ,p_move_order_type => gme_common_pvt.g_invis_move_order_type
2667: ,x_move_order_header_id => x_batch_header_rec.move_order_header_id
2668: ,x_return_status => l_return_status);
2669:
2670: IF g_debug <= gme_debug.g_log_statement THEN

Line 2684: ,p_move_order_type => gme_common_pvt.g_invis_move_order_type

2680:
2681: l_in_material_details := l_material_details;
2682: gme_move_orders_pvt.create_move_order_lines
2683: (p_move_order_header_id => x_batch_header_rec.move_order_header_id
2684: ,p_move_order_type => gme_common_pvt.g_invis_move_order_type
2685: ,p_material_details_tbl => l_in_material_details
2686: ,x_material_details_tbl => l_material_details
2687: ,x_trolin_tbl => l_trolin_tbl
2688: ,x_return_status => l_return_status);

Line 2703: ,last_updated_by = gme_common_pvt.g_user_ident

2699: /* Update batch header with move_order_header_id */
2700: UPDATE gme_batch_header
2701: SET move_order_header_id = x_batch_header_rec.move_order_header_id
2702: -- Bug 13256866
2703: ,last_updated_by = gme_common_pvt.g_user_ident
2704: ,last_update_date = gme_common_pvt.g_timestamp
2705: ,last_update_login = gme_common_pvt.g_login_id
2706: WHERE batch_id = x_batch_header_rec.batch_id;
2707:

Line 2704: ,last_update_date = gme_common_pvt.g_timestamp

2700: UPDATE gme_batch_header
2701: SET move_order_header_id = x_batch_header_rec.move_order_header_id
2702: -- Bug 13256866
2703: ,last_updated_by = gme_common_pvt.g_user_ident
2704: ,last_update_date = gme_common_pvt.g_timestamp
2705: ,last_update_login = gme_common_pvt.g_login_id
2706: WHERE batch_id = x_batch_header_rec.batch_id;
2707:
2708: /* Update material details table we have computed material requirement date and move_order_line_id */

Line 2705: ,last_update_login = gme_common_pvt.g_login_id

2701: SET move_order_header_id = x_batch_header_rec.move_order_header_id
2702: -- Bug 13256866
2703: ,last_updated_by = gme_common_pvt.g_user_ident
2704: ,last_update_date = gme_common_pvt.g_timestamp
2705: ,last_update_login = gme_common_pvt.g_login_id
2706: WHERE batch_id = x_batch_header_rec.batch_id;
2707:
2708: /* Update material details table we have computed material requirement date and move_order_line_id */
2709: FOR i IN 1 .. l_material_details.COUNT LOOP

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

2719: RAISE material_dtl_fetch_failure;
2720: END IF;
2721:
2722: /* Create High Level Reservations */
2723: IF (gme_common_pvt.g_create_high_level_resv_ind = 1) THEN
2724: IF g_debug <= gme_debug.g_log_statement THEN
2725: gme_debug.put_line ( g_pkg_name|| '.'|| l_api_name|| ' Creating reservations for batch id '|| x_batch_header_rec.batch_id);
2726: END IF;
2727:

Line 2730: ,p_timefence => gme_common_pvt.g_reservation_timefence

2726: END IF;
2727:
2728: gme_reservations_pvt.create_batch_reservations
2729: (p_batch_id => x_batch_header_rec.batch_id
2730: ,p_timefence => gme_common_pvt.g_reservation_timefence
2731: ,x_return_status => l_return_status);
2732:
2733: IF g_debug <= gme_debug.g_log_statement THEN
2734: gme_debug.put_line ( g_pkg_name

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

2739: END IF;
2740: END IF;
2741:
2742: /* Create Move Order */
2743: IF (gme_common_pvt.g_create_move_orders_ind = 1) THEN
2744: IF g_debug <= gme_debug.g_log_statement THEN
2745: gme_debug.put_line ( g_pkg_name
2746: || '.'
2747: || l_api_name

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

2785: END IF;
2786: END IF ;
2787: /*Bug#7493614 moved the workflow event call to the end of the batch
2788: create procedure */
2789: wf_event.RAISE (p_event_name => gme_common_pvt.G_BATCH_CREATED
2790: ,p_event_key => x_batch_header_rec.batch_id);
2791: IF g_debug <= gme_debug.g_log_procedure THEN
2792: gme_debug.put_line ('Exiting api ' || g_pkg_name || '.' || l_api_name);
2793: END IF;

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

2793: END IF;
2794: EXCEPTION
2795: WHEN doc_num_is_not_passed THEN
2796: x_return_status := fnd_api.g_ret_sts_error;
2797: gme_common_pvt.log_message ('GME_DOC_NUM_NOT_PASSED');
2798: WHEN gme_duplicate_batch THEN
2799: x_return_status := fnd_api.g_ret_sts_error;
2800: --FPBug#4898641
2801: IF x_batch_header_rec.batch_type = 0 THEN

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

2798: WHEN gme_duplicate_batch THEN
2799: x_return_status := fnd_api.g_ret_sts_error;
2800: --FPBug#4898641
2801: IF x_batch_header_rec.batch_type = 0 THEN
2802: gme_common_pvt.log_message ('GME_DUP_BATCH');
2803: ELSE
2804: gme_common_pvt.log_message ('GME_DUP_FPO');
2805: END IF;
2806: WHEN steps_creation_failure THEN

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

2800: --FPBug#4898641
2801: IF x_batch_header_rec.batch_type = 0 THEN
2802: gme_common_pvt.log_message ('GME_DUP_BATCH');
2803: ELSE
2804: gme_common_pvt.log_message ('GME_DUP_FPO');
2805: END IF;
2806: WHEN steps_creation_failure THEN
2807: NULL;
2808: WHEN error_create_phantom OR invalid_header_values OR invalid_recipe THEN

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

2820: IF (g_debug = gme_debug.g_log_statement) THEN
2821: gme_debug.put_line ('Contiguity period ... not found');
2822: END IF;
2823:
2824: gme_common_pvt.log_message ('GME_NON_CONTIGUOUS_TIME');
2825: x_return_status := 'C';
2826: WHEN conversion_failure THEN
2827: IF l_item_no IS NULL THEN
2828: OPEN cur_item_no (l_item_id, x_batch_header_rec.organization_id);

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

2843: IF (g_debug = gme_debug.g_log_statement) THEN
2844: gme_debug.put_line ('Failed to apply FPL');
2845: END IF;
2846: WHEN create_by_product_failure THEN
2847: gme_common_pvt.log_message ('GME_API_CREATE_BY_PROD_FAIL');
2848: x_return_status := fnd_api.g_ret_sts_error;
2849:
2850: IF (g_debug = gme_debug.g_log_statement) THEN
2851: gme_debug.put_line ('GME_API_CREATE_BY_PROD_FAIL');

Line 2854: gme_common_pvt.log_message ('GME_INTEGER_MULTIPLE_SCALE_ERR');

2850: IF (g_debug = gme_debug.g_log_statement) THEN
2851: gme_debug.put_line ('GME_API_CREATE_BY_PROD_FAIL');
2852: END IF;
2853: WHEN error_in_integer_scale THEN -- 10624995
2854: gme_common_pvt.log_message ('GME_INTEGER_MULTIPLE_SCALE_ERR');
2855: x_return_status := FND_API.g_ret_sts_error;
2856:
2857: IF (g_debug = gme_debug.g_log_statement) THEN
2858: gme_debug.put_line ('Integer scaling failed for non scaled batch.. should not happen !!');