DBA Data[Home] [Help]

APPS.CSTPLENG dependencies on FND_FILE

Line 72: FND_FILE.PUT_LINE(FND_FILE.LOG,'Compute layer actual cost ...');

68: l_err_msg := '';
69: l_debug := FND_PROFILE.VALUE('MRP_DEBUG');
70:
71: if (l_debug = 'Y') then
72: FND_FILE.PUT_LINE(FND_FILE.LOG,'Compute layer actual cost ...');
73: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer ID : ' || to_char(i_layer_id));
74: FND_FILE.PUT_LINE(FND_FILE.LOG,'cost hook : ' || to_char(i_cost_hook));
75: end if;
76:

Line 73: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer ID : ' || to_char(i_layer_id));

69: l_debug := FND_PROFILE.VALUE('MRP_DEBUG');
70:
71: if (l_debug = 'Y') then
72: FND_FILE.PUT_LINE(FND_FILE.LOG,'Compute layer actual cost ...');
73: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer ID : ' || to_char(i_layer_id));
74: FND_FILE.PUT_LINE(FND_FILE.LOG,'cost hook : ' || to_char(i_cost_hook));
75: end if;
76:
77:

Line 74: FND_FILE.PUT_LINE(FND_FILE.LOG,'cost hook : ' || to_char(i_cost_hook));

70:
71: if (l_debug = 'Y') then
72: FND_FILE.PUT_LINE(FND_FILE.LOG,'Compute layer actual cost ...');
73: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer ID : ' || to_char(i_layer_id));
74: FND_FILE.PUT_LINE(FND_FILE.LOG,'cost hook : ' || to_char(i_cost_hook));
75: end if;
76:
77:
78: /* For WIP component issue and negative component return,layers have already

Line 227: FND_FILE.PUT_LINE(FND_FILE.LOG,'Consume/Create Layers...');

223: l_err_msg := '';
224: l_debug := FND_PROFILE.VALUE('MRP_DEBUG');
225:
226: if (l_debug = 'Y') then
227: FND_FILE.PUT_LINE(FND_FILE.LOG,'Consume/Create Layers...');
228: end if;
229:
230: if ((i_txn_action_id = 1) /* Issue from stores */
231: OR (i_interorg_rec = 0) /* interorg shipment */

Line 252: FND_FILE.PUT_LINE(FND_FILE.LOG,'Consumption Transaction ...');

248: redundant */
249: ) then
250: l_stmt_num := 10;
251: if (l_debug = 'Y') then
252: FND_FILE.PUT_LINE(FND_FILE.LOG,'Consumption Transaction ...');
253: FND_FILE.PUT_LINE(FND_FILE.LOG,'Action ID : ' || to_char(i_txn_action_id));
254: FND_FILE.PUT_LINE(FND_FILE.LOG,'Primary Qty : ' || to_char(i_txn_qty));
255: end if;
256: consume_layers(

Line 253: FND_FILE.PUT_LINE(FND_FILE.LOG,'Action ID : ' || to_char(i_txn_action_id));

249: ) then
250: l_stmt_num := 10;
251: if (l_debug = 'Y') then
252: FND_FILE.PUT_LINE(FND_FILE.LOG,'Consumption Transaction ...');
253: FND_FILE.PUT_LINE(FND_FILE.LOG,'Action ID : ' || to_char(i_txn_action_id));
254: FND_FILE.PUT_LINE(FND_FILE.LOG,'Primary Qty : ' || to_char(i_txn_qty));
255: end if;
256: consume_layers(
257: i_org_id,

Line 254: FND_FILE.PUT_LINE(FND_FILE.LOG,'Primary Qty : ' || to_char(i_txn_qty));

250: l_stmt_num := 10;
251: if (l_debug = 'Y') then
252: FND_FILE.PUT_LINE(FND_FILE.LOG,'Consumption Transaction ...');
253: FND_FILE.PUT_LINE(FND_FILE.LOG,'Action ID : ' || to_char(i_txn_action_id));
254: FND_FILE.PUT_LINE(FND_FILE.LOG,'Primary Qty : ' || to_char(i_txn_qty));
255: end if;
256: consume_layers(
257: i_org_id,
258: i_txn_id,

Line 307: FND_FILE.PUT_LINE(FND_FILE.LOG,'Transaction creates inventory layers ...');

303: OR ( i_txn_action_id = 26 and i_txn_qty > 0 ) /*logical Receipt*/
304: ) then
305: l_stmt_num := 20;
306: if (l_debug = 'Y') then
307: FND_FILE.PUT_LINE(FND_FILE.LOG,'Transaction creates inventory layers ...');
308: FND_FILE.PUT_LINE(FND_FILE.LOG,'Action ID : ' || to_char(i_txn_action_id));
309: FND_FILE.PUT_LINE(FND_FILE.LOG,'Primary Qty : ' || to_char(i_txn_qty));
310: end if;
311: create_layers(

Line 308: FND_FILE.PUT_LINE(FND_FILE.LOG,'Action ID : ' || to_char(i_txn_action_id));

304: ) then
305: l_stmt_num := 20;
306: if (l_debug = 'Y') then
307: FND_FILE.PUT_LINE(FND_FILE.LOG,'Transaction creates inventory layers ...');
308: FND_FILE.PUT_LINE(FND_FILE.LOG,'Action ID : ' || to_char(i_txn_action_id));
309: FND_FILE.PUT_LINE(FND_FILE.LOG,'Primary Qty : ' || to_char(i_txn_qty));
310: end if;
311: create_layers(
312: i_org_id,

Line 309: FND_FILE.PUT_LINE(FND_FILE.LOG,'Primary Qty : ' || to_char(i_txn_qty));

305: l_stmt_num := 20;
306: if (l_debug = 'Y') then
307: FND_FILE.PUT_LINE(FND_FILE.LOG,'Transaction creates inventory layers ...');
308: FND_FILE.PUT_LINE(FND_FILE.LOG,'Action ID : ' || to_char(i_txn_action_id));
309: FND_FILE.PUT_LINE(FND_FILE.LOG,'Primary Qty : ' || to_char(i_txn_qty));
310: end if;
311: create_layers(
312: i_org_id,
313: i_txn_id,

Line 345: FND_FILE.PUT_LINE(FND_FILE.LOG,'Scrap transaction with cost hook');

341: /* scrap transaction */
342: l_stmt_num := 30;
343: if (i_cost_hook = 1) then
344: if (l_debug = 'Y') then
345: FND_FILE.PUT_LINE(FND_FILE.LOG,'Scrap transaction with cost hook');
346: end if;
347: return;
348: else
349: if (l_debug = 'Y') then

Line 350: FND_FILE.PUT_LINE(FND_FILE.LOG,'Scrap transaction inserts into MCACD');

346: end if;
347: return;
348: else
349: if (l_debug = 'Y') then
350: FND_FILE.PUT_LINE(FND_FILE.LOG,'Scrap transaction inserts into MCACD');
351: end if;
352: insert into mtl_cst_actual_cost_details (
353: transaction_id,
354: organization_id,

Line 534: FND_FILE.PUT_LINE(FND_FILE.LOG,'get_source_number ...');

530: l_src_number := to_char(i_txn_id);
531: end if;
532:
533: if (l_debug = 'Y') then
534: FND_FILE.PUT_LINE(FND_FILE.LOG,'get_source_number ...');
535: FND_FILE.PUT_LINE(FND_FILE.LOG,'Txn Src Type : ' || to_char(i_txn_src_type));
536: FND_FILE.PUT_LINE(FND_FILE.LOG,'Txn Src ID : ' || to_char(i_src_id));
537: FND_FILE.PUT_LINE(FND_FILE.LOG,'Txn Source : ' || l_src_number);
538: end if;

Line 535: FND_FILE.PUT_LINE(FND_FILE.LOG,'Txn Src Type : ' || to_char(i_txn_src_type));

531: end if;
532:
533: if (l_debug = 'Y') then
534: FND_FILE.PUT_LINE(FND_FILE.LOG,'get_source_number ...');
535: FND_FILE.PUT_LINE(FND_FILE.LOG,'Txn Src Type : ' || to_char(i_txn_src_type));
536: FND_FILE.PUT_LINE(FND_FILE.LOG,'Txn Src ID : ' || to_char(i_src_id));
537: FND_FILE.PUT_LINE(FND_FILE.LOG,'Txn Source : ' || l_src_number);
538: end if;
539:

Line 536: FND_FILE.PUT_LINE(FND_FILE.LOG,'Txn Src ID : ' || to_char(i_src_id));

532:
533: if (l_debug = 'Y') then
534: FND_FILE.PUT_LINE(FND_FILE.LOG,'get_source_number ...');
535: FND_FILE.PUT_LINE(FND_FILE.LOG,'Txn Src Type : ' || to_char(i_txn_src_type));
536: FND_FILE.PUT_LINE(FND_FILE.LOG,'Txn Src ID : ' || to_char(i_src_id));
537: FND_FILE.PUT_LINE(FND_FILE.LOG,'Txn Source : ' || l_src_number);
538: end if;
539:
540: return l_src_number;

Line 537: FND_FILE.PUT_LINE(FND_FILE.LOG,'Txn Source : ' || l_src_number);

533: if (l_debug = 'Y') then
534: FND_FILE.PUT_LINE(FND_FILE.LOG,'get_source_number ...');
535: FND_FILE.PUT_LINE(FND_FILE.LOG,'Txn Src Type : ' || to_char(i_txn_src_type));
536: FND_FILE.PUT_LINE(FND_FILE.LOG,'Txn Src ID : ' || to_char(i_src_id));
537: FND_FILE.PUT_LINE(FND_FILE.LOG,'Txn Source : ' || l_src_number);
538: end if;
539:
540: return l_src_number;
541: EXCEPTION

Line 544: FND_FILE.PUT_LINE(FND_FILE.LOG,'No data found, using transaction ID');

540: return l_src_number;
541: EXCEPTION
542: when no_data_found then
543: l_src_number := to_char(i_txn_id);
544: FND_FILE.PUT_LINE(FND_FILE.LOG,'No data found, using transaction ID');
545: return l_src_number;
546:
547: END get_source_number;
548:

Line 633: FND_FILE.PUT_LINE(FND_FILE.LOG,'Insert Row in MCLACD...');

629: where transaction_id = i_txn_id;
630:
631: /* Write to log file */
632: if (l_debug = 'Y') then
633: FND_FILE.PUT_LINE(FND_FILE.LOG,'Insert Row in MCLACD...');
634: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer_id:' || to_char(i_layer_id));
635: FND_FILE.PUT_LINE(FND_FILE.LOG,'cur_layer:' || to_char(i_cur_layer_id));
636: FND_FILE.PUT_LINE(FND_FILE.LOG,'qty :'|| to_char(i_qty));
637: FND_FILE.PUT_LINE(FND_FILE.LOG,'actual_cost_table:' || (i_actual_cost_table));

Line 634: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer_id:' || to_char(i_layer_id));

630:
631: /* Write to log file */
632: if (l_debug = 'Y') then
633: FND_FILE.PUT_LINE(FND_FILE.LOG,'Insert Row in MCLACD...');
634: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer_id:' || to_char(i_layer_id));
635: FND_FILE.PUT_LINE(FND_FILE.LOG,'cur_layer:' || to_char(i_cur_layer_id));
636: FND_FILE.PUT_LINE(FND_FILE.LOG,'qty :'|| to_char(i_qty));
637: FND_FILE.PUT_LINE(FND_FILE.LOG,'actual_cost_table:' || (i_actual_cost_table));
638: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer_cost_table:' || (i_layer_cost_table));

Line 635: FND_FILE.PUT_LINE(FND_FILE.LOG,'cur_layer:' || to_char(i_cur_layer_id));

631: /* Write to log file */
632: if (l_debug = 'Y') then
633: FND_FILE.PUT_LINE(FND_FILE.LOG,'Insert Row in MCLACD...');
634: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer_id:' || to_char(i_layer_id));
635: FND_FILE.PUT_LINE(FND_FILE.LOG,'cur_layer:' || to_char(i_cur_layer_id));
636: FND_FILE.PUT_LINE(FND_FILE.LOG,'qty :'|| to_char(i_qty));
637: FND_FILE.PUT_LINE(FND_FILE.LOG,'actual_cost_table:' || (i_actual_cost_table));
638: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer_cost_table:' || (i_layer_cost_table));
639: FND_FILE.PUT_LINE(FND_FILE.LOG,'actual_layer_id :' || to_char(i_actual_layer_id));

Line 636: FND_FILE.PUT_LINE(FND_FILE.LOG,'qty :'|| to_char(i_qty));

632: if (l_debug = 'Y') then
633: FND_FILE.PUT_LINE(FND_FILE.LOG,'Insert Row in MCLACD...');
634: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer_id:' || to_char(i_layer_id));
635: FND_FILE.PUT_LINE(FND_FILE.LOG,'cur_layer:' || to_char(i_cur_layer_id));
636: FND_FILE.PUT_LINE(FND_FILE.LOG,'qty :'|| to_char(i_qty));
637: FND_FILE.PUT_LINE(FND_FILE.LOG,'actual_cost_table:' || (i_actual_cost_table));
638: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer_cost_table:' || (i_layer_cost_table));
639: FND_FILE.PUT_LINE(FND_FILE.LOG,'actual_layer_id :' || to_char(i_actual_layer_id));
640: end if;

Line 637: FND_FILE.PUT_LINE(FND_FILE.LOG,'actual_cost_table:' || (i_actual_cost_table));

633: FND_FILE.PUT_LINE(FND_FILE.LOG,'Insert Row in MCLACD...');
634: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer_id:' || to_char(i_layer_id));
635: FND_FILE.PUT_LINE(FND_FILE.LOG,'cur_layer:' || to_char(i_cur_layer_id));
636: FND_FILE.PUT_LINE(FND_FILE.LOG,'qty :'|| to_char(i_qty));
637: FND_FILE.PUT_LINE(FND_FILE.LOG,'actual_cost_table:' || (i_actual_cost_table));
638: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer_cost_table:' || (i_layer_cost_table));
639: FND_FILE.PUT_LINE(FND_FILE.LOG,'actual_layer_id :' || to_char(i_actual_layer_id));
640: end if;
641:

Line 638: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer_cost_table:' || (i_layer_cost_table));

634: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer_id:' || to_char(i_layer_id));
635: FND_FILE.PUT_LINE(FND_FILE.LOG,'cur_layer:' || to_char(i_cur_layer_id));
636: FND_FILE.PUT_LINE(FND_FILE.LOG,'qty :'|| to_char(i_qty));
637: FND_FILE.PUT_LINE(FND_FILE.LOG,'actual_cost_table:' || (i_actual_cost_table));
638: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer_cost_table:' || (i_layer_cost_table));
639: FND_FILE.PUT_LINE(FND_FILE.LOG,'actual_layer_id :' || to_char(i_actual_layer_id));
640: end if;
641:
642: select count(*)

Line 639: FND_FILE.PUT_LINE(FND_FILE.LOG,'actual_layer_id :' || to_char(i_actual_layer_id));

635: FND_FILE.PUT_LINE(FND_FILE.LOG,'cur_layer:' || to_char(i_cur_layer_id));
636: FND_FILE.PUT_LINE(FND_FILE.LOG,'qty :'|| to_char(i_qty));
637: FND_FILE.PUT_LINE(FND_FILE.LOG,'actual_cost_table:' || (i_actual_cost_table));
638: FND_FILE.PUT_LINE(FND_FILE.LOG,'layer_cost_table:' || (i_layer_cost_table));
639: FND_FILE.PUT_LINE(FND_FILE.LOG,'actual_layer_id :' || to_char(i_actual_layer_id));
640: end if;
641:
642: select count(*)
643: into l_mclacd_exists

Line 691: FND_FILE.put_line(FND_FILE.log, l_msg_data);

687: x_zero_cost_flag => l_zero_cost_flag
688: );
689:
690: if (l_return_status <> fnd_api.g_ret_sts_success) then
691: FND_FILE.put_line(FND_FILE.log, l_msg_data);
692: l_api_message := 'get_zeroCostIssue_flag returned unexpected error';
693: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
694: FND_MESSAGE.set_token('TEXT', l_api_message);
695: FND_MSG_pub.add;

Line 700: FND_FILE.PUT_LINE(FND_FILE.LOG,'zero_cost_flag: '|| to_char(l_zero_cost_flag));

696: raise fnd_api.g_exc_unexpected_error;
697: end if;
698:
699: if (l_debug = 'Y') then
700: FND_FILE.PUT_LINE(FND_FILE.LOG,'zero_cost_flag: '|| to_char(l_zero_cost_flag));
701: end if;
702:
703: insert into mtl_cst_layer_act_cost_details (
704: transaction_id,

Line 765: FND_FILE.put_line(FND_FILE.log, l_msg_data);

761: x_zero_cost_flag => l_zero_cost_flag
762: );
763:
764: if (l_return_status <> fnd_api.g_ret_sts_success) then
765: FND_FILE.put_line(FND_FILE.log, l_msg_data);
766: l_api_message := 'get_zeroCostIssue_flag returned unexpected error';
767: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
768: FND_MESSAGE.set_token('TEXT', l_api_message);
769: FND_MSG_pub.add;

Line 774: FND_FILE.PUT_LINE(FND_FILE.LOG,'zero_cost_flag: '|| to_char(l_zero_cost_flag));

770: raise fnd_api.g_exc_unexpected_error;
771: end if;
772:
773: if (l_debug = 'Y') then
774: FND_FILE.PUT_LINE(FND_FILE.LOG,'zero_cost_flag: '|| to_char(l_zero_cost_flag));
775: end if;
776:
777: insert into mtl_cst_layer_act_cost_details (
778: transaction_id,

Line 1144: FND_FILE.put_line(FND_FILE.log, l_msg_data);

1140: x_zero_cost_flag => l_zero_cost_flag
1141: );
1142:
1143: if (l_return_status <> fnd_api.g_ret_sts_success) then
1144: FND_FILE.put_line(FND_FILE.log, l_msg_data);
1145: l_api_message := 'get_zeroCostIssue_flag returned unexpected error';
1146: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
1147: FND_MESSAGE.set_token('TEXT', l_api_message);
1148: FND_MSG_pub.add;

Line 1153: FND_FILE.PUT_LINE(FND_FILE.LOG,'zero_cost_flag: '|| to_char(l_zero_cost_flag));

1149: raise fnd_api.g_exc_unexpected_error;
1150: end if;
1151:
1152: if (l_debug = 'Y') then
1153: FND_FILE.PUT_LINE(FND_FILE.LOG,'zero_cost_flag: '|| to_char(l_zero_cost_flag));
1154: end if;
1155: insert into mtl_cst_layer_act_cost_details (
1156: transaction_id,
1157: organization_id,

Line 1216: FND_FILE.put_line(FND_FILE.log, l_msg_data);

1212: x_zero_cost_flag => l_zero_cost_flag
1213: );
1214:
1215: if (l_return_status <> fnd_api.g_ret_sts_success) then
1216: FND_FILE.put_line(FND_FILE.log, l_msg_data);
1217: l_api_message := 'get_zeroCostIssue_flag returned unexpected error';
1218: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
1219: FND_MESSAGE.set_token('TEXT', l_api_message);
1220: FND_MSG_pub.add;

Line 1225: FND_FILE.PUT_LINE(FND_FILE.LOG,'zero_cost_flag: '|| to_char(l_zero_cost_flag));

1221: raise fnd_api.g_exc_unexpected_error;
1222: end if;
1223:
1224: if (l_debug = 'Y') then
1225: FND_FILE.PUT_LINE(FND_FILE.LOG,'zero_cost_flag: '|| to_char(l_zero_cost_flag));
1226: end if;
1227:
1228: l_stmt_num := 20;
1229:

Line 1282: FND_FILE.PUT_LINE(FND_FILE.LOG,sql%rowcount || ' records inserted using stmt : ' || to_char(l_stmt_num));

1278:
1279: end if;
1280: end if;
1281: if (l_debug = 'Y') then
1282: FND_FILE.PUT_LINE(FND_FILE.LOG,sql%rowcount || ' records inserted using stmt : ' || to_char(l_stmt_num));
1283: end if;
1284:
1285: if ((l_err_num <> 0) and (l_err_num <> 999)) then
1286: raise process_error;

Line 1396: FND_FILE.PUT_LINE(FND_FILE.LOG,'Insert into MCACD for expense flag of 1...');

1392:
1393: /* If expense item, then insert into MCACD using current costs. No inventory layer created */
1394: IF (i_exp_flag = 1) THEN
1395: IF (l_debug = 'Y') THEN
1396: FND_FILE.PUT_LINE(FND_FILE.LOG,'Insert into MCACD for expense flag of 1...');
1397: END IF;
1398:
1399: l_stmt_num := 5;
1400: SELECT COUNT(*)

Line 1577: FND_FILE.PUT_LINE(FND_FILE.LOG,'Last Inventory Layer : ' || l_inv_layer_id);

1573: FROM cst_inv_layers
1574: WHERE layer_id = i_layer_id;
1575:
1576: IF (l_debug = 'Y') THEN
1577: FND_FILE.PUT_LINE(FND_FILE.LOG,'Last Inventory Layer : ' || l_inv_layer_id);
1578: END IF;
1579:
1580: /* Obtain cost table, whose costs need to be used to insert into MCLACD
1581: If cost_hook is present, use MCACD, else use costs from MCTCD, or the latest

Line 1606: FND_FILE.PUT_LINE(FND_FILE.LOG,'Actual cost table : ' || l_actual_cost_table);

1602: END IF;
1603: END IF;
1604:
1605: IF (l_debug = 'Y') THEN
1606: FND_FILE.PUT_LINE(FND_FILE.LOG,'Actual cost table : ' || l_actual_cost_table);
1607: END IF;
1608:
1609: /* Insert into MCLACD */
1610: l_stmt_num := 40;

Line 1651: FND_FILE.PUT_LINE(FND_FILE.LOG,'Apply layer material overhead ...');

1647: (i_txn_action_id = 32 AND i_txn_src_type = 5) OR /* Assembly completion */
1648: (i_interorg_rec = 1))) /* Interorg receipt */
1649: THEN
1650: IF (l_debug = 'Y') then
1651: FND_FILE.PUT_LINE(FND_FILE.LOG,'Apply layer material overhead ...');
1652: END IF;
1653: l_stmt_num := 50;
1654: apply_layer_material_ovhd(
1655: i_org_id,

Line 1683: FND_FILE.PUT_LINE(FND_FILE.LOG,' l_inv_layer_id ' ||l_inv_layer_id);

1679: END IF;
1680: END IF;
1681:
1682: IF (l_debug = 'Y') THEN
1683: FND_FILE.PUT_LINE(FND_FILE.LOG,' l_inv_layer_id ' ||l_inv_layer_id);
1684: END IF;
1685: /* Check if a layer need to be created */
1686: l_merge := CSTPACHK.LayerMerge_Hook(
1687: i_txn_id => i_txn_id,

Line 1696: fnd_file.put_line(

1692:
1693: IF (l_merge <> 0 AND l_merge <> 1) OR (l_err_num <> 0) THEN
1694: IF l_debug = 'Y' THEN
1695: l_stmt_num := 15;
1696: fnd_file.put_line(
1697: fnd_file.log,
1698: 'CSTPACHK.layer_hook errors out with '||
1699: 'l_merge ='||l_merge||','||
1700: 'l_err_num = '||l_err_num||','||

Line 1697: fnd_file.log,

1693: IF (l_merge <> 0 AND l_merge <> 1) OR (l_err_num <> 0) THEN
1694: IF l_debug = 'Y' THEN
1695: l_stmt_num := 15;
1696: fnd_file.put_line(
1697: fnd_file.log,
1698: 'CSTPACHK.layer_hook errors out with '||
1699: 'l_merge ='||l_merge||','||
1700: 'l_err_num = '||l_err_num||','||
1701: 'l_err_code = '||l_err_code||','||

Line 1724: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_count '||l_count);

1720: AND cil.layer_quantity < 0
1721: AND cil.layer_quantity > cql.layer_quantity;
1722:
1723: IF (l_debug = 'Y') THEN
1724: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_count '||l_count);
1725: END IF;
1726:
1727: IF (l_count = 0) THEN
1728: /* Check the type of the current transaction and the transaction that

Line 1737: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_last_txn_id '||l_last_txn_id);

1733: FROM cst_inv_layers
1734: WHERE inv_layer_id = l_inv_layer_id;
1735:
1736: IF (l_debug = 'Y') THEN
1737: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_last_txn_id '||l_last_txn_id);
1738: END IF;
1739:
1740: l_stmt_num := 65;
1741: BEGIN

Line 1754: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_last_txn_type_id '||l_last_txn_type_id);

1750: AND mmt.rcv_transaction_id = rt1.transaction_id (+)
1751: AND rt1.parent_transaction_id = rt2.transaction_id (+);
1752:
1753: IF (l_debug = 'Y') THEN
1754: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_last_txn_type_id '||l_last_txn_type_id);
1755: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_last_rcv_txn_id '||l_last_rcv_txn_id);
1756: END IF;
1757: EXCEPTION
1758: when no_data_found then

Line 1755: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_last_rcv_txn_id '||l_last_rcv_txn_id);

1751: AND rt1.parent_transaction_id = rt2.transaction_id (+);
1752:
1753: IF (l_debug = 'Y') THEN
1754: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_last_txn_type_id '||l_last_txn_type_id);
1755: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_last_rcv_txn_id '||l_last_rcv_txn_id);
1756: END IF;
1757: EXCEPTION
1758: when no_data_found then
1759: l_last_txn_type_id := -1;

Line 1763: FND_FILE.PUT_LINE(FND_FILE.LOG,'i_txn_id '||i_txn_id);

1759: l_last_txn_type_id := -1;
1760: l_last_rcv_txn_id := -1;
1761: END;
1762:
1763: FND_FILE.PUT_LINE(FND_FILE.LOG,'i_txn_id '||i_txn_id);
1764: l_stmt_num := 70;
1765: SELECT mmt.transaction_type_id,
1766: decode(rt2.parent_transaction_id,-1,rt2.transaction_id,rt2.parent_transaction_id)
1767: INTO l_txn_type_id,

Line 1777: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_txn_type_id '||l_txn_type_id);

1773: AND mmt.rcv_transaction_id = rt1.transaction_id (+)
1774: AND rt1.parent_transaction_id = rt2.transaction_id (+);
1775:
1776: IF (l_debug = 'Y') THEN
1777: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_txn_type_id '||l_txn_type_id);
1778: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_rcv_txn_id '||l_rcv_txn_id);
1779: END IF;
1780:
1781: l_stmt_num := 75;

Line 1778: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_rcv_txn_id '||l_rcv_txn_id);

1774: AND rt1.parent_transaction_id = rt2.transaction_id (+);
1775:
1776: IF (l_debug = 'Y') THEN
1777: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_txn_type_id '||l_txn_type_id);
1778: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_rcv_txn_id '||l_rcv_txn_id);
1779: END IF;
1780:
1781: l_stmt_num := 75;
1782: IF ( ( (l_txn_type_id = l_last_txn_type_id)

Line 1809: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_last_moh '||l_last_moh);

1805: AND cost_element_id = 2
1806: AND level_type = 1;
1807:
1808: IF (l_debug = 'Y') THEN
1809: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_last_moh '||l_last_moh);
1810: END IF;
1811: l_stmt_num := 85;
1812:
1813: SELECT nvl(SUM(actual_cost),0)

Line 1824: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_moh '||l_moh);

1820: AND cost_element_id = 2
1821: AND level_type = 1;
1822:
1823: IF (l_debug = 'Y') THEN
1824: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_moh '||l_moh);
1825: END IF;
1826:
1827: IF (l_last_moh=l_moh) THEN
1828: l_create := 0;

Line 1850: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_last_layer_cost '||l_last_layer_cost);

1846:
1847:
1848:
1849: IF (l_debug = 'Y') THEN
1850: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_last_layer_cost '||l_last_layer_cost);
1851: END IF;
1852: l_stmt_num := 87;
1853:
1854:

Line 1867: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_layer_cost '||l_layer_cost);

1863: AND level_type = 1;
1864:
1865:
1866: IF (l_debug = 'Y') THEN
1867: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_layer_cost '||l_layer_cost);
1868: END IF;
1869:
1870:
1871: IF (l_last_layer_cost=l_layer_cost) THEN

Line 1879: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_actual_cost_table '||l_actual_cost_table);

1875: END IF;
1876: END IF;
1877: ELSE
1878: IF (l_debug = 'Y') THEN
1879: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_actual_cost_table '||l_actual_cost_table);
1880: END IF;
1881: IF (l_actual_cost_table = 'CILCD') THEN
1882: l_create := 0;
1883: END IF;

Line 1890: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_create '||l_create);

1886: END IF;
1887: END IF;
1888:
1889: IF (l_debug = 'Y') THEN
1890: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_create '||l_create);
1891: END IF;
1892:
1893: IF (l_create = 0) THEN
1894: IF (l_debug = 'Y') THEN

Line 1895: FND_FILE.PUT_LINE(FND_FILE.LOG,'Adding inventory layers ...');

1891: END IF;
1892:
1893: IF (l_create = 0) THEN
1894: IF (l_debug = 'Y') THEN
1895: FND_FILE.PUT_LINE(FND_FILE.LOG,'Adding inventory layers ...');
1896: FND_FILE.PUT_LINE(FND_FILE.LOG,'Inventory Layer Number : ' || to_char(l_inv_layer_id));
1897: FND_FILE.PUT_LINE(FND_FILE.LOG,'Inventory Layer Quantity : ' || to_char(i_txn_qty));
1898: END IF;
1899:

Line 1896: FND_FILE.PUT_LINE(FND_FILE.LOG,'Inventory Layer Number : ' || to_char(l_inv_layer_id));

1892:
1893: IF (l_create = 0) THEN
1894: IF (l_debug = 'Y') THEN
1895: FND_FILE.PUT_LINE(FND_FILE.LOG,'Adding inventory layers ...');
1896: FND_FILE.PUT_LINE(FND_FILE.LOG,'Inventory Layer Number : ' || to_char(l_inv_layer_id));
1897: FND_FILE.PUT_LINE(FND_FILE.LOG,'Inventory Layer Quantity : ' || to_char(i_txn_qty));
1898: END IF;
1899:
1900: /* Get transaction source ID for the transaction */

Line 1897: FND_FILE.PUT_LINE(FND_FILE.LOG,'Inventory Layer Quantity : ' || to_char(i_txn_qty));

1893: IF (l_create = 0) THEN
1894: IF (l_debug = 'Y') THEN
1895: FND_FILE.PUT_LINE(FND_FILE.LOG,'Adding inventory layers ...');
1896: FND_FILE.PUT_LINE(FND_FILE.LOG,'Inventory Layer Number : ' || to_char(l_inv_layer_id));
1897: FND_FILE.PUT_LINE(FND_FILE.LOG,'Inventory Layer Quantity : ' || to_char(i_txn_qty));
1898: END IF;
1899:
1900: /* Get transaction source ID for the transaction */
1901: l_stmt_num := 86;

Line 1936: FND_FILE.PUT_LINE(FND_FILE.LOG,'Creating inventory layers ...');

1932: INTO l_inv_layer_id
1933: FROM dual;
1934:
1935: IF (l_debug = 'Y') THEN
1936: FND_FILE.PUT_LINE(FND_FILE.LOG,'Creating inventory layers ...');
1937: FND_FILE.PUT_LINE(FND_FILE.LOG,'Inventory Layer Number : ' || to_char(l_inv_layer_id));
1938: FND_FILE.PUT_LINE(FND_FILE.LOG,'Inventory Layer Quantity : ' || to_char(i_txn_qty));
1939: END IF;
1940:

Line 1937: FND_FILE.PUT_LINE(FND_FILE.LOG,'Inventory Layer Number : ' || to_char(l_inv_layer_id));

1933: FROM dual;
1934:
1935: IF (l_debug = 'Y') THEN
1936: FND_FILE.PUT_LINE(FND_FILE.LOG,'Creating inventory layers ...');
1937: FND_FILE.PUT_LINE(FND_FILE.LOG,'Inventory Layer Number : ' || to_char(l_inv_layer_id));
1938: FND_FILE.PUT_LINE(FND_FILE.LOG,'Inventory Layer Quantity : ' || to_char(i_txn_qty));
1939: END IF;
1940:
1941: /* Update MCLACD entries */

Line 1938: FND_FILE.PUT_LINE(FND_FILE.LOG,'Inventory Layer Quantity : ' || to_char(i_txn_qty));

1934:
1935: IF (l_debug = 'Y') THEN
1936: FND_FILE.PUT_LINE(FND_FILE.LOG,'Creating inventory layers ...');
1937: FND_FILE.PUT_LINE(FND_FILE.LOG,'Inventory Layer Number : ' || to_char(l_inv_layer_id));
1938: FND_FILE.PUT_LINE(FND_FILE.LOG,'Inventory Layer Quantity : ' || to_char(i_txn_qty));
1939: END IF;
1940:
1941: /* Update MCLACD entries */
1942: l_stmt_num := 100;

Line 1949: FND_FILE.PUT_LINE(FND_FILE.LOG, sql%rowcount || ' records updated in mclacd for ' || l_inv_layer_id);

1945: WHERE transaction_id = i_txn_id
1946: AND organization_id = i_org_id
1947: AND layer_id = i_layer_id;
1948:
1949: FND_FILE.PUT_LINE(FND_FILE.LOG, sql%rowcount || ' records updated in mclacd for ' || l_inv_layer_id);
1950:
1951: /* Get transaction source ID for the transaction */
1952: l_stmt_num := 105;
1953: SELECT transaction_source_id

Line 2014: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Inventory layer created');

2010: i_prg_id,
2011: sysdate);
2012:
2013: IF (l_debug = 'Y') THEN
2014: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Inventory layer created');
2015: END IF;
2016:
2017: /* Delete cost details for the inventory layer from CILCD. No rows should
2018: be present. Just a safety check */

Line 2066: FND_FILE.PUT_LINE(FND_FILE.LOG, sql%rowcount || ' records copied from mclacd for ' || l_inv_layer_id);

2062: inv_layer_id,
2063: cost_element_id,
2064: level_type;
2065:
2066: FND_FILE.PUT_LINE(FND_FILE.LOG, sql%rowcount || ' records copied from mclacd for ' || l_inv_layer_id);
2067: /* Update layer cost in CIL */
2068: l_stmt_num := 130;
2069: IF (nvl(i_interorg_rec,-1) <> 3) THEN
2070: UPDATE cst_inv_layers

Line 2093: FND_FILE.PUT_LINE(FND_FILE.LOG,'CIL cost updated from CILCD');

2089: AND inv_layer_id = l_inv_layer_id;
2090: END IF;
2091:
2092: IF (l_debug = 'Y') THEN
2093: FND_FILE.PUT_LINE(FND_FILE.LOG,'CIL cost updated from CILCD');
2094: END IF;
2095: END IF; /* l_create = 0 */
2096:
2097: /* Create cursor to find any negative layers, order in FIFO/LIFO method */

Line 2116: FND_FILE.PUT_LINE(

2112:
2113: l_qty_available := abs(i_txn_qty);
2114:
2115: IF (l_debug = 'Y') then
2116: FND_FILE.PUT_LINE(
2117: FND_FILE.LOG,
2118: 'Qty available for replenishment : ' || to_char(l_qty_available));
2119: END IF;
2120:

Line 2117: FND_FILE.LOG,

2113: l_qty_available := abs(i_txn_qty);
2114:
2115: IF (l_debug = 'Y') then
2116: FND_FILE.PUT_LINE(
2117: FND_FILE.LOG,
2118: 'Qty available for replenishment : ' || to_char(l_qty_available));
2119: END IF;
2120:
2121: /* Loop while positive quantity is available, get the next negative layer and

Line 2328: FND_FILE.PUT_LINE(FND_FILE.LOG,'Consuming inventory layers from CG layer : ' || to_char(i_layer_id));

2324: l_debug := FND_PROFILE.VALUE('MRP_DEBUG');
2325:
2326: l_stmt_num := 5;
2327: if (l_debug = 'Y') then
2328: FND_FILE.PUT_LINE(FND_FILE.LOG,'Consuming inventory layers from CG layer : ' || to_char(i_layer_id));
2329: end if;
2330: select count(*)
2331: into l_layers_exist
2332: from cst_inv_layers

Line 2337: FND_FILE.PUT_LINE(FND_FILE.LOG,'Creating negative layer ...');

2333: where layer_id = i_layer_id;
2334:
2335: if (l_layers_exist = 0) then
2336: if (l_debug = 'Y') then
2337: FND_FILE.PUT_LINE(FND_FILE.LOG,'Creating negative layer ...');
2338: end if;
2339:
2340: /* Bug 2325297
2341: Create Layers is called with i_interorg_rec parameter as NULL

Line 2386: FND_FILE.PUT_LINE(FND_FILE.LOG,'Insert into MCACD for expense item...');

2382:
2383: l_stmt_num := 7;
2384: if (l_exp_item = 1) then
2385: if (l_debug = 'Y') then
2386: FND_FILE.PUT_LINE(FND_FILE.LOG,'Insert into MCACD for expense item...');
2387: end if;
2388: select count(*) into l_count
2389: from cst_layer_cost_details
2390: where layer_id = i_layer_id;

Line 2508: fnd_file.put_line(

2504: l_err_msg);
2505: IF l_err_num <> 0 THEN
2506: IF l_debug = 'Y' THEN
2507: l_stmt_num := 15;
2508: fnd_file.put_line(
2509: fnd_file.log,
2510: 'CSTPACHK.layer_hook errors out with '||
2511: 'l_err_num = '||l_err_num||','||
2512: 'l_err_code = '||l_err_code||','||

Line 2509: fnd_file.log,

2505: IF l_err_num <> 0 THEN
2506: IF l_debug = 'Y' THEN
2507: l_stmt_num := 15;
2508: fnd_file.put_line(
2509: fnd_file.log,
2510: 'CSTPACHK.layer_hook errors out with '||
2511: 'l_err_num = '||l_err_num||','||
2512: 'l_err_code = '||l_err_code||','||
2513: 'l_err_msg = '||l_err_msg

Line 2543: FND_FILE.PUT_LINE(FND_FILE.LOG,'Layer specific consumption...');

2539: where organization_id = i_org_id
2540: and secondary_inventory_name = l_subinv;
2541:
2542: if (l_debug = 'Y') then
2543: FND_FILE.PUT_LINE(FND_FILE.LOG,'Layer specific consumption...');
2544: FND_FILE.PUT_LINE(FND_FILE.LOG,'Layer hook : ' || to_char(l_layer_hook));
2545: FND_FILE.PUT_LINE(FND_FILE.LOG,'Source ID : ' || to_char(l_src_id));
2546: end if;
2547: if (l_expsub = 1) then

Line 2544: FND_FILE.PUT_LINE(FND_FILE.LOG,'Layer hook : ' || to_char(l_layer_hook));

2540: and secondary_inventory_name = l_subinv;
2541:
2542: if (l_debug = 'Y') then
2543: FND_FILE.PUT_LINE(FND_FILE.LOG,'Layer specific consumption...');
2544: FND_FILE.PUT_LINE(FND_FILE.LOG,'Layer hook : ' || to_char(l_layer_hook));
2545: FND_FILE.PUT_LINE(FND_FILE.LOG,'Source ID : ' || to_char(l_src_id));
2546: end if;
2547: if (l_expsub = 1) then
2548: IF (l_debug = 'Y') THEN

Line 2545: FND_FILE.PUT_LINE(FND_FILE.LOG,'Source ID : ' || to_char(l_src_id));

2541:
2542: if (l_debug = 'Y') then
2543: FND_FILE.PUT_LINE(FND_FILE.LOG,'Layer specific consumption...');
2544: FND_FILE.PUT_LINE(FND_FILE.LOG,'Layer hook : ' || to_char(l_layer_hook));
2545: FND_FILE.PUT_LINE(FND_FILE.LOG,'Source ID : ' || to_char(l_src_id));
2546: end if;
2547: if (l_expsub = 1) then
2548: IF (l_debug = 'Y') THEN
2549: FND_FILE.PUT_LINE(FND_FILE.LOG,'Insert into MCACD for the Item Coming from Exp Sub Inv ...');

Line 2549: FND_FILE.PUT_LINE(FND_FILE.LOG,'Insert into MCACD for the Item Coming from Exp Sub Inv ...');

2545: FND_FILE.PUT_LINE(FND_FILE.LOG,'Source ID : ' || to_char(l_src_id));
2546: end if;
2547: if (l_expsub = 1) then
2548: IF (l_debug = 'Y') THEN
2549: FND_FILE.PUT_LINE(FND_FILE.LOG,'Insert into MCACD for the Item Coming from Exp Sub Inv ...');
2550: END IF;
2551:
2552: l_stmt_num := 21;
2553: SELECT COUNT(*)

Line 2700: FND_FILE.PUT_LINE(FND_FILE.LOG,'Consumption from exp subinv');

2696: expense subinv for asset item should come from only the next layer that
2697: would be consumed if it were from asset subinv */
2698: l_stmt_num := 27;
2699: if (l_debug = 'Y') then
2700: FND_FILE.PUT_LINE(FND_FILE.LOG,'Consumption from exp subinv');
2701: end if;
2702:
2703: get_layers_consumed(
2704: i_txn_id => i_txn_id,

Line 2717: fnd_file.put_line(fnd_file.log, 'Regular consumption ');

2713: );
2714: else
2715: l_stmt_num := 30;
2716: if (l_debug = 'Y') then
2717: fnd_file.put_line(fnd_file.log, 'Regular consumption ');
2718: end if;
2719:
2720: get_layers_consumed(
2721: i_txn_id => i_txn_id,

Line 2807: FND_FILE.PUT_LINE(FND_FILE.LOG,'Calling apply_layer_material_ovhd...');

2803: )
2804: ) then
2805: l_stmt_num :=60;
2806: if (l_debug = 'Y') then
2807: FND_FILE.PUT_LINE(FND_FILE.LOG,'Calling apply_layer_material_ovhd...');
2808: end if;
2809: apply_layer_material_ovhd(
2810: i_org_id,
2811: i_txn_id,

Line 2844: FND_FILE.PUT_LINE(FND_FILE.LOG,'CIL.layer_qty changed by ' || to_char(l_inv_layer_table(i).layer_quantity));

2840: update cst_inv_layers
2841: set layer_quantity = nvl(layer_quantity,0)-l_inv_layer_table(i).layer_quantity
2842: where inv_layer_id = l_inv_layer_table(i).inv_layer_id;
2843: if (l_debug = 'Y') then
2844: FND_FILE.PUT_LINE(FND_FILE.LOG,'CIL.layer_qty changed by ' || to_char(l_inv_layer_table(i).layer_quantity));
2845: end if;
2846: end if;
2847: END LOOP;
2848: END IF; /* IF l_inv_layer_table.COUNT >0 THEN */

Line 2934: fnd_file.put_line(

2930: l_err_num := 0;
2931: l_err_code := '';
2932: l_err_msg := '';
2933: IF l_debug = 'Y' THEN
2934: fnd_file.put_line(
2935: fnd_file.log,
2936: 'Entering get_layers_consumed for transaction '||i_txn_id||
2937: ' and a required quantity of '||l_required_qty||
2938: ' with a consumption mode of '||consume_mode

Line 2935: fnd_file.log,

2931: l_err_code := '';
2932: l_err_msg := '';
2933: IF l_debug = 'Y' THEN
2934: fnd_file.put_line(
2935: fnd_file.log,
2936: 'Entering get_layers_consumed for transaction '||i_txn_id||
2937: ' and a required quantity of '||l_required_qty||
2938: ' with a consumption mode of '||consume_mode
2939: );

Line 2948: fnd_file.put_line(fnd_file.log,'EXPSUB consumption');

2944: Instead, we just need to get a reference cost from the earliest / latest layer */
2945:
2946: IF consume_mode = 'EXPSUB' THEN
2947: IF l_debug = 'Y' THEN
2948: fnd_file.put_line(fnd_file.log,'EXPSUB consumption');
2949: END IF;
2950: IF i_cost_method = 5 THEN
2951: l_stmt_num := 10;
2952: SELECT MIN(inv_layer_id)

Line 3006: fnd_file.put_line(fnd_file.log,'Trying custom layer '||l_custom_layer);

3002:
3003: /* 1. Positive quantity in the layer specified by the layer hook */
3004: IF (l_custom_layer > 0) AND (l_required_qty > 0) THEN
3005: IF l_debug = 'Y' THEN
3006: fnd_file.put_line(fnd_file.log,'Trying custom layer '||l_custom_layer);
3007: END IF;
3008: l_stmt_num := 30;
3009: SELECT inv_layer_id, layer_quantity
3010: INTO l_inv_layer_rec.inv_layer_id,l_inv_layer_rec.layer_quantity

Line 3019: fnd_file.put_line(

3015: IF l_required_qty < l_inv_layer_rec.layer_quantity THEN
3016: l_inv_layer_rec.layer_quantity := l_required_qty;
3017: END IF;
3018: IF l_debug = 'Y' THEN
3019: fnd_file.put_line(
3020: fnd_file.log,
3021: 'Using custom layer '||l_custom_layer||' for '||l_inv_layer_rec.layer_quantity
3022: );
3023: END IF;

Line 3020: fnd_file.log,

3016: l_inv_layer_rec.layer_quantity := l_required_qty;
3017: END IF;
3018: IF l_debug = 'Y' THEN
3019: fnd_file.put_line(
3020: fnd_file.log,
3021: 'Using custom layer '||l_custom_layer||' for '||l_inv_layer_rec.layer_quantity
3022: );
3023: END IF;
3024: l_required_qty := l_required_qty - l_inv_layer_rec.layer_quantity;

Line 3035: fnd_file.put_line(fnd_file.log,'Driving custom layer '||l_custom_layer||' negative?');

3031: /* 2. Drive the layer specified by the layer hook negative only if there are no
3032: other positive layers */
3033: IF (l_custom_layer > 0) AND (l_required_qty > 0) THEN
3034: IF l_debug = 'Y' THEN
3035: fnd_file.put_line(fnd_file.log,'Driving custom layer '||l_custom_layer||' negative?');
3036: END IF;
3037: l_stmt_num := 40;
3038: SELECT count(*)
3039: INTO l_pos_layer_exist

Line 3046: fnd_file.put_line(fnd_file.log,'Driving custom layer '||l_custom_layer||' negative');

3042: AND inv_layer_id <> l_custom_layer
3043: AND layer_quantity > 0;
3044: IF l_pos_layer_exist = 0 THEN
3045: IF l_debug = 'Y' THEN
3046: fnd_file.put_line(fnd_file.log,'Driving custom layer '||l_custom_layer||' negative');
3047: END IF;
3048: l_inv_layer_rec.inv_layer_id := l_custom_layer;
3049: l_inv_layer_rec.layer_quantity := l_required_qty;
3050: l_required_qty := 0;

Line 3060: fnd_file.put_line(fnd_file.log,'Trying custom layers');

3056:
3057: /* 3. Positive quantity from the layers specified in the layers hook in the order that they are specified */
3058: IF l_required_qty > 0 THEN
3059: IF l_debug = 'Y' THEN
3060: fnd_file.put_line(fnd_file.log,'Trying custom layers');
3061: END IF;
3062: l_stmt_num := 50;
3063: CSTPACHK.layers_hook (
3064: i_txn_id => i_txn_id,

Line 3073: fnd_file.put_line(fnd_file.log,'Error in calling CSTPACHK.layers_hook');

3069: o_err_code => l_err_code,
3070: o_err_msg => l_err_msg
3071: );
3072: IF l_err_num <> 0 THEN
3073: fnd_file.put_line(fnd_file.log,'Error in calling CSTPACHK.layers_hook');
3074: RAISE process_error;
3075: END IF;
3076: l_layers_hook := 0;
3077: l_layers_list := '(-1';

Line 3079: fnd_file.put_line(fnd_file.log,'There are '||l_custom_layers.COUNT||' custom layers');

3075: END IF;
3076: l_layers_hook := 0;
3077: l_layers_list := '(-1';
3078: IF l_debug = 'Y' THEN
3079: fnd_file.put_line(fnd_file.log,'There are '||l_custom_layers.COUNT||' custom layers');
3080: END IF;
3081: IF l_custom_layers.COUNT > 0 THEN
3082: FOR i IN l_custom_layers.FIRST..l_custom_layers.LAST LOOP
3083: EXIT WHEN l_required_qty = 0;

Line 3085: fnd_file.put_line(

3081: IF l_custom_layers.COUNT > 0 THEN
3082: FOR i IN l_custom_layers.FIRST..l_custom_layers.LAST LOOP
3083: EXIT WHEN l_required_qty = 0;
3084: IF l_debug = 'Y' THEN
3085: fnd_file.put_line(
3086: fnd_file.log,
3087: 'Trying to consume '||l_custom_layers(i).layer_quantity||
3088: ' from custom layer '||l_custom_layers(i).inv_layer_id
3089: );

Line 3086: fnd_file.log,

3082: FOR i IN l_custom_layers.FIRST..l_custom_layers.LAST LOOP
3083: EXIT WHEN l_required_qty = 0;
3084: IF l_debug = 'Y' THEN
3085: fnd_file.put_line(
3086: fnd_file.log,
3087: 'Trying to consume '||l_custom_layers(i).layer_quantity||
3088: ' from custom layer '||l_custom_layers(i).inv_layer_id
3089: );
3090: END IF;

Line 3107: fnd_file.put_line(

3103: l_err_num := -1;
3104: l_err_msg := 'Custom layer '||l_custom_layers(i).inv_layer_id||
3105: ' and quantity '||l_custom_layers(i).layer_quantity||
3106: ' is not valid';
3107: fnd_file.put_line(
3108: fnd_file.log, l_err_msg
3109: );
3110: RAISE process_error;
3111: END;

Line 3108: fnd_file.log, l_err_msg

3104: l_err_msg := 'Custom layer '||l_custom_layers(i).inv_layer_id||
3105: ' and quantity '||l_custom_layers(i).layer_quantity||
3106: ' is not valid';
3107: fnd_file.put_line(
3108: fnd_file.log, l_err_msg
3109: );
3110: RAISE process_error;
3111: END;
3112: -- ignore the layer if it has been specified by the layer hook to avoid double counting.

Line 3120: fnd_file.put_line(

3116: END IF;
3117: l_required_qty := l_required_qty - l_inv_layer_rec.layer_quantity;
3118: l_stmt_num := 60;
3119: IF l_debug = 'Y' THEN
3120: fnd_file.put_line(
3121: fnd_file.log,
3122: 'Using custom layer '||l_custom_layers(i).inv_layer_id||
3123: ' for '||l_inv_layer_rec.layer_quantity
3124: );

Line 3121: fnd_file.log,

3117: l_required_qty := l_required_qty - l_inv_layer_rec.layer_quantity;
3118: l_stmt_num := 60;
3119: IF l_debug = 'Y' THEN
3120: fnd_file.put_line(
3121: fnd_file.log,
3122: 'Using custom layer '||l_custom_layers(i).inv_layer_id||
3123: ' for '||l_inv_layer_rec.layer_quantity
3124: );
3125: END IF;

Line 3140: fnd_file.put_line(fnd_file.log,'Trying original delivery');

3136: /* 4. Positive quantity from the layer that was created for the delivery that this
3137: return / correction corresponds to */
3138: IF (consume_mode = 'SPECIFIC') AND (i_src_id IS NOT NULL) AND (l_required_qty > 0) then
3139: IF l_debug = 'Y' THEN
3140: fnd_file.put_line(fnd_file.log,'Trying original delivery');
3141: END IF;
3142: -- check if the current transaction is a return to receiving or correction
3143: l_stmt_num := 65;
3144: SELECT COUNT(*)

Line 3166: FND_FILE.PUT_LINE(

3162: AND mmt_rtr.transaction_id = i_txn_id;
3163: EXCEPTION
3164: WHEN OTHERS THEN
3165: IF (l_debug = 'Y') THEN
3166: FND_FILE.PUT_LINE(
3167: FND_FILE.LOG,
3168: 'No delivery is found for transaction ' || i_txn_id
3169: );
3170: END IF;

Line 3167: FND_FILE.LOG,

3163: EXCEPTION
3164: WHEN OTHERS THEN
3165: IF (l_debug = 'Y') THEN
3166: FND_FILE.PUT_LINE(
3167: FND_FILE.LOG,
3168: 'No delivery is found for transaction ' || i_txn_id
3169: );
3170: END IF;
3171: END;

Line 3183: fnd_file.put_line(

3179: l_stmt_num := 80;
3180: sql_stmt := sql_stmt || ' AND inv_layer_id NOT IN '|| l_layers_list;
3181: END IF;
3182: IF l_debug = 'Y' THEN
3183: fnd_file.put_line(
3184: fnd_file.log,
3185: 'Using SQL '||sql_stmt||' with '||l_rtr_txn_id||','||l_custom_layer
3186: );
3187: END IF;

Line 3184: fnd_file.log,

3180: sql_stmt := sql_stmt || ' AND inv_layer_id NOT IN '|| l_layers_list;
3181: END IF;
3182: IF l_debug = 'Y' THEN
3183: fnd_file.put_line(
3184: fnd_file.log,
3185: 'Using SQL '||sql_stmt||' with '||l_rtr_txn_id||','||l_custom_layer
3186: );
3187: END IF;
3188: OPEN inv_layer_cursor FOR sql_stmt USING l_rtr_txn_id, l_custom_layer;

Line 3207: fnd_file.put_line(fnd_file.log,'Trying other layers with the same source');

3203: /* 5. Positive quantity from the layers that was created for the deliveries for
3204: the same PO or completions from the same job in FIFO/LIFO manner */
3205: IF (consume_mode = 'SPECIFIC') AND (i_src_id IS NOT NULL) AND (l_required_qty > 0) THEN
3206: IF l_debug = 'Y' THEN
3207: fnd_file.put_line(fnd_file.log,'Trying other layers with the same source');
3208: END IF;
3209: l_stmt_num := 90;
3210: sql_stmt := 'SELECT inv_layer_id,layer_quantity FROM cst_inv_layers'
3211: ||' WHERE layer_id = :i AND transaction_source_id = :j AND layer_quantity > 0 '

Line 3225: fnd_file.put_line(

3221: l_stmt_num := 105;
3222: sql_stmt := sql_stmt || ' ORDER BY creation_date, inv_layer_id';
3223: END IF;
3224: IF l_debug = 'Y' THEN
3225: fnd_file.put_line(
3226: fnd_file.log,
3227: 'Using SQL '||sql_stmt||' with '||i_layer_id||','||l_source_id||
3228: ','||l_rtr_txn_id||','||l_custom_layer
3229: );

Line 3226: fnd_file.log,

3222: sql_stmt := sql_stmt || ' ORDER BY creation_date, inv_layer_id';
3223: END IF;
3224: IF l_debug = 'Y' THEN
3225: fnd_file.put_line(
3226: fnd_file.log,
3227: 'Using SQL '||sql_stmt||' with '||i_layer_id||','||l_source_id||
3228: ','||l_rtr_txn_id||','||l_custom_layer
3229: );
3230: END IF;

Line 3250: fnd_file.put_line(

3246: same PO or completions from the same job negative only if there are
3247: no other positive layers */
3248: IF (consume_mode = 'SPECIFIC') AND (i_src_id IS NOT NULL) AND (l_required_qty > 0) THEN
3249: IF l_debug = 'Y' THEN
3250: fnd_file.put_line(
3251: fnd_file.log,
3252: 'Driving earliest/latest layer with the same source negative?'
3253: );
3254: END IF;

Line 3251: fnd_file.log,

3247: no other positive layers */
3248: IF (consume_mode = 'SPECIFIC') AND (i_src_id IS NOT NULL) AND (l_required_qty > 0) THEN
3249: IF l_debug = 'Y' THEN
3250: fnd_file.put_line(
3251: fnd_file.log,
3252: 'Driving earliest/latest layer with the same source negative?'
3253: );
3254: END IF;
3255: l_stmt_num := 115;

Line 3265: fnd_file.put_line(

3261: l_stmt_num := 120;
3262: sql_stmt := sql_stmt || ' AND inv_layer_id NOT IN ' || l_layers_list;
3263: END IF;
3264: IF l_debug = 'Y' THEN
3265: fnd_file.put_line(
3266: fnd_file.log,
3267: 'Using SQL '||sql_stmt||' with '||i_layer_id||','||l_custom_layer||
3268: ','||l_source_id
3269: );

Line 3266: fnd_file.log,

3262: sql_stmt := sql_stmt || ' AND inv_layer_id NOT IN ' || l_layers_list;
3263: END IF;
3264: IF l_debug = 'Y' THEN
3265: fnd_file.put_line(
3266: fnd_file.log,
3267: 'Using SQL '||sql_stmt||' with '||i_layer_id||','||l_custom_layer||
3268: ','||l_source_id
3269: );
3270: END IF;

Line 3291: fnd_file.put_line(

3287: AND transaction_source_id = l_source_id;
3288: END IF;
3289: IF l_inv_layer_rec.inv_layer_id IS NOT NULL THEN
3290: IF l_debug = 'Y' THEN
3291: fnd_file.put_line(
3292: fnd_file.log,
3293: 'Driving earliest/latest layer with the same source negative'
3294: );
3295: END IF;

Line 3292: fnd_file.log,

3288: END IF;
3289: IF l_inv_layer_rec.inv_layer_id IS NOT NULL THEN
3290: IF l_debug = 'Y' THEN
3291: fnd_file.put_line(
3292: fnd_file.log,
3293: 'Driving earliest/latest layer with the same source negative'
3294: );
3295: END IF;
3296: l_inv_layer_rec.layer_quantity := l_required_qty;

Line 3309: fnd_file.put_line(fnd_file.log,'General consumption');

3305:
3306: /* 7. Positive quantity from all layers in FIFO/LIFO manner */
3307: IF l_required_qty > 0 THEN
3308: IF l_debug = 'Y' THEN
3309: fnd_file.put_line(fnd_file.log,'General consumption');
3310: END IF;
3311: l_stmt_num := 140;
3312: sql_stmt := 'SELECT inv_layer_id,layer_quantity FROM cst_inv_layers WHERE layer_id = :i'
3313: ||' AND inv_layer_id <> :j AND NVL(transaction_source_id,-2) <> :k'

Line 3327: fnd_file.put_line(

3323: l_stmt_num := 155;
3324: sql_stmt := sql_stmt || ' ORDER BY creation_date, inv_layer_id';
3325: END IF;
3326: IF l_debug = 'Y' THEN
3327: fnd_file.put_line(
3328: fnd_file.log,
3329: 'Using SQL '||sql_stmt||' with '||i_layer_id||','||l_custom_layer||
3330: ','||l_source_id
3331: );

Line 3328: fnd_file.log,

3324: sql_stmt := sql_stmt || ' ORDER BY creation_date, inv_layer_id';
3325: END IF;
3326: IF l_debug = 'Y' THEN
3327: fnd_file.put_line(
3328: fnd_file.log,
3329: 'Using SQL '||sql_stmt||' with '||i_layer_id||','||l_custom_layer||
3330: ','||l_source_id
3331: );
3332: END IF;

Line 3350: fnd_file.put_line(fnd_file.log,'Driving earliest/latest layer negative');

3346:
3347: /* 8. Drive the overall earliest / latest layer negative */
3348: IF l_required_qty > 0 THEN
3349: IF l_debug = 'Y' THEN
3350: fnd_file.put_line(fnd_file.log,'Driving earliest/latest layer negative');
3351: END IF;
3352: IF l_debug = 'Y' THEN
3353: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_neg_qty ' || to_char(l_required_qty));
3354: END IF;

Line 3353: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_neg_qty ' || to_char(l_required_qty));

3349: IF l_debug = 'Y' THEN
3350: fnd_file.put_line(fnd_file.log,'Driving earliest/latest layer negative');
3351: END IF;
3352: IF l_debug = 'Y' THEN
3353: FND_FILE.PUT_LINE(FND_FILE.LOG,'l_neg_qty ' || to_char(l_required_qty));
3354: END IF;
3355: l_stmt_num := 165;
3356: sql_stmt := 'SELECT inv_layer_id,layer_quantity FROM cst_inv_layers WHERE layer_id = :i';
3357: IF i_cost_method = 5 THEN

Line 3363: fnd_file.put_line(fnd_file.log,'Using SQL '||sql_stmt||' with '||i_layer_id);

3359: ELSE
3360: sql_stmt := sql_stmt || ' ORDER BY creation_date,inv_layer_id';
3361: END IF;
3362: IF l_debug = 'Y' THEN
3363: fnd_file.put_line(fnd_file.log,'Using SQL '||sql_stmt||' with '||i_layer_id);
3364: END IF;
3365: OPEN inv_layer_cursor FOR sql_stmt USING i_layer_id;
3366: FETCH inv_layer_cursor into l_inv_layer_rec.inv_layer_id,l_inv_layer_rec.layer_quantity;
3367: l_inv_layer_rec.layer_quantity := l_required_qty;

Line 3381: FND_FILE.PUT_LINE(FND_FILE.LOG,SQLCODE ||' ' ||to_char(l_stmt_num)||' '||substr(SQLERRM,1,200));

3377: o_err_code := l_err_code;
3378: o_err_msg := l_err_msg;
3379: when others then
3380: rollback;
3381: FND_FILE.PUT_LINE(FND_FILE.LOG,SQLCODE ||' ' ||to_char(l_stmt_num)||' '||substr(SQLERRM,1,200));
3382: o_err_num := SQLCODE;
3383: o_err_msg := 'CSTPLENG.get_layers_consumed (' || to_char(l_stmt_num) || '): ' || substr(SQLERRM,1,200);
3384: END get_layers_consumed;
3385:

Line 3605: fnd_file.put_line(fnd_file.log, 'In apply_layer_material_ovhd!!!!');

3601: -- Find out if there are any material overhead rows for the layer
3602: -- which have actual cost value.
3603:
3604: if(l_debug = 'Y') then
3605: fnd_file.put_line(fnd_file.log, 'In apply_layer_material_ovhd!!!!');
3606: end if;
3607:
3608: l_stmt_num := 10;
3609: /* Changes for MOH Absorption Rules */

Line 3632: fnd_file.put_line(fnd_file.log, '--Material Overhead Absorption Overidden--'); ELSE

3628: RAISE moh_rules_error;
3629: END IF;
3630:
3631: IF(l_earn_moh = 0) THEN
3632: fnd_file.put_line(fnd_file.log, '--Material Overhead Absorption Overidden--'); ELSE
3633:
3634: l_stmt_num := 11;
3635:
3636: select count(*)

Line 3758: fnd_file.put_line(fnd_file.log, 'Inserting into MACS');

3754:
3755: l_stmt_num := 35;
3756:
3757: if(l_debug = 'Y') then
3758: fnd_file.put_line(fnd_file.log, 'Inserting into MACS');
3759: end if;
3760:
3761: Insert into mtl_actual_cost_subelement(
3762: transaction_id,

Line 3869: fnd_file.put_line(fnd_file.log, 'Inserting into MACS');

3865:
3866:
3867: l_stmt_num := 55;
3868: if(l_debug = 'Y') then
3869: fnd_file.put_line(fnd_file.log, 'Inserting into MACS');
3870: end if;
3871:
3872: Insert into mtl_actual_cost_subelement(
3873: transaction_id,

Line 3929: FND_FILE.PUT_LINE(FND_FILE.LOG, 'movh.l_mat_ovhds = '

3925: and cost_element_id = 2
3926: and level_type = decode(i_level, 1,1,level_type);
3927:
3928: if l_debug = 'Y' then
3929: FND_FILE.PUT_LINE(FND_FILE.LOG, 'movh.l_mat_ovhds = '
3930: || to_char(l_mat_ovhds)
3931: || ' , stmt '
3932: || to_char(l_stmt_num));
3933: end if;

Line 3949: FND_FILE.PUT_LINE(FND_FILE.LOG, 'movh.mclacd_ovhd = '

3945: and cost_element_id = 2
3946: and level_type = decode(i_level,1,1,level_type);
3947:
3948: if l_debug = 'Y' then
3949: FND_FILE.PUT_LINE(FND_FILE.LOG, 'movh.mclacd_ovhd = '
3950: || to_char(l_mclacd_ovhd)
3951: || ' , stmt '
3952: || to_char(l_stmt_num));
3953: end if;

Line 3973: FND_FILE.PUT_LINE(FND_FILE.LOG, 'movh.l_ovhd_cost = '

3969: and layer_id = i_layer_id
3970: and cost_element_id = 2;
3971:
3972: if l_debug = 'Y' then
3973: FND_FILE.PUT_LINE(FND_FILE.LOG, 'movh.l_ovhd_cost = '
3974: || to_char(l_ovhd_cost)
3975: || ' ,stmt '
3976: || to_char(l_stmt_num));
3977: end if;

Line 4028: FND_FILE.PUT_LINE(FND_FILE.LOG, 'movh.updating mclacd...l_ovhd_cost = '

4024: and mclacd.cost_element_id = 2;
4025: end if;
4026:
4027: if l_debug = 'Y' then
4028: FND_FILE.PUT_LINE(FND_FILE.LOG, 'movh.updating mclacd...l_ovhd_cost = '
4029: || to_char(l_ovhd_cost)
4030: || ' , stmt '
4031: || to_char(l_stmt_num));
4032: end if;

Line 4085: FND_FILE.PUT_LINE(FND_FILE.LOG, 'movh.insertign mclacd...l_ovhd_cost = '

4081: i_prg_id,
4082: sysdate);
4083:
4084: if l_debug = 'Y' then
4085: FND_FILE.PUT_LINE(FND_FILE.LOG, 'movh.insertign mclacd...l_ovhd_cost = '
4086: || to_char(l_ovhd_cost)
4087: || ',txn_lyr = '
4088: || to_char(i_layer_qty)
4089: || ' , stmt '

Line 4222: FND_FILE.PUT_LINE(FND_FILE.LOG, 'No records in MCLACD');

4218: where transaction_id = i_txn_id
4219: and organization_id = i_org_id;
4220:
4221: if (l_count = 0) then
4222: FND_FILE.PUT_LINE(FND_FILE.LOG, 'No records in MCLACD');
4223: end if;
4224:
4225: /* Insert MCACD (by summing up MCLACD) only if it's not a scrap txn.
4226: Beware: there will be time where MCACD exists, such as when cost hook is used.

Line 4760: FND_FILE.PUT_LINE(FND_FILE.LOG,'No mctcd rows');

4756: raise no_mctcd_error;
4757: end if;
4758: */
4759: if l_mctcd_exist = 0 then
4760: FND_FILE.PUT_LINE(FND_FILE.LOG,'No mctcd rows');
4761: end if;
4762:
4763: l_stmt_num := 10;
4764:

Line 4989: FND_FILE.PUT_LINE(FND_FILE.LOG, 'layer qty = ' || to_char(l_layer_qty));

4985: from cst_inv_layers cil
4986: where cil.layer_id = i_layer_id
4987: and cil.inv_layer_id = l_inv_layer_id;
4988:
4989: FND_FILE.PUT_LINE(FND_FILE.LOG, 'layer qty = ' || to_char(l_layer_qty));
4990: l_stmt_num := 70;
4991:
4992: CSTPLENG.calc_layer_average_cost(
4993: i_org_id,