[Home] [Help]
1: PACKAGE BODY gme_api_pub AS
2: /* $Header: GMEPAPIB.pls 120.62.12010000.1 2008/07/25 10:29:12 appldev ship $ */
3: g_debug VARCHAR2 (5) := NVL(fnd_profile.VALUE ('AFLOG_LEVEL'),-1);
4: g_pkg_name CONSTANT VARCHAR2 (30) := 'GME_API_PUB';
5:
1: PACKAGE BODY gme_api_pub AS
2: /* $Header: GMEPAPIB.pls 120.62.12010000.1 2008/07/25 10:29:12 appldev ship $ */
3: g_debug VARCHAR2 (5) := NVL(fnd_profile.VALUE ('AFLOG_LEVEL'),-1);
4: g_pkg_name CONSTANT VARCHAR2 (30) := 'GME_API_PUB';
5:
6: PROCEDURE gme_when_others (
7: p_api_name IN VARCHAR2
8: ,x_message_count OUT NOCOPY NUMBER
844:
845: --Bug#5459105 Begin
846: IF x_return_status = fnd_api.g_ret_sts_success THEN
847: IF p_commit = fnd_api.g_true THEN
848: gme_api_pub.save_batch (p_header_id => NULL
849: ,p_table => NULL
850: ,p_commit => fnd_api.g_false
851: ,x_return_status => x_return_status);
852:
967:
968: --Bug#5459105 Begin
969: IF x_return_status = fnd_api.g_ret_sts_success THEN
970: IF p_commit = fnd_api.g_true THEN
971: gme_api_pub.save_batch (p_header_id => NULL
972: ,p_table => NULL
973: ,p_commit => fnd_api.g_false
974: ,x_return_status => x_return_status);
975:
1124: l_batch_header.batch_id := x_rsrc_txn_rec.doc_id;
1125:
1126: IF x_return_status = fnd_api.g_ret_sts_success THEN
1127: IF p_commit = fnd_api.g_true THEN
1128: gme_api_pub.save_batch (p_header_id => NULL
1129: ,p_table => NULL
1130: ,p_commit => fnd_api.g_false
1131: ,x_return_status => x_return_status);
1132:
1287: l_batch_header.batch_id := x_rsrc_txn_rec.doc_id;
1288:
1289: IF x_return_status = fnd_api.g_ret_sts_success THEN
1290: IF p_commit = fnd_api.g_true THEN
1291: gme_api_pub.save_batch (p_header_id => NULL
1292: ,p_table => NULL
1293: ,p_commit => fnd_api.g_false
1294: ,x_return_status => x_return_status);
1295:
1429: l_batch_header.batch_id := x_rsrc_txn_rec.doc_id;
1430:
1431: IF x_return_status = fnd_api.g_ret_sts_success THEN
1432: IF p_commit = fnd_api.g_true THEN
1433: gme_api_pub.save_batch (p_header_id => NULL
1434: ,p_table => NULL
1435: ,p_commit => fnd_api.g_false
1436: ,x_return_status => x_return_status);
1437:
1475: # DESCRIPTION
1476: # This Api is used to state that a resource has started, and
1477: # creates a transaction row in the resource transactions table.
1478: # At a later time this transaction is updated with the usage
1479: # by calling gme_api_pub.end_cmplt_actual_rsrc_txn (It passes
1480: # the end date and the usage is calculated as diferrence between
1481: # end_date and start_date)
1482: # HISTORY
1483: # 10-MAR-2005 Punit Kumar
1572:
1573: /*end */
1574: IF x_return_status = fnd_api.g_ret_sts_success THEN
1575: IF p_commit = fnd_api.g_true THEN
1576: gme_api_pub.save_batch (p_header_id => NULL
1577: ,p_table => NULL
1578: ,p_commit => fnd_api.g_false
1579: ,x_return_status => x_return_status);
1580:
1704:
1705: /* end */
1706: IF x_return_status = fnd_api.g_ret_sts_success THEN
1707: IF p_commit = fnd_api.g_true THEN
1708: gme_api_pub.save_batch (p_header_id => NULL
1709: ,p_table => NULL
1710: ,p_commit => fnd_api.g_false
1711: ,x_return_status => x_return_status);
1712:
1969: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1970: RAISE reschedule_batch_failed;
1971: ELSE
1972: IF p_commit = fnd_api.g_true THEN
1973: gme_api_pub.save_batch (p_header_id => NULL
1974: ,p_table => NULL
1975: ,p_commit => fnd_api.g_false
1976: ,x_return_status => x_return_status);
1977:
2290: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2291: RAISE reschedule_step_failed;
2292: ELSE
2293: IF p_commit = fnd_api.g_true THEN
2294: gme_api_pub.save_batch (p_header_id => NULL
2295: ,p_table => NULL
2296: ,p_commit => fnd_api.g_false
2297: ,x_return_status => x_return_status);
2298:
2991: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2992: RAISE delete_step_failed;
2993: ELSE
2994: IF p_commit = fnd_api.g_true THEN
2995: gme_api_pub.save_batch (p_header_id => null
2996: ,p_table => 1
2997: ,p_commit => fnd_api.g_false
2998: ,x_return_status => x_return_status);
2999:
3222: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3223: RAISE insert_step_failed;
3224: ELSE
3225: IF p_commit = fnd_api.g_true THEN
3226: gme_api_pub.save_batch (p_header_id => null
3227: ,p_table => 1
3228: ,p_commit => fnd_api.g_false
3229: ,x_return_status => x_return_status);
3230:
3455: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3456: RAISE fnd_api.g_exc_error;
3457: ELSE
3458: IF p_commit = fnd_api.g_true THEN
3459: gme_api_pub.save_batch (p_header_id => NULL
3460: ,p_table => 1
3461: ,p_commit => fnd_api.g_false
3462: ,x_return_status => x_return_status);
3463:
3707: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3708: RAISE fnd_api.g_exc_error;
3709: ELSE
3710: IF p_commit = fnd_api.g_true THEN
3711: gme_api_pub.save_batch (p_header_id => NULL
3712: ,p_table => 1
3713: ,p_commit => fnd_api.g_false
3714: ,x_return_status => x_return_status);
3715:
4006: END IF;
4007:
4008: IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
4009: IF p_commit = FND_API.G_TRUE THEN
4010: gme_api_pub.save_batch (p_header_id => NULL,
4011: p_table => gme_common_pvt.g_interface_table,
4012: p_commit => p_commit,
4013: x_return_status => x_return_status);
4014:
4165: END IF;
4166:
4167: IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
4168: IF p_commit = FND_API.G_TRUE THEN
4169: gme_api_pub.save_batch (p_header_id => NULL,
4170: p_table => gme_common_pvt.g_interface_table,
4171: p_commit => FND_API.G_FALSE,
4172: x_return_status => x_return_status);
4173: IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
4317: IF (g_debug = gme_debug.g_log_statement) THEN
4318: gme_debug.put_line ('Calling save_batch.');
4319: END IF;
4320:
4321: gme_api_pub.save_batch (p_header_id => null
4322: ,p_table => 1
4323: ,p_commit => fnd_api.g_false
4324: ,x_return_status => x_return_status);
4325:
4468: IF x_return_status <> fnd_api.g_ret_sts_success THEN
4469: RAISE step_close_failed;
4470: ELSE
4471: IF p_commit = fnd_api.g_true THEN
4472: gme_api_pub.save_batch (p_header_id => null
4473: ,p_table => 1
4474: ,p_commit => fnd_api.g_false
4475: ,x_return_status => x_return_status);
4476:
4575: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN
4576: RAISE batch_reopen_failure;
4577: ELSE
4578: IF p_commit = fnd_api.g_true THEN
4579: gme_api_pub.save_batch
4580: (p_header_id => null
4581: ,p_table => 1
4582: ,p_commit => fnd_api.g_false
4583: ,x_return_status => x_return_status);
4683: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN
4684: RAISE step_reopen_failure;
4685: ELSE
4686: IF p_commit = fnd_api.g_true THEN
4687: gme_api_pub.save_batch (p_header_id => null
4688: ,p_table => 1
4689: ,p_commit => fnd_api.g_false
4690: ,x_return_status => x_return_status);
4691: IF x_return_status = fnd_api.g_ret_sts_success THEN
4856: RAISE error_incr_backflush;
4857: END IF;
4858:
4859: /* Invoke save_batch */
4860: gme_api_pub.save_batch
4861: (p_header_id => gme_common_pvt.g_transaction_header_id
4862: ,p_table => 1
4863: ,p_commit => p_commit
4864: ,x_return_status => x_return_status);
5190: gme_debug.put_line ( 'before save batch'
5191: || gme_common_pvt.g_transaction_header_id);
5192: END IF;
5193: l_header_id := gme_common_pvt.g_transaction_header_id;
5194: gme_api_pub.save_batch
5195: (p_header_id => gme_common_pvt.g_transaction_header_id
5196: ,p_table => 1
5197: ,p_commit => p_commit
5198: ,x_return_status => x_return_status);
5531: gme_debug.put_line ( 'before save batch'
5532: || gme_common_pvt.g_transaction_header_id);
5533: END IF;
5534: l_header_id:= gme_common_pvt.g_transaction_header_id;
5535: gme_api_pub.save_batch
5536: (p_header_id => gme_common_pvt.get_txn_header_id
5537: ,p_table => 1
5538: ,p_commit => p_commit
5539: ,x_return_status => x_return_status);
5690: ,x_return_status => x_return_status);
5691:
5692: IF x_return_status = fnd_api.g_ret_sts_success THEN
5693: IF (p_commit = fnd_api.g_true) THEN
5694: gme_api_pub.save_batch
5695: (p_header_id => gme_common_pvt.get_txn_header_id
5696: ,p_table => 1
5697: ,p_commit => p_commit
5698: ,x_return_status => x_return_status);
5865: RAISE reroute_batch_failed;
5866: ELSIF (x_return_status = fnd_api.g_ret_sts_unexp_error) THEN
5867: RAISE fnd_api.g_exc_unexpected_error;
5868: END IF;
5869: gme_api_pub.save_batch
5870: (p_header_id => NULL
5871: ,p_table => gme_common_pvt.g_interface_table
5872: ,p_commit => p_commit
5873: ,x_return_status => x_return_status);
6038: END IF;
6039:
6040: IF x_return_status = fnd_api.g_ret_sts_success THEN
6041: IF p_commit = fnd_api.g_true THEN
6042: gme_api_pub.save_batch
6043: (p_header_id => NULL
6044: ,p_table => gme_common_pvt.g_interface_table
6045: ,p_commit => p_commit
6046: ,x_return_status => x_return_status);
6281: END IF;
6282:
6283: IF x_return_status = fnd_api.g_ret_sts_success THEN
6284: IF p_commit = fnd_api.g_true THEN
6285: gme_api_pub.save_batch
6286: (p_header_id => NULL
6287: ,p_table => gme_common_pvt.g_interface_table
6288: ,p_commit => p_commit
6289: ,x_return_status => x_return_status);
6497:
6498: IF x_return_status <> fnd_api.g_ret_sts_success THEN
6499: RAISE detail_reservation_error;
6500: END IF;
6501: gme_api_pub.save_batch
6502: (p_header_id => gme_common_pvt.g_transaction_header_id
6503: ,p_table => 1
6504: ,p_commit => p_commit
6505: ,x_return_status => x_return_status);
6508: gme_debug.put_line
6509: ( g_pkg_name
6510: || '.'
6511: || l_api_name
6512: || ' return status from gme_api_pub.save_batch is '
6513: || x_return_status);
6514: END IF;
6515:
6516: IF x_return_status <> fnd_api.g_ret_sts_success THEN
6937: || l_api_name
6938: || ' invoke save_batch');
6939: END IF;
6940:
6941: gme_api_pub.save_batch (p_header_id => NULL
6942: ,p_table => NULL
6943: ,p_commit => p_commit
6944: ,x_return_status => x_return_status);
6945:
7227: || ' invoke save_batch with commit ='
7228: || p_commit);
7229: END IF;
7230:
7231: gme_api_pub.save_batch
7232: (p_header_id => gme_common_pvt.g_transaction_header_id
7233: ,p_table => null
7234: ,p_commit => p_commit
7235: ,x_return_status => x_return_status);
7553: gme_debug.put_line ( g_pkg_name || '.' || l_api_name || ' invoke
7554: save_batch tith commit set ' || p_commit);
7555: END IF;
7556:
7557: gme_api_pub.save_batch
7558: (p_header_id => gme_common_pvt.g_transaction_header_id
7559: ,p_table => null
7560: ,p_commit => p_commit
7561: ,x_return_status => x_return_status);
8079: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN
8080: RAISE insert_activity_failed;
8081: END IF;
8082:
8083: gme_api_pub.save_batch (x_return_status => x_return_status);
8084:
8085: IF (x_return_status = fnd_api.g_ret_sts_success) THEN
8086: COMMIT WORK;
8087: ELSE
8221: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN
8222: RAISE update_activity_failed;
8223: END IF;
8224:
8225: gme_api_pub.save_batch (x_return_status => x_return_status);
8226:
8227: IF (x_return_status = fnd_api.g_ret_sts_success) THEN
8228: COMMIT WORK;
8229: ELSE
8348: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN
8349: RAISE delete_activity_failed;
8350: END IF;
8351:
8352: gme_api_pub.save_batch (x_return_status => x_return_status);
8353:
8354: IF (x_return_status = fnd_api.g_ret_sts_success) THEN
8355: COMMIT;
8356: ELSE
8511: );
8512:
8513: IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
8514: IF p_commit = fnd_api.g_true THEN
8515: gme_api_pub.save_batch (p_header_id => NULL
8516: ,p_table => NULL
8517: ,p_commit => p_commit
8518: ,x_return_status => x_return_status);
8519:
8726: IF x_return_status <> fnd_api.g_ret_sts_success THEN
8727: RAISE error_create_pp_lot;
8728: END IF;
8729:
8730: gme_api_pub.save_batch
8731: (p_header_id => gme_common_pvt.g_transaction_header_id
8732: ,p_table => 1
8733: ,p_commit => p_commit
8734: ,x_return_status => x_return_status);
8737: gme_debug.put_line
8738: ( g_pkg_name
8739: || '.'
8740: || l_api_name
8741: || ' Return status from gme_api_pub.save_batch is '
8742: || x_return_status);
8743: END IF;
8744:
8745: IF x_return_status <> fnd_api.g_ret_sts_success THEN
8962: || ' About to invoke save_batch with header_id of '
8963: || gme_common_pvt.g_transaction_header_id);
8964: END IF;
8965:
8966: gme_api_pub.save_batch
8967: (p_header_id => gme_common_pvt.g_transaction_header_id
8968: ,p_table => 1
8969: ,p_commit => p_commit
8970: ,x_return_status => x_return_status);
8973: gme_debug.put_line
8974: ( g_pkg_name
8975: || '.'
8976: || l_api_name
8977: || ' Return status from gme_api_pub.save_batch is '
8978: || x_return_status);
8979: END IF;
8980:
8981: IF x_return_status <> fnd_api.g_ret_sts_success THEN
9202: || ' About to invoke save_batch with header_id of '
9203: || gme_common_pvt.g_transaction_header_id);
9204: END IF;
9205:
9206: gme_api_pub.save_batch
9207: (p_header_id => gme_common_pvt.g_transaction_header_id
9208: ,p_table => 1
9209: ,p_commit => p_commit
9210: ,x_return_status => x_return_status);
9213: gme_debug.put_line
9214: ( g_pkg_name
9215: || '.'
9216: || l_api_name
9217: || ' Return status from gme_api_pub.save_batch is '
9218: || x_return_status);
9219: END IF;
9220:
9221: IF x_return_status <> fnd_api.g_ret_sts_success THEN
9369: RAISE error_unrelease_batch;
9370: END IF;
9371:
9372: /* Invoke save_batch */
9373: gme_api_pub.save_batch
9374: (p_header_id => gme_common_pvt.g_transaction_header_id
9375: ,p_table => 1
9376: ,p_commit => p_commit
9377: ,x_return_status => x_return_status);
9377: ,x_return_status => x_return_status);
9378:
9379: IF g_debug <= gme_debug.g_log_statement THEN
9380: gme_debug.put_line ( g_pkg_name || '.' || l_api_name ||
9381: ' Return status from gme_api_pub.save_batch is '
9382: || x_return_status);
9383: END IF;
9384:
9385: IF x_return_status <> fnd_api.g_ret_sts_success THEN
9554: || ' About to invoke save_batch with header_id of '
9555: || gme_common_pvt.g_transaction_header_id);
9556: END IF;
9557:
9558: gme_api_pub.save_batch
9559: (p_header_id => gme_common_pvt.g_transaction_header_id
9560: ,p_table => 1
9561: ,p_commit => p_commit
9562: ,x_return_status => x_return_status);
9565: gme_debug.put_line
9566: ( g_pkg_name
9567: || '.'
9568: || l_api_name
9569: || ' Return status from gme_api_pub.save_batch is '
9570: || x_return_status);
9571: END IF;
9572:
9573: IF x_return_status <> fnd_api.g_ret_sts_success THEN
9776: || ' About to invoke save_batch with header_id of '
9777: || gme_common_pvt.g_transaction_header_id);
9778: END IF;
9779:
9780: gme_api_pub.save_batch
9781: (p_header_id => gme_common_pvt.g_transaction_header_id
9782: ,p_table => 1
9783: ,p_commit => p_commit
9784: ,x_return_status => x_return_status);
9787: gme_debug.put_line
9788: ( g_pkg_name
9789: || '.'
9790: || l_api_name
9791: || ' Return status from gme_api_pub.save_batch is '
9792: || x_return_status);
9793: END IF;
9794:
9795: IF x_return_status <> fnd_api.g_ret_sts_success THEN
10038: -- reset flex global
10039: gme_common_pvt.g_flex_validate_prof := 0;
10040:
10041: /* Invoke save_batch */
10042: gme_api_pub.save_batch
10043: (p_header_id => gme_common_pvt.g_transaction_header_id
10044: ,p_table => 1
10045: ,p_commit => p_commit
10046: ,x_return_status => x_return_status);
10049: gme_debug.put_line
10050: ( g_pkg_name
10051: || '.'
10052: || l_api_name
10053: || ' Return status from gme_api_pub.save_batch is '
10054: || x_return_status);
10055: END IF;
10056:
10057: IF x_return_status <> fnd_api.g_ret_sts_success THEN
10238: gme_debug.put_line ( g_pkg_name || '.' || l_api_name || ' About to
10239: invoke save_batch with header_id of ' || gme_common_pvt.g_transaction_header_id);
10240: END IF;
10241:
10242: gme_api_pub.save_batch
10243: (p_header_id => gme_common_pvt.g_transaction_header_id
10244: ,p_table => 1
10245: ,p_commit => p_commit
10246: ,x_return_status => x_return_status);
10246: ,x_return_status => x_return_status);
10247:
10248: IF g_debug <= gme_debug.g_log_statement THEN
10249: gme_debug.put_line ( g_pkg_name || '.' || l_api_name ||
10250: ' Return status from gme_api_pub.save_batch is ' || x_return_status);
10251: END IF;
10252:
10253: IF x_return_status <> fnd_api.g_ret_sts_success THEN
10254: RAISE fnd_api.g_exc_error;
10476: gme_debug.put_line ( g_pkg_name || '.' || l_api_name || ' About to
10477: invoke save_batch with header_id of ' || gme_common_pvt.g_transaction_header_id);
10478: END IF;
10479:
10480: gme_api_pub.save_batch
10481: (p_header_id => gme_common_pvt.g_transaction_header_id
10482: ,p_table => 1
10483: ,p_commit => p_commit
10484: ,x_return_status => x_return_status);
10484: ,x_return_status => x_return_status);
10485:
10486: IF g_debug <= gme_debug.g_log_statement THEN
10487: gme_debug.put_line ( g_pkg_name || '.' || l_api_name || ' Return
10488: status from gme_api_pub.save_batch is ' || x_return_status);
10489: END IF;
10490:
10491: IF x_return_status <> fnd_api.g_ret_sts_success THEN
10492: RAISE fnd_api.g_exc_error;
10702: i := i+1;
10703: l_in_batch_header_rec.batch_id := get_rec.batch_id;
10704: -- DBMS_OUTPUT.put_line ('batch_id is ' || l_in_batch_header_rec.batch_id);
10705: IF (p_action = 3) THEN
10706: gme_api_pub.auto_detail_batch
10707: (p_api_version => 2.0,
10708: p_init_msg_list => 'T',
10709: p_commit => 'T',
10710: x_message_count => x_message_count,
10713: p_batch_rec => l_in_batch_header_rec,
10714: p_org_code => NULL
10715: );
10716: ELSIF (p_action = 4) THEN
10717: gme_api_pub.release_batch
10718: (p_api_version => 2.0,
10719: p_validation_level => 100,
10720: p_init_msg_list => 'T',
10721: p_commit => 'T',
10729: x_batch_header_rec => l_batch_header_rec,
10730: x_exception_material_tbl => l_exception_material_tbl
10731: );
10732: ELSIF (p_action = 5) THEN
10733: gme_api_pub.complete_batch
10734: (p_api_version => 2.0,
10735: p_validation_level => 100,
10736: p_init_msg_list => 'T',
10737: p_commit => 'T',
10745: x_batch_header_rec => l_batch_header_rec,
10746: x_exception_material_tbl => l_exception_material_tbl
10747: );
10748: ELSIF (p_action = 6) THEN
10749: gme_api_pub.close_batch
10750: (p_api_version => 2.0,
10751: p_validation_level => 100,
10752: p_init_msg_list => 'T',
10753: p_commit => 'T',
10758: x_batch_header_rec => l_batch_header_rec,
10759: p_org_code => NULL
10760: );
10761: ELSIF (p_action = 7) THEN
10762: gme_api_pub.reopen_batch
10763: (p_api_version => 2.0,
10764: p_validation_level => 100,
10765: p_init_msg_list => 'T',
10766: p_commit => 'T',
10772: p_reopen_steps => NULL,
10773: x_batch_header_rec => l_batch_header_rec
10774: );
10775: ELSIF (p_action = 8) THEN
10776: gme_api_pub.revert_batch
10777: (p_api_version => 2.0,
10778: p_validation_level => 100,
10779: p_init_msg_list => 'T',
10780: p_commit => 'T',
10785: p_batch_header_rec => l_in_batch_header_rec,
10786: x_batch_header_rec => l_batch_header_rec
10787: );
10788: ELSIF (p_action = 9) THEN
10789: gme_api_pub.unrelease_batch
10790: (p_api_version => 2.0,
10791: p_validation_level => 100,
10792: p_init_msg_list => 'T',
10793: p_commit => 'T',
10799: p_create_resv_pend_lots => NULL,
10800: x_batch_header_rec => l_batch_header_rec
10801: );
10802: ELSIF (p_action = 10) THEN
10803: gme_api_pub.cancel_batch
10804: (p_api_version => 2.0,
10805: p_validation_level => 100,
10806: p_init_msg_list => 'T',
10807: p_commit => 'T',
10813: p_org_code => NULL
10814: );
10815:
10816: ELSIF (p_action = 11) THEN
10817: gme_api_pub.terminate_batch
10818: (p_api_version => 2.0,
10819: p_validation_level => 100,
10820: p_init_msg_list => 'T',
10821: p_commit => 'T',
10902: ,x_return_status => x_return_status );
10903: END process_group;
10904:
10905:
10906: END gme_api_pub;