120: l_dem_mat_det_rec get_demand_mat_details%ROWTYPE;
121: l_sup_mat_det_rec get_supply_inst_details%ROWTYPE;
122: l_get_wo_det get_wo_det%ROWTYPE;
123:
124: l_rep_can_mat_req_tab AHL_PP_MATERIALS_PVT.Req_Material_Tbl_Type;
125: l_cannibalization_sr_rec AHL_UMP_NONROUTINES_PVT.NonRoutine_Rec_Type;
126: l_rep_cannibalization_sr_rec AHL_UMP_NONROUTINES_PVT.NonRoutine_Rec_Type;
127:
128: -- FOR WO - WO
456: END IF;
457: CLOSE get_wo_det;
458:
459: IF G_DEBUG = 'Y' THEN
460: AHL_DEBUG_PUB.debug(G_PKG_NAME || '.' || l_api_name || '.Before Calling AHL_PP_MATERIALS_PVT..Wokorder id:: '||l_get_wo_det.workorder_id );
461: AHL_DEBUG_PUB.debug(G_PKG_NAME || '.' || l_api_name || '.Before Calling AHL_PP_MATERIALS_PVT..Supply Item id:: '||l_sup_mat_det_rec.inventory_item_id );
462: AHL_DEBUG_PUB.debug(G_PKG_NAME || '.' || l_api_name || '.Before Calling AHL_PP_MATERIALS_PVT..Supply Org id:: '||l_dem_mat_det_rec.organization_id );
463: END IF;
464:
457: CLOSE get_wo_det;
458:
459: IF G_DEBUG = 'Y' THEN
460: AHL_DEBUG_PUB.debug(G_PKG_NAME || '.' || l_api_name || '.Before Calling AHL_PP_MATERIALS_PVT..Wokorder id:: '||l_get_wo_det.workorder_id );
461: AHL_DEBUG_PUB.debug(G_PKG_NAME || '.' || l_api_name || '.Before Calling AHL_PP_MATERIALS_PVT..Supply Item id:: '||l_sup_mat_det_rec.inventory_item_id );
462: AHL_DEBUG_PUB.debug(G_PKG_NAME || '.' || l_api_name || '.Before Calling AHL_PP_MATERIALS_PVT..Supply Org id:: '||l_dem_mat_det_rec.organization_id );
463: END IF;
464:
465: -- Get the UOM for item (in the UI Primary UOM is defaulted, considered the same)
458:
459: IF G_DEBUG = 'Y' THEN
460: AHL_DEBUG_PUB.debug(G_PKG_NAME || '.' || l_api_name || '.Before Calling AHL_PP_MATERIALS_PVT..Wokorder id:: '||l_get_wo_det.workorder_id );
461: AHL_DEBUG_PUB.debug(G_PKG_NAME || '.' || l_api_name || '.Before Calling AHL_PP_MATERIALS_PVT..Supply Item id:: '||l_sup_mat_det_rec.inventory_item_id );
462: AHL_DEBUG_PUB.debug(G_PKG_NAME || '.' || l_api_name || '.Before Calling AHL_PP_MATERIALS_PVT..Supply Org id:: '||l_dem_mat_det_rec.organization_id );
463: END IF;
464:
465: -- Get the UOM for item (in the UI Primary UOM is defaulted, considered the same)
466: OPEN get_uom(l_dem_mat_det_rec.organization_id , l_sup_mat_det_rec.inventory_item_id);
473: END IF;
474: CLOSE get_uom;
475:
476: IF G_DEBUG = 'Y' THEN
477: AHL_DEBUG_PUB.debug(G_PKG_NAME || '.' || l_api_name || '.Before Calling AHL_PP_MATERIALS_PVT..Primary UOM code::'||l_primary_uom_code );
478: END IF;
479:
480: -- Map the Input parameters
481: l_rep_can_mat_req_tab(1).operation_flag := 'C';
493: l_rep_can_mat_req_tab(1).requested_quantity := 1;
494: l_rep_can_mat_req_tab(1).uom_code := l_primary_uom_code;
495:
496: IF G_DEBUG = 'Y' THEN
497: AHL_DEBUG_PUB.debug(G_PKG_NAME || '.' || l_api_name || '.Before Calling AHL_PP_MATERIALS_PVT.Process_Material_Request for Replace cannibalization' );
498: END IF;
499:
500: AHL_PP_MATERIALS_PVT.Process_Material_Request
501: (
496: IF G_DEBUG = 'Y' THEN
497: AHL_DEBUG_PUB.debug(G_PKG_NAME || '.' || l_api_name || '.Before Calling AHL_PP_MATERIALS_PVT.Process_Material_Request for Replace cannibalization' );
498: END IF;
499:
500: AHL_PP_MATERIALS_PVT.Process_Material_Request
501: (
502: p_api_version => 1.0,
503: p_init_msg_list => Fnd_Api.g_false,
504: p_commit => Fnd_Api.g_false,
510: x_msg_data => l_msg_data
511: );
512:
513: IF G_DEBUG = 'Y' THEN
514: AHL_DEBUG_PUB.debug(G_PKG_NAME || '.' || l_api_name || '.After Calling AHL_PP_MATERIALS_PVT.Process_Material_Request for Replace cannibalization' );
515: END IF;
516:
517: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
518: x_msg_count := l_msg_count;