[Home] [Help]
334: -- get an org_id from interface table
335: OPEN c_org;
336: FETCH c_org into l_org_id, l_org_code;
337: if c_org%NOTFOUND then
338: fnd_file.put_line(fnd_file.log, 'get_one_org_id: No entry is found in interface table');
339: return -1;
340: end if;
341: CLOSE c_org;
342:
351: exception
352: when others then
353: fnd_message.set_name('WSM','WSM_INVALID_FIELD');
354: fnd_message.set_token('FLD_NAME', 'Organization Code');
355: fnd_file.put_line(fnd_file.log, 'get_one_org_id: ' || fnd_message.get);
356: return -1;
357: end;
358: end if;
359:
373: exception
374: when others then
375: fnd_message.set_name('WSM','WSM_INVALID_FIELD');
376: fnd_message.set_token('FLD_NAME', 'Organization ID');
377: fnd_file.put_line(fnd_file.log, 'get_one_org_id: ' || fnd_message.get);
378: return -1;
379: end;
380:
381: return l_org_id;
407: END IF;
408:
409: if(l_profile = 2) then
410: g_create_job_copy := 'N';
411: fnd_file.put_line(fnd_file.log,
412: '++++++ Start calling WSMPLBJI.process_lbji_rows_1159 ++++++');
413: process_lbji_rows_1159 (retcode, errbuf, p_group_id);
414: fnd_file.put_line(fnd_file.log,
415: '++++++ End calling WSMPLBJI.process_lbji_rows_1159 ++++++');
410: g_create_job_copy := 'N';
411: fnd_file.put_line(fnd_file.log,
412: '++++++ Start calling WSMPLBJI.process_lbji_rows_1159 ++++++');
413: process_lbji_rows_1159 (retcode, errbuf, p_group_id);
414: fnd_file.put_line(fnd_file.log,
415: '++++++ End calling WSMPLBJI.process_lbji_rows_1159 ++++++');
416: else
417: g_create_job_copy := 'Y';
418: fnd_file.put_line(fnd_file.log,
414: fnd_file.put_line(fnd_file.log,
415: '++++++ End calling WSMPLBJI.process_lbji_rows_1159 ++++++');
416: else
417: g_create_job_copy := 'Y';
418: fnd_file.put_line(fnd_file.log,
419: '++++++ Start calling WSM_LBJ_INTERFACE_PVT.process_lbji_rows ++++++');
420: WSM_LBJ_INTERFACE_PVT.process_lbji_rows(retcode, errbuf, p_group_id);
421: fnd_file.put_line(fnd_file.log,
422: '++++++ End calling WSM_LBJ_INTERFACE_PVT.process_lbji_rows ++++++');
417: g_create_job_copy := 'Y';
418: fnd_file.put_line(fnd_file.log,
419: '++++++ Start calling WSM_LBJ_INTERFACE_PVT.process_lbji_rows ++++++');
420: WSM_LBJ_INTERFACE_PVT.process_lbji_rows(retcode, errbuf, p_group_id);
421: fnd_file.put_line(fnd_file.log,
422: '++++++ End calling WSM_LBJ_INTERFACE_PVT.process_lbji_rows ++++++');
423: end if;
424:
425: END process_interface_rows ;
456: END IF;
457:
458: if(l_profile = 2) then
459: g_create_job_copy := 'N';
460: fnd_file.put_line(fnd_file.log, '++++++ Calling WSMPLBJI.launch_worker_1159 ++++++');
461: WSMPLBJI.launch_worker_1159(retcode, errbuf, l_group_id, alotted_rows);
462: else
463: g_create_job_copy := 'Y';
464: fnd_file.put_line(fnd_file.log, '++++++ Calling WSM_LBJ_INTERFACE_PVT.launch_worker ++++++');
460: fnd_file.put_line(fnd_file.log, '++++++ Calling WSMPLBJI.launch_worker_1159 ++++++');
461: WSMPLBJI.launch_worker_1159(retcode, errbuf, l_group_id, alotted_rows);
462: else
463: g_create_job_copy := 'Y';
464: fnd_file.put_line(fnd_file.log, '++++++ Calling WSM_LBJ_INTERFACE_PVT.launch_worker ++++++');
465: WSM_LBJ_INTERFACE_PVT.launch_worker(retcode, errbuf, l_group_id, alotted_rows);
466: end if;
467:
468: END launch_worker;
838: where wo.wip_entity_id = p_wip_entity_id;
839:
840:
841: if (lbji_debug = 'Y') then
842: fnd_file.put_line(fnd_file.log,'update wo('||l_stmt_num||'): '|| SQL%ROWCOUNT);
843: end if;
844:
845: update WIP_OPERATIONS
846: --Bug 5207481:Actual quantity changes for bonus:costed_quantity_completed
852: where wip_entity_id = p_wip_entity_id
853: and operation_seq_num < abb_op_seq_num;
854:
855: if (lbji_debug = 'Y') then
856: fnd_file.put_line(fnd_file.log,'update quantity_cmplted in wo('||l_stmt_num||'): '|| SQL%ROWCOUNT);
857: end if;
858:
859: --Bug 5207481:Actual quantity changes for bonus-Start of changes
860: -- CJ: Start changes for Component Shrinkage project --
884: -- CJ: End changes for Component Shrinkage project --
885: --Bug 5207481:Actual quantity changes for bonus-End of changes
886:
887: if (lbji_debug = 'Y') then
888: fnd_file.put_line(fnd_file.log,'update quantity_issued in wro('||l_stmt_num||'): '|| SQL%ROWCOUNT);
889: end if;
890:
891: Exception
892:
1155: return;
1156: End;
1157:
1158: if lbji_debug = 'Y' then
1159: fnd_file.put_line(fnd_file.log, 'Inserted '||SQL%ROWCOUNT||' rows into wdj');
1160: end if;
1161:
1162: l_stmt_num := 130;
1163: begin
1207: return;
1208: end;
1209:
1210: if lbji_debug = 'Y' then
1211: fnd_file.put_line(fnd_file.log, 'Inserted '||SQL%ROWCOUNT||' rows into we');
1212: end if;
1213:
1214:
1215: l_stmt_num := 135;
1899: end if;
1900: --endfix 20026218
1901:
1902: if lbji_debug = 'Y' then
1903: fnd_file.put_line(fnd_file.log, 'Inserted '||SQL%ROWCOUNT||' rows into wo');
1904: end if;
1905:
1906: l_stat_num := 60;
1907: -- The below insert is used for Costing Changes (OP Yield)
1943: FROM WIP_OPERATION_YIELDS WOY
1944: WHERE WOY.WIP_ENTITY_ID = p_wip_entity_id);
1945:
1946: if lbji_debug = 'Y' then
1947: fnd_file.put_line(fnd_file.log, 'Inserted '||SQL%ROWCOUNT||' rows into woy');
1948: end if;
1949:
1950:
1951: l_stat_num := 80;
2010: from Wip_operation_resources WOR
2011: where WOR.wip_entity_id = p_wip_entity_id);
2012:
2013: if lbji_debug = 'Y' then
2014: fnd_file.put_line(fnd_file.log, 'Inserted '||SQL%ROWCOUNT||' rows into wor');
2015: end if;
2016:
2017: l_stat_num := 90;
2018: if p_job_seq_num = l_op_seq_incr then -- if this is the first operation
2050: if l_error_code <> 0 then
2051: p_error_msg := l_error_msg;
2052: p_error_code := -1;
2053: if (lbji_debug = 'Y') then
2054: fnd_file.put_line(fnd_file.log,p_error_msg);
2055: end if;
2056: return;
2057: end if;
2058:
2056: return;
2057: end if;
2058:
2059: if lbji_debug = 'Y' then
2060: fnd_file.put_line(fnd_file.log, 'Inserted rows into wro');
2061: end if;
2062:
2063: EXCEPTION
2064: WHEN NO_DATA_FOUND THEN
2064: WHEN NO_DATA_FOUND THEN
2065: p_error_msg := 'WSMPLBJI.insert_procedure('||l_stat_num||'): No Data Found';
2066: p_error_code := -1;
2067: if (lbji_debug = 'Y') then
2068: fnd_file.put_line(fnd_file.log,p_error_msg);
2069: end if;
2070:
2071: WHEN e_proc_error THEN
2072: p_error_msg := 'WSMPLBJI.insert_procedure('||l_stat_num||'): '||p_error_msg;
2071: WHEN e_proc_error THEN
2072: p_error_msg := 'WSMPLBJI.insert_procedure('||l_stat_num||'): '||p_error_msg;
2073: p_error_code := -1;
2074: if (lbji_debug = 'Y') then
2075: fnd_file.put_line(fnd_file.log,p_error_msg);
2076: end if;
2077:
2078: WHEN no_dept_error THEN
2079: fnd_message.set_name('WSM', 'WSM_NO_SCRAP_ACC');
2084: when others then
2085: p_error_code := SQLCODE;
2086: p_error_msg := 'WSMPLBJI.insert_procedure('||l_stat_num||')'|| substr(SQLERRM,1,200);
2087: if (lbji_debug = 'Y') then
2088: fnd_file.put_line(fnd_file.log,p_error_msg);
2089: end if;
2090:
2091: END insert_procedure;
2092:
2389: -- ED: bugfix 3299811
2390:
2391:
2392: if lbji_debug = 'Y' then
2393: fnd_file.put_line(fnd_file.log, 'Inserted '|| l_cnt ||' rows into wip_period_balances');
2394: end if;
2395:
2396: --if SQL%NOTFOUND then -- bug 3571360
2397: if l_cnt <= 0 then -- bug 3571360
2438: fnd_message.set_name('WSM','WSM_INVALID_FIELD');
2439: fnd_message.set_token('FLD_NAME', p_fld);
2440: x_err_msg := fnd_message.get;
2441: v_wlji_err_msg(v_index) := x_err_msg;
2442: fnd_file.put_line(fnd_file.log, 'stmt_num: '|| stmt_number||' '||x_err_msg||' '||aux_string);
2443: fnd_file.new_line(fnd_file.log, 3);
2444:
2445:
2446: END process_invalid_field;
2439: fnd_message.set_token('FLD_NAME', p_fld);
2440: x_err_msg := fnd_message.get;
2441: v_wlji_err_msg(v_index) := x_err_msg;
2442: fnd_file.put_line(fnd_file.log, 'stmt_num: '|| stmt_number||' '||x_err_msg||' '||aux_string);
2443: fnd_file.new_line(fnd_file.log, 3);
2444:
2445:
2446: END process_invalid_field;
2447:
2471: v_wlji_err_code(v_index) := -1;
2472: fnd_message.set_name(p_product, p_message_name);
2473: x_err_msg := fnd_message.get;
2474: v_wlji_err_msg(v_index) := x_err_msg;
2475: fnd_file.put_line(fnd_file.log, 'stmt_num: '|| stmt_number||' '||x_err_msg);
2476: fnd_file.new_line(fnd_file.log, 3);
2477:
2478:
2479: END process_errorred_field;
2472: fnd_message.set_name(p_product, p_message_name);
2473: x_err_msg := fnd_message.get;
2474: v_wlji_err_msg(v_index) := x_err_msg;
2475: fnd_file.put_line(fnd_file.log, 'stmt_num: '|| stmt_number||' '||x_err_msg);
2476: fnd_file.new_line(fnd_file.log, 3);
2477:
2478:
2479: END process_errorred_field;
2480:
2494: BEGIN
2495: v_wlji_process_status(v_index) := 3; --ERROR
2496: v_wlji_err_code(v_index) := p_err_code;
2497: v_wlji_err_msg(v_index) := substr(p_err_msg,1,2000);
2498: fnd_file.put_line(fnd_file.log, 'stmt_num: ' || stmt_number||' '||p_err_msg);
2499: fnd_file.new_line(fnd_file.log, 3);
2500:
2501: END handle_error;
2502:
2495: v_wlji_process_status(v_index) := 3; --ERROR
2496: v_wlji_err_code(v_index) := p_err_code;
2497: v_wlji_err_msg(v_index) := substr(p_err_msg,1,2000);
2498: fnd_file.put_line(fnd_file.log, 'stmt_num: ' || stmt_number||' '||p_err_msg);
2499: fnd_file.new_line(fnd_file.log, 3);
2500:
2501: END handle_error;
2502:
2503:
2518: dummy_err_code number;
2519: dummy_err_msg varchar2(2000);
2520:
2521: BEGIN
2522: fnd_file.new_line(fnd_file.log, 1);
2523: fnd_file.put_line(fnd_file.log, '*** WARNING MESSAGE BEGIN ***');
2524: fnd_file.put_line(fnd_file.log, p_err_msg);
2525: fnd_file.put_line(fnd_file.log, '*** WARNING MESSAGE END ***');
2526: fnd_file.new_line(fnd_file.log, 1);
2519: dummy_err_msg varchar2(2000);
2520:
2521: BEGIN
2522: fnd_file.new_line(fnd_file.log, 1);
2523: fnd_file.put_line(fnd_file.log, '*** WARNING MESSAGE BEGIN ***');
2524: fnd_file.put_line(fnd_file.log, p_err_msg);
2525: fnd_file.put_line(fnd_file.log, '*** WARNING MESSAGE END ***');
2526: fnd_file.new_line(fnd_file.log, 1);
2527: wsmputil.WRITE_TO_WIE (
2520:
2521: BEGIN
2522: fnd_file.new_line(fnd_file.log, 1);
2523: fnd_file.put_line(fnd_file.log, '*** WARNING MESSAGE BEGIN ***');
2524: fnd_file.put_line(fnd_file.log, p_err_msg);
2525: fnd_file.put_line(fnd_file.log, '*** WARNING MESSAGE END ***');
2526: fnd_file.new_line(fnd_file.log, 1);
2527: wsmputil.WRITE_TO_WIE (
2528: p_header_id,
2521: BEGIN
2522: fnd_file.new_line(fnd_file.log, 1);
2523: fnd_file.put_line(fnd_file.log, '*** WARNING MESSAGE BEGIN ***');
2524: fnd_file.put_line(fnd_file.log, p_err_msg);
2525: fnd_file.put_line(fnd_file.log, '*** WARNING MESSAGE END ***');
2526: fnd_file.new_line(fnd_file.log, 1);
2527: wsmputil.WRITE_TO_WIE (
2528: p_header_id,
2529: substr(p_err_msg,1,2000),
2522: fnd_file.new_line(fnd_file.log, 1);
2523: fnd_file.put_line(fnd_file.log, '*** WARNING MESSAGE BEGIN ***');
2524: fnd_file.put_line(fnd_file.log, p_err_msg);
2525: fnd_file.put_line(fnd_file.log, '*** WARNING MESSAGE END ***');
2526: fnd_file.new_line(fnd_file.log, 1);
2527: wsmputil.WRITE_TO_WIE (
2528: p_header_id,
2529: substr(p_err_msg,1,2000),
2530: p_request_id,
2641: l_resp_appl_id NUMBER;
2642:
2643: BEGIN
2644:
2645: fnd_file.put_line(fnd_file.log, 'Processing Interface rows..');
2646:
2647: retcode := 0; -- bugfix 2845397: set the code to 0 (success)
2648:
2649: l_user_id := fnd_global.USER_ID;
2671: if no_rows_per_worker < batch_size then
2672: no_rows_per_worker := batch_size;
2673: end if;
2674:
2675: fnd_file.put_line(fnd_file.log, 'Total Pending Rows = '||total_no_rows);
2676: fnd_file.put_line(fnd_file.log, 'Number of Workers = '||no_of_workers);
2677: fnd_file.put_line(fnd_file.log, 'Batch Size = '||batch_size);
2678: fnd_file.put_line(fnd_file.log, 'Number of Rows per worker = '||no_rows_per_worker);
2679:
2672: no_rows_per_worker := batch_size;
2673: end if;
2674:
2675: fnd_file.put_line(fnd_file.log, 'Total Pending Rows = '||total_no_rows);
2676: fnd_file.put_line(fnd_file.log, 'Number of Workers = '||no_of_workers);
2677: fnd_file.put_line(fnd_file.log, 'Batch Size = '||batch_size);
2678: fnd_file.put_line(fnd_file.log, 'Number of Rows per worker = '||no_rows_per_worker);
2679:
2680: select wsm_lot_job_interface_s.NEXTVAL
2673: end if;
2674:
2675: fnd_file.put_line(fnd_file.log, 'Total Pending Rows = '||total_no_rows);
2676: fnd_file.put_line(fnd_file.log, 'Number of Workers = '||no_of_workers);
2677: fnd_file.put_line(fnd_file.log, 'Batch Size = '||batch_size);
2678: fnd_file.put_line(fnd_file.log, 'Number of Rows per worker = '||no_rows_per_worker);
2679:
2680: select wsm_lot_job_interface_s.NEXTVAL
2681: into l_group_id
2674:
2675: fnd_file.put_line(fnd_file.log, 'Total Pending Rows = '||total_no_rows);
2676: fnd_file.put_line(fnd_file.log, 'Number of Workers = '||no_of_workers);
2677: fnd_file.put_line(fnd_file.log, 'Batch Size = '||batch_size);
2678: fnd_file.put_line(fnd_file.log, 'Number of Rows per worker = '||no_rows_per_worker);
2679:
2680: select wsm_lot_job_interface_s.NEXTVAL
2681: into l_group_id
2682: from dual;
2711: else
2712: commit;
2713: end if;
2714:
2715: fnd_file.put_line(fnd_file.log, 'Request_id: '||l_reqid||' submitted');
2716:
2717: if c_pir%notfound then exit; end if;
2718:
2719: if not c_pir%notfound then
2758: else
2759: commit;
2760: end if;
2761:
2762: fnd_file.put_line(fnd_file.log, 'Request_id: '||l_reqid||' submitted');
2763:
2764: else -- total_no_rows <= 0
2765: fnd_file.put_line(fnd_file.log, 'No Rows found in interface table');
2766: end if;
2761:
2762: fnd_file.put_line(fnd_file.log, 'Request_id: '||l_reqid||' submitted');
2763:
2764: else -- total_no_rows <= 0
2765: fnd_file.put_line(fnd_file.log, 'No Rows found in interface table');
2766: end if;
2767:
2768: end if; -- group_id
2769:
2772:
2773: when others then
2774: retcode := 1;
2775: errbuf := 'WSMLBJIB.process_lbji_rows_1159: stmt num= '||l_stmt_num||' '||SUBSTR(SQLERRM, 1,240);
2776: fnd_file.put_line(fnd_file.log,errbuf);
2777: conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('ERROR',errbuf);
2778:
2779: END process_lbji_rows_1159 ;
2780:
3107: l_stmt_num := 3;
3108: WSMPLCVA.load_class_code;
3109:
3110: if lbji_debug = 'Y' then
3111: fnd_file.put_line(fnd_file.log, 'loading org/subinv/class-code values into memory (once per worker).. Success.');
3112: end if;
3113:
3114: exception
3115: when others then
3234: v_wlji_date_released --bugfix 2697295
3235: limit batch_size;
3236:
3237: if lbji_debug = 'Y' then
3238: fnd_file.put_line(fnd_file.log, 'no of rows loaded for the current batch: '||c_wlji_1%rowcount);
3239: end if;
3240:
3241: if c_wlji_1%rowcount - prev_rowcount <> 0 then
3242:
3263: update wsm_lot_job_interface
3264: set group_id = batch_group_id
3265: where header_id = v_wlji_header_id(indx);
3266:
3267: fnd_file.put_line(fnd_file.output, ' ---- Lot Based Job Creation ---- ');
3268: fnd_file.put_line(fnd_file.output, ' ');
3269: fnd_file.put_line(fnd_file.output, ' ');
3270:
3271: -- ==============================================================================================
3264: set group_id = batch_group_id
3265: where header_id = v_wlji_header_id(indx);
3266:
3267: fnd_file.put_line(fnd_file.output, ' ---- Lot Based Job Creation ---- ');
3268: fnd_file.put_line(fnd_file.output, ' ');
3269: fnd_file.put_line(fnd_file.output, ' ');
3270:
3271: -- ==============================================================================================
3272: -- processing of data begins here
3265: where header_id = v_wlji_header_id(indx);
3266:
3267: fnd_file.put_line(fnd_file.output, ' ---- Lot Based Job Creation ---- ');
3268: fnd_file.put_line(fnd_file.output, ' ');
3269: fnd_file.put_line(fnd_file.output, ' ');
3270:
3271: -- ==============================================================================================
3272: -- processing of data begins here
3273: -- ==============================================================================================
3277: while v_index <= v_wlji_header_id.last
3278: loop -- inner loop
3279:
3280: if lbji_debug = 'Y' then
3281: fnd_file.put_line(fnd_file.log,'***************************************************************');
3282: fnd_file.put_line(fnd_file.log,'new job ... wlji header_id: '||v_wlji_header_id(v_index));
3283: fnd_file.put_line(fnd_file.log,' ... job name: '||v_wlji_job_name(v_index));
3284: fnd_file.put_line(fnd_file.log,'***************************************************************');
3285: end if;
3278: loop -- inner loop
3279:
3280: if lbji_debug = 'Y' then
3281: fnd_file.put_line(fnd_file.log,'***************************************************************');
3282: fnd_file.put_line(fnd_file.log,'new job ... wlji header_id: '||v_wlji_header_id(v_index));
3283: fnd_file.put_line(fnd_file.log,' ... job name: '||v_wlji_job_name(v_index));
3284: fnd_file.put_line(fnd_file.log,'***************************************************************');
3285: end if;
3286:
3279:
3280: if lbji_debug = 'Y' then
3281: fnd_file.put_line(fnd_file.log,'***************************************************************');
3282: fnd_file.put_line(fnd_file.log,'new job ... wlji header_id: '||v_wlji_header_id(v_index));
3283: fnd_file.put_line(fnd_file.log,' ... job name: '||v_wlji_job_name(v_index));
3284: fnd_file.put_line(fnd_file.log,'***************************************************************');
3285: end if;
3286:
3287: SAVEPOINT row_skip;
3280: if lbji_debug = 'Y' then
3281: fnd_file.put_line(fnd_file.log,'***************************************************************');
3282: fnd_file.put_line(fnd_file.log,'new job ... wlji header_id: '||v_wlji_header_id(v_index));
3283: fnd_file.put_line(fnd_file.log,' ... job name: '||v_wlji_job_name(v_index));
3284: fnd_file.put_line(fnd_file.log,'***************************************************************');
3285: end if;
3286:
3287: SAVEPOINT row_skip;
3288:
3429: if v_wlji_load_type(v_index) = 5 and v_wlji_mode_flag(v_index) = 2
3430: and v_load_wsli = true then
3431:
3432: if (lbji_debug = 'Y') then
3433: fnd_file.put_line(fnd_file.log,'loading wsli for batch group id: '||batch_group_id||'..');
3434: end if;
3435:
3436: load_wsli_data(batch_group_id);
3437: v_load_wsli := false;
3510: end if;
3511: xst := true;
3512:
3513: if lbji_debug = 'Y' then
3514: fnd_file.put_line(fnd_file.log, 'Org Id Validation..Success.');
3515: end if;
3516: -- *** validate org id end ***
3517:
3518:
3548: end if;
3549: l_no_of_records := 0;
3550:
3551: if lbji_debug = 'Y' then
3552: fnd_file.put_line(fnd_file.log, 'Checking existance of inv lots of the same name.. Success');
3553: end if;
3554:
3555: end if; -- load type 5
3556:
3592: GOTO skip_validate_constants;
3593: elsif v_wlji_job_type(v_index) = 3 then
3594: if v_wlji_mode_flag(v_index) <> 1 then
3595: if lbji_debug = 'Y' then
3596: fnd_file.put_line(fnd_file.log, 'Ignoring mode_flag, has to be 1 for non-standard jobs.');
3597: end if;
3598: end if;
3599: if v_wlji_mode_flag(v_index) is null then
3600: v_wlji_mode_flag(v_index) := 1;
3658: end if;
3659: l_aux_mesg := '';
3660:
3661: if lbji_debug = 'Y' then
3662: fnd_file.put_line(fnd_file.log, 'Validating Constants.. Success.');
3663: end if;
3664:
3665: -- *** validate constants end ***
3666:
3723: l_error_code := -1;
3724: end if;
3725:
3726: if l_error_code = 0 and l_err_msg is not null then
3727: fnd_file.new_line(fnd_file.log, 2);
3728: fnd_file.put_line(fnd_file.log,l_err_msg);
3729: fnd_file.new_line(fnd_file.log, 2);
3730: l_err_msg := '';
3731: end if;
3724: end if;
3725:
3726: if l_error_code = 0 and l_err_msg is not null then
3727: fnd_file.new_line(fnd_file.log, 2);
3728: fnd_file.put_line(fnd_file.log,l_err_msg);
3729: fnd_file.new_line(fnd_file.log, 2);
3730: l_err_msg := '';
3731: end if;
3732: end if; -- non-standard validations end
3725:
3726: if l_error_code = 0 and l_err_msg is not null then
3727: fnd_file.new_line(fnd_file.log, 2);
3728: fnd_file.put_line(fnd_file.log,l_err_msg);
3729: fnd_file.new_line(fnd_file.log, 2);
3730: l_err_msg := '';
3731: end if;
3732: end if; -- non-standard validations end
3733:
3771: end if;
3772: l_aux_mesg := '';
3773:
3774: if lbji_debug = 'Y' and v_wlji_mode_flag(v_index) = 1 then
3775: fnd_file.put_line(fnd_file.log, 'Assembly Quantity OK');
3776: end if;
3777: end if; -- job_type
3778: -- *** validate assembly quantity end ***
3779:
3856: str := '';
3857: hash_value := 0;
3858:
3859: if lbji_debug = 'Y' then
3860: fnd_file.put_line(fnd_file.log, 'Validation of Item.. Success');
3861: end if;
3862:
3863: end if; -- load type 5
3864: -- *** validate mode one item id end ***
3899: l_err_msg,
3900: v_wlji_start_quantity(v_index)); --Fixed bug # 2313574
3901:
3902: if lbji_debug = 'Y' then
3903: fnd_file.put_line(fnd_file.log, 'Getting complete date based on item lead time');
3904: end if;
3905:
3906: END IF ;
3907:
3918: l_err_msg,
3919: v_wlji_start_quantity(v_index)); --Fixed bug # 2313574
3920:
3921: if lbji_debug = 'Y' then
3922: fnd_file.put_line(fnd_file.log, 'Getting start date based on item lead time');
3923: end if;
3924: END IF;
3925:
3926: if l_error_code <> 0 OR l_err_msg IS NOT NULL then
3936: end if;
3937: l_err_msg := '';
3938:
3939: if lbji_debug = 'Y' then
3940: fnd_file.put_line(fnd_file.log, 'Date Validation.. Success.');
3941: end if;
3942:
3943: end if; -- load type 5
3944: -- *** validate dates end ***
3973: end if;
3974: l_aux_mesg := '';
3975:
3976: if lbji_debug = 'Y' then
3977: fnd_file.put_line(fnd_file.log, 'Net Quantity Validation.. Success.');
3978: end if;
3979:
3980: end if; -- load type 5
3981: -- *** validate net quantity end ***
3998: GOTO skip_other_steps;
3999: end if;
4000:
4001: if lbji_debug = 'Y' then
4002: fnd_file.put_line(fnd_file.log, 'Co Product Supply Flag Validation.. Success.');
4003: end if;
4004:
4005: end if; -- load type 5
4006: -- *** validate coproduct-supply flag end ***
4050: GOTO skip_other_steps;
4051: end if;
4052:
4053: if lbji_debug = 'Y' then
4054: fnd_file.put_line(fnd_file.log, 'Getting Routing Sequence Id: '||routing_seq_id);
4055: end if;
4056:
4057: IF v_wlji_completion_subinventory(v_index) IS NULL AND
4058: v_wlji_completion_locator_id(v_index) IS NULL THEN
4178: end if;
4179: l_aux_mesg := '';
4180:
4181: if lbji_debug = 'Y' then
4182: fnd_file.put_line(fnd_file.log, 'Getting Bill Sequence Id: '||bom_seq_id);
4183: end if;
4184:
4185: end if; -- load type 5
4186: -- *** get bill_seq_id end ***
4235: l_aux_mesg := '';
4236: l_locator_id := 0;
4237:
4238: if lbji_debug = 'Y' then
4239: fnd_file.put_line(fnd_file.log, 'Locator Id Validation.. Success.');
4240: end if;
4241:
4242: end if; -- load type 5
4243: -- *** validate locator id end ***
4283: xst := true;
4284: end if;
4285:
4286: if lbji_debug = 'Y' then
4287: fnd_file.put_line(fnd_file.log, 'Last Updt By Validation.. Success.');
4288: end if;
4289:
4290: end if; -- load type 5
4291: -- *** validate last_updt_by end ***
4328: xst := true;
4329: end if;
4330:
4331: if lbji_debug = 'Y' then
4332: fnd_file.put_line(fnd_file.log, 'Created By Validation.. Success.');
4333: end if;
4334:
4335: end if; -- load type 5
4336: -- *** validate created_by end ***
4523: end if;
4524: l_aux_mesg := '';
4525:
4526: if lbji_debug = 'Y' then
4527: fnd_file.put_line(fnd_file.log, 'Job Name and Id Validation.. Success.');
4528: end if;
4529:
4530: l_dummy := 0;
4531: -- *** validate job name and id end ***
4605: str := '';
4606: hash_value := 0;
4607:
4608: if lbji_debug = 'Y' then
4609: fnd_file.put_line(fnd_file.log, 'Class Code Validation.. Success.');
4610: end if;
4611:
4612: end if; -- load type 5
4613: -- *** validate class code end ***
4618: if v_wlji_load_type(v_index) = 5 then
4619: v_wlji_lot_number(v_index) := v_wlji_job_name(v_index);
4620:
4621: if lbji_debug = 'Y' then
4622: fnd_file.put_line(fnd_file.log, 'Lot Number Defaulted.. Success.');
4623: end if;
4624: end if; -- load type 5
4625: -- *** default lot_number end ***
4626:
4659: GOTO skip_other_steps;
4660: end if;
4661:
4662: if lbji_debug = 'Y' then
4663: fnd_file.put_line(fnd_file.log, 'Getting Revisions.. Success.');
4664: end if;
4665:
4666: end if; -- load type 5
4667: -- *** get revisions end ***
4680: v_wlji_description(v_index) := RTRIM(v_wlji_description(v_index));
4681: end if;
4682:
4683: if lbji_debug = 'Y' then
4684: fnd_file.put_line(fnd_file.log, 'Default Description.. Success.');
4685: end if;
4686: end if; -- load type 5
4687: -- *** default description end ***
4688:
4957: l_dummy := 0;
4958: l_err_msg := '';
4959:
4960: if lbji_debug = 'Y' then
4961: fnd_file.put_line(fnd_file.log, 'Verify that the component is reqd. at the first operation of the assembly.. Success');
4962: end if;
4963:
4964: l_stmt_num := 640;
4965: -- abbKanban begin
5135: GOTO skip_other_steps;
5136: end if;
5137:
5138: if lbji_debug = 'Y' then
5139: fnd_file.put_line(fnd_file.log, 'Mode 2 Quantity Verification.. Success');
5140: end if;
5141: -- *** end validate quantity ***
5142:
5143:
5216: l_dummy := 0;
5217: l_err_msg := '';
5218:
5219: if lbji_debug = 'Y' then
5220: fnd_file.put_line(fnd_file.log, 'Verify that the starting lot is not phantom.. Success');
5221: end if;
5222: -- *** validate starting lot is not phantom end ***
5223:
5224: end if; -- mode flag 2
5263:
5264: v_wlji_date_released(v_index) := null;
5265:
5266: if lbji_debug = 'Y' then
5267: fnd_file.put_line(fnd_file.log, 'value for column DATE_RELEASED is being ignored for unreleased job');
5268: end if;
5269: elsif (v_wlji_status_type(v_index) = WIP_CONSTANTS.RELEASED ) then
5270: if (v_wlji_date_released(v_index) > sysdate ) then
5271:
5288:
5289: l_err_msg := '';
5290:
5291: if lbji_debug = 'Y' then
5292: fnd_file.put_line(fnd_file.log, 'Date_Released Validation.. First Phase Done.');
5293: end if;
5294:
5295: end if; -- load type 5
5296: -- bugfix 2697295 ends
5371: end if;
5372: l_dummy := 0;
5373:
5374: if lbji_debug = 'Y' then
5375: fnd_file.put_line(fnd_file.log, 'Schedule Group Id Verification.. Success');
5376: end if;
5377: -- *** validate schedule_group_id end ***
5378:
5379:
5422: GOTO skip_other_steps;
5423: end if;
5424:
5425: if lbji_debug = 'Y' then
5426: fnd_file.put_line(fnd_file.log, 'Build Seq. Id Verification.. Success');
5427: end if;
5428:
5429: end if; -- job type <> 3 for schedule group and build sequence.
5430: -- *** validate build_seq_id end ***
5516: v_wlji_bom_revision(v_index) := null;
5517: v_wlji_alt_bom_designator(v_index) := null;
5518: v_wlji_alt_routing_designator(v_index) := null;
5519:
5520: fnd_file.put_line(fnd_file.log, 'Ignoring any of the following fields if provided by the user for this standard job:');
5521: -- fnd_file.new_line(fnd_file.log, 1);
5522: fnd_file.put_line(fnd_file.log, 'ROUTING_REFERENCE_ID, BOM_REFERENCE_ID, ROUTING_REVISION_DATE, ROUTING_REVISION, BOM_REVISION_DATE, BOM_REVISION, ALTERNATE_BOM_DESIGNATOR, ALTERNATE_ROUTING_DESIGNATOR');
5523: end if;
5524:
5517: v_wlji_alt_bom_designator(v_index) := null;
5518: v_wlji_alt_routing_designator(v_index) := null;
5519:
5520: fnd_file.put_line(fnd_file.log, 'Ignoring any of the following fields if provided by the user for this standard job:');
5521: -- fnd_file.new_line(fnd_file.log, 1);
5522: fnd_file.put_line(fnd_file.log, 'ROUTING_REFERENCE_ID, BOM_REFERENCE_ID, ROUTING_REVISION_DATE, ROUTING_REVISION, BOM_REVISION_DATE, BOM_REVISION, ALTERNATE_BOM_DESIGNATOR, ALTERNATE_ROUTING_DESIGNATOR');
5523: end if;
5524:
5525: end if; -- job type 1
5518: v_wlji_alt_routing_designator(v_index) := null;
5519:
5520: fnd_file.put_line(fnd_file.log, 'Ignoring any of the following fields if provided by the user for this standard job:');
5521: -- fnd_file.new_line(fnd_file.log, 1);
5522: fnd_file.put_line(fnd_file.log, 'ROUTING_REFERENCE_ID, BOM_REFERENCE_ID, ROUTING_REVISION_DATE, ROUTING_REVISION, BOM_REVISION_DATE, BOM_REVISION, ALTERNATE_BOM_DESIGNATOR, ALTERNATE_ROUTING_DESIGNATOR');
5523: end if;
5524:
5525: end if; -- job type 1
5526: */ -- Bug 2762029 commenting ends
5899: GOTO skip_resched_validations;
5900: end if;
5901:
5902: elsif p_old_status_type <> 1 then
5903: fnd_file.put_line(fnd_file.log, 'Ignoring any of the following fields if provided by the user for this standard job:');
5904: fnd_file.put_line(fnd_file.log, 'ROUTING_REVISION_DATE, ROUTING_REVISION, BOM_REVISION_DATE, BOM_REVISION,
5905: ALTERNATE_BOM_DESIGNATOR, ALTERNATE_ROUTING_DESIGNATOR');
5906: end if; -- change bom/routing alternate
5907:
5900: end if;
5901:
5902: elsif p_old_status_type <> 1 then
5903: fnd_file.put_line(fnd_file.log, 'Ignoring any of the following fields if provided by the user for this standard job:');
5904: fnd_file.put_line(fnd_file.log, 'ROUTING_REVISION_DATE, ROUTING_REVISION, BOM_REVISION_DATE, BOM_REVISION,
5905: ALTERNATE_BOM_DESIGNATOR, ALTERNATE_ROUTING_DESIGNATOR');
5906: end if; -- change bom/routing alternate
5907:
5908: end if; -- job type 1, near l_stmt_num := 700.1;
5977: -- the update of status.
5978:
5979: if (p_change_bom_reference = 1 or p_change_routing_reference = 1)
5980: and p_old_status_type <> 1 then
5981: fnd_file.put_line(fnd_file.log,'Ignoring any of the following fields if provided by the user:');
5982: --fnd_file.new_line(fnd_file.log, 1);
5983: fnd_file.put_line(fnd_file.log, 'ROUTING_REFERENCE_ID, BOM_REFERENCE_ID, ROUTING_REVISION_DATE , ROUTING_REVISION, BOM_REVISION_DATE, BOM_REVISION, ALTERNATE_BOM_DESIGNATOR, ALTERNATE_ROUTING_DESIGNATOR');
5984: v_wlji_bom_revision_date(v_index):= p_old_bom_revision_date;
5985: v_wlji_bom_reference_id(v_index):= p_old_bom_reference_id;
5978:
5979: if (p_change_bom_reference = 1 or p_change_routing_reference = 1)
5980: and p_old_status_type <> 1 then
5981: fnd_file.put_line(fnd_file.log,'Ignoring any of the following fields if provided by the user:');
5982: --fnd_file.new_line(fnd_file.log, 1);
5983: fnd_file.put_line(fnd_file.log, 'ROUTING_REFERENCE_ID, BOM_REFERENCE_ID, ROUTING_REVISION_DATE , ROUTING_REVISION, BOM_REVISION_DATE, BOM_REVISION, ALTERNATE_BOM_DESIGNATOR, ALTERNATE_ROUTING_DESIGNATOR');
5984: v_wlji_bom_revision_date(v_index):= p_old_bom_revision_date;
5985: v_wlji_bom_reference_id(v_index):= p_old_bom_reference_id;
5986: v_wlji_alt_bom_designator(v_index):= p_old_alt_bom_designator;
5979: if (p_change_bom_reference = 1 or p_change_routing_reference = 1)
5980: and p_old_status_type <> 1 then
5981: fnd_file.put_line(fnd_file.log,'Ignoring any of the following fields if provided by the user:');
5982: --fnd_file.new_line(fnd_file.log, 1);
5983: fnd_file.put_line(fnd_file.log, 'ROUTING_REFERENCE_ID, BOM_REFERENCE_ID, ROUTING_REVISION_DATE , ROUTING_REVISION, BOM_REVISION_DATE, BOM_REVISION, ALTERNATE_BOM_DESIGNATOR, ALTERNATE_ROUTING_DESIGNATOR');
5984: v_wlji_bom_revision_date(v_index):= p_old_bom_revision_date;
5985: v_wlji_bom_reference_id(v_index):= p_old_bom_reference_id;
5986: v_wlji_alt_bom_designator(v_index):= p_old_alt_bom_designator;
5987: v_wlji_routing_revision_date(v_index):=p_old_routing_revision_date;
6257:
6258:
6259: if lbji_debug = 'Y' then
6260: if p_skip_updt = 1 then
6261: fnd_file.put_line(fnd_file.log, 'Planning to skip update of wo, wor, wro');
6262: else
6263: fnd_file.put_line(fnd_file.log, 'No Plans to skip update of wo, wor, wro');
6264: end if;
6265: end if;
6259: if lbji_debug = 'Y' then
6260: if p_skip_updt = 1 then
6261: fnd_file.put_line(fnd_file.log, 'Planning to skip update of wo, wor, wro');
6262: else
6263: fnd_file.put_line(fnd_file.log, 'No Plans to skip update of wo, wor, wro');
6264: end if;
6265: end if;
6266:
6267:
6431: v_wlji_err_code(v_index) := -1;
6432: fnd_message.set_name('WSM','WSM_NO_WAC_SCRAP_ACC');
6433: fnd_message.set_token('CC', l_temp_cc);
6434: v_wlji_err_msg(v_index) := fnd_message.get;
6435: fnd_file.put_line(fnd_file.log, 'stmt_num: '|| l_stmt_num ||' ' ||v_wlji_err_msg(v_index));
6436: fnd_file.new_line(fnd_file.log, 3);
6437: l_error_code := -1;
6438: GOTO skip_resched_validations;
6439: end if;
6432: fnd_message.set_name('WSM','WSM_NO_WAC_SCRAP_ACC');
6433: fnd_message.set_token('CC', l_temp_cc);
6434: v_wlji_err_msg(v_index) := fnd_message.get;
6435: fnd_file.put_line(fnd_file.log, 'stmt_num: '|| l_stmt_num ||' ' ||v_wlji_err_msg(v_index));
6436: fnd_file.new_line(fnd_file.log, 3);
6437: l_error_code := -1;
6438: GOTO skip_resched_validations;
6439: end if;
6440: if p_est_scrap_account is null or p_est_scrap_var_account is null then
6442: v_wlji_err_code(v_index) := -1;
6443: fnd_message.set_name('WSM','WSM_NO_WAC_SCRAP_ACC');
6444: fnd_message.set_token('CC', l_temp_cc);
6445: v_wlji_err_msg(v_index) := fnd_message.get;
6446: fnd_file.put_line(fnd_file.log, 'stmt_num: '|| l_stmt_num ||' ' ||v_wlji_err_msg(v_index));
6447: fnd_file.new_line(fnd_file.log, 3);
6448: l_error_code := -1;
6449: GOTO skip_resched_validations;
6450: end if;
6443: fnd_message.set_name('WSM','WSM_NO_WAC_SCRAP_ACC');
6444: fnd_message.set_token('CC', l_temp_cc);
6445: v_wlji_err_msg(v_index) := fnd_message.get;
6446: fnd_file.put_line(fnd_file.log, 'stmt_num: '|| l_stmt_num ||' ' ||v_wlji_err_msg(v_index));
6447: fnd_file.new_line(fnd_file.log, 3);
6448: l_error_code := -1;
6449: GOTO skip_resched_validations;
6450: end if;
6451: end if;
6899: WHERE ORGANIZATION_ID = v_wlji_org(v_index)
6900: AND WIP_ENTITY_ID = v_wlji_wip_entity_id(v_index);
6901:
6902: if lbji_debug = 'Y' then
6903: fnd_file.put_line(fnd_file.log, 'Updated '||SQL%ROWCOUNT||' rows into wo');
6904: end if;
6905:
6906: l_stmt_num := 1063;
6907: UPDATE WIP_OPERATION_RESOURCES
6921: WHERE ORGANIZATION_ID = v_wlji_org(v_index)
6922: AND WIP_ENTITY_ID = v_wlji_wip_entity_id(v_index);
6923:
6924: if lbji_debug = 'Y' then
6925: fnd_file.put_line(fnd_file.log, 'Updated '||SQL%ROWCOUNT||' rows into wor');
6926: end if;
6927:
6928: l_stmt_num := 1064;
6929: --LBM enh: modified the expression on required_quantity
6945: WHERE ORGANIZATION_ID = v_wlji_org(v_index)
6946: AND WIP_ENTITY_ID = v_wlji_wip_entity_id(v_index);
6947:
6948: if lbji_debug = 'Y' then
6949: fnd_file.put_line(fnd_file.log, 'Updated '||SQL%ROWCOUNT||' rows into wro');
6950: end if;
6951:
6952: l_stmt_num := 1065;
6953: -- abb H: optional scrap accounting
6977: v_wlji_err_code(v_index) := -1;
6978: fnd_message.set_name('WSM','WSM_NO_SCRAP_ACC');
6979: fnd_message.set_token('DEPT_ID',to_char(l_department_id));
6980: v_wlji_err_msg(v_index) := fnd_message.get;
6981: fnd_file.put_line(fnd_file.log, 'stmt_num: '|| l_stmt_num ||' '||v_wlji_err_msg(v_index));
6982: fnd_file.new_line(fnd_file.log, 3);
6983: l_error_code := -1;
6984: l_error_count := l_error_count + 1;
6985: GOTO skip_other_steps;
6978: fnd_message.set_name('WSM','WSM_NO_SCRAP_ACC');
6979: fnd_message.set_token('DEPT_ID',to_char(l_department_id));
6980: v_wlji_err_msg(v_index) := fnd_message.get;
6981: fnd_file.put_line(fnd_file.log, 'stmt_num: '|| l_stmt_num ||' '||v_wlji_err_msg(v_index));
6982: fnd_file.new_line(fnd_file.log, 3);
6983: l_error_code := -1;
6984: l_error_count := l_error_count + 1;
6985: GOTO skip_other_steps;
6986: end if;
6991: WHERE WIP_ENTITY_ID = v_wlji_wip_entity_id(v_index)
6992: and operation_seq_num = min_op_seq_num;
6993:
6994: if lbji_debug = 'Y' then
6995: fnd_file.put_line(fnd_file.log, 'Updated '||SQL%ROWCOUNT||' rows into woy');
6996: end if;
6997:
6998: select max(operation_seq_num)
6999: into max_op_seq_num
7012: v_wlji_err_code(v_index) := -1;
7013: fnd_message.set_name('WSM','WSM_NO_SCRAP_ACC');
7014: fnd_message.set_token('DEPT_ID',to_char(l_department_id));
7015: v_wlji_err_msg(v_index) := fnd_message.get;
7016: fnd_file.put_line(fnd_file.log, 'stmt_num: '|| l_stmt_num ||' '||v_wlji_err_msg(v_index));
7017: fnd_file.new_line(fnd_file.log, 3);
7018: l_error_code := -1;
7019: l_error_count := l_error_count + 1;
7020: GOTO skip_other_steps;
7013: fnd_message.set_name('WSM','WSM_NO_SCRAP_ACC');
7014: fnd_message.set_token('DEPT_ID',to_char(l_department_id));
7015: v_wlji_err_msg(v_index) := fnd_message.get;
7016: fnd_file.put_line(fnd_file.log, 'stmt_num: '|| l_stmt_num ||' '||v_wlji_err_msg(v_index));
7017: fnd_file.new_line(fnd_file.log, 3);
7018: l_error_code := -1;
7019: l_error_count := l_error_count + 1;
7020: GOTO skip_other_steps;
7021: end if;
7026: WHERE WIP_ENTITY_ID = v_wlji_wip_entity_id(v_index)
7027: and operation_seq_num = max_op_seq_num;
7028:
7029: if lbji_debug = 'Y' then
7030: fnd_file.put_line(fnd_file.log, 'Updated '||SQL%ROWCOUNT||' rows into woy');
7031: end if;
7032:
7033: end if;
7034:
7049: delete from wip_period_balances
7050: where wip_entity_id = v_wlji_wip_entity_id(v_index)
7051: and organization_id = v_wlji_org(v_index);
7052: if lbji_debug = 'Y' then
7053: fnd_file.put_line(fnd_file.log, 'Deleted '||SQL%ROWCOUNT||' rows from wpb');
7054: end if;
7055: end if;
7056:
7057: l_stmt_num := 1072;
7087: update wip_discrete_jobs wdj
7088: set status_type = 7
7089: where wdj.wip_entity_id = v_wlji_wip_entity_id(v_index);
7090: if lbji_debug = 'Y' then
7091: fnd_file.put_line(fnd_file.log, 'Updated status type to 7 in wdj');
7092: end if;
7093: --
7094: -- begin Bugfix 2820900 : Update the job name with sector lot extn. once canceled.
7095: -- Note: Since status update for canceled jobs are not allowed currently, there's
7217: -- bug 2762029 modification end
7218: end if; -- update jobs for which status is not cancelled
7219:
7220: if lbji_debug = 'Y' then
7221: fnd_file.put_line(fnd_file.log, 'Updated '||SQL%ROWCOUNT||' rows of wdj');
7222: end if;
7223:
7224:
7225: l_stmt_num := 1074;
7234: last_update_date = v_wlji_last_updt_date(v_index)
7235: where we.wip_entity_id = v_wlji_wip_entity_id(v_index);
7236:
7237: if lbji_debug = 'Y' then
7238: fnd_file.put_line(fnd_file.log, 'Updated '||SQL%ROWCOUNT||' rows into we');
7239: end if;
7240:
7241: Exception
7242: when others then
7259:
7260: if ((v_wlji_load_type(v_index) = 6) AND (v_wlji_class_code(v_index) is NULL)) then
7261: v_wlji_class_code(v_index) := p_old_class_code;
7262: end if;
7263: fnd_file.put_line(fnd_file.log, 'date released ****: '||v_wlji_date_released(v_index));
7264: insert_into_period_balances (
7265: p_wip_entity_id => v_wlji_wip_entity_id(v_index),
7266: p_organization_id => v_wlji_org(v_index),
7267: p_class_code => v_wlji_class_code(v_index),
7378: mtl_material_transactions_s.nextval /* Transaction Temp Id */
7379: ) RETURNING transaction_temp_id into txn_tmp_header_id;
7380:
7381: if lbji_debug = 'Y' then
7382: fnd_file.put_line(fnd_file.log, 'Inserted '||SQL%ROWCOUNT||' rows into mmtt');
7383: end if;
7384:
7385: l_stmt_num := 1160;
7386:
7407: -l_quantity_tobe_issued,
7408: v_wsli(v_wlji_source_line_id(v_index)).lot_number);
7409:
7410: if lbji_debug = 'Y' then
7411: fnd_file.put_line(fnd_file.log, 'Inserted '||SQL%ROWCOUNT||' rows into mtlt');
7412: end if;
7413:
7414: l_stmt_num := 1160;
7415: UPDATE WIP_REQUIREMENT_OPERATIONS
7445: IF p_old_status_type in (0,1,3,6) THEN -- Initialized Value,
7446: --Unreleased, released, Hold
7447: l_stmt_num := 1170;
7448: IF (lbji_debug='Y') THEN
7449: fnd_file.put_line(fnd_file.log, 'Before Calling WSM_LotAttr_PVT.create_update_lotattr');
7450: END IF;
7451: WSM_LotAttr_PVT.create_update_lotattr(
7452: x_err_code => l_error_code,
7453: x_err_msg => l_error_msg,
7462: l_error_count := l_error_count + 1;
7463: GOTO skip_other_steps;
7464: END IF;
7465: IF (lbji_debug='Y') THEN
7466: fnd_file.put_line(fnd_file.log, 'WSM_LotAttr_PVT.create_update_lotattr returned Success');
7467: END IF;
7468: l_stmt_num := 1180;
7469: END IF; -- p_old_status_type in (1,3,6)
7470:
7483: -- *** write into output file ***
7484: -- note that this is a rudimentary piece of commentary on the job created,
7485: -- or failed to create because there's no customer requirement on this.
7486: if v_wlji_load_type(v_index) = 5 then
7487: fnd_file.put_line(fnd_file.output, '-------------------------------------------------------');
7488: --bug 5051783:Replaced org_organization_definitions with mtl_parameters.
7489: select organization_code
7490: into org_code
7491: --from ORG_ORGANIZATION_DEFINITIONS
7491: --from ORG_ORGANIZATION_DEFINITIONS
7492: from mtl_parameters
7493: where organization_id = v_wlji_org(v_index);
7494:
7495: fnd_file.put_line(fnd_file.output, 'Organization: '||org_code);
7496: fnd_file.put_line(fnd_file.output, 'Job_name: '|| v_wlji_job_name(v_index));
7497: select meaning
7498: into job_type_meaning
7499: from mfg_lookups
7492: from mtl_parameters
7493: where organization_id = v_wlji_org(v_index);
7494:
7495: fnd_file.put_line(fnd_file.output, 'Organization: '||org_code);
7496: fnd_file.put_line(fnd_file.output, 'Job_name: '|| v_wlji_job_name(v_index));
7497: select meaning
7498: into job_type_meaning
7499: from mfg_lookups
7500: where lookup_type = 'WIP_DISCRETE_JOB'
7498: into job_type_meaning
7499: from mfg_lookups
7500: where lookup_type = 'WIP_DISCRETE_JOB'
7501: and lookup_code = v_wlji_job_type(v_index);
7502: fnd_file.put_line(fnd_file.output, 'Job Type: '|| job_type_meaning);
7503:
7504: begin
7505: select unique(concatenated_segments)
7506: into assembly_name
7510: exception
7511: when others then
7512: assembly_name := 'Unknown';
7513: end;
7514: fnd_file.put_line(fnd_file.output, 'Assembly: '|| assembly_name);
7515: fnd_file.put_line(fnd_file.output, 'Quantity: '|| v_wlji_start_quantity(v_index));
7516: fnd_file.put_line(fnd_file.output, 'Start Date: '|| v_wlji_fusd(v_index));
7517: fnd_file.put_line(fnd_file.output, 'Completion Date: '|| v_wlji_lucd(v_index));
7518: fnd_file.put_line(fnd_file.output, 'Kanban Card: '|| v_wlji_kanban_card_id(v_index));
7511: when others then
7512: assembly_name := 'Unknown';
7513: end;
7514: fnd_file.put_line(fnd_file.output, 'Assembly: '|| assembly_name);
7515: fnd_file.put_line(fnd_file.output, 'Quantity: '|| v_wlji_start_quantity(v_index));
7516: fnd_file.put_line(fnd_file.output, 'Start Date: '|| v_wlji_fusd(v_index));
7517: fnd_file.put_line(fnd_file.output, 'Completion Date: '|| v_wlji_lucd(v_index));
7518: fnd_file.put_line(fnd_file.output, 'Kanban Card: '|| v_wlji_kanban_card_id(v_index));
7519: if v_wlji_process_status(v_index) <> 3 then
7512: assembly_name := 'Unknown';
7513: end;
7514: fnd_file.put_line(fnd_file.output, 'Assembly: '|| assembly_name);
7515: fnd_file.put_line(fnd_file.output, 'Quantity: '|| v_wlji_start_quantity(v_index));
7516: fnd_file.put_line(fnd_file.output, 'Start Date: '|| v_wlji_fusd(v_index));
7517: fnd_file.put_line(fnd_file.output, 'Completion Date: '|| v_wlji_lucd(v_index));
7518: fnd_file.put_line(fnd_file.output, 'Kanban Card: '|| v_wlji_kanban_card_id(v_index));
7519: if v_wlji_process_status(v_index) <> 3 then
7520: status_name := 'Success';
7513: end;
7514: fnd_file.put_line(fnd_file.output, 'Assembly: '|| assembly_name);
7515: fnd_file.put_line(fnd_file.output, 'Quantity: '|| v_wlji_start_quantity(v_index));
7516: fnd_file.put_line(fnd_file.output, 'Start Date: '|| v_wlji_fusd(v_index));
7517: fnd_file.put_line(fnd_file.output, 'Completion Date: '|| v_wlji_lucd(v_index));
7518: fnd_file.put_line(fnd_file.output, 'Kanban Card: '|| v_wlji_kanban_card_id(v_index));
7519: if v_wlji_process_status(v_index) <> 3 then
7520: status_name := 'Success';
7521: else
7514: fnd_file.put_line(fnd_file.output, 'Assembly: '|| assembly_name);
7515: fnd_file.put_line(fnd_file.output, 'Quantity: '|| v_wlji_start_quantity(v_index));
7516: fnd_file.put_line(fnd_file.output, 'Start Date: '|| v_wlji_fusd(v_index));
7517: fnd_file.put_line(fnd_file.output, 'Completion Date: '|| v_wlji_lucd(v_index));
7518: fnd_file.put_line(fnd_file.output, 'Kanban Card: '|| v_wlji_kanban_card_id(v_index));
7519: if v_wlji_process_status(v_index) <> 3 then
7520: status_name := 'Success';
7521: else
7522: status_name := 'Falied To Create';
7520: status_name := 'Success';
7521: else
7522: status_name := 'Falied To Create';
7523: end if;
7524: fnd_file.put_line(fnd_file.output, 'Process Status: '|| Status_name);
7525: if v_wlji_process_status(v_index) = 3 then
7526: fnd_file.put_line(fnd_file.output, v_wlji_err_msg(v_index));
7527: end if;
7528: fnd_file.put_line(fnd_file.output, '-------------------------------------------------------');
7522: status_name := 'Falied To Create';
7523: end if;
7524: fnd_file.put_line(fnd_file.output, 'Process Status: '|| Status_name);
7525: if v_wlji_process_status(v_index) = 3 then
7526: fnd_file.put_line(fnd_file.output, v_wlji_err_msg(v_index));
7527: end if;
7528: fnd_file.put_line(fnd_file.output, '-------------------------------------------------------');
7529: end if; -- load type 5
7530: -- *** write into output file end***
7524: fnd_file.put_line(fnd_file.output, 'Process Status: '|| Status_name);
7525: if v_wlji_process_status(v_index) = 3 then
7526: fnd_file.put_line(fnd_file.output, v_wlji_err_msg(v_index));
7527: end if;
7528: fnd_file.put_line(fnd_file.output, '-------------------------------------------------------');
7529: end if; -- load type 5
7530: -- *** write into output file end***
7531:
7532:
7540:
7541: if v_wlji_process_status(v_index) <> 3 then
7542: v_wlji_process_status(v_index) := 5; -- 5 : complete without error
7543: if lbji_debug = 'Y' then
7544: fnd_file.put_line(fnd_file.log, 'Everything OK, changing the status of the row to 5..');
7545: end if;
7546: else
7547: -- abbkanban begin
7548: if v_wlji_kanban_card_id(v_index) is not null then
7586: dummy_err_code,
7587: dummy_err_msg );
7588:
7589: if dummy_err_code <> 0 then
7590: fnd_file.put_line(fnd_file.log, '*** WARNING ***');
7591: fnd_file.put_line(fnd_file.log, 'WSMPLBJI.launch_worker: '||dummy_err_msg);
7592: l_error_count := l_error_count + 1;
7593: end if;
7594: end if;
7587: dummy_err_msg );
7588:
7589: if dummy_err_code <> 0 then
7590: fnd_file.put_line(fnd_file.log, '*** WARNING ***');
7591: fnd_file.put_line(fnd_file.log, 'WSMPLBJI.launch_worker: '||dummy_err_msg);
7592: l_error_count := l_error_count + 1;
7593: end if;
7594: end if;
7595:
7597:
7598: end loop; -- inner loop
7599:
7600: if lbji_debug = 'Y' then
7601: fnd_file.put_line(fnd_file.log, ' ');
7602: fnd_file.put_line(fnd_file.log, ' ');
7603: fnd_file.put_line(fnd_file.log, ' ');
7604: fnd_file.put_line(fnd_file.log, ' ');
7605: end if;
7598: end loop; -- inner loop
7599:
7600: if lbji_debug = 'Y' then
7601: fnd_file.put_line(fnd_file.log, ' ');
7602: fnd_file.put_line(fnd_file.log, ' ');
7603: fnd_file.put_line(fnd_file.log, ' ');
7604: fnd_file.put_line(fnd_file.log, ' ');
7605: end if;
7606:
7599:
7600: if lbji_debug = 'Y' then
7601: fnd_file.put_line(fnd_file.log, ' ');
7602: fnd_file.put_line(fnd_file.log, ' ');
7603: fnd_file.put_line(fnd_file.log, ' ');
7604: fnd_file.put_line(fnd_file.log, ' ');
7605: end if;
7606:
7607: -- *** RETCODE return values ***
7600: if lbji_debug = 'Y' then
7601: fnd_file.put_line(fnd_file.log, ' ');
7602: fnd_file.put_line(fnd_file.log, ' ');
7603: fnd_file.put_line(fnd_file.log, ' ');
7604: fnd_file.put_line(fnd_file.log, ' ');
7605: end if;
7606:
7607: -- *** RETCODE return values ***
7608: -- 0: success
7612:
7613: if l_warning_count <> 0 then
7614: retcode := 1;
7615: errbuf := 'The interface process produced atleast one warning message';
7616: fnd_file.put_line(fnd_file.log,errbuf);
7617: conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('WARNING',errbuf);
7618: end if;
7619:
7620: if l_error_count <> 0 then
7619:
7620: if l_error_count <> 0 then
7621: retcode := 1;
7622: errbuf := 'The interface process marked atleast one row as errored';
7623: fnd_file.put_line(fnd_file.log,errbuf);
7624: conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('WARNING',errbuf);
7625: end if;
7626:
7627: -- *** bulk update wsm_lot_job_interface ***
7637:
7638: l_boolean_success := false;
7639:
7640: if l_atleast_one_row_in_mmtt <>0 THEN
7641: fnd_file.put_line(fnd_file.log, 'Invoking Inventory Worker with header id: '||to_char(txn_header_id));
7642: l_inv_worker_req_id := FND_REQUEST.submit_request (
7643: 'INV', 'INCTCW', NULL, NULL, FALSE,
7644: --to_char(txn_header_id), '1', NULL, NULL); -- bug 3733798
7645: to_char(txn_header_id), '4', NULL, NULL); -- bug 3733798
7645: to_char(txn_header_id), '4', NULL, NULL); -- bug 3733798
7646:
7647: commit;
7648:
7649: fnd_file.put_line(fnd_file.log,'Material Transaction temp_header_id is '
7650: ||to_char(txn_header_id));
7651:
7652: if l_inv_worker_req_id = 0 then
7653:
7653:
7654: retcode := 1;
7655: errbuf:= 'WSMPLBJI. Inventory worker returned failure '||
7656: '(Transaction_header_id=' ||txn_header_id||') : '|| SUBSTRB(SQLERRM,1,1000);
7657: fnd_file.put_line(fnd_file.log,errbuf);
7658: conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('WARNING',errbuf);
7659: update wsm_lot_job_interface
7660: set process_status = 4,
7661: error_code = -2,
7663: where mode_flag = 2;
7664:
7665: else -- req_id <> 0
7666:
7667: fnd_file.put_line(fnd_file.log,'Inventory Transaction Worker request_id is '
7668: ||to_char(l_inv_worker_req_id));
7669: req_wait := FND_CONCURRENT.WAIT_FOR_REQUEST
7670: (request_id => l_inv_worker_req_id,
7671: interval => 10, -- 10 seconds interval
7675: dev_phase => req_devphase,
7676: dev_status => req_devstatus,
7677: message => req_message);
7678:
7679: fnd_file.put_line(fnd_file.log, 'Inventory Transaction Worker status is '
7680: ||req_status);
7681: fnd_file.put_line(fnd_file.log, 'Inventory Transaction Worker Completion Message: '
7682: ||req_message);
7683:
7677: message => req_message);
7678:
7679: fnd_file.put_line(fnd_file.log, 'Inventory Transaction Worker status is '
7680: ||req_status);
7681: fnd_file.put_line(fnd_file.log, 'Inventory Transaction Worker Completion Message: '
7682: ||req_message);
7683:
7684: if req_devphase <> 'COMPLETE' OR req_devstatus <> 'NORMAL' THEN
7685: retcode := 1;
7685: retcode := 1;
7686: errbuf:= 'WSMPLBJI. Inventory worker returned failure '||
7687: '(Transaction_header_id=' ||txn_header_id||') : '||
7688: SUBSTRB(SQLERRM,1,1000);
7689: fnd_file.put_line(fnd_file.log,errbuf);
7690: conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('WARNING',errbuf);
7691: end if;
7692:
7693: check_errored_mmtt_records(txn_header_id, l_error_code, l_error_msg);
7695: if (l_error_code <> 0) or (l_error_msg is not null ) then
7696: retcode := 1;
7697: errbuf:= 'WSMPLBJI. Errored Records in mmtt ' ||
7698: '(Transaction_header_id=' ||txn_header_id||') : '|| SUBSTRB(SQLERRM,1,1000);
7699: fnd_file.put_line(fnd_file.log,errbuf);
7700: conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('WARNING',errbuf);
7701: end if;
7702:
7703: end if; -- req_id
7723: SYSDATE-l_del_int_prof_value)
7724: );
7725:
7726: if lbji_debug = 'Y' then
7727: fnd_file.put_line(fnd_file.log, 'Deleted '||SQL%ROWCOUNT||' rows from wsli');
7728: end if;
7729: end if;
7730:
7731: delete from wsm_lot_job_interface
7737: NVL(transaction_date, creation_date) -1,
7738: SYSDATE-l_del_int_prof_value);
7739:
7740: if lbji_debug = 'Y' then
7741: fnd_file.put_line(fnd_file.log, 'Deleted '||SQL%ROWCOUNT||' rows from wlji');
7742: end if;
7743:
7744: Exception
7745: when others then
7744: Exception
7745: when others then
7746: retcode := 1;
7747: errbuf := 'Deletion of successful rows from interface table(s) failed';
7748: fnd_file.put_line(fnd_file.log,errbuf);
7749: conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('WARNING',errbuf);
7750: End;
7751:
7752: commit;
7774: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
7775: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
7776: ) ;
7777:
7778: fnd_file.put_line(fnd_file.log,'Concurrent Request for Requisition Inport Submitted');
7779: fnd_file.put_line(fnd_file.log,'Request_id: '||l_req_request_id);
7780: end if;
7781: -- osp end
7782:
7775: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
7776: ) ;
7777:
7778: fnd_file.put_line(fnd_file.log,'Concurrent Request for Requisition Inport Submitted');
7779: fnd_file.put_line(fnd_file.log,'Request_id: '||l_req_request_id);
7780: end if;
7781: -- osp end
7782:
7783: -- phantom project
7798: when abort_request then
7799: rollback to back_to_square_one;
7800: retcode := 2;
7801: errbuf := 'WSMLBJIB.launch_worker_1159: stmt num= '||l_stmt_num||' '||SUBSTR(SQLERRM, 1,240);
7802: fnd_file.put_line(fnd_file.log,errbuf);
7803: conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('ERROR',errbuf);
7804: when others then
7805: rollback to back_to_square_one;
7806: retcode := 2;
7804: when others then
7805: rollback to back_to_square_one;
7806: retcode := 2;
7807: errbuf := 'WSMLBJIB.launch_worker_1159: stmt num= '||l_stmt_num||' '||SUBSTR(SQLERRM, 1,240);
7808: fnd_file.put_line(fnd_file.log,errbuf);
7809: conc_status := FND_CONCURRENT.SET_COMPLETION_STATUS('ERROR',errbuf);
7810:
7811: END launch_worker_1159;
7812: