107: IF (g_debug IS NOT NULL) THEN
108: gme_debug.log_initialize ('RelieveRsrvPndLots');
109: END IF;
110:
111: x_return_status := FND_API.G_RET_STS_SUCCESS;
112: x_error_msg := ' ';
113:
114: IF p_rsrv_pndlot_id IS NULL THEN
115: RAISE no_rsrv_pndlot_id;
120: gme_reservations_pvt.relieve_reservation(p_reservation_id => p_rsrv_pndlot_id,
121: p_prim_relieve_qty => p_relieve_qty,
122: x_return_status => x_return_status);
123:
124: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
125: gme_common_pvt.count_and_get (x_count => l_count
126: ,p_encoded => fnd_api.g_false
127: ,x_data => x_error_msg);
128:
122: x_return_status => x_return_status);
123:
124: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
125: gme_common_pvt.count_and_get (x_count => l_count
126: ,p_encoded => fnd_api.g_false
127: ,x_data => x_error_msg);
128:
129: END IF;
130: ELSE
132: ,p_quantity => p_relieve_qty
133: ,p_secondary_quantity=> p_sec_qty
134: ,x_return_status => x_return_status);
135:
136: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
137: gme_common_pvt.count_and_get (x_count => l_count
138: ,p_encoded => fnd_api.g_false
139: ,x_data => x_error_msg);
140:
134: ,x_return_status => x_return_status);
135:
136: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
137: gme_common_pvt.count_and_get (x_count => l_count
138: ,p_encoded => fnd_api.g_false
139: ,x_data => x_error_msg);
140:
141: END IF;
142: END IF;
141: END IF;
142: END IF;
143: EXCEPTION
144: WHEN NO_RSRV_PNDLOT_ID THEN
145: x_return_status := fnd_api.g_ret_sts_error;
146: fnd_message.set_name('GME','INVALID_VALUE');
147: x_error_msg := fnd_message.get;
148: WHEN OTHERS THEN
149: IF g_debug <= gme_debug.g_log_unexpected THEN
149: IF g_debug <= gme_debug.g_log_unexpected THEN
150: gme_debug.put_line('When others exception in relieve_resvns_pend_lots');
151: END IF;
152: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','relieve_resvns_pend_lots');
153: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
154: x_error_msg := fnd_message.get;
155:
156: END relieve_resvns_pend_lots;
157:
184: p_line_type => p_line_type,
185: x_return_status => x_return_status,
186: x_error_msg => x_error_msg);
187:
188: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
189: gme_common_pvt.count_and_get (x_count => l_count
190: ,p_encoded => fnd_api.g_false
191: ,x_data => x_error_msg);
192:
186: x_error_msg => x_error_msg);
187:
188: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
189: gme_common_pvt.count_and_get (x_count => l_count
190: ,p_encoded => fnd_api.g_false
191: ,x_data => x_error_msg);
192:
193: END IF;
194: EXCEPTION
196: IF g_debug <= gme_debug.g_log_unexpected THEN
197: gme_debug.put_line('When others exception in relieve_resvns_disp_items');
198: END IF;
199: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','relieve_resvns_disp_items');
200: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
201: x_error_msg := fnd_message.get;
202: END relieve_resvns_disp_items;
203:
204:
223: l_msg_count NUMBER;
224: BEGIN
225:
226: fnd_msg_pub.Count_And_Get
227: (p_encoded => FND_API.g_false,
228: p_count => l_msg_count,
229: p_data => l_message
230: );
231:
332: gme_common_pvt.g_user_ident := p_user_id;
333: gme_common_pvt.g_login_id := p_login_id;
334: gme_common_pvt.set_timestamp;
335:
336: x_return_status := FND_API.G_RET_STS_SUCCESS;
337: x_error_msg := ' ';
338:
339: l_mmti_rec_in.transaction_type_id := Get_Txn_Type(p_txn_type_id);
340:
385: x_mmti_rec => l_mmti_rec_out,
386: x_return_status => x_return_status);
387:
388:
389: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
390: -- Bug 5255933 Use GME_COMMON_PVT to get error message
391: --x_error_msg := fnd_message.get;
392: GME_COMMON_PVT.count_and_get (x_count => l_count
393: ,p_encoded => fnd_api.g_false
389: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
390: -- Bug 5255933 Use GME_COMMON_PVT to get error message
391: --x_error_msg := fnd_message.get;
392: GME_COMMON_PVT.count_and_get (x_count => l_count
393: ,p_encoded => fnd_api.g_false
394: ,x_data => x_error_msg);
395:
396: x_txn_id := -1;
397: x_txn_type_id := -1;
407: IF g_debug <= gme_debug.g_log_unexpected THEN
408: gme_debug.put_line('When others exception in Create MAterial Txn');
409: END IF;
410: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','create_material_txn');
411: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
412: x_error_msg := fnd_message.get;
413:
414: END Create_Material_Txn;
415:
448: IF (g_debug IS NOT NULL) THEN
449: gme_debug.log_initialize ('MobileCreLotTxn');
450: END IF;
451:
452: x_return_status := FND_API.G_RET_STS_SUCCESS;
453: x_error_msg := ' ';
454:
455: gme_common_pvt.g_user_ident := p_user_id;
456: gme_common_pvt.g_login_id := p_login_id;
473: x_mmli_rec => l_mmli_rec_out,
474: x_return_status => x_return_status
475: );
476:
477: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
478: x_error_msg := fnd_message.get;
479: END IF;
480:
481: EXCEPTION
483: IF g_debug <= gme_debug.g_log_unexpected THEN
484: gme_debug.put_line('When others exception in Create Lot Txn');
485: END IF;
486: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','create_lot_txn');
487: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
488: x_error_msg := fnd_message.get;
489:
490: END Create_Lot_Txn;
491:
525:
526: IF (g_debug IS NOT NULL) THEN
527: gme_debug.log_initialize ('MobileValLotTxn');
528: END IF;
529: x_return_status := FND_API.G_RET_STS_SUCCESS;
530: x_error_msg := ' ';
531:
532: l_transaction_type_id := Get_Txn_Type(p_transaction_type_id);
533:
532: l_transaction_type_id := Get_Txn_Type(p_transaction_type_id);
533:
534: IF NOT (INV_LOT_API_PUB.validate_lot_indivisible(
535: p_api_version =>1.0
536: ,p_init_msg_list =>FND_API.G_FALSE
537: ,p_commit =>FND_API.G_FALSE
538: ,p_validation_level =>FND_API.G_VALID_LEVEL_FULL
539: ,p_transaction_type_id =>l_transaction_type_id
540: ,p_organization_id =>p_organization_id
533:
534: IF NOT (INV_LOT_API_PUB.validate_lot_indivisible(
535: p_api_version =>1.0
536: ,p_init_msg_list =>FND_API.G_FALSE
537: ,p_commit =>FND_API.G_FALSE
538: ,p_validation_level =>FND_API.G_VALID_LEVEL_FULL
539: ,p_transaction_type_id =>l_transaction_type_id
540: ,p_organization_id =>p_organization_id
541: ,p_inventory_item_id =>p_item_id
534: IF NOT (INV_LOT_API_PUB.validate_lot_indivisible(
535: p_api_version =>1.0
536: ,p_init_msg_list =>FND_API.G_FALSE
537: ,p_commit =>FND_API.G_FALSE
538: ,p_validation_level =>FND_API.G_VALID_LEVEL_FULL
539: ,p_transaction_type_id =>l_transaction_type_id
540: ,p_organization_id =>p_organization_id
541: ,p_inventory_item_id =>p_item_id
542: ,p_revision =>p_revision
551: ,x_msg_data =>l_msg_data))
552:
553: THEN
554: GME_COMMON_PVT.Count_And_Get (x_count => l_msg_count
555: ,p_encoded => fnd_api.g_false
556: ,x_data => x_error_msg);
557:
558: x_return_status := FND_API.G_RET_STS_ERROR;
559: END IF;
554: GME_COMMON_PVT.Count_And_Get (x_count => l_msg_count
555: ,p_encoded => fnd_api.g_false
556: ,x_data => x_error_msg);
557:
558: x_return_status := FND_API.G_RET_STS_ERROR;
559: END IF;
560:
561: EXCEPTION
562: WHEN OTHERS THEN
563: IF g_debug <= gme_debug.g_log_unexpected THEN
564: gme_debug.put_line('When others exception in Validate Indiv Lot Txn');
565: END IF;
566: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','Validate_Indiv_Lot_Txn');
567: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
568: x_error_msg := fnd_message.get;
569:
570: END Validate_Indiv_Lot_Txn;
571:
608: IF (g_debug IS NOT NULL) THEN
609: gme_debug.log_initialize ('MobileValMtlSts');
610: END IF;
611:
612: x_return_status := FND_API.G_RET_STS_SUCCESS;
613: x_error_msg := ' ';
614:
615: l_transaction_type_id := Get_Txn_Type(p_transaction_type_id);
616:
685: FND_MESSAGE.SET_TOKEN('ITEM', l_item); --Bug#5658050
686: FND_MESSAGE.SET_TOKEN('LOCN',l_locator);
687: END IF;
688:
689: x_return_status := FND_API.G_RET_STS_ERROR;
690: x_error_msg := fnd_message.get;
691:
692: END IF;
693:
696: IF g_debug <= gme_debug.g_log_unexpected THEN
697: gme_debug.put_line('When others exception in Is_Material_Status_Applicable');
698: END IF;
699: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','Is_Material_Status_Applicable');
700: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
701: x_error_msg := fnd_message.get;
702:
703: END Is_Material_Status_Applicable;
704:
739: gme_debug.log_initialize ('MobileFetchAgrTxns');
740: END IF;
741:
742:
743: x_return_status := FND_API.G_RET_STS_SUCCESS;
744: x_error_msg := ' ';
745:
746: OPEN Get_Agg_Txn;
747: FETCH Get_Agg_Txn INTO x_aggr_txn_qty, x_aggr_txn_sec_qty;
752: IF g_debug <= gme_debug.g_log_unexpected THEN
753: gme_debug.put_line('When others exception in fetch aggrageted txns');
754: END IF;
755: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','fetch_aggregated_txns');
756: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
757: x_error_msg := fnd_message.get;
758:
759: END Fetch_Aggregated_Txns;
760:
786: gme_debug.log_initialize ('MobileFetchAgrLotTxns');
787: END IF;
788:
789:
790: x_return_status := FND_API.G_RET_STS_SUCCESS;
791: x_error_msg := ' ';
792:
793: OPEN x_txn_cursor FOR
794: SELECT m.revision,lot_number,
809: IF g_debug <= gme_debug.g_log_unexpected THEN
810: gme_debug.put_line('When others exception in fetch aggrageted lot txns');
811: END IF;
812: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','fetch_aggregated_lot_txns');
813: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
814: x_error_msg := fnd_message.get;
815:
816: END Fetch_Aggregated_Lot_Txns;
817:
855: gme_debug.log_initialize ('MobileFetchAgrRevTxns');
856: END IF;
857:
858:
859: x_return_status := FND_API.G_RET_STS_SUCCESS;
860: x_error_msg := ' ';
861:
862: OPEN Get_Agg_Txn;
863: FETCH Get_Agg_Txn INTO x_aggr_txn_qty, x_aggr_txn_sec_qty;
869: IF g_debug <= gme_debug.g_log_unexpected THEN
870: gme_debug.put_line('When others exception in fetch aggrageted lot txns');
871: END IF;
872: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','fetch_aggregated_rev_txns');
873: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
874: x_error_msg := fnd_message.get;
875:
876: END Fetch_Aggregated_Rev_Txns;
877:
906: END IF;
907:
908: l_txn_type_id := Get_Txn_Type(p_txn_type_id);
909:
910: x_return_status := FND_API.G_RET_STS_SUCCESS;
911: x_error_msg := ' ';
912:
913: FND_PROFILE.GET('MWA_DATE_FORMAT_MASK',l_date_format);
914:
941: IF g_debug <= gme_debug.g_log_unexpected THEN
942: gme_debug.put_line('When others exception in fetch Mtl Transactions');
943: END IF;
944: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','fetch_material_transactions');
945: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
946: x_error_msg := fnd_message.get;
947:
948: END Fetch_Material_Transactions;
949:
973: IF (g_debug IS NOT NULL) THEN
974: gme_debug.log_initialize ('MobileFetchLotTxn');
975: END IF;
976:
977: x_return_status := FND_API.G_RET_STS_SUCCESS;
978: x_error_msg := ' ';
979:
980: OPEN x_txn_cursor FOR
981: SELECT
992: IF g_debug <= gme_debug.g_log_unexpected THEN
993: gme_debug.put_line('When others exception in fetch Mtl Lot Transactions');
994: END IF;
995: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','fetch_material_lot_transactions');
996: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
997: x_error_msg := fnd_message.get;
998:
999: END Fetch_Lot_Transactions;
1000:
1035: -- Bug 8234700 - Let's pass in false to process transactions and commit after
1036: -- This more closely mimics how save is done on the form and commits all work together.
1037: GME_TRANSACTIONS_PVT.Process_Transactions
1038: (p_api_version => 2.0,
1039: p_init_msg_list => fnd_api.g_false,
1040: -- p_commit => fnd_api.g_true,
1041: p_commit => fnd_api.g_false,
1042: p_validation_level => fnd_api.g_valid_level_full,
1043: p_table => 1, -- Source table is Interface
1036: -- This more closely mimics how save is done on the form and commits all work together.
1037: GME_TRANSACTIONS_PVT.Process_Transactions
1038: (p_api_version => 2.0,
1039: p_init_msg_list => fnd_api.g_false,
1040: -- p_commit => fnd_api.g_true,
1041: p_commit => fnd_api.g_false,
1042: p_validation_level => fnd_api.g_valid_level_full,
1043: p_table => 1, -- Source table is Interface
1044: p_header_id => p_txn_header_id,
1037: GME_TRANSACTIONS_PVT.Process_Transactions
1038: (p_api_version => 2.0,
1039: p_init_msg_list => fnd_api.g_false,
1040: -- p_commit => fnd_api.g_true,
1041: p_commit => fnd_api.g_false,
1042: p_validation_level => fnd_api.g_valid_level_full,
1043: p_table => 1, -- Source table is Interface
1044: p_header_id => p_txn_header_id,
1045: x_return_status => x_return_status,
1038: (p_api_version => 2.0,
1039: p_init_msg_list => fnd_api.g_false,
1040: -- p_commit => fnd_api.g_true,
1041: p_commit => fnd_api.g_false,
1042: p_validation_level => fnd_api.g_valid_level_full,
1043: p_table => 1, -- Source table is Interface
1044: p_header_id => p_txn_header_id,
1045: x_return_status => x_return_status,
1046: x_msg_count => l_msg_count,
1046: x_msg_count => l_msg_count,
1047: x_msg_data => l_msg_data,
1048: x_trans_count => l_trans_count);
1049:
1050: IF (x_return_status <> fnd_api.g_ret_sts_success) THEN
1051: --x_error_msg := fnd_message.get;
1052: x_error_msg := l_msg_data;
1053: /* Bug 5438355: Added success message. */
1054: ELSE
1052: x_error_msg := l_msg_data;
1053: /* Bug 5438355: Added success message. */
1054: ELSE
1055: gme_common_pvt.log_message('PM_SAVED_CHANGES');
1056: gme_common_pvt.count_and_get(p_encoded => FND_API.G_FALSE,
1057: x_count => l_msg_count,
1058: x_data => x_error_msg);
1059: -- Bug 8234700 - Let's commit the work done by process transactions.
1060: COMMIT;
1069: IF g_debug <= gme_debug.g_log_unexpected THEN
1070: gme_debug.put_line('When others exception in Process_Transactions');
1071: END IF;
1072: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','process_transactions');
1073: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1074: x_error_msg := fnd_message.get;
1075:
1076: END Process_Interface_Txn;
1077:
1105: l_msg_count NUMBER ;
1106: l_msg_data VARCHAR2(3000) ;
1107: BEGIN
1108:
1109: x_return_status := fnd_api.G_RET_STS_SUCCESS;
1110: l_api_version := 1.0;
1111: l_init_msg_list := fnd_api.g_false;
1112: l_commit := fnd_api.g_false;
1113:
1107: BEGIN
1108:
1109: x_return_status := fnd_api.G_RET_STS_SUCCESS;
1110: l_api_version := 1.0;
1111: l_init_msg_list := fnd_api.g_false;
1112: l_commit := fnd_api.g_false;
1113:
1114: INV_LOT_API_PUB.validate_child_lot (
1115: x_return_status => l_return_status
1108:
1109: x_return_status := fnd_api.G_RET_STS_SUCCESS;
1110: l_api_version := 1.0;
1111: l_init_msg_list := fnd_api.g_false;
1112: l_commit := fnd_api.g_false;
1113:
1114: INV_LOT_API_PUB.validate_child_lot (
1115: x_return_status => l_return_status
1116: , x_msg_count => l_msg_count
1123: , p_parent_lot_number => p_parent_lot_number
1124: , p_child_lot_number => p_lot_number
1125: ) ;
1126:
1127: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1128: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1129: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_LOT_API_PUB.VALIDATE_CHILD_LOT');
1130: fnd_msg_pub.ADD;
1131: RAISE fnd_api.g_exc_unexpected_error;
1127: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1128: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1129: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_LOT_API_PUB.VALIDATE_CHILD_LOT');
1130: fnd_msg_pub.ADD;
1131: RAISE fnd_api.g_exc_unexpected_error;
1132: END IF;
1133:
1134: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1135: RAISE fnd_api.g_exc_error;
1130: fnd_msg_pub.ADD;
1131: RAISE fnd_api.g_exc_unexpected_error;
1132: END IF;
1133:
1134: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1135: RAISE fnd_api.g_exc_error;
1136: END IF;
1137:
1138:
1131: RAISE fnd_api.g_exc_unexpected_error;
1132: END IF;
1133:
1134: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1135: RAISE fnd_api.g_exc_error;
1136: END IF;
1137:
1138:
1139:
1138:
1139:
1140: EXCEPTION
1141: WHEN NO_DATA_FOUND THEN
1142: x_return_status := FND_API.G_RET_STS_ERROR;
1143:
1144: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1145: p_count => l_msg_count,
1146: p_data => x_error_msg);
1140: EXCEPTION
1141: WHEN NO_DATA_FOUND THEN
1142: x_return_status := FND_API.G_RET_STS_ERROR;
1143:
1144: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1145: p_count => l_msg_count,
1146: p_data => x_error_msg);
1147: if( l_msg_count > 1 ) then
1148: x_error_msg:= fnd_msg_pub.get(l_msg_count, FND_API.G_FALSE);
1144: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1145: p_count => l_msg_count,
1146: p_data => x_error_msg);
1147: if( l_msg_count > 1 ) then
1148: x_error_msg:= fnd_msg_pub.get(l_msg_count, FND_API.G_FALSE);
1149: end if;
1150:
1151: WHEN FND_API.G_EXC_ERROR THEN
1152: x_return_status := FND_API.G_RET_STS_ERROR;
1147: if( l_msg_count > 1 ) then
1148: x_error_msg:= fnd_msg_pub.get(l_msg_count, FND_API.G_FALSE);
1149: end if;
1150:
1151: WHEN FND_API.G_EXC_ERROR THEN
1152: x_return_status := FND_API.G_RET_STS_ERROR;
1153:
1154: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1155: p_count => l_msg_count,
1148: x_error_msg:= fnd_msg_pub.get(l_msg_count, FND_API.G_FALSE);
1149: end if;
1150:
1151: WHEN FND_API.G_EXC_ERROR THEN
1152: x_return_status := FND_API.G_RET_STS_ERROR;
1153:
1154: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1155: p_count => l_msg_count,
1156: p_data => l_msg_data);
1150:
1151: WHEN FND_API.G_EXC_ERROR THEN
1152: x_return_status := FND_API.G_RET_STS_ERROR;
1153:
1154: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1155: p_count => l_msg_count,
1156: p_data => l_msg_data);
1157: if( l_msg_count > 1 ) then
1158: x_error_msg := fnd_msg_pub.get(l_msg_count, FND_API.G_FALSE);
1154: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1155: p_count => l_msg_count,
1156: p_data => l_msg_data);
1157: if( l_msg_count > 1 ) then
1158: x_error_msg := fnd_msg_pub.get(l_msg_count, FND_API.G_FALSE);
1159: end if;
1160:
1161: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1162: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1157: if( l_msg_count > 1 ) then
1158: x_error_msg := fnd_msg_pub.get(l_msg_count, FND_API.G_FALSE);
1159: end if;
1160:
1161: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1162: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1163:
1164: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1165: p_count => l_msg_count,
1158: x_error_msg := fnd_msg_pub.get(l_msg_count, FND_API.G_FALSE);
1159: end if;
1160:
1161: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1162: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1163:
1164: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1165: p_count => l_msg_count,
1166: p_data => l_msg_data);
1160:
1161: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1162: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1163:
1164: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1165: p_count => l_msg_count,
1166: p_data => l_msg_data);
1167: if( l_msg_count > 1 ) then
1168: x_error_msg := fnd_msg_pub.get(l_msg_count, FND_API.G_FALSE);
1164: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1165: p_count => l_msg_count,
1166: p_data => l_msg_data);
1167: if( l_msg_count > 1 ) then
1168: x_error_msg := fnd_msg_pub.get(l_msg_count, FND_API.G_FALSE);
1169: end if;
1170:
1171:
1172: WHEN OTHERS THEN
1169: end if;
1170:
1171:
1172: WHEN OTHERS THEN
1173: x_return_status := fnd_api.g_ret_sts_error;
1174:
1175: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1176: p_count => l_msg_count,
1177: p_data => l_msg_data);
1171:
1172: WHEN OTHERS THEN
1173: x_return_status := fnd_api.g_ret_sts_error;
1174:
1175: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1176: p_count => l_msg_count,
1177: p_data => l_msg_data);
1178: if( l_msg_count > 1 ) then
1179: x_error_msg := fnd_msg_pub.get(l_msg_count, FND_API.G_FALSE);
1175: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false,
1176: p_count => l_msg_count,
1177: p_data => l_msg_data);
1178: if( l_msg_count > 1 ) then
1179: x_error_msg := fnd_msg_pub.get(l_msg_count, FND_API.G_FALSE);
1180: end if;
1181:
1182: END Validate_Child_Lot;
1183:
1211: IF (g_debug IS NOT NULL) THEN
1212: gme_debug.log_initialize ('MobileGenLotNumber');
1213: END IF;
1214:
1215: x_return_status := fnd_api.G_RET_STS_SUCCESS;
1216: x_error_msg := '';
1217:
1218: x_lot_number := INV_LOT_API_PUB.auto_gen_lot
1219: (p_org_id => p_org_id,
1231: p_transaction_action_id => NULL,
1232: p_transaction_source_type_id => NULL,
1233: p_lot_number => NULL,
1234: p_api_version => 1.0,
1235: p_init_msg_list => FND_API.G_FALSE,
1236: p_commit => FND_API.G_FALSE,
1237: p_validation_level => NULL,
1238: p_parent_lot_number => p_parent_lot_number,
1239: x_return_status => x_return_status,
1232: p_transaction_source_type_id => NULL,
1233: p_lot_number => NULL,
1234: p_api_version => 1.0,
1235: p_init_msg_list => FND_API.G_FALSE,
1236: p_commit => FND_API.G_FALSE,
1237: p_validation_level => NULL,
1238: p_parent_lot_number => p_parent_lot_number,
1239: x_return_status => x_return_status,
1240: x_msg_count => l_msg_count,
1239: x_return_status => x_return_status,
1240: x_msg_count => l_msg_count,
1241: x_msg_data => x_error_msg);
1242:
1243: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1244: RAISE fnd_api.g_exc_error;
1245: END IF;
1246:
1247: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
1240: x_msg_count => l_msg_count,
1241: x_msg_data => x_error_msg);
1242:
1243: IF x_return_status <> fnd_api.g_ret_sts_success THEN
1244: RAISE fnd_api.g_exc_error;
1245: END IF;
1246:
1247: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
1248: gme_debug.put_line ( 'lot_gen'
1251: || x_return_status);
1252: END IF;
1253:
1254: EXCEPTION
1255: WHEN fnd_api.g_exc_error THEN
1256: IF g_debug <= gme_debug.g_log_unexpected THEN
1257: gme_debug.put_line ( 'GME_MOBILE_TXNS'
1258: || '.'
1259: || 'Generate_Lot_Number'
1261: || 'When others exception:'
1262: || SQLERRM);
1263: END IF;
1264:
1265: x_return_status := fnd_api.g_ret_sts_error;
1266:
1267: WHEN OTHERS THEN
1268: IF g_debug <= gme_debug.g_log_unexpected THEN
1269: gme_debug.put_line ( 'GME_MOBILE_TXNS'
1274: || SQLERRM);
1275: END IF;
1276:
1277: gme_common_pvt.count_and_get (x_count => l_msg_count,
1278: p_encoded => fnd_api.g_false,
1279: x_data => x_error_msg);
1280: x_return_status := fnd_api.g_ret_sts_unexp_error;
1281:
1282: END Generate_Lot_Number;
1276:
1277: gme_common_pvt.count_and_get (x_count => l_msg_count,
1278: p_encoded => fnd_api.g_false,
1279: x_data => x_error_msg);
1280: x_return_status := fnd_api.g_ret_sts_unexp_error;
1281:
1282: END Generate_Lot_Number;
1283:
1284: /*+========================================================================+
1580: IF (g_debug IS NOT NULL) THEN
1581: gme_debug.log_initialize ('MobileValTxnDate');
1582: END IF;
1583:
1584: x_return_status := FND_API.G_RET_STS_SUCCESS;
1585: x_error_msg := ' ';
1586:
1587: --- Check that transaction date is not in the future
1588: IF p_txn_date > SYSDATE THEN
1605: EXCEPTION
1606: WHEN DATE_ERROR THEN
1607: x_period_id := -1;
1608: x_error_msg := fnd_message.get;
1609: x_return_status := FND_API.G_RET_STS_ERROR;
1610:
1611: WHEN OTHERS THEN
1612: IF g_debug <= gme_debug.g_log_unexpected THEN
1613: gme_debug.put_line('When others exception in Validate Txn Date');
1612: IF g_debug <= gme_debug.g_log_unexpected THEN
1613: gme_debug.put_line('When others exception in Validate Txn Date');
1614: END IF;
1615: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','Validate_Txn_Date');
1616: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1617: x_error_msg := fnd_message.get;
1618:
1619: END Validate_Txn_Date;
1620:
1666: IF (g_debug IS NOT NULL) THEN
1667: gme_debug.log_initialize ('MobileValBatchForIB');
1668: END IF;
1669:
1670: x_return_status := FND_API.G_RET_STS_SUCCESS;
1671: x_error_msg := ' ';
1672:
1673: OPEN Cur_batch_no;
1674: FETCH Cur_batch_no INTO l_parent_line_id;
1701:
1702:
1703: EXCEPTION
1704: WHEN BATCH_NOT_VALID THEN
1705: x_return_status := FND_API.G_RET_STS_ERROR;
1706: x_error_msg := fnd_message.get;
1707:
1708: WHEN OTHERS THEN
1709: IF g_debug <= gme_debug.g_log_unexpected THEN
1709: IF g_debug <= gme_debug.g_log_unexpected THEN
1710: gme_debug.put_line('When others exception in Validate Batch For IB');
1711: END IF;
1712: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','Validate_Batch_For_IB');
1713: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1714: x_error_msg := fnd_message.get;
1715:
1716: END Validate_Batch_For_IB;
1717:
1756: IF (g_debug IS NOT NULL) THEN
1757: gme_debug.log_initialize ('MobileValItemForIB');
1758: END IF;
1759:
1760: x_return_status := FND_API.G_RET_STS_SUCCESS;
1761: x_error_msg := ' ';
1762:
1763: OPEN Cur_batch_det;
1764: FETCH Cur_batch_det INTO l_mat_rec;
1787:
1788:
1789: EXCEPTION
1790: WHEN ITEM_NOT_VALID THEN
1791: x_return_status := FND_API.G_RET_STS_ERROR;
1792: x_error_msg := fnd_message.get;
1793:
1794: WHEN OTHERS THEN
1795: IF g_debug <= gme_debug.g_log_unexpected THEN
1795: IF g_debug <= gme_debug.g_log_unexpected THEN
1796: gme_debug.put_line('When others exception in Validate Item For IB');
1797: END IF;
1798: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','Validate_Item_For_IB');
1799: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1800: x_error_msg := fnd_message.get;
1801:
1802: END Validate_Item_For_IB;
1803:
1852:
1853: fnd_profile.put('USER_ID',to_char(p_user_id));
1854: fnd_profile.put('LOGIN_ID',to_char(p_login_id));
1855:
1856: x_return_status := FND_API.G_RET_STS_SUCCESS;
1857: x_error_msg := ' ';
1858:
1859: l_material_details.material_detail_id := p_material_detail_id;
1860: l_batch_header.batch_id := p_batch_id;
1861:
1862: GME_API_PUB.Incremental_Backflush
1863: (p_api_version => 2.0
1864: ,p_validation_level => gme_common_pvt.g_max_errors
1865: ,p_init_msg_list => fnd_api.g_false
1866: ,p_commit => fnd_api.g_true
1867: ,x_message_count => l_msg_count
1868: ,x_message_list => l_msg_list
1869: ,x_return_status => x_return_status
1862: GME_API_PUB.Incremental_Backflush
1863: (p_api_version => 2.0
1864: ,p_validation_level => gme_common_pvt.g_max_errors
1865: ,p_init_msg_list => fnd_api.g_false
1866: ,p_commit => fnd_api.g_true
1867: ,x_message_count => l_msg_count
1868: ,x_message_list => l_msg_list
1869: ,x_return_status => x_return_status
1870: ,p_batch_header_rec => l_batch_header
1872: ,p_material_detail_rec => l_material_details
1873: ,p_qty => p_qty
1874: ,p_qty_type => p_qty_type
1875: ,p_trans_date => p_trans_date
1876: ,p_ignore_exception => fnd_api.g_false --- Do not proceed if exceptios
1877: ,p_adjust_cmplt => fnd_api.g_false --- Completed batches not supported
1878: ,x_exception_material_tbl => l_exception_material_tab);
1879:
1880: IF (g_debug IS NOT NULL) THEN
1873: ,p_qty => p_qty
1874: ,p_qty_type => p_qty_type
1875: ,p_trans_date => p_trans_date
1876: ,p_ignore_exception => fnd_api.g_false --- Do not proceed if exceptios
1877: ,p_adjust_cmplt => fnd_api.g_false --- Completed batches not supported
1878: ,x_exception_material_tbl => l_exception_material_tab);
1879:
1880: IF (g_debug IS NOT NULL) THEN
1881: gme_debug.put_line('Return Status = '||x_return_status);
1898: END IF;
1899:
1900: EXCEPTION
1901: WHEN BACKFLUSH_ERROR THEN
1902: x_return_status := FND_API.G_RET_STS_ERROR;
1903: ROLLBACK;
1904:
1905: WHEN OTHERS THEN
1906: IF g_debug <= gme_debug.g_log_unexpected THEN
1906: IF g_debug <= gme_debug.g_log_unexpected THEN
1907: gme_debug.put_line('When others exception in Backflush Material');
1908: END IF;
1909: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','Backflush_Material');
1910: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1911: x_error_msg := fnd_message.get;
1912: ROLLBACK;
1913:
1914: END Backflush_Material;
1964:
1965:
1966: GME_API_PUB.Update_Batchstep_Resource
1967: ( p_api_version => 2.0
1968: , p_init_msg_list => FND_API.G_TRUE
1969: , p_commit => FND_API.G_TRUE
1970: , p_batchstep_resource_rec => l_input_rec
1971: , x_batchstep_resource_rec => l_output_rec
1972: , x_message_count => l_msg_count
1965:
1966: GME_API_PUB.Update_Batchstep_Resource
1967: ( p_api_version => 2.0
1968: , p_init_msg_list => FND_API.G_TRUE
1969: , p_commit => FND_API.G_TRUE
1970: , p_batchstep_resource_rec => l_input_rec
1971: , x_batchstep_resource_rec => l_output_rec
1972: , x_message_count => l_msg_count
1973: , x_message_list => l_msg_list
1980: LOOP
1981: FND_MSG_PUB.get
1982: ( p_msg_index => i
1983: , p_data => message
1984: , p_encoded => fnd_api.g_false
1985: , p_msg_index_out => dummy
1986: );
1987:
1988: IF i = 1
2043: IF (g_debug IS NOT NULL) THEN
2044: gme_debug.log_initialize ('MobileFetchPendingLot');
2045: END IF;
2046:
2047: x_return_status := FND_API.G_RET_STS_SUCCESS;
2048: x_error_msg := ' ';
2049:
2050: FND_PROFILE.GET('MWA_DATE_FORMAT_MASK',l_date_format);
2051:
2085: IF g_debug <= gme_debug.g_log_unexpected THEN
2086: gme_debug.put_line('When others exception in fetch Pending Lots');
2087: END IF;
2088: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','fetch_pending_product_lots');
2089: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2090: x_error_msg := fnd_message.get;
2091:
2092: END Fetch_Product_Pending_Lots;
2093:
2106: IF (g_debug IS NOT NULL) THEN
2107: gme_debug.log_initialize ('MobileFetchRevPendingLot');
2108: END IF;
2109:
2110: x_return_status := FND_API.G_RET_STS_SUCCESS;
2111: x_error_msg := ' ';
2112:
2113: FND_PROFILE.GET('MWA_DATE_FORMAT_MASK',l_date_format);
2114:
2149: IF g_debug <= gme_debug.g_log_unexpected THEN
2150: gme_debug.put_line('When others exception in fetch Rev Pending Lots');
2151: END IF;
2152: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','fetch_rev_pending_product_lots');
2153: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2154: x_error_msg := fnd_message.get;
2155:
2156: END Fetch_Rev_Product_Pending_Lots;
2157:
2204:
2205: BEGIN
2206:
2207: IF p_create_lot = 'TRUE' THEN
2208: l_create_lot := fnd_api.g_true;
2209: ELSE
2210: l_create_lot := fnd_api.g_false;
2211: END IF;
2212:
2206:
2207: IF p_create_lot = 'TRUE' THEN
2208: l_create_lot := fnd_api.g_true;
2209: ELSE
2210: l_create_lot := fnd_api.g_false;
2211: END IF;
2212:
2213: IF (g_debug IS NOT NULL) THEN
2214: gme_debug.log_initialize ('MobileCrePendingLot');
2223: gme_debug.put_line('User Id = ' || p_user_id);
2224: gme_debug.put_line('Login Id = ' || p_login_id);
2225: END IF;
2226:
2227: x_return_status := FND_API.G_RET_STS_SUCCESS;
2228: x_error_msg := ' ';
2229:
2230: fnd_profile.put('USER_ID',to_char(p_user_id));
2231: fnd_profile.put('LOGIN_ID',to_char(p_login_id));
2253:
2254: GME_API_PUB.create_pending_product_lot
2255: (p_api_version => 2.0
2256: ,p_validation_level => gme_common_pvt.g_max_errors
2257: ,p_init_msg_list => fnd_api.g_true
2258: ,p_commit => fnd_api.g_true
2259: ,x_message_count => l_message_count
2260: ,x_message_list => x_error_msg
2261: ,x_return_status => x_return_status
2254: GME_API_PUB.create_pending_product_lot
2255: (p_api_version => 2.0
2256: ,p_validation_level => gme_common_pvt.g_max_errors
2257: ,p_init_msg_list => fnd_api.g_true
2258: ,p_commit => fnd_api.g_true
2259: ,x_message_count => l_message_count
2260: ,x_message_list => x_error_msg
2261: ,x_return_status => x_return_status
2262: ,p_batch_header_rec => l_batch_header_rec
2276: IF g_debug <= gme_debug.g_log_unexpected THEN
2277: gme_debug.put_line('When others exception in Create Pending Lots');
2278: END IF;
2279: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','create_pending_product_lots');
2280: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2281: x_error_msg := fnd_message.get;
2282:
2283: END Create_Product_Pending_Lot;
2284:
2335: IF (g_debug IS NOT NULL) THEN
2336: gme_debug.log_initialize ('MobileUpdatePendingLot');
2337: END IF;
2338:
2339: x_return_status := FND_API.G_RET_STS_SUCCESS;
2340: x_error_msg := ' ';
2341:
2342: fnd_profile.put('USER_ID',to_char(p_user_id));
2343: fnd_profile.put('LOGIN_ID',to_char(p_login_id));
2343: fnd_profile.put('LOGIN_ID',to_char(p_login_id));
2344:
2345: IF p_sequence IS NULL THEN
2346: --- Set sequence to the last value
2347: l_pending_product_lots_rec.sequence := FND_API.G_MISS_NUM;
2348: ELSE
2349: IF p_is_seq_changed = 'Y' THEN
2350: l_pending_product_lots_rec.sequence := p_sequence;
2351: ELSE
2370: l_pending_product_lots_rec.secondary_quantity := NULL;
2371: END IF;
2372:
2373: IF p_reason_id IS NULL THEN
2374: l_pending_product_lots_rec.reason_id := FND_API.G_MISS_NUM;
2375: ELSE
2376: l_pending_product_lots_rec.reason_id := p_reason_id;
2377: END IF;
2378:
2390:
2391: GME_API_PUB.update_pending_product_lot
2392: (p_api_version => 2.0
2393: ,p_validation_level => gme_common_pvt.g_max_errors
2394: ,p_init_msg_list => fnd_api.g_true
2395: ,p_commit => fnd_api.g_true
2396: ,x_message_count => l_message_count
2397: ,x_message_list => l_message_list
2398: ,x_return_status => x_return_status
2391: GME_API_PUB.update_pending_product_lot
2392: (p_api_version => 2.0
2393: ,p_validation_level => gme_common_pvt.g_max_errors
2394: ,p_init_msg_list => fnd_api.g_true
2395: ,p_commit => fnd_api.g_true
2396: ,x_message_count => l_message_count
2397: ,x_message_list => l_message_list
2398: ,x_return_status => x_return_status
2399: ,p_batch_header_rec => l_batch_header_rec
2422: );
2423: gme_debug.put_line('Error = '||x_error_msg);
2424: END IF;
2425: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','update_pending_product_lots');
2426: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2427:
2428: END Update_Product_Pending_Lot;
2429:
2430: /*+========================================================================+
2463: IF (g_debug IS NOT NULL) THEN
2464: gme_debug.log_initialize ('MobilePopulateDispTbl');
2465: END IF;
2466:
2467: x_return_status := FND_API.G_RET_STS_SUCCESS;
2468: x_error_msg := ' ';
2469:
2470: -- clear out temp table
2471: DELETE FROM GME_MATERIAL_DISPENSING_GTMP;
2473: -- Fetch dispensing data for the given material line
2474:
2475: GMO_DISPENSE_GRP.GET_MATERIAL_DISPENSE_DATA (
2476: p_api_version => 1.0,
2477: p_init_msg_list => FND_API.G_FALSE,
2478: x_return_status => l_return_status,
2479: x_msg_count => l_msg_count,
2480: x_msg_data => l_msg_data,
2481: p_material_detail_id => p_material_detail_id,
2544: 255));
2545:
2546: END IF;
2547: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','Populate_Dispensing_Table');
2548: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2549: x_error_msg := fnd_message.get;
2550:
2551: END Populate_Dispensing_Table;
2552:
2575: IF (g_debug IS NOT NULL) THEN
2576: gme_debug.log_initialize ('MobileDelDispRec');
2577: END IF;
2578:
2579: x_return_status := FND_API.G_RET_STS_SUCCESS;
2580: x_error_msg := ' ';
2581:
2582: DELETE FROM GME_MATERIAL_DISPENSING_GTMP
2583: WHERE dispense_id = p_dispense_id;
2587: IF g_debug <= gme_debug.g_log_unexpected THEN
2588: gme_debug.put_line('When others exception in Delete_Dispensing_Record');
2589: END IF;
2590: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','Delete_Dispensing_Record');
2591: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2592: x_error_msg := fnd_message.get;
2593:
2594: END Delete_Dispensing_Record;
2595:
2625: IF (g_debug IS NOT NULL) THEN
2626: gme_debug.log_initialize ('MobileCountDispLot');
2627: END IF;
2628:
2629: x_return_status := FND_API.G_RET_STS_SUCCESS;
2630: x_error_msg := ' ';
2631:
2632: OPEN lot_count;
2633: FETCH lot_count INTO x_lot_count;
2638: IF g_debug <= gme_debug.g_log_unexpected THEN
2639: gme_debug.put_line('When others exception in Get_Dispensed_Lot_Count');
2640: END IF;
2641: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','Get_Dispensed_Lot_Count');
2642: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2643: x_error_msg := fnd_message.get;
2644:
2645: END Get_Dispensed_Lot_Count;
2646:
2693: l_cost_group_id number;
2694:
2695: BEGIN
2696:
2697: x_return_status := FND_API.G_RET_STS_SUCCESS;
2698: x_error_msg := ' ';
2699:
2700: IF (g_debug IS NOT NULL) THEN
2701: gme_debug.log_initialize ('MobileQueryQtyTree');
2718: end if;
2719:
2720: Inv_Quantity_Tree_Pub.Query_Quantities (
2721: p_api_version_number => 1.0,
2722: p_init_msg_lst => fnd_api.g_false,
2723: x_return_status => x_return_status,
2724: x_msg_count => l_msg_count,
2725: x_msg_data => x_error_msg,
2726: p_organization_id => p_organization_id,
2797: IF (g_debug IS NOT NULL) THEN
2798: gme_debug.log_initialize ('MobileCreQtyTree');
2799: END IF;
2800:
2801: x_return_status := FND_API.G_RET_STS_SUCCESS;
2802: x_error_msg := ' ';
2803:
2804: IF upper(p_revision_control) = 'TRUE' THEN
2805: l_is_revision_control := TRUE;
2838: , p_onhand_source => 3
2839: , x_tree_id => x_tree_id
2840: );
2841:
2842: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2843: RAISE CREATE_TREE_ERROR;
2844: END IF;
2845:
2846: EXCEPTION
2853: IF g_debug <= gme_debug.g_log_unexpected THEN
2854: gme_debug.put_line('When others exception in Create Qty Tree');
2855: END IF;
2856: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','Create_Qty_Tree');
2857: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2858: x_error_msg := fnd_message.get;
2859:
2860: END Create_Qty_Tree;
2861:
2901: IF (g_debug IS NOT NULL) THEN
2902: gme_debug.log_initialize ('MobileQtyTree');
2903: END IF;
2904:
2905: x_return_status := FND_API.G_RET_STS_SUCCESS;
2906: x_error_msg := ' ';
2907:
2908: INV_Quantity_Tree_Grp.Query_Tree(
2909: p_api_version_number => 1
2930: , x_satt => x_satt
2931: , x_satr => x_satr
2932: );
2933:
2934: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2935: RAISE QUERY_TREE_ERROR;
2936: END IF;
2937:
2938: EXCEPTION
2945: IF g_debug <= gme_debug.g_log_unexpected THEN
2946: gme_debug.put_line('When others exception in Query_Tree');
2947: END IF;
2948: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','Query_Tree');
2949: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2950: x_error_msg := fnd_message.get;
2951:
2952: END Query_Qty_Tree;
2953:
2998: IF (g_debug IS NOT NULL) THEN
2999: gme_debug.log_initialize ('MobileUpdateQtyTree');
3000: END IF;
3001:
3002: x_return_status := FND_API.G_RET_STS_SUCCESS;
3003: x_error_msg := ' ';
3004:
3005: IF p_locator_id <= 0 THEN
3006: l_locator_id := null;
3047: p_containerized => 0,
3048: p_lpn_id => NULL);
3049:
3050: gme_debug.put_line('New ATT = '||l_att);
3051: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3052: RAISE UPDATE_TREE_ERROR;
3053: END IF;
3054:
3055: END IF;
3065: IF g_debug <= gme_debug.g_log_unexpected THEN
3066: gme_debug.put_line('When others exception in Update Qty Tree');
3067: END IF;
3068: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','Update_Qty_Tree');
3069: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3070: x_error_msg := fnd_message.get;
3071:
3072: END Update_Qty_Tree;
3073:
3167: gme_debug.put_line('Line Id = ' || p_material_detail_id);
3168: gme_debug.put_line('Item Id = ' || p_item_id);
3169: END IF;
3170:
3171: x_return_status := FND_API.G_RET_STS_SUCCESS;
3172: x_error_msg := ' ';
3173:
3174: OPEN Get_Mtl_dtl;
3175: FETCH Get_Mtl_Dtl INTO l_release_type, l_phantom_type, l_phantom_line_id;
3214: END IF; */
3215:
3216: EXCEPTION
3217: WHEN ITEM_NOT_VALID THEN
3218: x_return_status := FND_API.G_RET_STS_ERROR;
3219: x_error_msg := fnd_message.get;
3220:
3221: WHEN OTHERS THEN
3222: IF g_debug <= gme_debug.g_log_unexpected THEN
3222: IF g_debug <= gme_debug.g_log_unexpected THEN
3223: gme_debug.put_line('When others exception in Validate Item To Issue');
3224: END IF;
3225: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','Validate_Item_To_Issue');
3226: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3227: x_error_msg := fnd_message.get;
3228:
3229: END Validate_Item_To_Issue;
3230:
3265: gme_debug.put_line('Line Id = ' || p_material_detail_id);
3266: gme_debug.put_line('Item Id = ' || p_item_id);
3267: END IF;
3268:
3269: x_return_status := FND_API.G_RET_STS_SUCCESS;
3270: x_error_msg := ' ';
3271:
3272: OPEN Get_Mtl_dtl;
3273: FETCH Get_Mtl_Dtl INTO l_dispense_ind;
3281: END IF;
3282:
3283: EXCEPTION
3284: WHEN ITEM_NOT_VALID THEN
3285: x_return_status := FND_API.G_RET_STS_ERROR;
3286: x_error_msg := fnd_message.get;
3287:
3288: WHEN OTHERS THEN
3289: IF g_debug <= gme_debug.g_log_unexpected THEN
3289: IF g_debug <= gme_debug.g_log_unexpected THEN
3290: gme_debug.put_line('When others exception in Validate Item To Return');
3291: END IF;
3292: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','Validate_Item_To_Return');
3293: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3294: x_error_msg := fnd_message.get;
3295:
3296: END Validate_Item_To_Return;
3297:
3342: gme_debug.put_line('Line Id = ' || p_material_detail_id);
3343: gme_debug.put_line('Item Id = ' || p_item_id);
3344: END IF;
3345:
3346: x_return_status := FND_API.G_RET_STS_SUCCESS;
3347: x_error_msg := ' ';
3348:
3349: OPEN Get_Batch_Status;
3350: FETCH Get_Batch_Status INTO l_batch_status;
3384:
3385:
3386: EXCEPTION
3387: WHEN ITEM_NOT_VALID THEN
3388: x_return_status := FND_API.G_RET_STS_ERROR;
3389: x_error_msg := fnd_message.get;
3390:
3391: WHEN OTHERS THEN
3392: IF g_debug <= gme_debug.g_log_unexpected THEN
3392: IF g_debug <= gme_debug.g_log_unexpected THEN
3393: gme_debug.put_line('When others exception in Validate Prod To Yield');
3394: END IF;
3395: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','Validate_Prod_To_Yield');
3396: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3397: x_error_msg := fnd_message.get;
3398:
3399: END Validate_Prod_To_Yield;
3400:
3427: IF (g_debug IS NOT NULL) THEN
3428: gme_debug.log_initialize ('MobileFetchIssueTxn');
3429: END IF;
3430:
3431: x_return_status := FND_API.G_RET_STS_SUCCESS;
3432: x_error_msg := ' ';
3433:
3434: FND_PROFILE.GET('MWA_DATE_FORMAT_MASK',l_date_format);
3435:
3467: IF g_debug <= gme_debug.g_log_unexpected THEN
3468: gme_debug.put_line('When others exception in fetch Issue Transactions');
3469: END IF;
3470: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','fetch_issue_transactions');
3471: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3472: x_error_msg := fnd_message.get;
3473:
3474: END Fetch_Issue_Transactions;
3475:
3504: IF (g_debug IS NOT NULL) THEN
3505: gme_debug.log_initialize ('MobileFetchYieldTxn');
3506: END IF;
3507:
3508: x_return_status := FND_API.G_RET_STS_SUCCESS;
3509: x_error_msg := ' ';
3510:
3511: FND_PROFILE.GET('MWA_DATE_FORMAT_MASK',l_date_format);
3512:
3546: IF g_debug <= gme_debug.g_log_unexpected THEN
3547: gme_debug.put_line('When others exception in fetch yield Transactions');
3548: END IF;
3549: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','fetch_yield_transactions');
3550: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3551: x_error_msg := fnd_message.get;
3552:
3553: END Fetch_Yield_Transactions;
3554:
3597: gme_debug.log_initialize ('MobileCreatePhantomTxn');
3598: END IF;
3599:
3600: --Initially let us assign the return status to success
3601: x_return_status := fnd_api.g_ret_sts_success;
3602:
3603: IF (g_debug <= gme_debug.g_log_statement) THEN
3604: gme_debug.put_line (g_pkg_name || '.' || l_api_name || ':'
3605: || 'Entering');
3609: FETCH cur_get_transaction INTO l_mmti_rec;
3610: IF cur_get_transaction%NOTFOUND THEN
3611: CLOSE cur_get_transaction;
3612: gme_common_pvt.log_message('GME_NO_TRANS_FOUND');
3613: RAISE fnd_api.g_exc_error;
3614: END IF;
3615: CLOSE cur_get_transaction;
3616:
3617: OPEN cur_get_lot_transaction(p_mmti_trans_id);
3639: (-1) * l_mmti_rec.secondary_transaction_quantity;
3640:
3641: END IF;
3642:
3643: GME_COMMON_PVT.G_MOVE_TO_TEMP := FND_API.G_FALSE;
3644:
3645: GME_TRANSACTIONS_PVT.Create_Material_Txn
3646:
3647: (p_mmti_rec => l_mmti_rec
3648: ,p_mmli_tbl => l_mmli_tbl
3649: ,p_phantom_trans => 2
3650: ,x_return_status => x_return_status);
3651:
3652: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3653: RAISE fnd_api.g_exc_error;
3654: END IF;
3655:
3656: IF (g_debug <= gme_debug.g_log_statement) THEN
3649: ,p_phantom_trans => 2
3650: ,x_return_status => x_return_status);
3651:
3652: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3653: RAISE fnd_api.g_exc_error;
3654: END IF;
3655:
3656: IF (g_debug <= gme_debug.g_log_statement) THEN
3657: gme_debug.put_line ( g_pkg_name
3662: || x_return_status);
3663: END IF;
3664:
3665: EXCEPTION
3666: WHEN fnd_api.g_exc_error THEN
3667: x_return_status := fnd_api.g_ret_sts_error;
3668: x_error_msg := fnd_message.get;
3669:
3670: WHEN fnd_api.g_exc_unexpected_error THEN
3663: END IF;
3664:
3665: EXCEPTION
3666: WHEN fnd_api.g_exc_error THEN
3667: x_return_status := fnd_api.g_ret_sts_error;
3668: x_error_msg := fnd_message.get;
3669:
3670: WHEN fnd_api.g_exc_unexpected_error THEN
3671: x_return_status := fnd_api.g_ret_sts_unexp_error;
3666: WHEN fnd_api.g_exc_error THEN
3667: x_return_status := fnd_api.g_ret_sts_error;
3668: x_error_msg := fnd_message.get;
3669:
3670: WHEN fnd_api.g_exc_unexpected_error THEN
3671: x_return_status := fnd_api.g_ret_sts_unexp_error;
3672:
3673: WHEN OTHERS THEN
3674: x_return_status := fnd_api.g_ret_sts_unexp_error;
3667: x_return_status := fnd_api.g_ret_sts_error;
3668: x_error_msg := fnd_message.get;
3669:
3670: WHEN fnd_api.g_exc_unexpected_error THEN
3671: x_return_status := fnd_api.g_ret_sts_unexp_error;
3672:
3673: WHEN OTHERS THEN
3674: x_return_status := fnd_api.g_ret_sts_unexp_error;
3675: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
3670: WHEN fnd_api.g_exc_unexpected_error THEN
3671: x_return_status := fnd_api.g_ret_sts_unexp_error;
3672:
3673: WHEN OTHERS THEN
3674: x_return_status := fnd_api.g_ret_sts_unexp_error;
3675: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
3676: x_error_msg := fnd_message.get;
3677: IF (NVL (g_debug, -1) = gme_debug.g_log_unexpected) THEN
3678: gme_debug.put_line ( g_pkg_name
3716: validate_step_status_error EXCEPTION;
3717: BEGIN
3718: SAVEPOINT complete_step_mobile ;
3719:
3720: x_return_status := FND_API.G_RET_STS_SUCCESS;
3721:
3722: l_act_strt_dt := TO_DATE(p_act_strt_dt, p_date_format||HOUR_MIN_SEC_FORMAT_STRING);
3723: l_act_complt_dt := TO_DATE(p_act_complt_dt, p_date_format||HOUR_MIN_SEC_FORMAT_STRING);
3724:
3754: -- Added call to validate step for complete.
3755: gme_complete_batch_step_pvt.validate_step_for_complete
3756: (p_batch_header_rec => l_batch_header
3757: ,p_batch_step_rec => l_batch_step
3758: ,p_override_quality => FND_API.G_FALSE
3759: ,x_batch_step_rec => l_batch_step_out
3760: ,x_return_status => x_return_status);
3761:
3762: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3758: ,p_override_quality => FND_API.G_FALSE
3759: ,x_batch_step_rec => l_batch_step_out
3760: ,x_return_status => x_return_status);
3761:
3762: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3763: RAISE validate_step_error;
3764: END IF;
3765:
3766: gme_api_main.complete_step (
3764: END IF;
3765:
3766: gme_api_main.complete_step (
3767: p_validation_level => gme_common_pvt.g_max_errors,
3768: p_init_msg_list => FND_API.G_TRUE,
3769: x_message_count => x_message_count,
3770: x_message_list => x_message_list,
3771: x_return_status => x_return_status,
3772: p_batch_step_rec => l_batch_step,
3772: p_batch_step_rec => l_batch_step,
3773: p_batch_header_rec => l_batch_header,
3774: x_batch_step_rec => x_batch_step,
3775: x_exception_material_tbl => x_exception_material,
3776: p_ignore_exception => FND_API.G_FALSE);
3777: IF x_return_status = 'X' THEN
3778: RAISE step_alloc_error;
3779: END IF;
3780: IF x_return_status = 'S' THEN
3800:
3801: END IF;
3802: EXCEPTION
3803: WHEN expected_error THEN
3804: x_return_status := FND_API.G_RET_STS_ERROR;
3805: WHEN step_alloc_error THEN
3806: ROLLBACK TO SAVEPOINT complete_step_mobile ;
3807: FND_MESSAGE.SET_NAME('GME', 'GME_API_UNALLOC_MATERIALS');
3808: x_message_list := FND_MESSAGE.GET;
3807: FND_MESSAGE.SET_NAME('GME', 'GME_API_UNALLOC_MATERIALS');
3808: x_message_list := FND_MESSAGE.GET;
3809: WHEN validate_step_error THEN
3810: gme_common_pvt.count_and_get (x_count => x_message_count
3811: ,p_encoded => fnd_api.g_false
3812: ,x_data => x_message_list);
3813: WHEN validate_step_status_error THEN
3814: FND_MESSAGE.SET_NAME('GME','GME_API_INV_BATCH_CMPL_STEP');
3815: x_message_list := FND_MESSAGE.GET;
3813: WHEN validate_step_status_error THEN
3814: FND_MESSAGE.SET_NAME('GME','GME_API_INV_BATCH_CMPL_STEP');
3815: x_message_list := FND_MESSAGE.GET;
3816: WHEN OTHERS THEN
3817: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3818: END complete_step;
3819:
3820: /*###############################################################
3821: # DESCRIPTION
3838: l_in_rsrc_txn_rec gme_resource_txns%ROWTYPE;
3839: l_rsrc_txn_rec gme_resource_txns%ROWTYPE;
3840: l_api_name VARCHAR2(30) := 'End_Cmplt_Actual_Rsrc_Txn';
3841: BEGIN
3842: x_return_status := FND_API.G_RET_STS_SUCCESS;
3843: x_error_msg := '';
3844: FND_PROFILE.put('USER_ID',to_char(p_uid));
3845: gme_common_pvt.g_user_name := p_uname;
3846: gme_common_pvt.g_user_ident := p_uid;
3855: l_in_rsrc_txn_rec.reason_id := p_reason_id;
3856:
3857: GME_API_PUB.end_cmplt_actual_rsrc_txn (
3858: p_api_version => 2.0
3859: ,p_init_msg_list => FND_API.G_TRUE
3860: ,p_commit => FND_API.G_TRUE
3861: ,p_instance_no => NULL
3862: ,p_reason_name => NULL
3863: ,p_rsrc_txn_rec => l_in_rsrc_txn_rec
3856:
3857: GME_API_PUB.end_cmplt_actual_rsrc_txn (
3858: p_api_version => 2.0
3859: ,p_init_msg_list => FND_API.G_TRUE
3860: ,p_commit => FND_API.G_TRUE
3861: ,p_instance_no => NULL
3862: ,p_reason_name => NULL
3863: ,p_rsrc_txn_rec => l_in_rsrc_txn_rec
3864: ,x_rsrc_txn_rec => l_rsrc_txn_rec
3867: ,x_return_status => x_return_status);
3868: x_trans_id := l_rsrc_txn_rec.poc_trans_id;
3869: EXCEPTION
3870: WHEN OTHERS THEN
3871: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3872: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
3873: END End_Cmplt_Actual_Rsrc_Txn;
3874:
3875: /*###############################################################
3927: validate_step_error EXCEPTION;
3928: validate_step_status_error EXCEPTION;
3929: BEGIN
3930: SAVEPOINT release_step_mobile;
3931: x_return_status := FND_API.G_RET_STS_SUCCESS;
3932:
3933: l_act_strt_dt := TO_DATE(p_act_strt_dt, p_date_format||HOUR_MIN_SEC_FORMAT_STRING);
3934:
3935: fnd_profile.put('USER_ID',to_char(p_uid));
3966: ,p_batch_step_rec => l_batch_step
3967: ,x_batch_step_rec => l_batch_step_out
3968: ,x_return_status => x_return_status);
3969:
3970: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3971: RAISE validate_step_error;
3972: END IF;
3973:
3974: gme_api_main.release_step (
3972: END IF;
3973:
3974: gme_api_main.release_step (
3975: p_validation_level => gme_common_pvt.g_max_errors,
3976: p_init_msg_list => FND_API.G_TRUE,
3977: x_message_count => x_message_count,
3978: x_message_list => x_message_list,
3979: x_return_status => x_return_status,
3980: p_batch_step_rec => l_batch_step,
3980: p_batch_step_rec => l_batch_step,
3981: p_batch_header_rec => l_batch_hdr_rec,
3982: x_batch_step_rec => x_batch_step,
3983: x_exception_material_tbl => x_exception_material,
3984: p_ignore_exception => FND_API.G_FALSE);
3985: IF x_return_status = 'X' THEN
3986: RAISE step_alloc_error;
3987: --
3988: -- bug 10389977
3996: p_clear_qty_cache => 'T');
3997: END IF;
3998: EXCEPTION
3999: WHEN expected_error THEN
4000: x_return_status := FND_API.G_RET_STS_ERROR;
4001: WHEN step_alloc_error THEN
4002: ROLLBACK TO SAVEPOINT release_step_mobile ;
4003: FND_MESSAGE.SET_NAME('GME', 'GME_API_UNALLOC_MATERIALS');
4004: x_message_list := FND_MESSAGE.GET;
4003: FND_MESSAGE.SET_NAME('GME', 'GME_API_UNALLOC_MATERIALS');
4004: x_message_list := FND_MESSAGE.GET;
4005: WHEN validate_step_error THEN
4006: GME_COMMON_PVT.count_and_get (x_count => l_count
4007: ,p_encoded => fnd_api.g_false
4008: ,x_data => x_message_list);
4009:
4010: WHEN validate_step_status_error THEN
4011: FND_MESSAGE.SET_NAME('GME','GME_API_INV_BATCH_REL_STEP');
4010: WHEN validate_step_status_error THEN
4011: FND_MESSAGE.SET_NAME('GME','GME_API_INV_BATCH_REL_STEP');
4012: x_message_list := FND_MESSAGE.GET;
4013: WHEN OTHERS THEN
4014: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4015: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
4016: END release_step;
4017:
4018: /*###############################################################
4035: l_rsrc_txn_rec gme_resource_txns%ROWTYPE;
4036: l_in_rsrc_txn_rec gme_resource_txns%ROWTYPE;
4037: l_api_name VARCHAR2(30) := 'Start_Cmplt_Actual_Rsrc_Txn';
4038: BEGIN
4039: x_return_status := FND_API.G_RET_STS_SUCCESS;
4040: x_error_msg := '';
4041: FND_PROFILE.put('USER_ID',to_char(p_uid));
4042: gme_common_pvt.g_user_name := p_uname;
4043: gme_common_pvt.g_user_ident := p_uid;
4052: l_in_rsrc_txn_rec.reason_id := p_reason_id;
4053:
4054: GME_API_PUB.start_cmplt_actual_rsrc_txn (
4055: p_api_version => 2.0
4056: ,p_init_msg_list => FND_API.G_TRUE
4057: ,p_commit => FND_API.G_TRUE
4058: ,p_org_code => NULL
4059: ,p_instance_no => NULL
4060: ,p_rsrc_txn_rec => l_in_rsrc_txn_rec
4053:
4054: GME_API_PUB.start_cmplt_actual_rsrc_txn (
4055: p_api_version => 2.0
4056: ,p_init_msg_list => FND_API.G_TRUE
4057: ,p_commit => FND_API.G_TRUE
4058: ,p_org_code => NULL
4059: ,p_instance_no => NULL
4060: ,p_rsrc_txn_rec => l_in_rsrc_txn_rec
4061: ,x_rsrc_txn_rec => l_rsrc_txn_rec
4064: ,x_return_status => x_return_status);
4065: x_trans_id := l_rsrc_txn_rec.poc_trans_id;
4066: EXCEPTION
4067: WHEN OTHERS THEN
4068: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4069: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
4070: END Start_Cmplt_Actual_Rsrc_Txn;
4071:
4072: /*###############################################################
4094: -- bug 14376915
4095: --
4096: l_start_date DATE;
4097: BEGIN
4098: x_return_status := FND_API.G_RET_STS_SUCCESS;
4099: l_sysdate := SYSDATE;
4100: l_complt_date := TO_DATE(p_complt_date, p_date_format||HOUR_MIN_SEC_FORMAT_STRING);
4101:
4102: --
4116: RAISE INVALID_STEP_COMPLT_DATE;
4117: END IF;
4118: EXCEPTION
4119: WHEN FUTURE_DATE_EX THEN
4120: x_return_status := FND_API.G_RET_STS_ERROR;
4121: FND_MESSAGE.SET_NAME('GMA', 'SY_NOFUTUREDATE');
4122: x_error_msg := FND_MESSAGE.GET;
4123: WHEN INVALID_STEP_COMPLT_DATE THEN
4124: x_return_status := FND_API.G_RET_STS_ERROR;
4120: x_return_status := FND_API.G_RET_STS_ERROR;
4121: FND_MESSAGE.SET_NAME('GMA', 'SY_NOFUTUREDATE');
4122: x_error_msg := FND_MESSAGE.GET;
4123: WHEN INVALID_STEP_COMPLT_DATE THEN
4124: x_return_status := FND_API.G_RET_STS_ERROR;
4125: FND_MESSAGE.SET_NAME('GME', 'GME_CMPLT_DATE_OUTSIDE');
4126: x_error_msg := FND_MESSAGE.GET;
4127: WHEN OTHERS THEN
4128: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4124: x_return_status := FND_API.G_RET_STS_ERROR;
4125: FND_MESSAGE.SET_NAME('GME', 'GME_CMPLT_DATE_OUTSIDE');
4126: x_error_msg := FND_MESSAGE.GET;
4127: WHEN OTHERS THEN
4128: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4129: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
4130: x_error_msg := FND_MESSAGE.GET;
4131: END Validate_Step_Completion_Date;
4132:
4140: x_error_msg OUT NOCOPY VARCHAR2) IS
4141: l_step_qty NUMBER;
4142: l_api_name VARCHAR2(30) := 'Validate_Step_Qty';
4143: BEGIN
4144: x_return_status := FND_API.G_RET_STS_SUCCESS;
4145: l_step_qty := TO_NUMBER(p_step_qty);
4146: EXCEPTION
4147: WHEN VALUE_ERROR THEN
4148: x_return_status := FND_API.G_RET_STS_ERROR;
4144: x_return_status := FND_API.G_RET_STS_SUCCESS;
4145: l_step_qty := TO_NUMBER(p_step_qty);
4146: EXCEPTION
4147: WHEN VALUE_ERROR THEN
4148: x_return_status := FND_API.G_RET_STS_ERROR;
4149: FND_MESSAGE.SET_NAME('GME', 'GME_VALUE_ERROR');
4150: x_error_msg := FND_MESSAGE.GET;
4151: WHEN OTHERS THEN
4152: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4148: x_return_status := FND_API.G_RET_STS_ERROR;
4149: FND_MESSAGE.SET_NAME('GME', 'GME_VALUE_ERROR');
4150: x_error_msg := FND_MESSAGE.GET;
4151: WHEN OTHERS THEN
4152: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4153: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
4154: x_error_msg := FND_MESSAGE.GET;
4155: END Validate_Step_Qty;
4156:
4181: WHERE batch_id = p_batch_id;
4182: FUTURE_DATE_EX EXCEPTION;
4183: INVALID_STEP_START_DATE EXCEPTION;
4184: BEGIN
4185: x_return_status := FND_API.G_RET_STS_SUCCESS;
4186: l_sysdate := SYSDATE;
4187: l_start_date := TO_DATE(p_start_date, p_date_format||HOUR_MIN_SEC_FORMAT_STRING);
4188: IF l_start_date > SYSDATE THEN
4189: RAISE FUTURE_DATE_EX;
4200: END IF;
4201: END IF;
4202: EXCEPTION
4203: WHEN FUTURE_DATE_EX THEN
4204: x_return_status := FND_API.G_RET_STS_ERROR;
4205: FND_MESSAGE.SET_NAME('GMA', 'SY_NOFUTUREDATE');
4206: x_error_msg := FND_MESSAGE.GET;
4207: WHEN INVALID_STEP_START_DATE THEN
4208: x_return_status := FND_API.G_RET_STS_ERROR;
4204: x_return_status := FND_API.G_RET_STS_ERROR;
4205: FND_MESSAGE.SET_NAME('GMA', 'SY_NOFUTUREDATE');
4206: x_error_msg := FND_MESSAGE.GET;
4207: WHEN INVALID_STEP_START_DATE THEN
4208: x_return_status := FND_API.G_RET_STS_ERROR;
4209: FND_MESSAGE.SET_NAME('GME', 'GME_STEP_START_BATCH_START_ERR');
4210: x_error_msg := FND_MESSAGE.GET;
4211: WHEN OTHERS THEN
4212: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4208: x_return_status := FND_API.G_RET_STS_ERROR;
4209: FND_MESSAGE.SET_NAME('GME', 'GME_STEP_START_BATCH_START_ERR');
4210: x_error_msg := FND_MESSAGE.GET;
4211: WHEN OTHERS THEN
4212: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4213: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
4214: x_error_msg := FND_MESSAGE.GET;
4215: END Validate_Step_Start_Date;
4216:
4219: x_return_status OUT NOCOPY VARCHAR2,
4220: x_message OUT NOCOPY VARCHAR2) IS
4221: l_count NUMBER;
4222: BEGIN
4223: x_return_status := FND_API.G_RET_STS_SUCCESS;
4224: IF NOT (gme_common_pvt.check_close_period(p_org_id, p_trans_date)) THEN
4225: gme_common_pvt.count_and_get(p_encoded => FND_API.G_FALSE,
4226: x_count => l_count,
4227: x_data => x_message);
4221: l_count NUMBER;
4222: BEGIN
4223: x_return_status := FND_API.G_RET_STS_SUCCESS;
4224: IF NOT (gme_common_pvt.check_close_period(p_org_id, p_trans_date)) THEN
4225: gme_common_pvt.count_and_get(p_encoded => FND_API.G_FALSE,
4226: x_count => l_count,
4227: x_data => x_message);
4228: END IF;
4229: END check_close_period;
4247: ,x_rsc_row_count => x_row_count
4248: ,x_return_status => x_return_status);
4249: EXCEPTION
4250: WHEN expected_error THEN
4251: x_return_status := FND_API.G_RET_STS_ERROR;
4252: WHEN OTHERS THEN
4253: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4254: END Load_resource_Txns;
4255:
4249: EXCEPTION
4250: WHEN expected_error THEN
4251: x_return_status := FND_API.G_RET_STS_ERROR;
4252: WHEN OTHERS THEN
4253: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4254: END Load_resource_Txns;
4255:
4256: /* Bug#5663458 Begin
4257: * Created the following procedure. This procedure is to get transaction date of
4269: IF (g_debug IS NOT NULL) THEN
4270: gme_debug.log_initialize ('RelieveRsrvPndLots');
4271: END IF;
4272:
4273: x_return_status := fnd_api.g_ret_sts_success;
4274: x_error_msg := ' ';
4275:
4276: --calling gme_common_pvt routine
4277: gme_common_pvt.fetch_trans_date(p_material_detail_id => p_material_detail_id,
4278: p_invoke_mode => 'T',
4279: x_trans_date => l_trans_date,
4280: x_return_status => x_return_status);
4281:
4282: IF x_return_status <> fnd_api.g_ret_sts_success THEN
4283: gme_common_pvt.count_and_get (x_count => l_count
4284: ,p_encoded => fnd_api.g_false
4285: ,x_data => x_error_msg);
4286:
4280: x_return_status => x_return_status);
4281:
4282: IF x_return_status <> fnd_api.g_ret_sts_success THEN
4283: gme_common_pvt.count_and_get (x_count => l_count
4284: ,p_encoded => fnd_api.g_false
4285: ,x_data => x_error_msg);
4286:
4287: END IF;
4288:
4300: IF g_debug <= gme_debug.g_log_unexpected THEN
4301: gme_debug.put_line('When others exception in fetch_txn_date');
4302: END IF;
4303: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','fetch_txn_date');
4304: x_return_status := fnd_api.g_ret_sts_unexp_error;
4305: x_error_msg := fnd_message.get;
4306: END;
4307:
4308: --Bug#5867209 added restricted subinv code
4336:
4337: l_exists NUMBER;
4338: ERROR_INV_SUBINV EXCEPTION;
4339: BEGIN
4340: x_return_status := fnd_api.g_ret_sts_success;
4341: x_error_message := ' ';
4342:
4343: IF p_restrict_code = 1 THEN
4344: OPEN x_sub_lov1;
4357: END IF;
4358:
4359: EXCEPTION
4360: WHEN ERROR_INV_SUBINV THEN
4361: x_return_status := fnd_api.g_ret_sts_error;
4362: FND_MESSAGE.SET_NAME('GME','GME_NOT_VALID_SUBINV');
4363: x_error_message := FND_MESSAGE.GET;
4364: END Validate_Subinv_Master;
4365:
4394:
4395: l_exists NUMBER;
4396: ERROR_INVALID_LOCATOR EXCEPTION;
4397: BEGIN
4398: x_return_status := fnd_api.g_ret_sts_success;
4399: x_error_message := ' ';
4400:
4401: IF p_restrict_code = 1 THEN
4402: OPEN x_loc_lov1;
4414: CLOSE x_loc_lov ;
4415: END IF;
4416: EXCEPTION
4417: WHEN ERROR_INVALID_LOCATOR THEN
4418: x_return_status := fnd_api.g_ret_sts_error;
4419: FND_MESSAGE.SET_NAME('GME','GME_NOT_VALID_LOC');
4420: x_error_message := FND_MESSAGE.GET;
4421: END Validate_Locator_Master;
4422: /* Bug#5663458 End*/
4443: gme_debug.log_initialize ('MobileFetchSubinvLoc');
4444: END IF;
4445:
4446:
4447: x_return_status := FND_API.G_RET_STS_SUCCESS;
4448: x_error_msg := ' ';
4449:
4450: OPEN c_subinv_loc;
4451: FETCH c_subinv_loc INTO x_subinventory_code,x_locator,x_locator_id ;
4456: IF g_debug <= gme_debug.g_log_unexpected THEN
4457: gme_debug.put_line('When others exception in Fetch_subinv_locator');
4458: END IF;
4459: fnd_msg_pub.add_exc_msg('GME_MOBILE_TXN','Fetch_subinv_locator');
4460: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4461: x_error_msg := fnd_message.get;
4462: END Fetch_subinv_locator;
4463:
4464: -- nsinghi bug#5209065 START. Added following Procs.
4474: l_mtlt_txn_rec MTL_TRANSACTION_LOTS_TEMP%ROWTYPE;
4475: l_lot_expiration_date DATE;
4476:
4477: BEGIN
4478: x_return_status := FND_API.G_RET_STS_SUCCESS;
4479: IF (g_debug IS NOT NULL) THEN
4480: gme_debug.log_initialize ('MobileGetExpDate');
4481: END IF;
4482:
4492: ,x_lot_expiration_date => l_lot_expiration_date
4493: ,x_return_status => x_return_status);
4494:
4495: inv_calculate_exp_date.purge_mti_tab;
4496: IF x_return_status <> fnd_api.g_ret_sts_success THEN
4497: IF g_debug <= gme_debug.g_log_statement THEN
4498: gme_debug.put_line('Program inv_calculate_exp_date.get_lot_expiration_date has failed with a Unexpected exception');
4499: END IF;
4500: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
4499: END IF;
4500: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
4501: FND_MESSAGE.SET_TOKEN('PROG_NAME','inv_calculate_exp_date.get_lot_expiration_date');
4502: fnd_msg_pub.ADD;
4503: RAISE fnd_api.g_exc_unexpected_error;
4504: END IF;
4505: IF g_debug = 1 THEN
4506: gme_debug.put_line('l_lot_expiration_date '||l_lot_expiration_date);
4507: END IF;
4510: -- x_expiration_date := x_origination_date + l_get_dft_attr_rec.shelf_life_days;
4511: END IF;
4512: EXCEPTION
4513: WHEN OTHERS THEN
4514: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4515: IF g_debug <= gme_debug.g_log_unexpected THEN
4516: gme_debug.put_line('WHEN OTHERS exception : '||SQLERRM);
4517: END IF;
4518: END get_expiration_date;
4523: , x_exp_act_date OUT NOCOPY DATE
4524: , x_return_status OUT NOCOPY VARCHAR2
4525: ) IS
4526: BEGIN
4527: x_return_status := FND_API.G_RET_STS_SUCCESS;
4528: x_exp_act_date := p_expiration_date;
4529:
4530: IF p_expiration_date IS NOT NULL AND p_exp_act_interval IS NOT NULL THEN
4531: x_exp_act_date := p_expiration_date + p_exp_act_interval;
4532: END IF;
4533:
4534: EXCEPTION
4535: WHEN OTHERS THEN
4536: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4537: IF g_debug <= gme_debug.g_log_unexpected THEN
4538: gme_debug.put_line('WHEN OTHERS exception : '||SQLERRM);
4539: END IF;
4540: END get_exp_action_date;
4587: l_txn_id Number;
4588: l_txn_type_id NUMBER;
4589: l_user_id number;
4590: BEGIN
4591: x_return_status := FND_API.G_RET_STS_SUCCESS;
4592: x_error_msg := ' ';
4593:
4594: OPEN get_details;
4595: FETCH get_details INTO l_item_no, l_batch_no, l_txn_id, l_user_id, l_txn_type_id;
4654:
4655: x_return_status := l_ret_status;
4656: EXCEPTION
4657: WHEN OTHERS THEN
4658: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4659: END print_label;
4660:
4661: END GME_MOBILE_TXN;