68: -- FND_MESSAGE.SET_NAME('CSD','CSD_API_INV_PRICE_LIST_ID');
69: -- FND_MESSAGE.SET_TOKEN('PRICE_LIST_ID',p_price_list_id);
70: -- FND_MSG_PUB.ADD;
71: --
72: -- RAISE FND_API.G_EXC_ERROR;
73: --
74: -- WHEN TOO_MANY_ROWS THEN
75: --
76: -- IF (g_debug > 0 ) THEN
80: -- FND_MESSAGE.SET_NAME('CSD','CSD_API_INV_PRICE_LIST_ID');
81: -- FND_MESSAGE.SET_TOKEN('PRICE_LIST_ID',p_price_list_id);
82: -- FND_MSG_PUB.ADD;
83: --
84: -- RAISE FND_API.G_EXC_ERROR;
85: --
86: -- END Validate_PriceListID;
87: /*---------------------------------------------------------------------------*/
88:
155: x_msg_data OUT NOCOPY VARCHAR2) IS
156: l_Inventory_Item_ID NUMBER;
157: BEGIN
158:
159: x_return_status := Fnd_Api.G_RET_STS_SUCCESS;
160:
161: -- Validate given item id against following sql query.
162: SELECT m.inventory_item_id
163: INTO l_Inventory_Item_ID
181: THEN
182: Csd_Gen_Utility_Pvt.ADD('Inventory_Item_id is invalid');
183: END IF;
184:
185: x_return_status := Fnd_Api.G_Ret_Sts_Error;
186:
187: Fnd_Msg_Pub.Count_And_Get(p_count => x_msg_count,
188: p_data => x_msg_data);
189:
248: THEN
249: Csd_Gen_Utility_Pvt.ADD('Txn_Billing_Type_id is invalid');
250: END IF;
251:
252: RAISE Fnd_Api.G_EXC_ERROR;
253:
254: END Validate_TxnBillingTypeID;
255: /*---------------------------------------------------------------------------*/
256:
297: Fnd_Message.SET_TOKEN('ITEM', g_Concatenated_Segments);
298: Fnd_Message.SET_TOKEN('REVISION', p_revision);
299: Fnd_Msg_Pub.ADD;
300:
301: RAISE Fnd_Api.G_EXC_ERROR;
302:
303: END Validate_Revision;
304: /*---------------------------------------------------------------------------*/
305:
371: Fnd_Message.SET_TOKEN('ITEM', g_Concatenated_Segments);
372: Fnd_Message.SET_TOKEN('INSTANCE_ID', p_Instance_ID);
373: Fnd_Msg_Pub.ADD;
374:
375: RAISE Fnd_Api.G_EXC_ERROR;
376:
377: END Validate_Instance_ID;
378: /*---------------------------------------------------------------------------*/
379:
419: Fnd_Message.SET_TOKEN('ITEM', g_Concatenated_Segments);
420: Fnd_Message.SET_TOKEN('LOT_NUMBER', p_Lot_Number);
421: Fnd_Msg_Pub.ADD;
422:
423: RAISE Fnd_Api.G_EXC_ERROR;
424:
425: END Validate_LotNumber;
426: /*---------------------------------------------------------------------------*/
427:
470: THEN
471: Csd_Gen_Utility_Pvt.ADD('Serial Number status invalid');
472: END IF;
473:
474: RAISE Fnd_Api.G_EXC_ERROR;
475:
476: END IF;
477:
478: EXCEPTION
531: Fnd_Message.SET_NAME('CSD', 'CSD_INVALID_REASONCODE');
532: Fnd_Message.SET_TOKEN('REASON_CODE', p_ReasonCode);
533: Fnd_Msg_Pub.ADD;
534:
535: RAISE Fnd_Api.G_EXC_ERROR;
536:
537: END Validate_ReasonCode;
538: /*---------------------------------------------------------------------------*/
539:
588: Fnd_Message.SET_TOKEN('ITEM', g_Concatenated_Segments);
589: Fnd_Message.SET_TOKEN('UOM', p_Unit_Of_Measure);
590: Fnd_Msg_Pub.ADD;
591:
592: RAISE Fnd_Api.G_EXC_ERROR;
593:
594: END Validate_UOM;
595: /*---------------------------------------------------------------------------*/
596:
655: Fnd_Message.SET_TOKEN('PARTY_SITE_ID', p_Party_Site_ID);
656: Fnd_Message.SET_TOKEN('SITE_USE_TYPE', p_Site_Use_Type);
657: Fnd_Msg_Pub.ADD;
658:
659: RAISE Fnd_Api.G_EXC_ERROR;
660:
661: END IF;
662:
663: IF PS_Cur_Type%ISOPEN
691:
692: -- Action_Code
693: IF (p_Upd_ProdTxn_Rec.action_code <>
694: x_Product_Txn_Rec.action_code AND
695: p_Upd_ProdTxn_Rec.action_code <> Fnd_Api.G_MISS_CHAR)
696: THEN
697: x_Product_Txn_Rec.action_code := p_Upd_ProdTxn_Rec.action_code;
698: END IF;
699:
699:
700: -- Action_Type
701: IF (p_Upd_ProdTxn_Rec.Action_Type <>
702: x_Product_Txn_Rec.Action_Type AND
703: p_Upd_ProdTxn_Rec.Action_Type <> Fnd_Api.G_MISS_CHAR)
704: THEN
705: x_Product_Txn_Rec.action_type := p_Upd_ProdTxn_Rec.action_type;
706: END IF;
707:
707:
708: -- Attributes
709: IF (p_Upd_ProdTxn_Rec.attribute1 <>
710: x_Product_Txn_Rec.attribute1 AND
711: p_Upd_ProdTxn_Rec.attribute1 <> Fnd_Api.G_MISS_CHAR)
712: THEN
713: x_Product_Txn_Rec.attribute1 := p_Upd_ProdTxn_Rec.attribute1;
714: END IF;
715:
714: END IF;
715:
716: IF (p_Upd_ProdTxn_Rec.attribute10 <>
717: x_Product_Txn_Rec.attribute10 AND
718: p_Upd_ProdTxn_Rec.attribute10 <> Fnd_Api.G_MISS_CHAR)
719: THEN
720: x_Product_Txn_Rec.attribute10 := p_Upd_ProdTxn_Rec.attribute10;
721: END IF;
722:
721: END IF;
722:
723: IF (p_Upd_ProdTxn_Rec.attribute11 <>
724: x_Product_Txn_Rec.attribute11 AND
725: p_Upd_ProdTxn_Rec.attribute11 <> Fnd_Api.G_MISS_CHAR)
726: THEN
727: x_Product_Txn_Rec.attribute11 := p_Upd_ProdTxn_Rec.attribute11;
728: END IF;
729:
728: END IF;
729:
730: IF (p_Upd_ProdTxn_Rec.attribute12 <>
731: x_Product_Txn_Rec.attribute12 AND
732: p_Upd_ProdTxn_Rec.attribute12 <> Fnd_Api.G_MISS_CHAR)
733: THEN
734: x_Product_Txn_Rec.attribute12 := p_Upd_ProdTxn_Rec.attribute12;
735: END IF;
736:
735: END IF;
736:
737: IF (p_Upd_ProdTxn_Rec.attribute13 <>
738: x_Product_Txn_Rec.attribute13 AND
739: p_Upd_ProdTxn_Rec.attribute13 <> Fnd_Api.G_MISS_CHAR)
740: THEN
741: x_Product_Txn_Rec.attribute13 := p_Upd_ProdTxn_Rec.attribute13;
742: END IF;
743:
742: END IF;
743:
744: IF (p_Upd_ProdTxn_Rec.attribute14 <>
745: x_Product_Txn_Rec.attribute14 AND
746: p_Upd_ProdTxn_Rec.attribute14 <> Fnd_Api.G_MISS_CHAR)
747: THEN
748: x_Product_Txn_Rec.attribute14 := p_Upd_ProdTxn_Rec.attribute14;
749: END IF;
750:
749: END IF;
750:
751: IF (p_Upd_ProdTxn_Rec.attribute15 <>
752: x_Product_Txn_Rec.attribute15 AND
753: p_Upd_ProdTxn_Rec.attribute15 <> Fnd_Api.G_MISS_CHAR)
754: THEN
755: x_Product_Txn_Rec.attribute15 := p_Upd_ProdTxn_Rec.attribute15;
756: END IF;
757:
756: END IF;
757:
758: IF (p_Upd_ProdTxn_Rec.attribute2 <>
759: x_Product_Txn_Rec.attribute2 AND
760: p_Upd_ProdTxn_Rec.attribute2 <> Fnd_Api.G_MISS_CHAR)
761: THEN
762: x_Product_Txn_Rec.attribute2 := p_Upd_ProdTxn_Rec.attribute2;
763: END IF;
764:
763: END IF;
764:
765: IF (p_Upd_ProdTxn_Rec.attribute3 <>
766: x_Product_Txn_Rec.attribute3 AND
767: p_Upd_ProdTxn_Rec.attribute3 <> Fnd_Api.G_MISS_CHAR)
768: THEN
769: x_Product_Txn_Rec.attribute3 := p_Upd_ProdTxn_Rec.attribute3;
770: END IF;
771:
770: END IF;
771:
772: IF (p_Upd_ProdTxn_Rec.attribute4 <>
773: x_Product_Txn_Rec.attribute4 AND
774: p_Upd_ProdTxn_Rec.attribute4 <> Fnd_Api.G_MISS_CHAR)
775: THEN
776: x_Product_Txn_Rec.attribute4 := p_Upd_ProdTxn_Rec.attribute4;
777: END IF;
778:
777: END IF;
778:
779: IF (p_Upd_ProdTxn_Rec.attribute5 <>
780: x_Product_Txn_Rec.attribute5 AND
781: p_Upd_ProdTxn_Rec.attribute5 <> Fnd_Api.G_MISS_CHAR)
782: THEN
783: x_Product_Txn_Rec.attribute5 := p_Upd_ProdTxn_Rec.attribute5;
784: END IF;
785:
784: END IF;
785:
786: IF (p_Upd_ProdTxn_Rec.attribute6 <>
787: x_Product_Txn_Rec.attribute6 AND
788: p_Upd_ProdTxn_Rec.attribute6 <> Fnd_Api.G_MISS_CHAR)
789: THEN
790: x_Product_Txn_Rec.attribute6 := p_Upd_ProdTxn_Rec.attribute6;
791: END IF;
792:
791: END IF;
792:
793: IF (p_Upd_ProdTxn_Rec.attribute7 <>
794: x_Product_Txn_Rec.attribute7 AND
795: p_Upd_ProdTxn_Rec.attribute7 <> Fnd_Api.G_MISS_CHAR)
796: THEN
797: x_Product_Txn_Rec.attribute7 := p_Upd_ProdTxn_Rec.attribute7;
798: END IF;
799:
798: END IF;
799:
800: IF (p_Upd_ProdTxn_Rec.attribute8 <>
801: x_Product_Txn_Rec.attribute8 AND
802: p_Upd_ProdTxn_Rec.attribute8 <> Fnd_Api.G_MISS_CHAR)
803: THEN
804: x_Product_Txn_Rec.attribute8 := p_Upd_ProdTxn_Rec.attribute8;
805: END IF;
806:
805: END IF;
806:
807: IF (p_Upd_ProdTxn_Rec.attribute9 <>
808: x_Product_Txn_Rec.attribute9 AND
809: p_Upd_ProdTxn_Rec.attribute9 <> Fnd_Api.G_MISS_CHAR)
810: THEN
811: x_Product_Txn_Rec.attribute9 := p_Upd_ProdTxn_Rec.attribute9;
812: END IF;
813:
812: END IF;
813:
814: -- DFF Context
815: IF (p_Upd_ProdTxn_Rec.context <> x_Product_Txn_Rec.context AND
816: p_Upd_ProdTxn_Rec.context <> Fnd_Api.G_MISS_CHAR)
817: THEN
818: x_Product_Txn_Rec.context := p_Upd_ProdTxn_Rec.context;
819: END IF;
820:
820:
821: -- Instance_Id
822: IF (p_Upd_ProdTxn_Rec.source_instance_id <>
823: x_Product_Txn_Rec.source_instance_id AND p_Upd_ProdTxn_Rec.source_instance_id <>
824: Fnd_Api.G_MISS_NUM)
825: THEN
826: x_Product_Txn_Rec.source_instance_id := p_Upd_ProdTxn_Rec.source_instance_id;
827: END IF;
828: -- non source instance
827: END IF;
828: -- non source instance
829: IF (p_Upd_ProdTxn_Rec.non_source_instance_id <>
830: x_Product_Txn_Rec.non_source_instance_id AND p_Upd_ProdTxn_Rec.non_source_instance_id <>
831: Fnd_Api.G_MISS_NUM)
832: THEN
833: x_Product_Txn_Rec.non_source_instance_id := p_Upd_ProdTxn_Rec.non_source_instance_id;
834: END IF;
835:
835:
836: -- Inventory_Item_Id
837: IF (p_Upd_ProdTxn_Rec.inventory_item_id <>
838: x_Product_Txn_Rec.inventory_item_id AND
839: p_Upd_ProdTxn_Rec.inventory_item_id <> Fnd_Api.G_MISS_NUM)
840: THEN
841: x_Product_Txn_Rec.inventory_item_id := p_Upd_ProdTxn_Rec.inventory_item_id;
842: END IF;
843:
843:
844: -- Invoice_To_Org_Id
845: IF (p_Upd_ProdTxn_Rec.invoice_to_org_id <>
846: x_Product_Txn_Rec.invoice_to_org_id AND
847: p_Upd_ProdTxn_Rec.invoice_to_org_id <> Fnd_Api.G_MISS_NUM)
848: THEN
849: x_Product_Txn_Rec.invoice_to_org_id := p_Upd_ProdTxn_Rec.invoice_to_org_id;
850: END IF;
851:
851:
852: -- Lot_Number
853: IF (p_Upd_ProdTxn_Rec.lot_number <>
854: x_Product_Txn_Rec.lot_number AND
855: p_Upd_ProdTxn_Rec.lot_number <> Fnd_Api.G_MISS_CHAR)
856: THEN
857: x_Product_Txn_Rec.lot_number := p_Upd_ProdTxn_Rec.lot_number;
858: END IF;
859:
859:
860: -- object_version_number
861: IF (p_Upd_ProdTxn_Rec.object_version_number <>
862: x_Product_Txn_Rec.object_version_number AND p_Upd_ProdTxn_Rec.object_version_number <>
863: Fnd_Api.G_MISS_NUM)
864: THEN
865: x_Product_Txn_Rec.object_version_number := p_Upd_ProdTxn_Rec.object_version_number;
866: END IF;
867:
867:
868: -- PO_Number
869: IF (p_Upd_ProdTxn_Rec.po_number <>
870: x_Product_Txn_Rec.po_number AND
871: p_Upd_ProdTxn_Rec.po_number <> Fnd_Api.G_MISS_CHAR)
872: THEN
873: x_Product_Txn_Rec.po_number := p_Upd_ProdTxn_Rec.po_number;
874: END IF;
875:
875:
876: -- Price_List_Id
877: IF (p_Upd_ProdTxn_Rec.price_list_id <>
878: x_Product_Txn_Rec.price_list_id AND
879: p_Upd_ProdTxn_Rec.price_list_id <> Fnd_Api.G_MISS_NUM)
880: THEN
881: x_Product_Txn_Rec.price_list_id := p_Upd_ProdTxn_Rec.price_list_id;
882: END IF;
883:
882: END IF;
883:
884: -- Quantity
885: IF (p_Upd_ProdTxn_Rec.quantity <> x_Product_Txn_Rec.quantity AND
886: p_Upd_ProdTxn_Rec.quantity <> Fnd_Api.G_MISS_NUM)
887: THEN
888: x_Product_Txn_Rec.quantity := p_Upd_ProdTxn_Rec.quantity;
889: END IF;
890:
890:
891: -- Return_By_Date
892: IF (p_Upd_ProdTxn_Rec.return_by_date <>
893: x_Product_Txn_Rec.return_by_date AND
894: p_Upd_ProdTxn_Rec.return_by_date <> Fnd_Api.G_MISS_DATE)
895: THEN
896: x_Product_Txn_Rec.return_by_date := p_Upd_ProdTxn_Rec.return_by_date;
897: END IF;
898:
898:
899: -- Return_Reason
900: IF (p_Upd_ProdTxn_Rec.return_reason <>
901: x_Product_Txn_Rec.return_reason AND
902: p_Upd_ProdTxn_Rec.return_reason <> Fnd_Api.G_MISS_CHAR)
903: THEN
904: x_Product_Txn_Rec.return_reason := p_Upd_ProdTxn_Rec.return_reason;
905: END IF;
906:
905: END IF;
906:
907: -- Revision
908: IF (p_Upd_ProdTxn_Rec.revision <> x_Product_Txn_Rec.revision AND
909: p_Upd_ProdTxn_Rec.revision <> Fnd_Api.G_MISS_CHAR)
910: THEN
911: x_Product_Txn_Rec.revision := p_Upd_ProdTxn_Rec.revision;
912: END IF;
913:
912: END IF;
913:
914: -- Serial_Number
915: IF (p_Upd_ProdTxn_Rec.source_serial_number <>
916: Fnd_Api.G_MISS_CHAR) AND
917: NVL(p_Upd_ProdTxn_Rec.source_serial_number, '-') <>
918: NVL(x_Product_Txn_Rec.source_serial_number, '-')
919: THEN
920: x_Product_Txn_Rec.source_serial_number := p_Upd_ProdTxn_Rec.source_serial_number;
920: x_Product_Txn_Rec.source_serial_number := p_Upd_ProdTxn_Rec.source_serial_number;
921: END IF;
922: -- non_source_Serial_Number
923: IF (p_Upd_ProdTxn_Rec.non_source_serial_number <>
924: Fnd_Api.G_MISS_CHAR) AND
925: NVL(p_Upd_ProdTxn_Rec.non_source_serial_number, '-') <>
926: NVL(x_Product_Txn_Rec.non_source_serial_number, '-')
927: THEN
928: x_Product_Txn_Rec.non_source_serial_number := p_Upd_ProdTxn_Rec.non_source_serial_number;
930:
931: -- Ship_To_Org_Id
932: IF (p_Upd_ProdTxn_Rec.ship_to_org_id <>
933: x_Product_Txn_Rec.ship_to_org_id AND
934: p_Upd_ProdTxn_Rec.ship_to_org_id <> Fnd_Api.G_MISS_NUM)
935: THEN
936: x_Product_Txn_Rec.ship_to_org_id := p_Upd_ProdTxn_Rec.ship_to_org_id;
937: END IF;
938:
938:
939: -- Sub_Inventory
940: IF (p_Upd_ProdTxn_Rec.sub_inventory <>
941: x_Product_Txn_Rec.sub_inventory AND
942: p_Upd_ProdTxn_Rec.sub_inventory <> Fnd_Api.G_MISS_CHAR)
943: THEN
944: x_Product_Txn_Rec.sub_inventory := p_Upd_ProdTxn_Rec.sub_inventory;
945: END IF;
946:
946:
947: -- Txn_Billing_Type_ID
948: IF (p_Upd_ProdTxn_Rec.txn_billing_type_id <>
949: x_Product_Txn_Rec.txn_billing_type_id AND p_Upd_ProdTxn_Rec.txn_billing_type_id <>
950: Fnd_Api.G_MISS_NUM)
951: THEN
952: x_Product_Txn_Rec.txn_billing_type_id := p_Upd_ProdTxn_Rec.txn_billing_type_id;
953: END IF;
954:
954:
955: -- Unit_Of_Measure
956: IF (p_Upd_ProdTxn_Rec.unit_of_measure_code <>
957: x_Product_Txn_Rec.unit_of_measure_code AND p_Upd_ProdTxn_Rec.unit_of_measure_code <>
958: Fnd_Api.G_MISS_CHAR)
959: THEN
960: x_Product_Txn_Rec.unit_of_measure_code := p_Upd_ProdTxn_Rec.unit_of_measure_code;
961: END IF;
962: --SU:02/28 Pass G_MISS_NUM when contract_Id is NULL
961: END IF;
962: --SU:02/28 Pass G_MISS_NUM when contract_Id is NULL
963: IF x_Product_Txn_Rec.Contract_ID IS NULL
964: THEN
965: x_Product_Txn_REc.Contract_Id := Fnd_Api.G_MISS_NUM;
966: END IF;
967:
968: -- Set values for WHO columns
969: x_Product_Txn_Rec.Last_Updated_By := Fnd_Global.User_Id;
1055: Fnd_Message.SET_TOKEN('ITEM', p_inventory_item_id);
1056: Fnd_Message.SET_TOKEN('SERIAL_NUM', p_Serial_Number);
1057: Fnd_Msg_Pub.ADD;
1058:
1059: RAISE Fnd_Api.G_EXC_ERROR;
1060:
1061: END IF;
1062:
1063: EXCEPTION
1079: Fnd_Message.SET_TOKEN('ITEM', g_Concatenated_Segments);
1080: Fnd_Message.SET_TOKEN('SERIAL_NUM', p_Serial_Number);
1081: Fnd_Msg_Pub.ADD;
1082:
1083: RAISE Fnd_Api.G_EXC_ERROR;
1084:
1085: END IF;
1086:
1087: END Validate_source_SerialNumber;
1203: WHERE Incident_Id = p_Incident_Id;
1204:
1205: BEGIN
1206:
1207: x_return_status := Fnd_Api.G_RET_STS_SUCCESS;
1208:
1209: -- Get Item attributes in local variable
1210: Get_ItemAttributes(p_Inventory_Item_Id => p_Product_Txn_Rec.Inventory_Item_Id,
1211: p_inv_org_id => Cs_Std.get_item_valdn_orgzn_id,
1250: p_api_name => l_api_name);
1251: END IF;
1252: -- IF value is found then Validate Inventory_Item_Id
1253: IF p_Upd_ProdTxn_Rec.Inventory_Item_Id <>
1254: Fnd_Api.G_MISS_NUM
1255: THEN
1256:
1257: Validate_InventoryItemId(p_Inventory_Item_ID => p_Product_Txn_Rec.Inventory_Item_Id,
1258: x_Return_Status => x_Return_Status,
1258: x_Return_Status => x_Return_Status,
1259: x_Msg_Data => x_Msg_Data,
1260: x_Msg_Count => x_Msg_Count);
1261:
1262: IF x_Return_Status <> Fnd_Api.G_RET_STS_SUCCESS
1263: THEN
1264:
1265: RAISE Fnd_Api.G_EXC_ERROR;
1266:
1261:
1262: IF x_Return_Status <> Fnd_Api.G_RET_STS_SUCCESS
1263: THEN
1264:
1265: RAISE Fnd_Api.G_EXC_ERROR;
1266:
1267: END IF;
1268:
1269: END IF;
1278: p_api_name => l_api_name);
1279: END IF;
1280:
1281: IF p_Upd_ProdTxn_Rec.Txn_Billing_Type_Id <>
1282: Fnd_Api.G_MISS_NUM
1283: THEN
1284: -- IF value is found then Validate Txn_Billing_Type_ID value
1285:
1286: -- Line_Order_Category_Code can have one of the two valus 'RETURN'
1332: p_api_name => l_api_name);
1333: END IF;
1334:
1335: -- If value is not Null then validate Revision Value
1336: IF p_Upd_ProdTxn_Rec.Revision <> Fnd_Api.G_MISS_CHAR
1337: THEN
1338:
1339: Validate_Revision(p_Inventory_Item_Id => p_Product_Txn_Rec.Inventory_Item_Id,
1340: p_Revision => p_product_Txn_Rec.Revision);
1344: ELSE
1345:
1346: -- Check if value is passed to Revision Code
1347: IF NVL(p_Upd_ProdTxn_Rec.Revision,
1348: Fnd_Api.G_MISS_CHAR) <> Fnd_Api.G_MISS_CHAR
1349: THEN
1350:
1351: IF (g_debug > 0)
1352: THEN
1358:
1359: Fnd_Message.SET_TOKEN('ATTRIBUTE', 'Revision');
1360: Fnd_Msg_Pub.ADD;
1361:
1362: RAISE Fnd_Api.G_EXC_ERROR;
1363:
1364: END IF;
1365:
1366: END IF;
1368: -- Reason_Code column should be Null for Ship line.
1369: IF (p_Product_Txn_Rec.action_type IN
1370: (C_ACTION_TYPE_SHIP, C_ACTION_TYPE_WALK_IN_ISSUE) AND
1371: p_Upd_ProdTxn_Rec.Return_Reason <>
1372: Fnd_Api.G_MISS_CHAR)
1373: THEN
1374:
1375: IF (g_debug > 0)
1376: THEN
1380: Fnd_Message.SET_NAME('CSD', 'CSD_ATTRB_VALUE_NOT_EXPECTED');
1381: Fnd_Message.SET_TOKEN('ATTRIBUTE', 'Return Reason Code');
1382: Fnd_Msg_Pub.ADD;
1383:
1384: RAISE Fnd_Api.G_EXC_ERROR;
1385:
1386: END IF;
1387:
1388: -- Reason Code is required for RMA line. Check if Reason Code value is NULL, if so then raise error.
1398: END IF;
1399:
1400: -- If value is not Null then validate Revision Value
1401: IF p_Upd_ProdTxn_Rec.Return_Reason <>
1402: Fnd_Api.G_MISS_CHAR
1403: THEN
1404:
1405: Validate_ReasonCode(p_ReasonCode => p_Product_Txn_Rec.Return_Reason);
1406:
1411: -- non_source_Serial_Number should be Null for RMA line.
1412: IF p_Product_Txn_Rec.action_type IN
1413: (C_ACTION_TYPE_RMA, C_ACTION_TYPE_WALK_IN_RECPT) AND
1414: NVL(p_Upd_ProdTxn_Rec.non_source_Serial_Number,
1415: Fnd_Api.G_MISS_CHAR) <> Fnd_Api.G_MISS_CHAR
1416: THEN
1417:
1418: IF (g_debug > 0)
1419: THEN
1423: Fnd_Message.SET_NAME('CSD', 'CSD_ATTRB_VALUE_NOT_EXPECTED');
1424: Fnd_Message.SET_TOKEN('ATTRIBUTE',
1425: 'non source Serial Number');
1426: Fnd_Msg_Pub.ADD;
1427: RAISE Fnd_Api.G_EXC_ERROR;
1428:
1429: END IF;
1430: -- non_source_instance_id should be Null for RMA line.
1431: IF p_Product_Txn_Rec.action_type IN
1430: -- non_source_instance_id should be Null for RMA line.
1431: IF p_Product_Txn_Rec.action_type IN
1432: (C_ACTION_TYPE_RMA, C_ACTION_TYPE_WALK_IN_RECPT) AND
1433: NVL(p_Upd_ProdTxn_Rec.non_source_instance_id,
1434: Fnd_Api.G_MISS_NUM) <> Fnd_Api.G_MISS_NUM
1435: THEN
1436:
1437: IF (g_debug > 0)
1438: THEN
1442: Fnd_Message.SET_NAME('CSD', 'CSD_ATTRB_VALUE_NOT_EXPECTED');
1443: Fnd_Message.SET_TOKEN('ATTRIBUTE',
1444: 'non source instance_id');
1445: Fnd_Msg_Pub.ADD;
1446: RAISE Fnd_Api.G_EXC_ERROR;
1447:
1448: END IF;
1449:
1450: -- Return_By_Date should be Null for RMA line.
1451: -- NVL check for Action Type is not required.
1452: IF p_Product_Txn_Rec.action_type IN
1453: (C_ACTION_TYPE_RMA, C_ACTION_TYPE_WALK_IN_RECPT) AND
1454: NVL(p_Upd_ProdTxn_Rec.Return_By_Date,
1455: Fnd_Api.G_MISS_DATE) <> Fnd_Api.G_MISS_DATE
1456: THEN
1457:
1458: IF (g_debug > 0)
1459: THEN
1463: Fnd_Message.SET_NAME('CSD', 'CSD_ATTRB_VALUE_NOT_EXPECTED');
1464: Fnd_Message.SET_TOKEN('ATTRIBUTE', 'Return By Date');
1465: Fnd_Msg_Pub.ADD;
1466:
1467: RAISE Fnd_Api.G_EXC_ERROR;
1468:
1469: END IF;
1470:
1471: -- Validate source_Serial Number
1471: -- Validate source_Serial Number
1472: IF l_ItemAttributes.Serial_Code > 1
1473: THEN
1474: IF NVL(p_Upd_ProdTxn_Rec.source_Serial_Number,
1475: Fnd_Api.G_MISS_CHAR) <> Fnd_Api.G_MISS_CHAR AND
1476: p_Product_Txn_Rec.Action_Type IN
1477: (C_ACTION_TYPE_RMA, C_ACTION_TYPE_WALK_IN_RECPT)
1478: THEN
1479:
1481: p_Serial_Number => p_Product_Txn_Rec.source_Serial_Number);
1482: END IF;
1483:
1484: IF NVL(p_Upd_ProdTxn_Rec.source_Serial_Number,
1485: Fnd_Api.G_MISS_CHAR) <> Fnd_Api.G_MISS_CHAR AND
1486: p_Product_Txn_Rec.Action_Type IN
1487: (C_ACTION_TYPE_SHIP, C_ACTION_TYPE_WALK_IN_ISSUE)
1488: THEN
1489:
1492: p_serial_control_code => l_ItemAttributes.Serial_Code);
1493: END IF;
1494:
1495: IF NVL(p_Upd_ProdTxn_Rec.non_source_Serial_Number,
1496: Fnd_Api.G_MISS_CHAR) <> Fnd_Api.G_MISS_CHAR
1497: THEN
1498:
1499: Validate_SerialNumber(p_Inventory_Item_Id => p_Product_Txn_Rec.Inventory_Item_Id,
1500: p_Serial_Number => p_Product_Txn_Rec.non_source_Serial_Number);
1503: ELSE
1504: --Serial Number column should be NULL else raise exception
1505: -- attribute value not expected.
1506: IF NVL(p_Upd_ProdTxn_Rec.source_Serial_Number,
1507: Fnd_Api.G_MISS_CHAR) <> Fnd_Api.G_MISS_CHAR
1508: THEN
1509: Fnd_Message.SET_NAME('CSD',
1510: 'CSD_ATTRB_VALUE_NOT_EXPECTED');
1511: Fnd_Message.SET_TOKEN('ATTRIBUTE',
1510: 'CSD_ATTRB_VALUE_NOT_EXPECTED');
1511: Fnd_Message.SET_TOKEN('ATTRIBUTE',
1512: 'source_Serial Number');
1513: Fnd_Msg_Pub.ADD;
1514: RAISE Fnd_Api.G_EXC_ERROR;
1515: END IF;
1516: IF NVL(p_Upd_ProdTxn_Rec.non_source_Serial_Number,
1517: Fnd_Api.G_MISS_CHAR) <> Fnd_Api.G_MISS_CHAR
1518: THEN
1513: Fnd_Msg_Pub.ADD;
1514: RAISE Fnd_Api.G_EXC_ERROR;
1515: END IF;
1516: IF NVL(p_Upd_ProdTxn_Rec.non_source_Serial_Number,
1517: Fnd_Api.G_MISS_CHAR) <> Fnd_Api.G_MISS_CHAR
1518: THEN
1519: Fnd_Message.SET_NAME('CSD',
1520: 'CSD_ATTRB_VALUE_NOT_EXPECTED');
1521: Fnd_Message.SET_TOKEN('ATTRIBUTE',
1520: 'CSD_ATTRB_VALUE_NOT_EXPECTED');
1521: Fnd_Message.SET_TOKEN('ATTRIBUTE',
1522: 'non_source_Serial Number');
1523: Fnd_Msg_Pub.ADD;
1524: RAISE Fnd_Api.G_EXC_ERROR;
1525: END IF;
1526:
1527: END IF;
1528:
1530: IF l_ItemAttributes.IB_Flag = 'Y'
1531: THEN
1532:
1533: IF NVL(p_Upd_ProdTxn_Rec.source_Instance_id,
1534: Fnd_Api.G_MISS_NUM) <> Fnd_Api.G_MISS_NUM
1535: THEN
1536: Validate_Instance_ID(p_Inventory_Item_Id => p_Product_Txn_Rec.Inventory_Item_Id,
1537: p_Instance_Id => p_Product_Txn_Rec.source_Instance_ID,
1538: p_Party_Id => l_Customer_ID,
1541: x_Serial_Number => l_Serial_Number);
1542: END IF;
1543: --non source
1544: IF NVL(p_Upd_ProdTxn_Rec.non_source_Instance_id,
1545: Fnd_Api.G_MISS_NUM) <> Fnd_Api.G_MISS_NUM
1546: THEN
1547: Validate_Instance_ID(p_Inventory_Item_Id => p_Product_Txn_Rec.Inventory_Item_Id,
1548: p_Instance_Id => p_Product_Txn_Rec.non_source_Instance_ID,
1549: p_Party_Id => l_Customer_ID,
1554: -- If item is not IB trackable then value is not
1555: -- expected for instance_Id
1556: ELSE
1557: IF NVL(p_Upd_ProdTxn_Rec.source_Instance_id,
1558: Fnd_Api.G_MISS_NUM) <> Fnd_Api.G_MISS_NUM
1559: THEN
1560: Fnd_Message.SET_NAME('CSD',
1561: 'CSD_ATTRB_VALUE_NOT_EXPECTED');
1562: Fnd_Message.SET_TOKEN('ATTRIBUTE', 'Instance Id');
1560: Fnd_Message.SET_NAME('CSD',
1561: 'CSD_ATTRB_VALUE_NOT_EXPECTED');
1562: Fnd_Message.SET_TOKEN('ATTRIBUTE', 'Instance Id');
1563: Fnd_Msg_Pub.ADD;
1564: RAISE Fnd_Api.G_EXC_ERROR;
1565: END IF;
1566:
1567: END IF;
1568:
1584: Fnd_Message.SET_TOKEN('INSTANCE_NUM',
1585: l_Instance_Number);
1586: Fnd_Msg_Pub.ADD;
1587:
1588: RAISE Fnd_Api.G_EXC_ERROR;
1589:
1590: END IF;
1591: -- non source
1592: IF NVL(p_Product_Txn_Rec.non_source_Serial_Number, '-') <>
1602: Fnd_Message.SET_TOKEN('INSTANCE_NUM',
1603: l_non_src_Instance_Number);
1604: Fnd_Msg_Pub.ADD;
1605:
1606: RAISE Fnd_Api.G_EXC_ERROR;
1607:
1608: END IF;
1609:
1610: END IF;
1613: IF l_ItemAttributes.Lot_Code > 1
1614: THEN
1615:
1616: IF NVL(p_Upd_ProdTxn_Rec.Lot_Number,
1617: Fnd_Api.G_MISS_CHAR) <> Fnd_Api.G_MISS_CHAR
1618: THEN
1619:
1620: Validate_LotNumber(p_Inventory_Item_Id => p_Product_Txn_Rec.Inventory_Item_Id,
1621: p_Lot_Number => p_Product_Txn_Rec.Lot_Number);
1633: END IF;
1634:
1635: -- Validate Bill to org ID
1636: IF NVL(p_Upd_ProdTxn_Rec.Invoice_To_Org_Id,
1637: Fnd_Api.G_MISS_NUM) <> Fnd_Api.G_MISS_NUM
1638: THEN
1639:
1640: Validate_PartySiteID(p_Party_ID => l_Customer_Id,
1641: p_Party_Site_Id => p_Product_Txn_Rec.Invoice_To_Org_ID,
1651: p_api_name => l_api_name);
1652: END IF;
1653: -- Validate Ship to org ID
1654: IF NVL(p_Upd_ProdTxn_Rec.Ship_To_Org_Id,
1655: Fnd_Api.G_MISS_NUM) <> Fnd_Api.G_MISS_NUM
1656: THEN
1657:
1658: Validate_PartySiteID(p_Party_ID => l_Customer_Id,
1659: p_Party_Site_Id => p_Product_Txn_Rec.Ship_To_Org_ID,
1671: END IF;
1672:
1673: -- Validate Unit of Measure
1674: IF NVL(p_Upd_ProdTxn_Rec.Unit_Of_Measure_Code,
1675: Fnd_Api.G_MISS_CHAR) <> Fnd_Api.G_MISS_CHAR
1676: THEN
1677:
1678: Validate_UOM(p_Inventory_Item_Id => p_Product_Txn_Rec.Inventory_Item_Id,
1679: p_Unit_Of_Measure => p_Product_Txn_Rec.Unit_Of_Measure_Code);
1683: END IF; --
1684:
1685: EXCEPTION
1686:
1687: WHEN Fnd_Api.G_Exc_Error THEN
1688: x_return_status := Fnd_Api.G_Ret_Sts_Error;
1689: Fnd_Msg_Pub.Count_And_Get(p_count => x_msg_count,
1690: p_data => x_msg_data);
1691:
1684:
1685: EXCEPTION
1686:
1687: WHEN Fnd_Api.G_Exc_Error THEN
1688: x_return_status := Fnd_Api.G_Ret_Sts_Error;
1689: Fnd_Msg_Pub.Count_And_Get(p_count => x_msg_count,
1690: p_data => x_msg_data);
1691:
1692: WHEN OTHERS THEN
1689: Fnd_Msg_Pub.Count_And_Get(p_count => x_msg_count,
1690: p_data => x_msg_data);
1691:
1692: WHEN OTHERS THEN
1693: x_return_status := Fnd_Api.G_RET_STS_UNEXP_ERROR;
1694: IF Fnd_Msg_Pub.Check_Msg_Level(Fnd_Msg_Pub.G_Msg_Lvl_Unexp_Error)
1695: THEN
1696: Fnd_Msg_Pub.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1697: END IF;
1742: -- Following Attributes cannot be changed.
1743: -- Action Type cannot be changed
1744: IF (p_Upd_ProdTxn_Rec.Action_Type <>
1745: p_Product_Txn_Rec.Action_Type AND
1746: p_Upd_ProdTxn_Rec.Action_Type <> Fnd_Api.G_MISS_CHAR)
1747: THEN
1748: l_Attribute := 'Action Type';
1749: RAISE Fnd_Api.G_EXC_ERROR;
1750: END IF;
1745: p_Product_Txn_Rec.Action_Type AND
1746: p_Upd_ProdTxn_Rec.Action_Type <> Fnd_Api.G_MISS_CHAR)
1747: THEN
1748: l_Attribute := 'Action Type';
1749: RAISE Fnd_Api.G_EXC_ERROR;
1750: END IF;
1751:
1752: -- Action Code cannot be changed
1753: IF (p_Upd_ProdTxn_Rec.Action_Code <>
1751:
1752: -- Action Code cannot be changed
1753: IF (p_Upd_ProdTxn_Rec.Action_Code <>
1754: p_Product_Txn_Rec.Action_Code AND
1755: p_Upd_ProdTxn_Rec.Action_Code <> Fnd_Api.G_MISS_CHAR)
1756: THEN
1757: l_Attribute := 'Action Code';
1758: RAISE Fnd_Api.G_EXC_ERROR;
1759: END IF;
1754: p_Product_Txn_Rec.Action_Code AND
1755: p_Upd_ProdTxn_Rec.Action_Code <> Fnd_Api.G_MISS_CHAR)
1756: THEN
1757: l_Attribute := 'Action Code';
1758: RAISE Fnd_Api.G_EXC_ERROR;
1759: END IF;
1760:
1761: -- Item cannot be changed
1762: IF (p_Upd_ProdTxn_Rec.Inventory_Item_Id <>
1760:
1761: -- Item cannot be changed
1762: IF (p_Upd_ProdTxn_Rec.Inventory_Item_Id <>
1763: p_Product_Txn_Rec.Inventory_Item_Id AND p_Upd_ProdTxn_Rec.Inventory_Item_Id <>
1764: Fnd_Api.G_MISS_NUM)
1765: THEN
1766: l_Attribute := 'Product';
1767: RAISE Fnd_Api.G_EXC_ERROR;
1768: END IF;
1763: p_Product_Txn_Rec.Inventory_Item_Id AND p_Upd_ProdTxn_Rec.Inventory_Item_Id <>
1764: Fnd_Api.G_MISS_NUM)
1765: THEN
1766: l_Attribute := 'Product';
1767: RAISE Fnd_Api.G_EXC_ERROR;
1768: END IF;
1769:
1770: -- Txn Billing Type cannot be changed
1771: IF (p_Upd_ProdTxn_Rec.Txn_Billing_Type_Id <>
1770: -- Txn Billing Type cannot be changed
1771: IF (p_Upd_ProdTxn_Rec.Txn_Billing_Type_Id <>
1772: p_Product_Txn_Rec.Txn_Billing_Type_Id AND
1773: p_Upd_ProdTxn_Rec.Txn_Billing_Type_Id <>
1774: Fnd_Api.G_MISS_NUM)
1775: THEN
1776: l_Attribute := 'Service Activity';
1777: RAISE Fnd_Api.G_EXC_ERROR;
1778: END IF;
1773: p_Upd_ProdTxn_Rec.Txn_Billing_Type_Id <>
1774: Fnd_Api.G_MISS_NUM)
1775: THEN
1776: l_Attribute := 'Service Activity';
1777: RAISE Fnd_Api.G_EXC_ERROR;
1778: END IF;
1779:
1780: -- Price List cannot be changed
1781: IF (p_Upd_ProdTxn_Rec.Price_List_Id <>
1779:
1780: -- Price List cannot be changed
1781: IF (p_Upd_ProdTxn_Rec.Price_List_Id <>
1782: p_Product_Txn_Rec.Price_List_Id AND
1783: p_Upd_ProdTxn_Rec.Price_List_Id <> Fnd_Api.G_MISS_NUM)
1784: THEN
1785: l_Attribute := 'Price List';
1786: RAISE Fnd_Api.G_EXC_ERROR;
1787: END IF;
1782: p_Product_Txn_Rec.Price_List_Id AND
1783: p_Upd_ProdTxn_Rec.Price_List_Id <> Fnd_Api.G_MISS_NUM)
1784: THEN
1785: l_Attribute := 'Price List';
1786: RAISE Fnd_Api.G_EXC_ERROR;
1787: END IF;
1788:
1789: -- Quantity cannot be changed
1790: IF (p_Upd_ProdTxn_Rec.Quantity <>
1788:
1789: -- Quantity cannot be changed
1790: IF (p_Upd_ProdTxn_Rec.Quantity <>
1791: p_Product_Txn_Rec.Quantity AND
1792: p_Upd_ProdTxn_Rec.Quantity <> Fnd_Api.G_MISS_NUM)
1793: THEN
1794: l_Attribute := 'Quantity';
1795: RAISE Fnd_Api.G_EXC_ERROR;
1796: END IF;
1791: p_Product_Txn_Rec.Quantity AND
1792: p_Upd_ProdTxn_Rec.Quantity <> Fnd_Api.G_MISS_NUM)
1793: THEN
1794: l_Attribute := 'Quantity';
1795: RAISE Fnd_Api.G_EXC_ERROR;
1796: END IF;
1797:
1798: -- Return Reason cannot be changed
1799: IF (p_Upd_ProdTxn_Rec.Return_Reason <>
1796: END IF;
1797:
1798: -- Return Reason cannot be changed
1799: IF (p_Upd_ProdTxn_Rec.Return_Reason <>
1800: NVL(p_Product_Txn_Rec.Return_Reason, Fnd_Api.G_MISS_CHAR) AND
1801: p_Upd_ProdTxn_Rec.Return_Reason <>
1802: Fnd_Api.G_MISS_CHAR)
1803: THEN
1804: l_Attribute := 'Return_Reason';
1798: -- Return Reason cannot be changed
1799: IF (p_Upd_ProdTxn_Rec.Return_Reason <>
1800: NVL(p_Product_Txn_Rec.Return_Reason, Fnd_Api.G_MISS_CHAR) AND
1801: p_Upd_ProdTxn_Rec.Return_Reason <>
1802: Fnd_Api.G_MISS_CHAR)
1803: THEN
1804: l_Attribute := 'Return_Reason';
1805: RAISE Fnd_Api.G_EXC_ERROR;
1806: END IF;
1801: p_Upd_ProdTxn_Rec.Return_Reason <>
1802: Fnd_Api.G_MISS_CHAR)
1803: THEN
1804: l_Attribute := 'Return_Reason';
1805: RAISE Fnd_Api.G_EXC_ERROR;
1806: END IF;
1807:
1808: -- Return By Date cannot be changed
1809: IF (p_Upd_ProdTxn_Rec.Return_By_Date <>
1806: END IF;
1807:
1808: -- Return By Date cannot be changed
1809: IF (p_Upd_ProdTxn_Rec.Return_By_Date <>
1810: NVL(p_Product_Txn_Rec.Return_By_Date, Fnd_Api.G_MISS_DATE) AND
1811: p_Upd_ProdTxn_Rec.Return_By_Date <>
1812: Fnd_Api.G_MISS_DATE)
1813: THEN
1814: l_Attribute := 'Return_By_Date';
1808: -- Return By Date cannot be changed
1809: IF (p_Upd_ProdTxn_Rec.Return_By_Date <>
1810: NVL(p_Product_Txn_Rec.Return_By_Date, Fnd_Api.G_MISS_DATE) AND
1811: p_Upd_ProdTxn_Rec.Return_By_Date <>
1812: Fnd_Api.G_MISS_DATE)
1813: THEN
1814: l_Attribute := 'Return_By_Date';
1815: RAISE Fnd_Api.G_EXC_ERROR;
1816: END IF;
1811: p_Upd_ProdTxn_Rec.Return_By_Date <>
1812: Fnd_Api.G_MISS_DATE)
1813: THEN
1814: l_Attribute := 'Return_By_Date';
1815: RAISE Fnd_Api.G_EXC_ERROR;
1816: END IF;
1817:
1818: -- PO Number cannot be changed
1819: IF (p_Upd_ProdTxn_Rec.PO_Number <>
1816: END IF;
1817:
1818: -- PO Number cannot be changed
1819: IF (p_Upd_ProdTxn_Rec.PO_Number <>
1820: NVL(p_Product_Txn_Rec.PO_Number, Fnd_Api.G_MISS_CHAR) AND
1821: p_Upd_ProdTxn_Rec.PO_Number <> Fnd_Api.G_MISS_CHAR)
1822: THEN
1823: l_Attribute := 'PO Number';
1824: RAISE Fnd_Api.G_EXC_ERROR;
1817:
1818: -- PO Number cannot be changed
1819: IF (p_Upd_ProdTxn_Rec.PO_Number <>
1820: NVL(p_Product_Txn_Rec.PO_Number, Fnd_Api.G_MISS_CHAR) AND
1821: p_Upd_ProdTxn_Rec.PO_Number <> Fnd_Api.G_MISS_CHAR)
1822: THEN
1823: l_Attribute := 'PO Number';
1824: RAISE Fnd_Api.G_EXC_ERROR;
1825: END IF;
1820: NVL(p_Product_Txn_Rec.PO_Number, Fnd_Api.G_MISS_CHAR) AND
1821: p_Upd_ProdTxn_Rec.PO_Number <> Fnd_Api.G_MISS_CHAR)
1822: THEN
1823: l_Attribute := 'PO Number';
1824: RAISE Fnd_Api.G_EXC_ERROR;
1825: END IF;
1826:
1827: -- Bill TO Address cannot be changed
1828: IF (p_Upd_ProdTxn_Rec.Invoice_To_Org_ID <>
1826:
1827: -- Bill TO Address cannot be changed
1828: IF (p_Upd_ProdTxn_Rec.Invoice_To_Org_ID <>
1829: p_Product_Txn_Rec.Invoice_To_Org_ID AND p_Upd_ProdTxn_Rec.Invoice_To_Org_ID <>
1830: Fnd_Api.G_MISS_NUM)
1831: THEN
1832: l_Attribute := 'Bill_To_Address';
1833: RAISE Fnd_Api.G_EXC_ERROR;
1834: END IF;
1829: p_Product_Txn_Rec.Invoice_To_Org_ID AND p_Upd_ProdTxn_Rec.Invoice_To_Org_ID <>
1830: Fnd_Api.G_MISS_NUM)
1831: THEN
1832: l_Attribute := 'Bill_To_Address';
1833: RAISE Fnd_Api.G_EXC_ERROR;
1834: END IF;
1835:
1836: -- Ship TO Address cannot be changed
1837: -- SU: Remove NVL function as Ship To Address is required column
1836: -- Ship TO Address cannot be changed
1837: -- SU: Remove NVL function as Ship To Address is required column
1838: IF (p_Upd_ProdTxn_Rec.Ship_To_Org_ID <>
1839: p_Product_Txn_Rec.Ship_To_Org_ID AND p_Upd_ProdTxn_Rec.Ship_To_Org_ID <>
1840: Fnd_Api.G_MISS_NUM)
1841: THEN
1842: l_Attribute := 'Ship_To_Address';
1843: RAISE Fnd_Api.G_EXC_ERROR;
1844: END IF;
1839: p_Product_Txn_Rec.Ship_To_Org_ID AND p_Upd_ProdTxn_Rec.Ship_To_Org_ID <>
1840: Fnd_Api.G_MISS_NUM)
1841: THEN
1842: l_Attribute := 'Ship_To_Address';
1843: RAISE Fnd_Api.G_EXC_ERROR;
1844: END IF;
1845:
1846: -- Unit of Measure cannot be changed
1847: IF (p_Upd_ProdTxn_Rec.Unit_Of_Measure_Code <>
1846: -- Unit of Measure cannot be changed
1847: IF (p_Upd_ProdTxn_Rec.Unit_Of_Measure_Code <>
1848: p_Product_Txn_Rec.Unit_Of_Measure_Code AND
1849: p_Upd_ProdTxn_Rec.Unit_Of_Measure_Code <>
1850: Fnd_Api.G_MISS_CHAR)
1851: THEN
1852: l_Attribute := 'Unit Of Measure';
1853: RAISE Fnd_Api.G_EXC_ERROR;
1854: END IF;
1849: p_Upd_ProdTxn_Rec.Unit_Of_Measure_Code <>
1850: Fnd_Api.G_MISS_CHAR)
1851: THEN
1852: l_Attribute := 'Unit Of Measure';
1853: RAISE Fnd_Api.G_EXC_ERROR;
1854: END IF;
1855:
1856: -- Charge cannot be changed
1857: IF (p_Upd_ProdTxn_Rec.Charge <>
1855:
1856: -- Charge cannot be changed
1857: IF (p_Upd_ProdTxn_Rec.Charge <>
1858: NVL(p_Product_Txn_Rec.After_Warranty_Cost,
1859: Fnd_Api.G_MISS_NUM) AND
1860: p_Upd_ProdTxn_Rec.Charge <> Fnd_Api.G_MISS_NUM)
1861: THEN
1862: l_Attribute := 'Charge';
1863: RAISE Fnd_Api.G_EXC_ERROR;
1856: -- Charge cannot be changed
1857: IF (p_Upd_ProdTxn_Rec.Charge <>
1858: NVL(p_Product_Txn_Rec.After_Warranty_Cost,
1859: Fnd_Api.G_MISS_NUM) AND
1860: p_Upd_ProdTxn_Rec.Charge <> Fnd_Api.G_MISS_NUM)
1861: THEN
1862: l_Attribute := 'Charge';
1863: RAISE Fnd_Api.G_EXC_ERROR;
1864: END IF;
1859: Fnd_Api.G_MISS_NUM) AND
1860: p_Upd_ProdTxn_Rec.Charge <> Fnd_Api.G_MISS_NUM)
1861: THEN
1862: l_Attribute := 'Charge';
1863: RAISE Fnd_Api.G_EXC_ERROR;
1864: END IF;
1865:
1866: -- SU: Move this validation in if statement status <> ENTERED
1867: IF (p_Upd_ProdTxn_Rec.Revision <>
1864: END IF;
1865:
1866: -- SU: Move this validation in if statement status <> ENTERED
1867: IF (p_Upd_ProdTxn_Rec.Revision <>
1868: NVL(p_Product_Txn_Rec.Revision, Fnd_Api.G_MISS_CHAR) AND
1869: p_Upd_ProdTxn_Rec.Revision <> Fnd_Api.G_MISS_CHAR)
1870: THEN
1871: l_Attribute := 'Revision';
1872: RAISE Fnd_Api.G_EXC_ERROR;
1865:
1866: -- SU: Move this validation in if statement status <> ENTERED
1867: IF (p_Upd_ProdTxn_Rec.Revision <>
1868: NVL(p_Product_Txn_Rec.Revision, Fnd_Api.G_MISS_CHAR) AND
1869: p_Upd_ProdTxn_Rec.Revision <> Fnd_Api.G_MISS_CHAR)
1870: THEN
1871: l_Attribute := 'Revision';
1872: RAISE Fnd_Api.G_EXC_ERROR;
1873: END IF;
1868: NVL(p_Product_Txn_Rec.Revision, Fnd_Api.G_MISS_CHAR) AND
1869: p_Upd_ProdTxn_Rec.Revision <> Fnd_Api.G_MISS_CHAR)
1870: THEN
1871: l_Attribute := 'Revision';
1872: RAISE Fnd_Api.G_EXC_ERROR;
1873: END IF;
1874:
1875: -- IB Ref Number cannot be changed once product transaction line is interfaced
1876: IF (p_Upd_ProdTxn_Rec.source_Instance_Id <>
1874:
1875: -- IB Ref Number cannot be changed once product transaction line is interfaced
1876: IF (p_Upd_ProdTxn_Rec.source_Instance_Id <>
1877: NVL(p_Product_Txn_Rec.source_Instance_Id,
1878: Fnd_Api.G_MISS_NUM) AND p_Upd_ProdTxn_Rec.source_Instance_Id <>
1879: Fnd_Api.G_MISS_NUM)
1880: THEN
1881: l_Attribute := 'Source IB Ref Num';
1882: RAISE Fnd_Api.G_EXC_ERROR;
1875: -- IB Ref Number cannot be changed once product transaction line is interfaced
1876: IF (p_Upd_ProdTxn_Rec.source_Instance_Id <>
1877: NVL(p_Product_Txn_Rec.source_Instance_Id,
1878: Fnd_Api.G_MISS_NUM) AND p_Upd_ProdTxn_Rec.source_Instance_Id <>
1879: Fnd_Api.G_MISS_NUM)
1880: THEN
1881: l_Attribute := 'Source IB Ref Num';
1882: RAISE Fnd_Api.G_EXC_ERROR;
1883: END IF;
1878: Fnd_Api.G_MISS_NUM) AND p_Upd_ProdTxn_Rec.source_Instance_Id <>
1879: Fnd_Api.G_MISS_NUM)
1880: THEN
1881: l_Attribute := 'Source IB Ref Num';
1882: RAISE Fnd_Api.G_EXC_ERROR;
1883: END IF;
1884:
1885: -- Lot Number cannot be changed
1886: IF (p_Upd_ProdTxn_Rec.Lot_Number <>
1884:
1885: -- Lot Number cannot be changed
1886: IF (p_Upd_ProdTxn_Rec.Lot_Number <>
1887: NVL(p_Product_Txn_Rec.Lot_Number, 'NULL') AND
1888: NVL(p_Upd_ProdTxn_Rec.Lot_Number, Fnd_Api.G_MISS_CHAR) <>
1889: Fnd_Api.G_MISS_CHAR)
1890: THEN
1891: l_Attribute := 'Lot_Number';
1892: RAISE Fnd_Api.G_EXC_ERROR;
1885: -- Lot Number cannot be changed
1886: IF (p_Upd_ProdTxn_Rec.Lot_Number <>
1887: NVL(p_Product_Txn_Rec.Lot_Number, 'NULL') AND
1888: NVL(p_Upd_ProdTxn_Rec.Lot_Number, Fnd_Api.G_MISS_CHAR) <>
1889: Fnd_Api.G_MISS_CHAR)
1890: THEN
1891: l_Attribute := 'Lot_Number';
1892: RAISE Fnd_Api.G_EXC_ERROR;
1893: END IF;
1888: NVL(p_Upd_ProdTxn_Rec.Lot_Number, Fnd_Api.G_MISS_CHAR) <>
1889: Fnd_Api.G_MISS_CHAR)
1890: THEN
1891: l_Attribute := 'Lot_Number';
1892: RAISE Fnd_Api.G_EXC_ERROR;
1893: END IF;
1894:
1895: -- Serial Number cannot be changed
1896: IF (p_Upd_ProdTxn_Rec.source_Serial_Number <>
1894:
1895: -- Serial Number cannot be changed
1896: IF (p_Upd_ProdTxn_Rec.source_Serial_Number <>
1897: NVL(p_Product_Txn_Rec.source_Serial_Number,
1898: Fnd_Api.G_MISS_CHAR) AND p_Upd_ProdTxn_Rec.source_Serial_Number <>
1899: Fnd_Api.G_MISS_CHAR)
1900: THEN
1901: l_Attribute := 'Serial_Number';
1902: RAISE Fnd_Api.G_EXC_ERROR;
1895: -- Serial Number cannot be changed
1896: IF (p_Upd_ProdTxn_Rec.source_Serial_Number <>
1897: NVL(p_Product_Txn_Rec.source_Serial_Number,
1898: Fnd_Api.G_MISS_CHAR) AND p_Upd_ProdTxn_Rec.source_Serial_Number <>
1899: Fnd_Api.G_MISS_CHAR)
1900: THEN
1901: l_Attribute := 'Serial_Number';
1902: RAISE Fnd_Api.G_EXC_ERROR;
1903: END IF;
1898: Fnd_Api.G_MISS_CHAR) AND p_Upd_ProdTxn_Rec.source_Serial_Number <>
1899: Fnd_Api.G_MISS_CHAR)
1900: THEN
1901: l_Attribute := 'Serial_Number';
1902: RAISE Fnd_Api.G_EXC_ERROR;
1903: END IF;
1904:
1905: END IF; -- End IF status is different to ENTERED
1906:
1909: p_Product_Txn_Rec.Order_Header_Id IS NOT NULL)
1910: THEN
1911: -- Sub Inventory cannot be changed
1912: IF (p_Upd_ProdTxn_Rec.Sub_Inventory <>
1913: NVL(p_Product_Txn_Rec.Sub_Inventory, Fnd_Api.G_MISS_CHAR) AND
1914: p_Upd_ProdTxn_Rec.Sub_Inventory <>
1915: Fnd_Api.G_MISS_CHAR)
1916: THEN
1917: l_Attribute := 'Sub Inventory';
1911: -- Sub Inventory cannot be changed
1912: IF (p_Upd_ProdTxn_Rec.Sub_Inventory <>
1913: NVL(p_Product_Txn_Rec.Sub_Inventory, Fnd_Api.G_MISS_CHAR) AND
1914: p_Upd_ProdTxn_Rec.Sub_Inventory <>
1915: Fnd_Api.G_MISS_CHAR)
1916: THEN
1917: l_Attribute := 'Sub Inventory';
1918: RAISE Fnd_Api.G_EXC_ERROR;
1919: END IF;
1914: p_Upd_ProdTxn_Rec.Sub_Inventory <>
1915: Fnd_Api.G_MISS_CHAR)
1916: THEN
1917: l_Attribute := 'Sub Inventory';
1918: RAISE Fnd_Api.G_EXC_ERROR;
1919: END IF;
1920:
1921: ELSIF p_Product_Txn_Rec.Prod_Txn_Status = C_PROD_TXN_STS_RELEASED
1922: THEN
1921: ELSIF p_Product_Txn_Rec.Prod_Txn_Status = C_PROD_TXN_STS_RELEASED
1922: THEN
1923:
1924: IF (p_Upd_ProdTxn_Rec.Sub_Inventory <>
1925: NVL(p_Product_Txn_Rec.Sub_Inventory, Fnd_Api.G_MISS_CHAR) AND
1926: p_Upd_ProdTxn_Rec.Sub_Inventory <>
1927: Fnd_Api.G_MISS_CHAR)
1928: THEN
1929: l_Attribute := 'Sub Inventory';
1923:
1924: IF (p_Upd_ProdTxn_Rec.Sub_Inventory <>
1925: NVL(p_Product_Txn_Rec.Sub_Inventory, Fnd_Api.G_MISS_CHAR) AND
1926: p_Upd_ProdTxn_Rec.Sub_Inventory <>
1927: Fnd_Api.G_MISS_CHAR)
1928: THEN
1929: l_Attribute := 'Sub Inventory';
1930: RAISE Fnd_Api.G_EXC_ERROR;
1931:
1926: p_Upd_ProdTxn_Rec.Sub_Inventory <>
1927: Fnd_Api.G_MISS_CHAR)
1928: THEN
1929: l_Attribute := 'Sub Inventory';
1930: RAISE Fnd_Api.G_EXC_ERROR;
1931:
1932: END IF;
1933:
1934: END IF; -- Product Transaction Statu is Released
1937: THEN
1938:
1939: --SU:02/24 Following validation is added today. Since sub Inventory is also not update able once item is shipped
1940: IF (p_Upd_ProdTxn_Rec.Sub_Inventory <>
1941: NVL(p_Product_Txn_Rec.Sub_Inventory, Fnd_Api.G_MISS_CHAR) AND
1942: p_Upd_ProdTxn_Rec.Sub_Inventory <>
1943: Fnd_Api.G_MISS_CHAR)
1944: THEN
1945: l_Attribute := 'Sub Inventory';
1939: --SU:02/24 Following validation is added today. Since sub Inventory is also not update able once item is shipped
1940: IF (p_Upd_ProdTxn_Rec.Sub_Inventory <>
1941: NVL(p_Product_Txn_Rec.Sub_Inventory, Fnd_Api.G_MISS_CHAR) AND
1942: p_Upd_ProdTxn_Rec.Sub_Inventory <>
1943: Fnd_Api.G_MISS_CHAR)
1944: THEN
1945: l_Attribute := 'Sub Inventory';
1946: RAISE Fnd_Api.G_EXC_ERROR;
1947: END IF;
1942: p_Upd_ProdTxn_Rec.Sub_Inventory <>
1943: Fnd_Api.G_MISS_CHAR)
1944: THEN
1945: l_Attribute := 'Sub Inventory';
1946: RAISE Fnd_Api.G_EXC_ERROR;
1947: END IF;
1948:
1949: END IF; --
1950:
1948:
1949: END IF; --
1950:
1951: EXCEPTION
1952: WHEN Fnd_Api.G_EXC_ERROR THEN
1953: --JG:02/25: Corrected message code. Removed space at the end.
1954: Fnd_Message.SET_NAME('CSD', 'CSD_PRODTXN_ATTRB_CHANGED');
1955: Fnd_Message.SET_TOKEN('PRODTXN_STATUS',
1956: l_ProdTxnStatus_Meaning);
1955: Fnd_Message.SET_TOKEN('PRODTXN_STATUS',
1956: l_ProdTxnStatus_Meaning);
1957: Fnd_Message.SET_TOKEN('ATTRB', l_Attribute);
1958: Fnd_Msg_Pub.ADD;
1959: x_return_status := Fnd_Api.G_Ret_Sts_Error;
1960: Fnd_Msg_Pub.Count_AND_Get(p_count => x_msg_count,
1961: p_data => x_msg_data);
1962:
1963: END Compare_ProductTrxnRec;
2026: Fnd_Message.SET_NAME('CSD', 'CSD_INVALID_ITEM');
2027: Fnd_Message.SET_TOKEN('ITEM_ID', p_Inventory_Item_Id);
2028: Fnd_Msg_Pub.ADD;
2029:
2030: RAISE Fnd_Api.G_EXC_ERROR;
2031:
2032: END Get_ItemAttributes;
2033:
2034:
2065: Fnd_Msg_Pub.ADD;
2066: Debug('Invalid repair line id =' || p_repair_line_id,
2067: l_mod_name,
2068: 1);
2069: RAISE Fnd_Api.G_EXC_ERROR;
2070: END;
2071:
2072: IF l_incident_id IS NOT NULL
2073: THEN
2079: Fnd_Message.SET_NAME('CSD', 'CSD_API_INV_SR_ID');
2080: Fnd_Message.SET_TOKEN('INCIDENT_ID', l_incident_id);
2081: Fnd_Msg_Pub.ADD;
2082: Debug('incident Id missing ', l_mod_name, 1);
2083: RAISE Fnd_Api.G_EXC_ERROR;
2084: END IF;
2085:
2086: -- assigning values for the order record
2087: x_order_rec.incident_id := l_incident_id;
2115: x_prodtxn_db_attr Csd_Logistics_Util.PRODTXN_DB_ATTR_REC;
2116:
2117:
2118: BEGIN
2119: IF NVL(p_product_txn_id, Fnd_Api.G_MISS_NUM) <> Fnd_Api.G_MISS_NUM
2120: THEN
2121:
2122: OPEN prod_txn(p_product_txn_id);
2123: FETCH prod_txn
2128: x_prodtxn_db_attr.curr_release_order_flag,
2129: x_prodtxn_db_attr.curr_ship_order_flag,
2130: x_prodtxn_db_attr.object_version_num;
2131: IF( prod_txn%NOTFOUND) THEN
2132: RAISE Fnd_Api.G_EXC_UNEXPECTED_ERROR;
2133: END IF;
2134: CLOSE prod_txn;
2135:
2136: END IF;
2205: -- Validate the prod_txn_id if it exists in csd_product_transactions
2206: IF NOT
2207: (Csd_Process_Util.Validate_prod_txn_id(p_prod_txn_id => p_product_txn_rec.product_transaction_id))
2208: THEN
2209: RAISE Fnd_Api.G_EXC_ERROR;
2210: END IF;
2211:
2212: Debug('Validate product txn status', l_mod_name, C_STATEMENT_LEVEL);
2213: Debug('p_product_txn_rec.PROD_TXN_STATUS =' ||
2215: l_mod_name,
2216: C_STATEMENT_LEVEL);
2217:
2218: -- Validate the PROD_TXN_STATUS
2219: IF NVL(p_product_txn_rec.PROD_TXN_STATUS, Fnd_Api.G_MISS_CHAR) <>
2220: Fnd_Api.G_MISS_CHAR
2221: THEN
2222: BEGIN
2223: SELECT 'X'
2216: C_STATEMENT_LEVEL);
2217:
2218: -- Validate the PROD_TXN_STATUS
2219: IF NVL(p_product_txn_rec.PROD_TXN_STATUS, Fnd_Api.G_MISS_CHAR) <>
2220: Fnd_Api.G_MISS_CHAR
2221: THEN
2222: BEGIN
2223: SELECT 'X'
2224: INTO l_check
2228: EXCEPTION
2229: WHEN NO_DATA_FOUND THEN
2230: Fnd_Message.SET_NAME('CSD', 'CSD_ERR_PROD_TXN_STATUS');
2231: Fnd_Msg_Pub.ADD;
2232: RAISE Fnd_Api.G_EXC_ERROR;
2233: END;
2234: END IF;
2235:
2236: Debug('Validate action type', l_mod_name, C_STATEMENT_LEVEL);
2234: END IF;
2235:
2236: Debug('Validate action type', l_mod_name, C_STATEMENT_LEVEL);
2237:
2238: IF NVL(p_product_txn_rec.action_type, Fnd_Api.G_MISS_CHAR) <>
2239: Fnd_Api.G_MISS_CHAR
2240: THEN
2241: -- Validate the Action Type
2242: IF NOT
2235:
2236: Debug('Validate action type', l_mod_name, C_STATEMENT_LEVEL);
2237:
2238: IF NVL(p_product_txn_rec.action_type, Fnd_Api.G_MISS_CHAR) <>
2239: Fnd_Api.G_MISS_CHAR
2240: THEN
2241: -- Validate the Action Type
2242: IF NOT
2243: (Csd_Process_Util.Validate_action_type(p_action_type => p_product_txn_rec.action_type))
2241: -- Validate the Action Type
2242: IF NOT
2243: (Csd_Process_Util.Validate_action_type(p_action_type => p_product_txn_rec.action_type))
2244: THEN
2245: RAISE Fnd_Api.G_EXC_ERROR;
2246: END IF;
2247: END IF;
2248:
2249: Debug('Validate action code', l_mod_name, C_STATEMENT_LEVEL);
2247: END IF;
2248:
2249: Debug('Validate action code', l_mod_name, C_STATEMENT_LEVEL);
2250:
2251: IF NVL(p_product_txn_rec.action_code, Fnd_Api.G_MISS_CHAR) <>
2252: Fnd_Api.G_MISS_CHAR
2253: THEN
2254: -- Validate the Action code
2255: IF NOT
2248:
2249: Debug('Validate action code', l_mod_name, C_STATEMENT_LEVEL);
2250:
2251: IF NVL(p_product_txn_rec.action_code, Fnd_Api.G_MISS_CHAR) <>
2252: Fnd_Api.G_MISS_CHAR
2253: THEN
2254: -- Validate the Action code
2255: IF NOT
2256: (Csd_Process_Util.Validate_action_code(p_action_code => p_product_txn_rec.action_code))
2254: -- Validate the Action code
2255: IF NOT
2256: (Csd_Process_Util.Validate_action_code(p_action_code => p_product_txn_rec.action_code))
2257: THEN
2258: RAISE Fnd_Api.G_EXC_ERROR;
2259: END IF;
2260: END IF;
2261:
2262: -- swai bug 6903344
2266: p_org_id => p_product_txn_rec.organization_id,
2267: x_line_type_id => p_product_txn_rec.line_type_id,
2268: x_line_category_code => p_product_txn_rec.line_category_code,
2269: x_return_status => l_return_status);
2270: IF NOT (l_return_status = Fnd_Api.G_RET_STS_SUCCESS)
2271: THEN
2272: Debug('csd_process_util.get_line_type failed',
2273: l_mod_name,
2274: C_STATEMENT_LEVEL);
2271: THEN
2272: Debug('csd_process_util.get_line_type failed',
2273: l_mod_name,
2274: C_STATEMENT_LEVEL);
2275: RAISE Fnd_Api.G_EXC_ERROR;
2276: END IF;
2277:
2278: --R12 Development pick rule changes begin
2279: Debug('Validating picking rule if passed[' ||
2288: IF (cur_pick_rules%NOTFOUND)
2289: THEN
2290: Fnd_Message.SET_NAME('CSD', 'CSD_INV_PICK_RULE');
2291: Fnd_Msg_Pub.ADD;
2292: RAISE Fnd_Api.G_EXC_ERROR;
2293: END IF;
2294: END IF;
2295: --R12 Development pick rule changes End
2296:
2294: END IF;
2295: --R12 Development pick rule changes End
2296:
2297:
2298: IF NVL(l_est_detail_id, Fnd_Api.G_MISS_NUM) <>
2299: Fnd_Api.G_MISS_NUM
2300: THEN
2301: IF l_est_detail_id <> p_prodtxn_db_attr.est_detail_id
2302: THEN
2295: --R12 Development pick rule changes End
2296:
2297:
2298: IF NVL(l_est_detail_id, Fnd_Api.G_MISS_NUM) <>
2299: Fnd_Api.G_MISS_NUM
2300: THEN
2301: IF l_est_detail_id <> p_prodtxn_db_attr.est_detail_id
2302: THEN
2303: Debug('The estimate detail id cannot to changed',
2302: THEN
2303: Debug('The estimate detail id cannot to changed',
2304: l_mod_name,
2305: C_STATEMENT_LEVEL);
2306: RAISE Fnd_Api.G_EXC_ERROR;
2307: END IF;
2308: ELSE
2309: l_est_detail_id := p_prodtxn_db_attr.est_detail_id;
2310: END IF;
2308: ELSE
2309: l_est_detail_id := p_prodtxn_db_attr.est_detail_id;
2310: END IF;
2311:
2312: IF NVL(l_repair_line_id, Fnd_Api.G_MISS_NUM) <>
2313: Fnd_Api.G_MISS_NUM
2314: THEN
2315: IF l_repair_line_id <> p_prodtxn_db_attr.repair_line_id
2316: THEN
2309: l_est_detail_id := p_prodtxn_db_attr.est_detail_id;
2310: END IF;
2311:
2312: IF NVL(l_repair_line_id, Fnd_Api.G_MISS_NUM) <>
2313: Fnd_Api.G_MISS_NUM
2314: THEN
2315: IF l_repair_line_id <> p_prodtxn_db_attr.repair_line_id
2316: THEN
2317: Debug('The repair line id cannot to changed',
2316: THEN
2317: Debug('The repair line id cannot to changed',
2318: l_mod_name,
2319: C_STATEMENT_LEVEL);
2320: RAISE Fnd_Api.G_EXC_ERROR;
2321: END IF;
2322: ELSE
2323: l_repair_line_id := p_prodtxn_db_attr.repair_line_id;
2324: END IF;
2344: WHERE estimate_detail_id = l_est_detail_id;
2345: EXCEPTION
2346: WHEN NO_DATA_FOUND THEN
2347: Debug('No Business business_process_id', l_mod_name, C_STATEMENT_LEVEL);
2348: RAISE Fnd_Api.G_EXC_ERROR;
2349: WHEN TOO_MANY_ROWS THEN
2350: Debug('Too many business_process_id', l_mod_name, C_STATEMENT_LEVEL);
2351: RAISE Fnd_Api.G_EXC_ERROR;
2352: END;
2347: Debug('No Business business_process_id', l_mod_name, C_STATEMENT_LEVEL);
2348: RAISE Fnd_Api.G_EXC_ERROR;
2349: WHEN TOO_MANY_ROWS THEN
2350: Debug('Too many business_process_id', l_mod_name, C_STATEMENT_LEVEL);
2351: RAISE Fnd_Api.G_EXC_ERROR;
2352: END;
2353:
2354: Debug('contract_line_id =' || p_product_txn_rec.contract_id,
2355: l_mod_name,
2356: C_STATEMENT_LEVEL);
2357: Debug('l_bus_process_id =' || l_bus_process_id, l_mod_name, C_STATEMENT_LEVEL);
2358:
2359: IF ((p_product_txn_rec.transaction_type_id IS NULL) OR
2360: (p_product_txn_rec.transaction_type_id = Fnd_Api.G_MISS_NUM)) AND
2361: (p_product_txn_rec.txn_billing_type_id IS NOT NULL)
2362: THEN
2363: BEGIN
2364: SELECT transaction_type_id
2387: l_mod_name,
2388: C_STATEMENT_LEVEL);
2389: END IF;
2390:
2391: IF NVL(p_product_txn_rec.contract_id, Fnd_Api.G_MISS_NUM) <>
2392: Fnd_Api.G_MISS_NUM
2393: THEN
2394: NULL;
2395: /*********************************
2388: C_STATEMENT_LEVEL);
2389: END IF;
2390:
2391: IF NVL(p_product_txn_rec.contract_id, Fnd_Api.G_MISS_NUM) <>
2392: Fnd_Api.G_MISS_NUM
2393: THEN
2394: NULL;
2395: /*********************************
2396: Gettting the coverage details code is removed from here.
2407: -- through except walk-in-receipt, which is no longer supported.
2408: -- We should allow RMA line creation without Serial number for
2409: -- all action types.
2410: /***********
2411: IF NVL(p_product_txn_rec.inventory_item_id, Fnd_Api.G_MISS_NUM) <>
2412: Fnd_Api.G_MISS_NUM
2413: THEN
2414:
2415: l_serial_flag := Csd_Process_Util.Is_item_serialized(p_product_txn_rec.inventory_item_id);
2408: -- We should allow RMA line creation without Serial number for
2409: -- all action types.
2410: /***********
2411: IF NVL(p_product_txn_rec.inventory_item_id, Fnd_Api.G_MISS_NUM) <>
2412: Fnd_Api.G_MISS_NUM
2413: THEN
2414:
2415: l_serial_flag := Csd_Process_Util.Is_item_serialized(p_product_txn_rec.inventory_item_id);
2416:
2416:
2417: IF l_serial_flag AND
2418: -- Changing it from serial_number to source_serial_number 11.5.10
2419: NVL(p_product_txn_rec.source_serial_number,
2420: Fnd_Api.G_MISS_CHAR) = Fnd_Api.G_MISS_CHAR AND
2421: p_product_txn_rec.action_type NOT IN
2422: ('SHIP', 'WALK_IN_ISSUE') AND
2423: (p_product_txn_rec.action_code <> 'LOANER' AND
2424: p_product_txn_rec.action_type <> 'RMA')
2430: Debug('Serial Number missing for inventory_item_id =' ||
2431: p_product_txn_rec.inventory_item_id,
2432: l_mod_name,
2433: C_STATEMENT_LEVEL);
2434: RAISE Fnd_Api.G_EXC_ERROR;
2435: END IF;
2436: END IF;
2437: ***********/
2438:
2451:
2452: ELSIF (p_product_txn_rec.new_order_flag = 'Y')
2453: THEN
2454: x_add_to_order_flag := 'F';
2455: x_add_to_order_id := Fnd_Api.G_MISS_NUM;
2456: -- Fix for bug#4051707
2457: p_product_txn_rec.add_to_order_flag := 'F';
2458: p_product_txn_rec.order_header_id := Fnd_Api.G_MISS_NUM;
2459: END IF;
2454: x_add_to_order_flag := 'F';
2455: x_add_to_order_id := Fnd_Api.G_MISS_NUM;
2456: -- Fix for bug#4051707
2457: p_product_txn_rec.add_to_order_flag := 'F';
2458: p_product_txn_rec.order_header_id := Fnd_Api.G_MISS_NUM;
2459: END IF;
2460:
2461: Debug('l_upd_charge_flag =' || l_upd_charge_flag,
2462: l_mod_name,
2477: Csd_Process_Util.CONVERT_TO_CHG_REC(p_prod_txn_rec => p_product_txn_rec,
2478: x_charges_rec => l_Charges_Rec,
2479: x_return_status => l_return_status);
2480:
2481: IF NOT (l_return_status = Fnd_Api.G_RET_STS_SUCCESS)
2482: THEN
2483: Debug('csd_process_util.convert_to_chg_rec failed',
2484: l_mod_name,
2485: C_STATEMENT_LEVEL);
2482: THEN
2483: Debug('csd_process_util.convert_to_chg_rec failed',
2484: l_mod_name,
2485: C_STATEMENT_LEVEL);
2486: RAISE Fnd_Api.G_EXC_ERROR;
2487: END IF;
2488:
2489: l_Charges_Rec.estimate_detail_id := l_est_detail_id;
2490: l_Charges_Rec.business_process_id := l_bus_process_id;
2497: l_mod_name,
2498: C_STATEMENT_LEVEL);
2499:
2500: Csd_Process_Pvt.PROCESS_CHARGE_LINES(p_api_version => 1.0,
2501: p_commit => Fnd_Api.g_false,
2502: p_init_msg_list => Fnd_Api.g_false,
2503: p_validation_level => Fnd_Api.g_valid_level_full,
2504: p_action => 'UPDATE',
2505: p_Charges_Rec => l_Charges_Rec,
2498: C_STATEMENT_LEVEL);
2499:
2500: Csd_Process_Pvt.PROCESS_CHARGE_LINES(p_api_version => 1.0,
2501: p_commit => Fnd_Api.g_false,
2502: p_init_msg_list => Fnd_Api.g_false,
2503: p_validation_level => Fnd_Api.g_valid_level_full,
2504: p_action => 'UPDATE',
2505: p_Charges_Rec => l_Charges_Rec,
2506: x_estimate_detail_id => l_tmp_id,
2499:
2500: Csd_Process_Pvt.PROCESS_CHARGE_LINES(p_api_version => 1.0,
2501: p_commit => Fnd_Api.g_false,
2502: p_init_msg_list => Fnd_Api.g_false,
2503: p_validation_level => Fnd_Api.g_valid_level_full,
2504: p_action => 'UPDATE',
2505: p_Charges_Rec => l_Charges_Rec,
2506: x_estimate_detail_id => l_tmp_id,
2507: x_return_status => l_return_status,
2507: x_return_status => l_return_status,
2508: x_msg_count => l_msg_count,
2509: x_msg_data => l_msg_data);
2510:
2511: IF NOT (l_return_status = Fnd_Api.G_RET_STS_SUCCESS)
2512: THEN
2513: Debug('process_charge_lines failed ', l_mod_name, C_STATEMENT_LEVEL);
2514: RAISE Fnd_Api.G_EXC_ERROR;
2515: END IF;
2510:
2511: IF NOT (l_return_status = Fnd_Api.G_RET_STS_SUCCESS)
2512: THEN
2513: Debug('process_charge_lines failed ', l_mod_name, C_STATEMENT_LEVEL);
2514: RAISE Fnd_Api.G_EXC_ERROR;
2515: END IF;
2516:
2517: END IF;
2518:
2531: p_ACTION_TYPE => p_product_txn_rec.ACTION_TYPE,
2532: p_ACTION_CODE => p_product_txn_rec.ACTION_CODE,
2533: p_LOT_NUMBER => p_product_txn_rec.LOT_NUMBER,
2534: p_SUB_INVENTORY => p_product_txn_rec.SUB_INVENTORY,
2535: p_INTERFACE_TO_OM_FLAG => Fnd_Api.G_MISS_CHAR,
2536: p_BOOK_SALES_ORDER_FLAG => Fnd_Api.G_MISS_CHAR,
2537: p_RELEASE_SALES_ORDER_FLAG => Fnd_Api.G_MISS_CHAR,
2538: p_SHIP_SALES_ORDER_FLAG => Fnd_Api.G_MISS_CHAR,
2539: p_PROD_TXN_STATUS => Fnd_Api.G_MISS_CHAR,
2532: p_ACTION_CODE => p_product_txn_rec.ACTION_CODE,
2533: p_LOT_NUMBER => p_product_txn_rec.LOT_NUMBER,
2534: p_SUB_INVENTORY => p_product_txn_rec.SUB_INVENTORY,
2535: p_INTERFACE_TO_OM_FLAG => Fnd_Api.G_MISS_CHAR,
2536: p_BOOK_SALES_ORDER_FLAG => Fnd_Api.G_MISS_CHAR,
2537: p_RELEASE_SALES_ORDER_FLAG => Fnd_Api.G_MISS_CHAR,
2538: p_SHIP_SALES_ORDER_FLAG => Fnd_Api.G_MISS_CHAR,
2539: p_PROD_TXN_STATUS => Fnd_Api.G_MISS_CHAR,
2540: p_PROD_TXN_CODE => p_product_txn_rec.PROD_TXN_CODE,
2533: p_LOT_NUMBER => p_product_txn_rec.LOT_NUMBER,
2534: p_SUB_INVENTORY => p_product_txn_rec.SUB_INVENTORY,
2535: p_INTERFACE_TO_OM_FLAG => Fnd_Api.G_MISS_CHAR,
2536: p_BOOK_SALES_ORDER_FLAG => Fnd_Api.G_MISS_CHAR,
2537: p_RELEASE_SALES_ORDER_FLAG => Fnd_Api.G_MISS_CHAR,
2538: p_SHIP_SALES_ORDER_FLAG => Fnd_Api.G_MISS_CHAR,
2539: p_PROD_TXN_STATUS => Fnd_Api.G_MISS_CHAR,
2540: p_PROD_TXN_CODE => p_product_txn_rec.PROD_TXN_CODE,
2541: p_LAST_UPDATE_DATE => SYSDATE,
2534: p_SUB_INVENTORY => p_product_txn_rec.SUB_INVENTORY,
2535: p_INTERFACE_TO_OM_FLAG => Fnd_Api.G_MISS_CHAR,
2536: p_BOOK_SALES_ORDER_FLAG => Fnd_Api.G_MISS_CHAR,
2537: p_RELEASE_SALES_ORDER_FLAG => Fnd_Api.G_MISS_CHAR,
2538: p_SHIP_SALES_ORDER_FLAG => Fnd_Api.G_MISS_CHAR,
2539: p_PROD_TXN_STATUS => Fnd_Api.G_MISS_CHAR,
2540: p_PROD_TXN_CODE => p_product_txn_rec.PROD_TXN_CODE,
2541: p_LAST_UPDATE_DATE => SYSDATE,
2542: p_CREATION_DATE => SYSDATE,
2535: p_INTERFACE_TO_OM_FLAG => Fnd_Api.G_MISS_CHAR,
2536: p_BOOK_SALES_ORDER_FLAG => Fnd_Api.G_MISS_CHAR,
2537: p_RELEASE_SALES_ORDER_FLAG => Fnd_Api.G_MISS_CHAR,
2538: p_SHIP_SALES_ORDER_FLAG => Fnd_Api.G_MISS_CHAR,
2539: p_PROD_TXN_STATUS => Fnd_Api.G_MISS_CHAR,
2540: p_PROD_TXN_CODE => p_product_txn_rec.PROD_TXN_CODE,
2541: p_LAST_UPDATE_DATE => SYSDATE,
2542: p_CREATION_DATE => SYSDATE,
2543: p_LAST_UPDATED_BY => Fnd_Global.USER_ID,
2656:
2657:
2658: BEGIN
2659:
2660: x_return_status := Fnd_Api.G_Ret_Sts_SUCCESS;
2661:
2662: IF p_prodtxn_db_attr.curr_submit_order_flag <>
2663: p_product_txn_rec.interface_to_om_flag AND
2664: p_product_txn_rec.interface_to_om_flag = 'Y'
2708:
2709: Csd_Process_Util.Validate_wip_task(p_prod_txn_id => p_product_txn_rec.product_transaction_id,
2710: x_return_status => l_return_status);
2711:
2712: IF NOT (l_return_status = Fnd_Api.G_RET_STS_SUCCESS)
2713: THEN
2714: Debug('Validate_wip_task failed',
2715: l_mod_name,
2716: 1);
2766: FND_PROFILE.PUT('CSD_UNIT_NUMBER', p_product_txn_rec.unit_number);
2767: end if;
2768:
2769: Csd_Process_Pvt.PROCESS_SALES_ORDER(p_api_version => 1.0,
2770: p_commit => Fnd_Api.g_false,
2771: p_init_msg_list => Fnd_Api.g_true,
2772: p_validation_level => Fnd_Api.g_valid_level_full,
2773: p_action => 'CREATE',
2774: p_order_rec => px_order_rec,
2767: end if;
2768:
2769: Csd_Process_Pvt.PROCESS_SALES_ORDER(p_api_version => 1.0,
2770: p_commit => Fnd_Api.g_false,
2771: p_init_msg_list => Fnd_Api.g_true,
2772: p_validation_level => Fnd_Api.g_valid_level_full,
2773: p_action => 'CREATE',
2774: p_order_rec => px_order_rec,
2775: x_return_status => l_return_status,
2768:
2769: Csd_Process_Pvt.PROCESS_SALES_ORDER(p_api_version => 1.0,
2770: p_commit => Fnd_Api.g_false,
2771: p_init_msg_list => Fnd_Api.g_true,
2772: p_validation_level => Fnd_Api.g_valid_level_full,
2773: p_action => 'CREATE',
2774: p_order_rec => px_order_rec,
2775: x_return_status => l_return_status,
2776: x_msg_count => l_msg_count,
2780: if (p_product_txn_rec.unit_number) is not null then
2781: FND_PROFILE.PUT('CSD_UNIT_NUMBER',null);
2782: end if;
2783:
2784: IF NOT (l_return_status = Fnd_Api.G_RET_STS_SUCCESS)
2785: THEN
2786: Debug('process_sales_order failed', l_mod_name, 1);
2787: RAISE CREATE_ORDER;
2788: END IF;
2827: if (((p_product_txn_rec.project_id is not null)
2828: OR (p_product_txn_rec.unit_number is not null)
2829: OR (p_product_txn_rec.sub_inventory is not null) ----bug#9955988
2830: OR (p_product_txn_rec.action_type in ('RMA_THIRD_PTY', 'SHIP_THIRD_PTY')))
2831: and ((NVL(p_product_txn_rec.project_id,-1)) <> FND_API.G_MISS_NUM)) then --bug#6075825
2832:
2833: OPEN order_line_cu(p_prodtxn_db_attr.est_detail_id);
2834: FETCH order_line_cu into l_order_line_id, l_p_ship_from_org_id;
2835: CLOSE order_line_cu;
2890: x_msg_count => l_msg_count,
2891: x_msg_data => l_msg_data
2892: );
2893:
2894: IF NOT(x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
2895: FND_MESSAGE.SET_NAME('CSD','CSD_ERR_OM_PROCESS_LINE');
2896: FND_MSG_PUB.ADD;
2897: RAISE CREATE_ORDER;
2898: END IF;
2909: Debug('In Create_order exception while submitting the charge line =' ||
2910: p_product_txn_rec.PRODUCT_TRANSACTION_ID,
2911: l_mod_name,
2912: 1);
2913: x_return_status := Fnd_Api.G_Ret_Sts_ERROR;
2914: WHEN OTHERS THEN
2915: Debug('In OTHERS exception while submitting the charge line =' ||
2916: p_product_txn_rec.PRODUCT_TRANSACTION_ID,
2917: l_mod_name,
2915: Debug('In OTHERS exception while submitting the charge line =' ||
2916: p_product_txn_rec.PRODUCT_TRANSACTION_ID,
2917: l_mod_name,
2918: 1);
2919: x_return_status := Fnd_Api.G_Ret_Sts_ERROR;
2920:
2921: END interface_prodtxn;
2922:
2923:
2977: Debug('l_est_detail_id = ' || p_product_txn_rec.estimate_detail_id,
2978: l_mod_name,
2979: 1);
2980:
2981: x_return_status := Fnd_Api.G_Ret_Sts_SUCCESS;
2982: BEGIN
2983: SELECT b.order_header_id,
2984: b.order_line_id,
2985: a.booked_flag
3085: if (((p_product_txn_rec.project_id is not null)
3086: OR (p_product_txn_rec.unit_number is not null)
3087: OR (p_product_txn_rec.sub_inventory is not null) ----bug#9955988
3088: OR (p_product_txn_rec.action_type in ('RMA_THIRD_PTY', 'SHIP_THIRD_PTY')))
3089: and ((NVL(p_product_txn_rec.project_id,-1)) <> FND_API.G_MISS_NUM)) then --bug#6075825
3090:
3091: if (l_order_line_id) is not null then
3092: l_Line_Tbl_Type(1) := OE_Order_PUB.G_MISS_LINE_REC;
3093: l_Line_Tbl_Type(1).line_id := l_order_line_id;
3144: x_msg_count => l_msg_count,
3145: x_msg_data => l_msg_data
3146: );
3147:
3148: IF NOT(x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
3149: FND_MESSAGE.SET_NAME('CSD','CSD_ERR_OM_PROCESS_LINE');
3150: FND_MSG_PUB.ADD;
3151: RAISE BOOK_ORDER;
3152: END IF;
3161: l_mod_name,
3162: 1);
3163:
3164: Csd_Process_Pvt.PROCESS_SALES_ORDER(p_api_version => 1.0,
3165: p_commit => Fnd_Api.g_false,
3166: p_init_msg_list => Fnd_Api.g_false,
3167: p_validation_level => Fnd_Api.g_valid_level_full,
3168: p_action => 'BOOK',
3169: p_order_rec => px_order_rec,
3162: 1);
3163:
3164: Csd_Process_Pvt.PROCESS_SALES_ORDER(p_api_version => 1.0,
3165: p_commit => Fnd_Api.g_false,
3166: p_init_msg_list => Fnd_Api.g_false,
3167: p_validation_level => Fnd_Api.g_valid_level_full,
3168: p_action => 'BOOK',
3169: p_order_rec => px_order_rec,
3170: x_return_status => l_return_status,
3163:
3164: Csd_Process_Pvt.PROCESS_SALES_ORDER(p_api_version => 1.0,
3165: p_commit => Fnd_Api.g_false,
3166: p_init_msg_list => Fnd_Api.g_false,
3167: p_validation_level => Fnd_Api.g_valid_level_full,
3168: p_action => 'BOOK',
3169: p_order_rec => px_order_rec,
3170: x_return_status => l_return_status,
3171: x_msg_count => l_msg_count,
3170: x_return_status => l_return_status,
3171: x_msg_count => l_msg_count,
3172: x_msg_data => l_msg_data);
3173:
3174: IF NOT (l_return_status = Fnd_Api.G_RET_STS_SUCCESS)
3175: THEN
3176: Debug('Process_sales_order failed',
3177: l_mod_name,
3178: 1);
3195: -- END IF;
3196:
3197: -- Fix for bug#4020651
3198: Csd_Update_Programs_Pvt.prod_txn_status_upd(p_repair_line_id => p_product_txn_rec.repair_line_id,
3199: p_commit => Fnd_Api.g_false);
3200:
3201: UPDATE CSD_REPAIRS
3202: SET ro_txn_status = 'OM_BOOKED'
3203: WHERE repair_line_id =
3231: -- END IF;
3232:
3233: -- Fix for bug#4020651
3234: Csd_Update_Programs_Pvt.prod_txn_status_upd(p_repair_line_id => p_product_txn_rec.repair_line_id,
3235: p_commit => Fnd_Api.g_false);
3236:
3237: UPDATE CSD_REPAIRS
3238: SET ro_txn_status = 'OM_BOOKED'
3239: WHERE repair_line_id =
3255: Debug('In Book_order exception while booking the order line =' ||
3256: p_product_txn_rec.PRODUCT_TRANSACTION_ID,
3257: l_mod_name,
3258: 1);
3259: x_return_status := Fnd_Api.G_Ret_Sts_ERROR;
3260: WHEN OTHERS THEN
3261: Debug('In OTHERS exception while booking the order line =' ||
3262: p_product_txn_rec.PRODUCT_TRANSACTION_ID,
3263: l_mod_name,
3261: Debug('In OTHERS exception while booking the order line =' ||
3262: p_product_txn_rec.PRODUCT_TRANSACTION_ID,
3263: l_mod_name,
3264: 1);
3265: x_return_status := Fnd_Api.G_Ret_Sts_ERROR;
3266:
3267: END book_prodtxn;
3268:
3269:
3304: /* R12 SN reservations integration change End */
3305:
3306:
3307: BEGIN
3308: x_return_status := Fnd_Api.G_Ret_Sts_SUCCESS;
3309:
3310: BEGIN
3311: /* Adding order_header_id and order_line_id in the select list
3312: for serial reservations change for R12, Vijay June 9th 2006 */
3323: RAISE RELEASE_ORDER;
3324: END;
3325:
3326: IF NVL(p_product_txn_rec.sub_inventory,
3327: Fnd_Api.G_MISS_CHAR) <> Fnd_Api.G_MISS_CHAR
3328: THEN
3329: px_order_rec.PICK_FROM_SUBINVENTORY := p_product_txn_rec.sub_inventory;
3330: END IF;
3331:
3377:
3378: Debug('Calling reserve serial..', l_mod_name, 1);
3379: Reserve_serial_number(l_serial_rsv_rec, l_return_status);
3380:
3381: if(l_return_status = FND_API.G_RET_STS_ERROR) THEN
3382: Fnd_Message.SET_NAME('CSD',
3383: 'CSD_SRL_RESERVE_FAILED');
3384: Fnd_Msg_Pub.ADD;
3385: RAISE RELEASE_ORDER;
3536: Debug('Call process_sales_order to Release SO',
3537: l_mod_name,
3538: 1);
3539: Csd_Process_Pvt.PROCESS_SALES_ORDER(p_api_version => 1.0,
3540: p_commit => Fnd_Api.g_false,
3541: p_init_msg_list => Fnd_Api.g_false,
3542: p_validation_level => Fnd_Api.g_valid_level_full,
3543: p_action => 'PICK-RELEASE',
3544: p_order_rec => px_order_rec,
3537: l_mod_name,
3538: 1);
3539: Csd_Process_Pvt.PROCESS_SALES_ORDER(p_api_version => 1.0,
3540: p_commit => Fnd_Api.g_false,
3541: p_init_msg_list => Fnd_Api.g_false,
3542: p_validation_level => Fnd_Api.g_valid_level_full,
3543: p_action => 'PICK-RELEASE',
3544: p_order_rec => px_order_rec,
3545: p_product_txn_rec => p_product_txn_rec,
3538: 1);
3539: Csd_Process_Pvt.PROCESS_SALES_ORDER(p_api_version => 1.0,
3540: p_commit => Fnd_Api.g_false,
3541: p_init_msg_list => Fnd_Api.g_false,
3542: p_validation_level => Fnd_Api.g_valid_level_full,
3543: p_action => 'PICK-RELEASE',
3544: p_order_rec => px_order_rec,
3545: p_product_txn_rec => p_product_txn_rec,
3546: x_return_status => l_return_status,
3546: x_return_status => l_return_status,
3547: x_msg_count => l_msg_count,
3548: x_msg_data => l_msg_data);
3549:
3550: IF NOT (l_return_status = Fnd_Api.G_RET_STS_SUCCESS)
3551: THEN
3552: Debug('process_sales_order failed, x_msg_data['||l_msg_data||']',
3553: l_mod_name,
3554: 1);
3651: Debug('In Release_order exception while releasing SO =' ||
3652: p_product_txn_rec.PRODUCT_TRANSACTION_ID,
3653: l_mod_name,
3654: 1);
3655: x_return_status := Fnd_Api.G_Ret_Sts_ERROR;
3656: WHEN OTHERS THEN
3657: Debug('In OTHERS exception while releasing SO =' ||
3658: p_product_txn_rec.PRODUCT_TRANSACTION_ID,
3659: l_mod_name,
3661: Debug('In OTHERS exception while releasing SO sqlerr=' ||
3662: sqlerrm,
3663: l_mod_name,
3664: 1);
3665: x_return_status := Fnd_Api.G_Ret_Sts_ERROR;
3666:
3667:
3668: END pickrelease_prodtxn;
3669:
3694: BEGIN
3695: Debug('l_est_detail_id = ' || p_product_txn_rec.estimate_detail_id,
3696: l_mod_name,
3697: 1);
3698: x_return_status := Fnd_Api.G_Ret_Sts_SUCCESS;
3699: BEGIN
3700: SELECT b.order_header_id,
3701: b.order_line_id,
3702: c.source_serial_number,
3776: Debug('Call Process_sales_order to ship SO',
3777: l_mod_name,
3778: 1);
3779: Csd_Process_Pvt.PROCESS_SALES_ORDER(p_api_version => 1.0,
3780: p_commit => Fnd_Api.g_false,
3781: p_init_msg_list => Fnd_Api.g_false,
3782: p_validation_level => Fnd_Api.g_valid_level_full,
3783: p_action => 'SHIP',
3784: /*Fixed for bug#4433942 passing product
3777: l_mod_name,
3778: 1);
3779: Csd_Process_Pvt.PROCESS_SALES_ORDER(p_api_version => 1.0,
3780: p_commit => Fnd_Api.g_false,
3781: p_init_msg_list => Fnd_Api.g_false,
3782: p_validation_level => Fnd_Api.g_valid_level_full,
3783: p_action => 'SHIP',
3784: /*Fixed for bug#4433942 passing product
3785: txn record as in parameter*/
3778: 1);
3779: Csd_Process_Pvt.PROCESS_SALES_ORDER(p_api_version => 1.0,
3780: p_commit => Fnd_Api.g_false,
3781: p_init_msg_list => Fnd_Api.g_false,
3782: p_validation_level => Fnd_Api.g_valid_level_full,
3783: p_action => 'SHIP',
3784: /*Fixed for bug#4433942 passing product
3785: txn record as in parameter*/
3786: p_product_txn_rec => p_product_txn_rec,
3788: x_return_status => l_return_status,
3789: x_msg_count => l_msg_count,
3790: x_msg_data => l_msg_data);
3791:
3792: IF NOT (l_return_status = Fnd_Api.G_RET_STS_SUCCESS)
3793: THEN
3794: Debug('Process_sales_order failed',
3795: l_mod_name,
3796: 1);
3909: Debug('In ship_order exception while shipping SO =' ||
3910: p_product_txn_rec.PRODUCT_TRANSACTION_ID,
3911: l_mod_name,
3912: 1);
3913: x_return_status := Fnd_Api.G_Ret_Sts_ERROR;
3914: WHEN OTHERS THEN
3915: Debug('In OTHERS exception while shipping SO =' ||
3916: p_product_txn_rec.PRODUCT_TRANSACTION_ID,
3917: l_mod_name,
3915: Debug('In OTHERS exception while shipping SO =' ||
3916: p_product_txn_rec.PRODUCT_TRANSACTION_ID,
3917: l_mod_name,
3918: 1);
3919: x_return_status := Fnd_Api.G_Ret_Sts_ERROR;
3920: END ship_prodtxn;
3921:
3922:
3923: --bug#7551068
3974: 'Entering cancel_prodtxn');
3975: --dbms_output.put_line('Entering');
3976: END IF;
3977:
3978: IF NOT Fnd_Api.Compatible_API_Call(l_api_version,
3979: p_api_version,
3980: l_api_name,
3981: G_PKG_NAME)
3982: THEN
3979: p_api_version,
3980: l_api_name,
3981: G_PKG_NAME)
3982: THEN
3983: RAISE Fnd_Api.G_EXC_UNEXPECTED_ERROR;
3984: END IF;
3985:
3986:
3987: -- Initialize message list if p_init_msg_list is set to TRUE.
3984: END IF;
3985:
3986:
3987: -- Initialize message list if p_init_msg_list is set to TRUE.
3988: IF Fnd_Api.to_Boolean(p_init_msg_list)
3989: THEN
3990: Fnd_Msg_Pub.initialize;
3991: oe_Msg_Pub.initialize;
3992: END IF;
3990: Fnd_Msg_Pub.initialize;
3991: oe_Msg_Pub.initialize;
3992: END IF;
3993: -- Initialize API return status to success
3994: x_return_status := Fnd_Api.G_RET_STS_SUCCESS;
3995: -- ---------------
3996:
3997: OPEN c_get_org_id (p_order_header_id);
3998: FETCH c_get_org_id INTO l_org_id;
4042: ----dbms_output.put_line('ret msg=['||x_msg_data||']');
4043: --dbms_output.put_line('ret msg count=['||x_msg_count||']');
4044:
4045: -- Check return status from the above procedure call
4046: IF x_return_status = Fnd_Api.G_RET_STS_ERROR THEN
4047: RAISE Fnd_Api.G_EXC_ERROR;
4048: ELSIF x_return_status = Fnd_Api.G_RET_STS_UNEXP_ERROR THEN
4049: RAISE Fnd_Api.G_EXC_UNEXPECTED_ERROR;
4050: END IF;
4043: --dbms_output.put_line('ret msg count=['||x_msg_count||']');
4044:
4045: -- Check return status from the above procedure call
4046: IF x_return_status = Fnd_Api.G_RET_STS_ERROR THEN
4047: RAISE Fnd_Api.G_EXC_ERROR;
4048: ELSIF x_return_status = Fnd_Api.G_RET_STS_UNEXP_ERROR THEN
4049: RAISE Fnd_Api.G_EXC_UNEXPECTED_ERROR;
4050: END IF;
4051:
4044:
4045: -- Check return status from the above procedure call
4046: IF x_return_status = Fnd_Api.G_RET_STS_ERROR THEN
4047: RAISE Fnd_Api.G_EXC_ERROR;
4048: ELSIF x_return_status = Fnd_Api.G_RET_STS_UNEXP_ERROR THEN
4049: RAISE Fnd_Api.G_EXC_UNEXPECTED_ERROR;
4050: END IF;
4051:
4052: --Update the product transactions table with the cancelled status.
4045: -- Check return status from the above procedure call
4046: IF x_return_status = Fnd_Api.G_RET_STS_ERROR THEN
4047: RAISE Fnd_Api.G_EXC_ERROR;
4048: ELSIF x_return_status = Fnd_Api.G_RET_STS_UNEXP_ERROR THEN
4049: RAISE Fnd_Api.G_EXC_UNEXPECTED_ERROR;
4050: END IF;
4051:
4052: --Update the product transactions table with the cancelled status.
4053: --
4059: OBJECT_VERSION_NUMBER = OBJECT_VERSION_NUMBER+1
4060: WHERE product_transaction_id = p_prod_txn_id;
4061:
4062: IF SQL%NOTFOUND THEN
4063: RAISE Fnd_Api.G_EXC_UNEXPECTED_ERROR;
4064: END IF;
4065: -- -------------------
4066: -- Api body ends here
4067: -- -------------------
4065: -- -------------------
4066: -- Api body ends here
4067: -- -------------------
4068: -- Standard check of p_commit.
4069: IF Fnd_Api.To_Boolean(p_commit)
4070: THEN
4071: COMMIT WORK;
4072: END IF;
4073:
4086: p_data => x_msg_data);
4087: end if;
4088:
4089: EXCEPTION
4090: WHEN Fnd_Api.g_exc_error THEN
4091: x_return_status := Fnd_Api.g_ret_sts_error;
4092: ROLLBACK TO CANCEL_PRODTXN_PVT;
4093: Fnd_Msg_Pub.count_and_get(p_count => x_msg_count,
4094: p_data => x_msg_data);
4087: end if;
4088:
4089: EXCEPTION
4090: WHEN Fnd_Api.g_exc_error THEN
4091: x_return_status := Fnd_Api.g_ret_sts_error;
4092: ROLLBACK TO CANCEL_PRODTXN_PVT;
4093: Fnd_Msg_Pub.count_and_get(p_count => x_msg_count,
4094: p_data => x_msg_data);
4095: if(x_msg_count = 0) then
4103: 'csd.plsql.csd_logistics_util.cancel_prodtxn',
4104: 'EXC_ERROR[' || x_msg_data || ']');
4105: END IF;
4106: --dbms_output.put_line('exec error raised');
4107: WHEN Fnd_Api.g_exc_unexpected_error THEN
4108: x_return_status := Fnd_Api.g_ret_sts_unexp_error;
4109: ROLLBACK TO CANCEL_PRODTXN_PVT;
4110: Fnd_Msg_Pub.count_and_get(p_count => x_msg_count,
4111: p_data => x_msg_data);
4104: 'EXC_ERROR[' || x_msg_data || ']');
4105: END IF;
4106: --dbms_output.put_line('exec error raised');
4107: WHEN Fnd_Api.g_exc_unexpected_error THEN
4108: x_return_status := Fnd_Api.g_ret_sts_unexp_error;
4109: ROLLBACK TO CANCEL_PRODTXN_PVT;
4110: Fnd_Msg_Pub.count_and_get(p_count => x_msg_count,
4111: p_data => x_msg_data);
4112: if(x_msg_count = 0) then
4121: 'EXC_UNEXP_ERROR[' || x_msg_data || ']');
4122: END IF;
4123: --dbms_output.put_line('unexpected error raised');
4124: WHEN OTHERS THEN
4125: x_return_status := Fnd_Api.g_ret_sts_unexp_error;
4126: ROLLBACK TO CANCEL_PRODTXN_PVT;
4127:
4128: IF Fnd_Msg_Pub.check_msg_level(Fnd_Msg_Pub.g_msg_lvl_unexp_error)
4129: THEN
4158:
4159: begin
4160: IF p_MSG_COUNT > 1 THEN
4161: FOR i IN 1..p_MSG_COUNT LOOP
4162: l_msg := apps.FND_MSG_PUB.Get(i,apps.FND_API.G_FALSE) ;
4163: --dbms_output.put_line('Msg Data : ' || l_msg ) ;
4164: END LOOP ;
4165: ELSE
4166: l_msg := apps.FND_MSG_PUB.Get(1,apps.FND_API.G_FALSE) ;
4162: l_msg := apps.FND_MSG_PUB.Get(i,apps.FND_API.G_FALSE) ;
4163: --dbms_output.put_line('Msg Data : ' || l_msg ) ;
4164: END LOOP ;
4165: ELSE
4166: l_msg := apps.FND_MSG_PUB.Get(1,apps.FND_API.G_FALSE) ;
4167: --dbms_output.put_line('Msg Data : ' || l_msg ) ;
4168: END IF ;
4169:
4170: end dbg_print_stack;
4359:
4360: -- Call the query_reservation api to find the existing reservations.
4361: INV_RESERVATION_PUB.QUERY_RESERVATION_OM_HDR_LINE (
4362: P_API_VERSION_NUMBER => 1,
4363: P_INIT_MSG_LST => FND_API.G_FALSE,
4364: X_RETURN_STATUS => X_RETURN_STATUS,
4365: X_MSG_COUNT => l_MSG_COUNT,
4366: X_MSG_DATA => l_MSG_DATA,
4367: p_query_input => l_rsv_qry_inp,
4459: END IF;
4460:
4461: INV_RESERVATION_PUB.UPDATE_RESERVATION (
4462: P_API_VERSION_NUMBER => 1,
4463: P_INIT_MSG_LST => FND_API.G_TRUE,
4464: X_RETURN_STATUS => X_RETURN_STATUS,
4465: X_MSG_COUNT => l_MSG_COUNT,
4466: X_MSG_DATA => l_MSG_DATA,
4467: p_original_rsv_rec => l_orig_rsv_rec,
4486: lx_serial_rsv_tbl.delete;
4487:
4488: INV_RESERVATION_PUB.CREATE_RESERVATION (
4489: P_API_VERSION_NUMBER => 1,
4490: P_INIT_MSG_LST => FND_API.G_FALSE,
4491: X_RETURN_STATUS => x_RETURN_STATUS,
4492: X_MSG_COUNT => l_MSG_COUNT,
4493: X_MSG_DATA => l_MSG_DATA,
4494: P_RSV_REC => l_RSV_REC,
4500: dbg_print_stack(l_msg_count);
4501: END IF;
4502:
4503: EXCEPTION
4504: WHEN Fnd_Api.g_exc_error THEN
4505: x_return_status := Fnd_Api.g_ret_sts_error;
4506:
4507: IF (Fnd_Log.level_error >= Fnd_Log.g_current_runtime_level)
4508: THEN
4501: END IF;
4502:
4503: EXCEPTION
4504: WHEN Fnd_Api.g_exc_error THEN
4505: x_return_status := Fnd_Api.g_ret_sts_error;
4506:
4507: IF (Fnd_Log.level_error >= Fnd_Log.g_current_runtime_level)
4508: THEN
4509: Fnd_Log.STRING(Fnd_Log.level_error,
4510: 'csd.plsql.csd_logistics_util.reserve_serial_number',
4511: 'EXC_ERROR[' || l_msg_data || ']');
4512: END IF;
4513: --dbms_output.put_line('exec error raised');
4514: WHEN Fnd_Api.g_exc_unexpected_error THEN
4515: x_return_status := Fnd_Api.g_ret_sts_unexp_error;
4516: IF (Fnd_Log.level_exception >= Fnd_Log.g_current_runtime_level)
4517: THEN
4518: Fnd_Log.STRING(Fnd_Log.level_exception,
4511: 'EXC_ERROR[' || l_msg_data || ']');
4512: END IF;
4513: --dbms_output.put_line('exec error raised');
4514: WHEN Fnd_Api.g_exc_unexpected_error THEN
4515: x_return_status := Fnd_Api.g_ret_sts_unexp_error;
4516: IF (Fnd_Log.level_exception >= Fnd_Log.g_current_runtime_level)
4517: THEN
4518: Fnd_Log.STRING(Fnd_Log.level_exception,
4519: 'csd.plsql.csd_logistics_util.reserve_serial_number',
4520: 'EXC_UNEXP_ERROR[' || l_msg_data || ']');
4521: END IF;
4522: --dbms_output.put_line('unexpected error raised');
4523: WHEN OTHERS THEN
4524: x_return_status := Fnd_Api.g_ret_sts_unexp_error;
4525: IF (Fnd_Log.level_exception >= Fnd_Log.g_current_runtime_level)
4526: THEN
4527: Fnd_Log.STRING(Fnd_Log.level_exception,
4528: 'csd.plsql.csd_logistics_util.reserve_serial_number',
4598:
4599: -- Call the query_reservation api to find the existing reservations.
4600: INV_RESERVATION_PUB.QUERY_RESERVATION_OM_HDR_LINE (
4601: P_API_VERSION_NUMBER => 1,
4602: P_INIT_MSG_LST => FND_API.G_FALSE,
4603: X_RETURN_STATUS => X_RETURN_STATUS,
4604: X_MSG_COUNT => l_MSG_COUNT,
4605: X_MSG_DATA => l_MSG_DATA,
4606: p_query_input => l_rsv_qry_inp,
4646: l_serial_rsv_tbl(1).serial_number := p_serial_reserve_rec.serial_number;
4647: -- Call the delete_reservation api to remove the existing reservations.
4648: INV_RESERVATION_PUB.DELETE_RESERVATION (
4649: P_API_VERSION_NUMBER => 1,
4650: P_INIT_MSG_LST => FND_API.G_FALSE,
4651: X_RETURN_STATUS => X_RETURN_STATUS,
4652: X_MSG_COUNT => l_MSG_COUNT,
4653: X_MSG_DATA => l_MSG_DATA,
4654: p_rsv_rec => l_rsv_rec,