DBA Data[Home] [Help]

APPS.CSTPAVCP dependencies on CSTPAVCP

Line 1: PACKAGE BODY CSTPAVCP AS

1: PACKAGE BODY CSTPAVCP AS
2: /* $Header: CSTAVCPB.pls 120.53 2012/02/18 00:16:47 anjha ship $ */
3:
4: G_PKG_NAME CONSTANT VARCHAR2(30) := 'CSTPAVCP';
5: G_DEBUG CONSTANT VARCHAR2(1) := NVL(FND_PROFILE.VALUE('MRP_DEBUG'),'N');

Line 4: G_PKG_NAME CONSTANT VARCHAR2(30) := 'CSTPAVCP';

1: PACKAGE BODY CSTPAVCP AS
2: /* $Header: CSTAVCPB.pls 120.53 2012/02/18 00:16:47 anjha ship $ */
3:
4: G_PKG_NAME CONSTANT VARCHAR2(30) := 'CSTPAVCP';
5: G_DEBUG CONSTANT VARCHAR2(1) := NVL(FND_PROFILE.VALUE('MRP_DEBUG'),'N');
6: G_CST_APPLICATION_ID CONSTANT NUMBER := 707;
7: G_INV_APPLICATION_ID CONSTANT NUMBER := 401;
8:

Line 86: fnd_file.put_line(fnd_file.log,'>>In CSTPAVCP.cost_processor Cost Processor');

82: l_txn_action_id := 0;
83: l_stmt_num := 0;
84:
85: if (g_debug = 'Y') then
86: fnd_file.put_line(fnd_file.log,'>>In CSTPAVCP.cost_processor Cost Processor');
87: end if;
88:
89: /* INVCONV sschinch Check if this transaction is a process discrete transfer */
90: SELECT MOD(SUM(DECODE(mp.process_enabled_flag, 'Y', 1, 2)), 2)

Line 116: CSTPAVCP.cost_logical_itr_receipt(i_org_id,

112: -- This is a new transaction type introduced for p-d xfers enh. only.
113: -- 2. Physical Intransit Receipt and
114: -- 3. Direct Xfer receipt.
115: --
116: CSTPAVCP.cost_logical_itr_receipt(i_org_id,
117: i_txn_id,
118: i_layer_id,
119: i_cost_type,
120: i_item_id,

Line 161: CSTPAVCP.interorg(i_org_id,

157: fnd_file.put_line(fnd_file.log,'>>Inter Org Transaction');
158: fnd_file.put_line(fnd_file.log,'>>Calling CSTPACVP.interorg');
159: end if;
160:
161: CSTPAVCP.interorg(i_org_id,
162: i_txn_id,
163: i_layer_id,
164: i_cost_type,
165: i_item_id,

Line 218: -- CSTPAVCP.cost_logical_itr_receipt

214: -- OPM INVCONV sschinch/umoogala
215: -- For process-discrete xfers, we need not cost physical receipt since
216: -- we compute the avg cost using logical txn i.e., using
217: -- InterOrg Intransit Receipt (15) using new procedure
218: -- CSTPAVCP.cost_logical_itr_receipt
219: OR
220: (i_txn_action_id = 21 and i_fob_point = 1 and l_pd_txfr_ind = 1 and i_org_id = i_txn_org_id))
221: -- OPM INVCONV sschinch/umoogala
222: -- For process-discrete xfers, this is a shipment line from discrete-to-process.

Line 247: l_new_cost := CSTPAVCP.compute_actual_cost(

243: else
244: l_layer_id := i_layer_id;
245: end if;
246:
247: l_new_cost := CSTPAVCP.compute_actual_cost(
248: i_org_id,
249: i_txn_id,
250: l_layer_id, /* Bug#4259926 changed i_layer_id to l_layer_id */
251: i_cost_type,

Line 275: CSTPAVCP.common_issue_to_wip(

271: end if;
272:
273: l_stmt_num := 30;
274:
275: CSTPAVCP.common_issue_to_wip(
276: i_org_id,
277: i_txn_id,
278: i_layer_id,
279: i_cost_type,

Line 363: fnd_file.put_line(fnd_file.log, '>>>>Hook has been used. Calling CSTPAVCP.validate_actual_cost_hook');

359: l_err_code,
360: l_err_msg);
361: IF (l_hook = 1) THEN
362: IF g_debug = 'Y' THEN
363: fnd_file.put_line(fnd_file.log, '>>>>Hook has been used. Calling CSTPAVCP.validate_actual_cost_hook');
364: END IF;
365:
366: CSTPAVCP.validate_actual_cost_hook(i_txn_id => i_txn_id,
367: i_org_id => i_org_id,

Line 366: CSTPAVCP.validate_actual_cost_hook(i_txn_id => i_txn_id,

362: IF g_debug = 'Y' THEN
363: fnd_file.put_line(fnd_file.log, '>>>>Hook has been used. Calling CSTPAVCP.validate_actual_cost_hook');
364: END IF;
365:
366: CSTPAVCP.validate_actual_cost_hook(i_txn_id => i_txn_id,
367: i_org_id => i_org_id,
368: i_layer_id => i_layer_id,
369: i_req_id => i_req_id,
370: i_prg_appl_id=> i_prg_appl_id,

Line 593: fnd_file.put_line(fnd_file.log, '>>Calling CSTPAVCP.compute_actual_cost');

589: end if;
590:
591: l_stmt_num := 100;
592: IF g_debug = 'Y' THEN
593: fnd_file.put_line(fnd_file.log, '>>Calling CSTPAVCP.compute_actual_cost');
594: END IF;
595: l_new_cost := CSTPAVCP.compute_actual_cost(
596: i_org_id,
597: i_txn_id,

Line 595: l_new_cost := CSTPAVCP.compute_actual_cost(

591: l_stmt_num := 100;
592: IF g_debug = 'Y' THEN
593: fnd_file.put_line(fnd_file.log, '>>Calling CSTPAVCP.compute_actual_cost');
594: END IF;
595: l_new_cost := CSTPAVCP.compute_actual_cost(
596: i_org_id,
597: i_txn_id,
598: l_layer_id,
599: i_cost_type,

Line 623: fnd_file.put_line(fnd_file.log, '<

619: raise process_error;
620: end if;
621:
622: IF g_debug = 'Y' THEN
623: fnd_file.put_line(fnd_file.log, '< 624: END IF;
625:
626: else
627: -- user populated actual cost.

Line 642: fnd_file.put_line(fnd_file.log, '>>Calling from CSTPAVCP.sub_transfer');

638: (i_txn_action_id = 12 and i_org_id = i_txn_org_id and i_fob_point = 1))
639: then
640: l_stmt_num := 110;
641: IF g_debug = 'Y' THEN
642: fnd_file.put_line(fnd_file.log, '>>Calling from CSTPAVCP.sub_transfer');
643: END IF;
644: CSTPAVCP.sub_transfer(
645: i_org_id,
646: i_txn_id,

Line 644: CSTPAVCP.sub_transfer(

640: l_stmt_num := 110;
641: IF g_debug = 'Y' THEN
642: fnd_file.put_line(fnd_file.log, '>>Calling from CSTPAVCP.sub_transfer');
643: END IF;
644: CSTPAVCP.sub_transfer(
645: i_org_id,
646: i_txn_id,
647: i_layer_id,
648: i_cost_type,

Line 670: fnd_file.put_line(fnd_file.log, '<

666: if (l_err_num <> 0) then
667: raise process_error;
668: end if;
669: IF g_debug = 'Y' THEN
670: fnd_file.put_line(fnd_file.log, '< 671: END IF;
672:
673: -- If this transaction is using a new cost and it is not an
674: -- expense item than we need to recalculate

Line 691: fnd_file.put_line(fnd_file.log, '>>Calling CSTPAVCP.calc_average_cost');

687: end if;
688:
689: l_stmt_num := 130;
690: IF g_debug = 'Y' THEN
691: fnd_file.put_line(fnd_file.log, '>>Calling CSTPAVCP.calc_average_cost');
692: END IF;
693: CSTPAVCP.calc_average_cost(
694: i_org_id,
695: i_txn_id,

Line 693: CSTPAVCP.calc_average_cost(

689: l_stmt_num := 130;
690: IF g_debug = 'Y' THEN
691: fnd_file.put_line(fnd_file.log, '>>Calling CSTPAVCP.calc_average_cost');
692: END IF;
693: CSTPAVCP.calc_average_cost(
694: i_org_id,
695: i_txn_id,
696: l_layer_id,
697: i_cost_type,

Line 715: fnd_file.put_line(fnd_file.log, '<

711: -- Error occured
712: raise process_error;
713: end if;
714: IF g_debug = 'Y' THEN
715: fnd_file.put_line(fnd_file.log, '< 716: END IF;
717: else
718: -- when we process transfer org's txn(i.e. intransit txfr),
719: -- we need to use txfr_layer_id instead.

Line 731: fnd_file.put_line(fnd_file.log, '>>Calling CSTPAVCP.current_average_cost');

727: end if;
728:
729: l_stmt_num := 140;
730: IF g_debug = 'Y' THEN
731: fnd_file.put_line(fnd_file.log, '>>Calling CSTPAVCP.current_average_cost');
732: END IF;
733: CSTPAVCP.current_average_cost(
734: l_org_id,
735: i_txn_id,

Line 733: CSTPAVCP.current_average_cost(

729: l_stmt_num := 140;
730: IF g_debug = 'Y' THEN
731: fnd_file.put_line(fnd_file.log, '>>Calling CSTPAVCP.current_average_cost');
732: END IF;
733: CSTPAVCP.current_average_cost(
734: l_org_id,
735: i_txn_id,
736: l_layer_id,
737: i_cost_type,

Line 757: fnd_file.put_line(fnd_file.log, '<

753: -- Error occured
754: raise process_error;
755: end if;
756: IF g_debug = 'Y' THEN
757: fnd_file.put_line(fnd_file.log, '< 758: END IF;
759: -- For Internal Order Issue transactons to Expense destinations,
760: -- call Cost_LogicalSOReceipt API to cost the Receipt transaction.
761: l_stmt_num := 150;

Line 770: CSTPAVCP.Cost_LogicalSOReceipt (

766: where transaction_id = i_txn_id;
767:
768: l_stmt_num := 160;
769: IF ( I_TXN_ACTION_ID = 1 AND L_TXN_TYPE_ID = 34 AND I_TXN_SRC_TYPE = 8) THEN
770: CSTPAVCP.Cost_LogicalSOReceipt (
771: p_parent_txn_id => i_txn_id,
772: p_user_id => i_user_id,
773: p_request_id => i_req_id,
774: p_prog_id => i_prg_id,

Line 798: o_err_msg := 'CSTPAVCP.Cost_Processor (' || to_char(l_stmt_num) || '): '

794: o_err_msg := l_err_msg;
795: when LOGICAL_SORECEIPT_ERROR then
796: rollback;
797: o_err_num := SQLCODE;
798: o_err_msg := 'CSTPAVCP.Cost_Processor (' || to_char(l_stmt_num) || '): '
799: || 'Error in CSTPAVCP.Cost_LogicalReceipt';
800: when OTHERS then
801: rollback;
802: o_err_num := SQLCODE;

Line 799: || 'Error in CSTPAVCP.Cost_LogicalReceipt';

795: when LOGICAL_SORECEIPT_ERROR then
796: rollback;
797: o_err_num := SQLCODE;
798: o_err_msg := 'CSTPAVCP.Cost_Processor (' || to_char(l_stmt_num) || '): '
799: || 'Error in CSTPAVCP.Cost_LogicalReceipt';
800: when OTHERS then
801: rollback;
802: o_err_num := SQLCODE;
803: o_err_msg := 'CSTPAVCP.Cost_Processor (' || to_char(l_stmt_num) || '): '

Line 803: o_err_msg := 'CSTPAVCP.Cost_Processor (' || to_char(l_stmt_num) || '): '

799: || 'Error in CSTPAVCP.Cost_LogicalReceipt';
800: when OTHERS then
801: rollback;
802: o_err_num := SQLCODE;
803: o_err_msg := 'CSTPAVCP.Cost_Processor (' || to_char(l_stmt_num) || '): '
804: || substr(SQLERRM,1,200);
805:
806: END cost_processor;
807:

Line 1242: CSTPAVCP.update_mmt(

1238: l_stmt_num := 60;
1239: /********************************************************************
1240: ** Update Mtl_Material_Transactions **
1241: ********************************************************************/
1242: CSTPAVCP.update_mmt(
1243: i_org_id,
1244: i_txn_id,
1245: -1, -- txfr_txn_id is not applicable
1246: i_layer_id,

Line 1298: CSTPAVCP.update_item_cost(

1294: l_stmt_num := 80;
1295: /********************************************************************
1296: ** Update Item Cost and Item Cost Details **
1297: ********************************************************************/
1298: CSTPAVCP.update_item_cost(
1299: i_org_id,
1300: i_txn_id,
1301: i_layer_id,
1302: i_cost_type,

Line 1335: o_err_msg := 'CSTPAVCP.average_cost_update (' || to_char(l_stmt_num) ||

1331: o_err_msg := l_err_msg;
1332: when others then
1333: rollback;
1334: o_err_num := SQLCODE;
1335: o_err_msg := 'CSTPAVCP.average_cost_update (' || to_char(l_stmt_num) ||
1336: '): '
1337: || substr(SQLERRM, 1,200);
1338: END average_cost_update;
1339:

Line 1647: l_ret_val := CSTPAVCP.compute_actual_cost(

1643: and (l_txn_type_id <> 68 or (l_txn_type_id = 68 and l_layer_chg = 0))then
1644:
1645: l_stmt_num := 90;
1646:
1647: l_ret_val := CSTPAVCP.compute_actual_cost(
1648: i_org_id,
1649: i_txn_id,
1650: i_layer_id,
1651: NULL,

Line 1684: CSTPAVCP.current_average_cost(

1680: --borrow payback, the following stmt make sure it is not borrow payback txn
1681: and (l_txn_type_id <> 68 or (l_txn_type_id = 68 and l_layer_chg = 0))then
1682: l_stmt_num := 100;
1683:
1684: CSTPAVCP.current_average_cost(
1685: i_org_id,
1686: i_txn_id,
1687: l_to_layer,
1688: i_cost_type,

Line 1714: CSTPAVCP.calc_average_cost(

1710: --borrow payback, the following stmt make sure it is not borrow payback txn
1711: and (l_txn_type_id <> 68 or (l_txn_type_id = 68 and l_layer_chg = 0))then
1712: l_stmt_num := 110;
1713:
1714: CSTPAVCP.calc_average_cost(
1715: i_org_id,
1716: i_txn_id,
1717: l_from_layer,
1718: i_cost_type,

Line 1749: CSTPAVCP.current_average_cost(

1745: if (l_txn_action_id = 27 and i_citw_flag = 1 ) then
1746: NULL;
1747: else
1748:
1749: CSTPAVCP.current_average_cost(
1750: i_org_id,
1751: i_txn_id,
1752: l_from_layer,
1753: i_cost_type,

Line 1791: CSTPAVCP.calc_average_cost(

1787: l_no_upd_mmt := 1;
1788: end if;
1789: end if;
1790:
1791: CSTPAVCP.calc_average_cost(
1792: i_org_id,
1793: i_txn_id,
1794: l_to_layer,
1795: i_cost_type,

Line 1819: CSTPAVCP.current_average_cost(

1815: and (l_txn_type_id <> 68 or (l_txn_type_id = 68 and l_layer_chg = 0))then
1816: --then
1817: l_stmt_num := 140;
1818:
1819: CSTPAVCP.current_average_cost(
1820: i_org_id,
1821: i_txn_id,
1822: l_to_layer,
1823: i_cost_type,

Line 1911: CSTPAVCP.current_average_cost(

1907: where layer_id = l_from_layer;
1908:
1909: -- bug 925262, need to update the layer quantity of the payback side
1910:
1911: CSTPAVCP.current_average_cost(
1912: i_org_id,
1913: i_txn_id,
1914: l_from_layer,
1915: i_cost_type,

Line 1958: CSTPAVCP.calc_average_cost(

1954: -- reaverage the from sub and then figure out the variance
1955:
1956: -- update new cost and then find variance
1957: -- base on new cost
1958: CSTPAVCP.calc_average_cost(
1959: i_org_id,
1960: i_txn_id,
1961: l_from_layer,
1962: i_cost_type,

Line 1998: CSTPAVCP.calc_average_cost(

1994: raise process_error;
1995: end if;
1996:
1997:
1998: CSTPAVCP.calc_average_cost(
1999: i_org_id,
2000: i_txn_id,
2001: l_to_layer,
2002: i_cost_type,

Line 2116: o_err_msg := 'CSTPAVCP.sub_transfer (' || to_char(l_stmt_num) ||

2112: o_err_msg := l_err_msg;
2113: when others then
2114: rollback;
2115: o_err_num := SQLCODE;
2116: o_err_msg := 'CSTPAVCP.sub_transfer (' || to_char(l_stmt_num) ||
2117: '): '
2118: || substr(SQLERRM, 1,200);
2119: END sub_transfer;
2120:

Line 2224: CSTPAVCP.sub_transfer(

2220:
2221: /* Modified for bug 6635134 - Moved the insert into MCACD outside the if-else clause */
2222: if l_txn_action_id = 1 then
2223:
2224: CSTPAVCP.sub_transfer(
2225: i_org_id,
2226: i_txn_id,
2227: i_layer_id,
2228: i_cost_type,

Line 2304: CSTPAVCP.sub_transfer(

2300: and layer_id = i_txfr_layer_id
2301: and transaction_action_id = i_txn_action_id; */
2302: else
2303:
2304: CSTPAVCP.sub_transfer(
2305: i_org_id,
2306: i_txn_id,
2307: i_txfr_layer_id,
2308: i_cost_type,

Line 2437: CSTPAVCP.current_average_cost(i_org_id,

2433: decrementing the quantity for this cg */
2434:
2435: else
2436:
2437: CSTPAVCP.current_average_cost(i_org_id,
2438: i_txn_id,
2439: i_txfr_layer_id,
2440: i_cost_type,
2441: i_item_id,

Line 2499: o_err_msg := 'CSTPAVCP.common_issue_to_wip (' || to_char(l_stmt_num) ||

2495: o_err_msg := l_err_msg;
2496: when others then
2497: rollback;
2498: o_err_num := SQLCODE;
2499: o_err_msg := 'CSTPAVCP.common_issue_to_wip (' || to_char(l_stmt_num) ||
2500: '): '
2501: || substr(SQLERRM, 1,200);
2502: END common_issue_to_wip;
2503:

Line 2882: o_err_msg := 'CSTPAVCP.compute_actual_cost (' || to_char(l_stmt_num) ||

2878: return l_ret_val;
2879: when OTHERS then
2880: rollback;
2881: o_err_num := SQLCODE;
2882: o_err_msg := 'CSTPAVCP.compute_actual_cost (' || to_char(l_stmt_num) ||
2883: '): '
2884: || substr(SQLERRM,1,200);
2885: return l_ret_val;
2886: END compute_actual_cost;

Line 3453: o_err_msg := 'CSTPAVCP.apply_material_ovhd (' || to_char(l_stmt_num) ||

3449: o_err_msg := FND_MESSAGE.Get;
3450: when others then
3451: rollback;
3452: o_err_num := SQLCODE;
3453: o_err_msg := 'CSTPAVCP.apply_material_ovhd (' || to_char(l_stmt_num) ||
3454: '): '
3455: || substr(SQLERRM, 1,200);
3456:
3457: END apply_material_ovhd;

Line 3723: fnd_file.put_line(fnd_file.log, '>>>Calling CSTPAVCP.update_mmt');

3719: l_txfr_txn_id := -1;
3720: end if;
3721:
3722: IF g_debug = 'Y' THEN
3723: fnd_file.put_line(fnd_file.log, '>>>Calling CSTPAVCP.update_mmt');
3724: END IF;
3725: CSTPAVCP.update_mmt(
3726: i_org_id,
3727: i_txn_id,

Line 3725: CSTPAVCP.update_mmt(

3721:
3722: IF g_debug = 'Y' THEN
3723: fnd_file.put_line(fnd_file.log, '>>>Calling CSTPAVCP.update_mmt');
3724: END IF;
3725: CSTPAVCP.update_mmt(
3726: i_org_id,
3727: i_txn_id,
3728: l_txfr_txn_id,
3729: i_layer_id,

Line 3743: fnd_file.put_line(fnd_file.log, '<<

3739: if (l_err_num <> 0) then
3740: raise process_error;
3741: end if;
3742: IF g_debug = 'Y' THEN
3743: fnd_file.put_line(fnd_file.log, '<< 3744: END IF;
3745: end if;
3746:
3747: /********************************************************************

Line 3824: fnd_file.put_line(fnd_file.log, '>>>Calling CSTPAVCP.update_item_cost');

3820: /********************************************************************
3821: ** Update Item Cost and Item Cost Details **
3822: ********************************************************************/
3823: IF g_debug = 'Y' THEN
3824: fnd_file.put_line(fnd_file.log, '>>>Calling CSTPAVCP.update_item_cost');
3825: END IF;
3826: CSTPAVCP.update_item_cost(
3827: i_org_id,
3828: i_txn_id,

Line 3826: CSTPAVCP.update_item_cost(

3822: ********************************************************************/
3823: IF g_debug = 'Y' THEN
3824: fnd_file.put_line(fnd_file.log, '>>>Calling CSTPAVCP.update_item_cost');
3825: END IF;
3826: CSTPAVCP.update_item_cost(
3827: i_org_id,
3828: i_txn_id,
3829: i_layer_id,
3830: i_cost_type,

Line 3846: fnd_file.put_line(fnd_file.log, '<<

3842: raise process_error;
3843: end if;
3844:
3845: IF g_debug = 'Y' THEN
3846: fnd_file.put_line(fnd_file.log, '<< 3847: END IF;
3848: EXCEPTION
3849: when process_error then
3850: o_err_num := l_err_num;

Line 3856: o_err_msg := 'CSTPAVCP.calc_average_cost (' || to_char(l_stmt_num) ||

3852: o_err_msg := l_err_msg;
3853: when others then
3854: rollback;
3855: o_err_num := SQLCODE;
3856: o_err_msg := 'CSTPAVCP.calc_average_cost (' || to_char(l_stmt_num) ||
3857: '): '
3858: || substr(SQLERRM, 1,200);
3859:
3860: END calc_average_cost;

Line 3907: CSTPAVCP.update_mmt(

3903: ** Update Mtl_Material_Transactions to set actual cost, prior **
3904: ** cost, new cost and prior costed quantity. **
3905: ********************************************************************/
3906: if (i_no_update_mmt = 0) then
3907: CSTPAVCP.update_mmt(
3908: i_org_id,
3909: i_txn_id,
3910: -1, -- txfr_txn_id is not applicable
3911: i_layer_id,

Line 3956: CSTPAVCP.update_item_cost(

3952: end if;
3953:
3954: -- If qty is going to be positive, need to reflect item cost in
3955: -- cst_item_cost table.
3956: CSTPAVCP.update_item_cost(
3957: i_org_id,
3958: i_txn_id,
3959: i_layer_id,
3960: i_cost_type,

Line 3988: o_err_msg := 'CSTPAVCP.current_average_cost (' || to_char(l_stmt_num) ||

3984: o_err_msg := l_err_msg;
3985: when others then
3986: rollback;
3987: o_err_num := SQLCODE;
3988: o_err_msg := 'CSTPAVCP.current_average_cost (' || to_char(l_stmt_num) ||
3989: '): '
3990: || substr(SQLERRM, 1,200);
3991:
3992: END current_average_cost;

Line 4283: o_err_msg := 'CSTPAVCP.update_mmt (' || to_char(l_stmt_num) ||

4279: EXCEPTION
4280: when OTHERS then
4281: rollback;
4282: o_err_num := SQLCODE;
4283: o_err_msg := 'CSTPAVCP.update_mmt (' || to_char(l_stmt_num) ||
4284: '): '
4285: || substr(SQLERRM,1,200);
4286:
4287: END update_mmt;

Line 4517: o_err_msg := 'CSTPAVCP.update_item_cost (' || to_char(l_stmt_num) ||

4513: EXCEPTION
4514: when others then
4515: rollback;
4516: o_err_num := SQLCODE;
4517: o_err_msg := 'CSTPAVCP.update_item_cost (' || to_char(l_stmt_num) ||
4518: '): '
4519: || substr(SQLERRM, 1,200);
4520:
4521: END update_item_cost;

Line 4642: fnd_file.put_line(fnd_file.log, '>>>Inside CSTPAVCP.interorg Interorg');

4638: o_hook_used := 0;
4639: l_ave_to_ave := 0;
4640:
4641: IF g_debug = 'Y' THEN
4642: fnd_file.put_line(fnd_file.log, '>>>Inside CSTPAVCP.interorg Interorg');
4643: END IF;
4644: l_earn_moh := 1;
4645: l_return_status := fnd_api.g_ret_sts_success;
4646: l_msg_count := 0;

Line 5240: fnd_file.put_line(fnd_file.log, '>>>>Hook has been used. Calling CSTPAVCP.validate_actual_cost_hook');

5236: o_err_msg => l_err_msg);
5237:
5238: IF (l_cost_hook_io=1) THEN
5239: IF g_debug = 'Y' THEN
5240: fnd_file.put_line(fnd_file.log, '>>>>Hook has been used. Calling CSTPAVCP.validate_actual_cost_hook');
5241: END IF;
5242:
5243: CSTPAVCP.validate_actual_cost_hook(i_txn_id => i_txn_id,
5244: i_org_id => i_org_id,

Line 5243: CSTPAVCP.validate_actual_cost_hook(i_txn_id => i_txn_id,

5239: IF g_debug = 'Y' THEN
5240: fnd_file.put_line(fnd_file.log, '>>>>Hook has been used. Calling CSTPAVCP.validate_actual_cost_hook');
5241: END IF;
5242:
5243: CSTPAVCP.validate_actual_cost_hook(i_txn_id => i_txn_id,
5244: i_org_id => i_org_id,
5245: i_layer_id => i_layer_id,
5246: i_req_id => i_req_id,
5247: i_prg_appl_id=> i_prg_appl_id,

Line 5258: fnd_file.put_line(fnd_file.log, '<<<

5254: raise process_error;
5255: END IF;
5256:
5257: IF g_debug = 'Y' THEN
5258: fnd_file.put_line(fnd_file.log, '<<< 5259: END IF;
5260:
5261: select sum(actual_cost), layer_id
5262: into l_snd_txn_cost, l_from_layer_id

Line 5813: o_err_msg := 'CSTPAVCP.interorg (' || to_char(l_stmt_num) ||

5809: o_err_msg := FND_MESSAGE.Get;
5810: when others then
5811: rollback;
5812: o_err_num := SQLCODE;
5813: o_err_msg := 'CSTPAVCP.interorg (' || to_char(l_stmt_num) ||
5814: '): '
5815: || substr(SQLERRM, 1,200);
5816:
5817: END interorg;

Line 5953: o_err_msg := 'CSTPAVCP.get_snd_rcv_rate (' || to_char(l_stmt_num) ||

5949:
5950: when others then
5951: rollback;
5952: o_err_num := SQLCODE;
5953: o_err_msg := 'CSTPAVCP.get_snd_rcv_rate (' || to_char(l_stmt_num) ||
5954: '): '
5955: || substr(SQLERRM, 1,200);
5956:
5957: END get_snd_rcv_rate;

Line 6007: o_err_msg := 'CSTPAVCP.get_snd_rcv_uom (' || to_char(l_stmt_num) ||

6003: EXCEPTION
6004: when others then
6005: rollback;
6006: o_err_num := SQLCODE;
6007: o_err_msg := 'CSTPAVCP.get_snd_rcv_uom (' || to_char(l_stmt_num) ||
6008: '): '
6009: || substr(SQLERRM, 1,200);
6010:
6011: END get_snd_rcv_uom;

Line 6255: o_err_msg := 'CSTPAVCP.borrow_cost (' || to_char(l_stmt_num) ||

6251: EXCEPTION
6252: when others then
6253: rollback;
6254: o_err_num := SQLCODE;
6255: o_err_msg := 'CSTPAVCP.borrow_cost (' || to_char(l_stmt_num) ||
6256: '): '
6257: || substr(SQLERRM, 1,200);
6258:
6259:

Line 6336: o_err_msg := 'CSTPAVCP.store_bp_variance (' || to_char(l_stmt_num) ||

6332: EXCEPTION
6333: when others then
6334: rollback;
6335: o_err_num := SQLCODE;
6336: o_err_msg := 'CSTPAVCP.store_bp_variance (' || to_char(l_stmt_num) ||
6337: '): '
6338: || substr(SQLERRM, 1,200);
6339:
6340: END store_bp_variance;

Line 6695: o_err_msg := 'CSTPAVCP.interorg_elemental_detail (' || to_char(l_stmt_num)

6691: o_err_msg := l_err_msg;
6692: when others then
6693: rollback;
6694: o_err_num := SQLCODE;
6695: o_err_msg := 'CSTPAVCP.interorg_elemental_detail (' || to_char(l_stmt_num)
6696: || '): ' || substr(SQLERRM, 1,200);
6697:
6698:
6699: END interorg_elemental_detail;

Line 7200: x_err_msg := 'CSTPAVCP.COST_ACCT_EVENTS:' || '(' || l_stmt_num || '):' ||

7196: when fnd_api.g_exc_error then
7197: ROLLBACK ;
7198: x_err_num := -1;
7199: x_err_code := l_err_code;
7200: x_err_msg := 'CSTPAVCP.COST_ACCT_EVENTS:' || '(' || l_stmt_num || '):' ||
7201: l_err_msg || ':' || substr(SQLERRM,1,200);
7202:
7203: /* Modified update statement for performance reasons. See bug#3585779*/
7204: if (p_parent_id is null) then

Line 7236: x_err_msg := 'CSTPAVCP.COST_ACCT_EVENTS:' || '(' || l_stmt_num || '):' ||

7232: when others then
7233: ROLLBACK ;
7234: x_err_num := -1;
7235: x_err_code := l_err_code;
7236: x_err_msg := 'CSTPAVCP.COST_ACCT_EVENTS:' || '(' || l_stmt_num || '):' ||
7237: substr(SQLERRM,1,200);
7238:
7239: /* Modified update statement for performance reasons. See bug#3585779*/
7240: if (p_parent_id is null) then

Line 7659: fnd_file.put_line(fnd_file.log, '>>>>Hook has been used. Calling CSTPAVCP.validate_actual_cost_hook');

7655: l_err_code,
7656: l_err_msg);
7657: IF (l_cost_hook = 1) THEN
7658: IF g_debug = 'Y' THEN
7659: fnd_file.put_line(fnd_file.log, '>>>>Hook has been used. Calling CSTPAVCP.validate_actual_cost_hook');
7660: END IF;
7661:
7662: CSTPAVCP.validate_actual_cost_hook(i_txn_id => p_txn_id,
7663: i_org_id => p_org_id,

Line 7662: CSTPAVCP.validate_actual_cost_hook(i_txn_id => p_txn_id,

7658: IF g_debug = 'Y' THEN
7659: fnd_file.put_line(fnd_file.log, '>>>>Hook has been used. Calling CSTPAVCP.validate_actual_cost_hook');
7660: END IF;
7661:
7662: CSTPAVCP.validate_actual_cost_hook(i_txn_id => p_txn_id,
7663: i_org_id => p_org_id,
7664: i_layer_id => l_layer_id,
7665: i_req_id => p_request_id,
7666: i_prg_appl_id=> p_prog_app_id,

Line 7886: x_err_msg := 'CSTPAVCP.COMPUTE_MCACD_COSTS:' || '(' || l_stmt_num || '):' ||

7882:
7883: when fnd_api.g_exc_error then
7884: x_err_num := -1;
7885: x_err_code := l_err_code;
7886: x_err_msg := 'CSTPAVCP.COMPUTE_MCACD_COSTS:' || '(' || l_stmt_num || '):' ||
7887: l_err_msg;
7888:
7889:
7890: when others then

Line 7893: x_err_msg := 'CSTPAVCP.COMPUTE_MCACD_COSTS:' || '(' || l_stmt_num || '):' ||

7889:
7890: when others then
7891: x_err_num := -1;
7892: x_err_code := l_err_code;
7893: x_err_msg := 'CSTPAVCP.COMPUTE_MCACD_COSTS:' || '(' || l_stmt_num || '):' ||
7894: l_err_msg;
7895:
7896: END Compute_MCACD_Costs;
7897:

Line 8053: o_err_msg := 'CSTPAVCP.payback_variance (' || to_char(l_stmt_num) ||

8049: EXCEPTION
8050: when others then
8051: rollback;
8052: o_err_num := SQLCODE;
8053: o_err_msg := 'CSTPAVCP.payback_variance (' || to_char(l_stmt_num) ||
8054: '): '
8055: || substr(SQLERRM, 1,200);
8056:
8057:

Line 8176: FND_FILE.PUT_LINE(FND_FILE.LOG, 'CSTPAVCP.Cost_LogicalSOReceipt <<<');

8172: l_msg_data VARCHAR2(8000);
8173:
8174: BEGIN
8175: IF g_debug = 'Y' THEN
8176: FND_FILE.PUT_LINE(FND_FILE.LOG, 'CSTPAVCP.Cost_LogicalSOReceipt <<<');
8177: END IF;
8178:
8179: -- Initialize Error Variables
8180: x_err_num := 0;

Line 8234: FND_FILE.PUT_LINE(FND_FILE.LOG, 'CSTPAVCP.Cost_LogicalSOReceipt >>>');

8230: THEN
8231: IF g_debug = 'Y' THEN
8232: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Receiving Org is Process Org. So, no accounting ' ||
8233: ' for receiving transaction.');
8234: FND_FILE.PUT_LINE(FND_FILE.LOG, 'CSTPAVCP.Cost_LogicalSOReceipt >>>');
8235: END IF;
8236: RETURN;
8237: ELSIF l_pd_xfer_ind = 'Y'
8238: THEN

Line 8254: FND_FILE.PUT_LINE(FND_FILE.LOG, 'CSTPAVCP.Cost_LogicalSOReceipt >>>');

8250: IF l_logical_txn_id IS NULL THEN
8251: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Logical Receipt Transaction not seeded');
8252: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Pre-upgrade transaction');
8253: IF g_debug = 'Y' THEN
8254: FND_FILE.PUT_LINE(FND_FILE.LOG, 'CSTPAVCP.Cost_LogicalSOReceipt >>>');
8255: END IF;
8256: RETURN;
8257: END IF;
8258:

Line 8303: FND_FILE.PUT_LINE(FND_FILE.LOG, 'CSTPAVCP.Cost_LogicalSOReceipt >>>');

8299: PROGRAM_ID = p_prog_id
8300: WHERE
8301: TRANSACTION_ID = l_logical_txn_id;
8302: IF g_debug = 'Y' THEN
8303: FND_FILE.PUT_LINE(FND_FILE.LOG, 'CSTPAVCP.Cost_LogicalSOReceipt >>>');
8304: END IF;
8305: RETURN;
8306:
8307: END IF;

Line 8878: x_err_msg := 'CSTPAVCP.Cost_LogicalSOReceipt:('||l_stmt_num||'): '||x_err_code || '. Error Msg: ' || l_msg_data;

8874:
8875: IF l_return_status <> 'S' THEN
8876: x_err_num := -1;
8877: x_err_code := 'Error raising SLA Event for transaction: '||to_char(l_trx_info.TRANSACTION_ID);
8878: x_err_msg := 'CSTPAVCP.Cost_LogicalSOReceipt:('||l_stmt_num||'): '||x_err_code || '. Error Msg: ' || l_msg_data;
8879:
8880: IF g_debug = 'Y' THEN
8881: FND_FILE.PUT_LINE(FND_FILE.LOG, 'CSTPAVCP.Cost_LogicalSOReceipt >>>');
8882: END IF;

Line 8881: FND_FILE.PUT_LINE(FND_FILE.LOG, 'CSTPAVCP.Cost_LogicalSOReceipt >>>');

8877: x_err_code := 'Error raising SLA Event for transaction: '||to_char(l_trx_info.TRANSACTION_ID);
8878: x_err_msg := 'CSTPAVCP.Cost_LogicalSOReceipt:('||l_stmt_num||'): '||x_err_code || '. Error Msg: ' || l_msg_data;
8879:
8880: IF g_debug = 'Y' THEN
8881: FND_FILE.PUT_LINE(FND_FILE.LOG, 'CSTPAVCP.Cost_LogicalSOReceipt >>>');
8882: END IF;
8883:
8884: RAISE FND_API.g_exc_unexpected_error;
8885: END IF;

Line 8889: FND_FILE.PUT_LINE(FND_FILE.LOG, 'CSTPAVCP.Cost_LogicalSOReceipt >>>');

8885: END IF;
8886: /* End bug 5349860 */
8887:
8888: IF g_debug = 'Y' THEN
8889: FND_FILE.PUT_LINE(FND_FILE.LOG, 'CSTPAVCP.Cost_LogicalSOReceipt >>>');
8890: END IF;
8891:
8892:
8893: EXCEPTION

Line 8900: x_err_code := 'CSTPAVCP.Cost_LogicalSOReceipt( '||to_char(l_stmt_num)||' ): '||'Error Inserting into MCACD: '||SQLERRM;

8896: x_err_code := 'Currency Conversion Rate not defined';
8897: x_err_msg := x_err_code;
8898: WHEN INSERT_MCACD_ERROR THEN
8899: x_err_num := -1;
8900: x_err_code := 'CSTPAVCP.Cost_LogicalSOReceipt( '||to_char(l_stmt_num)||' ): '||'Error Inserting into MCACD: '||SQLERRM;
8901: x_err_msg := x_err_code;
8902: FND_FILE.PUT_LINE(FND_FILE.LOG, x_err_code);
8903: WHEN INSERT_ACCT_ERROR THEN
8904: x_err_num := -1;

Line 8905: x_err_code := 'CSTPAVCP.Cost_LogicalSOReceipt( '||to_char(l_stmt_num)||' ): '||'Error in Insert_Account: ';

8901: x_err_msg := x_err_code;
8902: FND_FILE.PUT_LINE(FND_FILE.LOG, x_err_code);
8903: WHEN INSERT_ACCT_ERROR THEN
8904: x_err_num := -1;
8905: x_err_code := 'CSTPAVCP.Cost_LogicalSOReceipt( '||to_char(l_stmt_num)||' ): '||'Error in Insert_Account: ';
8906: x_err_msg := x_err_code;
8907: FND_FILE.PUT_LINE(FND_FILE.LOG, x_err_code);
8908:
8909: WHEN COST_HOOK_ACCOUNT_ERROR THEN

Line 8911: x_err_code := 'CSTPAVCP.Cost_LogicalSOReceipt' || l_err_code || 'Error in cost hook get_account_id' ;

8907: FND_FILE.PUT_LINE(FND_FILE.LOG, x_err_code);
8908:
8909: WHEN COST_HOOK_ACCOUNT_ERROR THEN
8910: x_err_num := l_err_num;
8911: x_err_code := 'CSTPAVCP.Cost_LogicalSOReceipt' || l_err_code || 'Error in cost hook get_account_id' ;
8912: x_err_msg := l_err_msg;
8913: FND_FILE.PUT_LINE(FND_FILE.LOG, x_err_code);
8914: FND_FILE.PUT_LINE(FND_FILE.LOG, x_err_msg);
8915:

Line 8931: x_err_code := 'CSTPAVCP.Cost_LogicalSOReceipt( '||to_char(l_stmt_num)||' ): ';

8927: commit;
8928:
8929: WHEN OTHERS THEN
8930: x_err_num := -1;
8931: x_err_code := 'CSTPAVCP.Cost_LogicalSOReceipt( '||to_char(l_stmt_num)||' ): ';
8932: x_err_msg := x_err_code;
8933: FND_FILE.PUT_LINE(FND_FILE.LOG, x_err_code);
8934:
8935: END Cost_LogicalSOReceipt;

Line 9354: o_err_msg := 'CSTPAVCP.Logical_itr_receipt(' || to_char(l_stmt_num) ||

9350: EXCEPTION
9351: when others then
9352: rollback;
9353: o_err_num := SQLCODE;
9354: o_err_msg := 'CSTPAVCP.Logical_itr_receipt(' || to_char(l_stmt_num) ||
9355: '): ' || substr(SQLERRM, 1,200);
9356:
9357: END Cost_Logical_itr_receipt;
9358:

Line 9552: x_return_message := 'Error in CSTPAVCP.CompEncumbrance_IntOrdersExp('||l_stmt_num||')';

9548: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9549: x_return_status := fnd_api.g_ret_sts_unexp_error;
9550: WHEN process_error THEN
9551: x_return_status := fnd_api.g_ret_sts_unexp_error;
9552: x_return_message := 'Error in CSTPAVCP.CompEncumbrance_IntOrdersExp('||l_stmt_num||')';
9553: WHEN OTHERS THEN
9554: x_return_status := fnd_api.g_ret_sts_unexp_error;
9555: x_return_message := 'Error in CST_UTIL_PUB.CompEncumbrance_IntOrdersExp('||l_stmt_num||')';
9556:

Line 9849: o_err_msg:='CSTPAVCP.validate_actual_cost_hook('||to_char(l_stmt_num)||'):'||substr(SQLERRM,1,200);

9845: WHERE transaction_id = i_txn_id;
9846: WHEN others THEN
9847: rollback;
9848: o_err_num:=SQLCODE;
9849: o_err_msg:='CSTPAVCP.validate_actual_cost_hook('||to_char(l_stmt_num)||'):'||substr(SQLERRM,1,200);
9850: UPDATE mtl_material_transactions
9851: SET costed_flag = 'E',
9852: error_code = substrb(o_err_code,1,240),
9853: error_explanation = substrb(o_err_msg,1,240),

Line 9861: END CSTPAVCP;

9857: program_update_date = sysdate
9858: WHERE transaction_id = i_txn_id;
9859: END validate_actual_cost_hook;
9860:
9861: END CSTPAVCP;