82: x_return_status := FND_API.G_RET_STS_SUCCESS;
83:
84: /* Checking for the empty table of record */
85: IF (nvl(p_forecast_hdr_tab.count,0) = 0 ) THEN
86: PA_FORECASTITEM_PVT.print_message('count 0 ... before return ... ');
87: RAISE l_empty_tab_record;
88: END IF;
89:
90: PA_FORECASTITEM_PVT.print_message('start of the forecast inser row .... ');
86: PA_FORECASTITEM_PVT.print_message('count 0 ... before return ... ');
87: RAISE l_empty_tab_record;
88: END IF;
89:
90: PA_FORECASTITEM_PVT.print_message('start of the forecast inser row .... ');
91:
92: FOR l_j IN p_forecast_hdr_tab.FIRST .. p_forecast_hdr_tab.LAST LOOP
93: if (p_forecast_hdr_tab(l_j).error_flag = 'Y') then
94: PA_FORECASTITEM_PVT.print_message('Errors');
90: PA_FORECASTITEM_PVT.print_message('start of the forecast inser row .... ');
91:
92: FOR l_j IN p_forecast_hdr_tab.FIRST .. p_forecast_hdr_tab.LAST LOOP
93: if (p_forecast_hdr_tab(l_j).error_flag = 'Y') then
94: PA_FORECASTITEM_PVT.print_message('Errors');
95: if (p_forecast_hdr_tab(l_j).cost_rejection_code is not null) then
96: lv_rejection_code := p_forecast_hdr_tab(l_j).cost_rejection_code;
97: raise l_fi_rejected;
98: end if;
250: l_availability_flag(l_j) := p_forecast_hdr_tab(l_j).availability_flag;
251: END LOOP;
252:
253:
254: PA_FORECASTITEM_PVT.print_message('act ins ');
255: FORALL l_j IN p_forecast_hdr_tab.FIRST..p_forecast_hdr_tab.LAST
256: INSERT INTO PA_FORECAST_ITEMS
257: (
258: forecast_item_id ,
502: x_return_status := FND_API.G_RET_STS_SUCCESS;
503:
504: /* Checking for the empty table of record */
505: IF (nvl(p_forecast_hdr_tab.count,0) = 0 ) THEN
506: PA_FORECASTITEM_PVT.print_message('count 0 ... before return ... ');
507: RAISE l_empty_tab_record;
508: END IF;
509:
510: PA_FORECASTITEM_PVT.print_message('start of the forecast update row .... ');
506: PA_FORECASTITEM_PVT.print_message('count 0 ... before return ... ');
507: RAISE l_empty_tab_record;
508: END IF;
509:
510: PA_FORECASTITEM_PVT.print_message('start of the forecast update row .... ');
511:
512: FOR l_J IN p_forecast_hdr_tab.FIRST..p_forecast_hdr_tab.LAST LOOP
513: if (p_forecast_hdr_tab(l_j).error_flag = 'Y' and nvl(p_forecast_hdr_tab(l_j).delete_flag,'N') <> 'Y') then -- added second condition for bug 4254376
514: PA_FORECASTITEM_PVT.print_message('Errors');
510: PA_FORECASTITEM_PVT.print_message('start of the forecast update row .... ');
511:
512: FOR l_J IN p_forecast_hdr_tab.FIRST..p_forecast_hdr_tab.LAST LOOP
513: if (p_forecast_hdr_tab(l_j).error_flag = 'Y' and nvl(p_forecast_hdr_tab(l_j).delete_flag,'N') <> 'Y') then -- added second condition for bug 4254376
514: PA_FORECASTITEM_PVT.print_message('Errors');
515: if (p_forecast_hdr_tab(l_j).cost_rejection_code is not null) then
516: lv_rejection_code := p_forecast_hdr_tab(l_j).cost_rejection_code;
517: raise l_fi_rejected;
518: end if;
743: EXPFUNC_BURDENED_COST = null,
744: EXPFUNC_TRANSFER_PRICE = null
745: WHERE forecast_item_id = l_forecast_item_id(l_j);
746:
747: PA_FORECASTITEM_PVT.print_message('end of update row .... ');
748: PA_DEBUG.Reset_Err_Stack;
749: EXCEPTION
750: WHEN l_empty_tab_record THEN
751: NULL;
800: p_procedure_name => PA_DEBUG.G_Err_Stack);
801: RAISE;
802:
803:
804: PA_FORECASTITEM_PVT.print_message('ERROR in update row '||sqlerrm);
805: END update_rows;
806:
807: -- This procedure will update the record in pa_schedules table
808: -- Input parameters
824: x_return_status := FND_API.G_RET_STS_SUCCESS;
825:
826: /* Checking for the empty table of record */
827: IF (nvl(p_schedule_tab.count,0) = 0 ) THEN
828: PA_FORECASTITEM_PVT.print_message('count 0 ... before return ... ');
829: RAISE l_empty_tab_record;
830: END IF;
831:
832: PA_FORECASTITEM_PVT.print_message('start of the schedule inser row .... ');
828: PA_FORECASTITEM_PVT.print_message('count 0 ... before return ... ');
829: RAISE l_empty_tab_record;
830: END IF;
831:
832: PA_FORECASTITEM_PVT.print_message('start of the schedule inser row .... ');
833:
834: FOR l_j IN p_schedule_tab.FIRST .. p_schedule_tab.LAST LOOP
835: PA_FORECASTITEM_PVT.print_message('inside loop');
836: l_schedule_id(l_j) := p_schedule_tab(l_j).schedule_id;
831:
832: PA_FORECASTITEM_PVT.print_message('start of the schedule inser row .... ');
833:
834: FOR l_j IN p_schedule_tab.FIRST .. p_schedule_tab.LAST LOOP
835: PA_FORECASTITEM_PVT.print_message('inside loop');
836: l_schedule_id(l_j) := p_schedule_tab(l_j).schedule_id;
837: l_forecast_txn_version_number(l_j) := p_schedule_tab(l_j).forecast_txn_version_number ;
838:
839: END LOOP;
837: l_forecast_txn_version_number(l_j) := p_schedule_tab(l_j).forecast_txn_version_number ;
838:
839: END LOOP;
840:
841: PA_FORECASTITEM_PVT.print_message('after loop');
842: FORALL l_j IN p_schedule_tab.FIRST..p_schedule_tab.LAST
843: UPDATE PA_SCHEDULES
844: SET
845: forecast_txn_version_number = NVL(l_forecast_txn_version_number(l_j),0) + 1 ,
849: last_update_login = fnd_global.login_id
850: WHERE schedule_id = l_schedule_id(l_j)
851: AND forecast_txn_version_number = l_forecast_txn_version_number(l_j);
852:
853: PA_FORECASTITEM_PVT.print_message('after update');
854: PA_DEBUG.Reset_Err_Stack;
855: -- PA_FORECASTITEM_PVT.print_message('end of update schedule row .... ');
856: EXCEPTION
857: WHEN l_empty_tab_record THEN
851: AND forecast_txn_version_number = l_forecast_txn_version_number(l_j);
852:
853: PA_FORECASTITEM_PVT.print_message('after update');
854: PA_DEBUG.Reset_Err_Stack;
855: -- PA_FORECASTITEM_PVT.print_message('end of update schedule row .... ');
856: EXCEPTION
857: WHEN l_empty_tab_record THEN
858: NULL;
859: WHEN OTHERS THEN
864: (p_pkg_name => 'PA_FORECAST_HDR_PKG.Update_Schedule_Rows',
865: p_procedure_name => PA_DEBUG.G_Err_Stack);
866: RAISE;
867:
868: PA_FORECASTITEM_PVT.print_message('ERROR in update row '||sqlerrm);
869: END update_schedule_rows;
870:
871: PROCEDURE update_rows(p_assignment_id IN NUMBER,
872: p_forecast_amt_calc_flag IN VARCHAR2,
885:
886: EXCEPTION
887:
888: WHEN OTHERS THEN
889: PA_FORECASTITEM_PVT.print_message('Failed in update_rows api');
890: PA_FORECASTITEM_PVT.print_message('SQLCODE'||sqlcode||sqlerrm);
891:
892: x_msg_count := 1;
893: x_msg_data := sqlerrm;
886: EXCEPTION
887:
888: WHEN OTHERS THEN
889: PA_FORECASTITEM_PVT.print_message('Failed in update_rows api');
890: PA_FORECASTITEM_PVT.print_message('SQLCODE'||sqlcode||sqlerrm);
891:
892: x_msg_count := 1;
893: x_msg_data := sqlerrm;
894: FND_MSG_PUB.add_exc_msg
910: x_msg_data := l_new_msg_data;
911: -- added for bug 4537865
912: End If;
913:
914: PA_FORECASTITEM_PVT.Print_message(x_msg_data);
915:
916: RAISE;
917:
918: END update_rows;