149: X_Return_Status := FND_API.G_RET_STS_SUCCESS;
150: X_Error_Message := Null;
151: t_transaction_id := -1;
152: IF (l_debug = 'Y') THEN
153: CSE_DEBUG_PUB.ADD('***** OUT NOCOPY OF SERVICE TRANSACTION ******');
154: CSE_DEBUG_PUB.ADD('-----------------------------------------------');
155: END IF;
156:
157: -- If the option is set turn on the debug log.
150: X_Error_Message := Null;
151: t_transaction_id := -1;
152: IF (l_debug = 'Y') THEN
153: CSE_DEBUG_PUB.ADD('***** OUT NOCOPY OF SERVICE TRANSACTION ******');
154: CSE_DEBUG_PUB.ADD('-----------------------------------------------');
155: END IF;
156:
157: -- If the option is set turn on the debug log.
158:
156:
157: -- If the option is set turn on the debug log.
158:
159: IF (l_debug = 'Y') THEN
160: cse_debug_pub.g_dir := nvl(FND_PROFILE.VALUE('CSE_DEBUG_LOG_DIRECTORY'), '/tmp');
161: cse_debug_pub.g_file := NULL;
162: l_file := cse_debug_pub.set_debug_file('cse' || to_char(l_sysdate, 'DD-MON-YYYY') || '.log');
163: cse_debug_pub.debug_on;
164: END IF;
157: -- If the option is set turn on the debug log.
158:
159: IF (l_debug = 'Y') THEN
160: cse_debug_pub.g_dir := nvl(FND_PROFILE.VALUE('CSE_DEBUG_LOG_DIRECTORY'), '/tmp');
161: cse_debug_pub.g_file := NULL;
162: l_file := cse_debug_pub.set_debug_file('cse' || to_char(l_sysdate, 'DD-MON-YYYY') || '.log');
163: cse_debug_pub.debug_on;
164: END IF;
165:
158:
159: IF (l_debug = 'Y') THEN
160: cse_debug_pub.g_dir := nvl(FND_PROFILE.VALUE('CSE_DEBUG_LOG_DIRECTORY'), '/tmp');
161: cse_debug_pub.g_file := NULL;
162: l_file := cse_debug_pub.set_debug_file('cse' || to_char(l_sysdate, 'DD-MON-YYYY') || '.log');
163: cse_debug_pub.debug_on;
164: END IF;
165:
166: -- l_Network_Location_Code := P_Out_Of_Service_Attr_Rec.Network_Location_Code;
159: IF (l_debug = 'Y') THEN
160: cse_debug_pub.g_dir := nvl(FND_PROFILE.VALUE('CSE_DEBUG_LOG_DIRECTORY'), '/tmp');
161: cse_debug_pub.g_file := NULL;
162: l_file := cse_debug_pub.set_debug_file('cse' || to_char(l_sysdate, 'DD-MON-YYYY') || '.log');
163: cse_debug_pub.debug_on;
164: END IF;
165:
166: -- l_Network_Location_Code := P_Out_Of_Service_Attr_Rec.Network_Location_Code;
167: If P_Out_Of_Service_Attr_Rec.Network_Location_id is not null then
178:
179: --Step 2, Query for the existence of the source record
180:
181: IF (l_debug = 'Y') THEN
182: CSE_DEBUG_PUB.ADD('Initailizing Query Record for the source item instance - step2');
183: END IF;
184:
185: l_Instance_Query_Rec := CSE_UTIL_PKG.Init_Instance_Query_Rec;
186: l_Instance_Query_Rec.Inventory_Item_Id := P_Out_Of_Service_Attr_Rec.Item_Id;
191: l_Instance_Query_Rec.Location_Type_Code:= l_Location_Type_Code;
192: l_Instance_Query_Rec.Instance_Usage_Code:=CSE_DATASTRUCTURES_PUB.G_IN_SERVICE;
193:
194: IF (l_debug = 'Y') THEN
195: CSE_DEBUG_PUB.ADD(l_Api_Name||' Before CSI_Item_Instance_Pub.Get_Item_Instance');
196: END IF;
197:
198: CSI_Item_Instance_Pub.Get_Item_Instances(
199: p_api_version => l_api_version,
281:
282: IF(P_Out_Of_Service_Attr_Rec.Serial_Number IS NOT NULL) THEN
283:
284: IF (l_debug = 'Y') THEN
285: CSE_DEBUG_PUB.ADD('Initailizing instance Record for update of serialized item inst- step4');
286: END IF;
287:
288: l_Instance_Rec := CSE_UTIL_PKG.Init_Instance_Update_Rec;
289: l_Instance_Rec.Instance_Id :=l_Source_Instance_Id;
302: IF NOT t_transaction_id = -1 THEN
303: l_txn_rec.transaction_id := t_transaction_id;
304: END IF;
305: IF (l_debug = 'Y') THEN
306: CSE_DEBUG_PUB.ADD('Before update of serialized item instanace');
307: END IF;
308:
309:
310: CSI_Item_Instance_Pub.Update_Item_Instance(
350:
351: --Step 5.1 ,Check for the existence of the destination record
352:
353: IF (l_debug = 'Y') THEN
354: CSE_DEBUG_PUB.ADD('Initailizing Query Record for the destination instance - step5.1');
355: END IF;
356:
357: l_Instance_Query_Rec := CSE_UTIL_PKG.Init_Instance_Query_Rec;
358: l_Instance_Query_Rec.Inventory_Item_Id := P_Out_Of_Service_Attr_Rec.Item_Id;
364: l_Instance_Query_Rec.Instance_Usage_Code:=CSE_DATASTRUCTURES_PUB.G_OUT_OF_SERVICE;
365: l_Active_Instance_Only:= FND_API.G_FALSE;
366:
367: IF (l_debug = 'Y') THEN
368: CSE_DEBUG_PUB.ADD('Before querying for the existence of destination record');
369: END IF;
370:
371: CSI_Item_Instance_Pub.Get_Item_Instances(
372: p_api_version => l_api_version,
402: -- update source instance quantity
403:
404:
405: IF (l_debug = 'Y') THEN
406: CSE_DEBUG_PUB.ADD('Initailizing instance Record for update of source qty - step5.3');
407: END IF;
408:
409: l_Instance_Rec := CSE_UTIL_PKG.Init_Instance_Update_Rec;
410: l_Instance_Rec.Instance_Id:= l_Source_instance_id;
427: IF NOT t_transaction_id = -1 THEN
428: l_txn_rec.transaction_id := t_transaction_id;
429: END IF;
430: IF (l_debug = 'Y') THEN
431: CSE_DEBUG_PUB.ADD('Before update of source instanace qty - step 5.3');
432: END IF;
433:
434: CSI_Item_Instance_Pub.Update_Item_Instance(
435: p_api_version => l_api_version,
486:
487: IF l_Dest_Instance_Rec.instance_id IS NOT NULL THEN
488: l_D_object_version_number:=l_Dest_Instance_Rec.object_version_number;
489:
490: -- CSE_DEBUG_PUB.ADD('Initailizing instance Record for update Of dest inst - step5.1');
491:
492: l_Instance_Rec := CSE_UTIL_PKG.Init_Instance_Update_Rec;
493: l_Instance_Rec.Instance_Id := l_Dest_Instance_Rec.Instance_Id;
494: l_Instance_Rec.Quantity := (P_Out_Of_Service_Attr_Rec.Quantity +
519: l_txn_rec.transaction_id := t_transaction_id;
520: END IF;
521:
522: IF (l_debug = 'Y') THEN
523: CSE_DEBUG_PUB.ADD('Before update of destination instanace');
524: END IF;
525:
526: CSI_Item_Instance_Pub.Update_Item_Instance(
527: p_api_version => l_api_version,
569:
570: IF (l_Create_Dest_Inst_Flag = FND_API.G_TRUE ) THEN
571:
572: IF (l_debug = 'Y') THEN
573: CSE_DEBUG_PUB.ADD('Initailizing instance Record for the creation Of dest inst - step5.1');
574: END IF;
575:
576: l_Instance_Rec := CSE_UTIL_PKG.Init_Instance_Create_Rec;
577: l_Instance_Rec.Inventory_Item_id := P_Out_Of_Service_Attr_Rec.Item_id;
612: IF NOT t_transaction_id = -1 THEN
613: l_txn_rec.transaction_id := t_transaction_id;
614: END IF;
615: IF (l_debug = 'Y') THEN
616: CSE_DEBUG_PUB.ADD('Before creation of destination instanace');
617: END IF;
618:
619:
620: CSI_Item_Instance_Pub.Create_Item_Instance(