2585: l_line_rec.db_flag := FND_API.G_FALSE;
2586:
2587: -- Set missing old record elements to NULL.
2588:
2589: OE_Line_Util.Convert_Miss_To_Null (l_old_line_rec);
2590:
2591: -- Lock the order header for unbooked orders: This would prevent order
2592: -- lines from being inserted on an order when it is being booked
2593: -- as the booking process also locks the order header.
2634: IF l_old_line_rec.line_id = FND_API.G_MISS_NUM OR
2635: l_old_line_rec.line_id IS NULL
2636: THEN
2637:
2638: OE_Line_Util.Query_Row
2639: ( p_line_id => l_line_rec.line_id
2640: , x_line_rec => l_old_line_rec );
2641:
2642: -- Only for lines we are reassiging queried line into old tbl
2644: p_x_old_line_tbl(I) := l_old_line_rec;
2645:
2646: ELSE
2647: -- Set missing old record elements to NULL.
2648: OE_Line_Util.Convert_Miss_To_Null (l_old_line_rec);
2649:
2650: END IF;
2651:
2652: -- Complete new record from old
2654: IF l_debug_level > 0 THEN
2655: oe_debug_pub.add( 'COMPLETE NEW RECORD FROM OLD' , 1 ) ;
2656: END IF;
2657:
2658: OE_Line_Util.Complete_Record
2659: ( p_x_line_rec => l_line_rec
2660: ,p_old_line_rec => l_old_line_rec);
2661:
2662: IF l_debug_level > 0 THEN
3106: ( p_operation => l_line_rec.operation
3107: ,p_control_rec => p_control_rec);
3108:
3109:
3110: OE_LINE_UTIL.Pre_Attribute_Security(p_x_line_rec => l_line_rec
3111: ,p_old_line_rec => l_old_line_rec
3112: ,p_index => I );
3113:
3114: -- CHECK SECURITY
3189: IF l_debug_level > 0 THEN
3190: oe_debug_pub.add( 'CLEAR DEPENDENT ATTRIBUTES' , 1 ) ;
3191: END IF;
3192:
3193: OE_Line_Util_Ext.Clear_Dependent_Attr
3194: ( p_x_line_rec => l_line_rec
3195: ,p_old_line_rec => l_old_line_rec );
3196:
3197: END IF;
3238: IF l_debug_level > 0 THEN
3239: oe_debug_pub.add( 'APPLY ATTRIBUTE CHANGES' , 2 ) ;
3240: END IF;
3241:
3242: OE_Line_Util.Apply_Attribute_Changes
3243: ( p_x_line_rec => l_line_rec
3244: ,p_old_line_rec => l_old_line_rec );
3245:
3246: IF l_line_rec.return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3341: -- writing to the DB (like Scheduling).
3342:
3343: IF l_control_rec.write_to_db THEN
3344:
3345: OE_LINE_UTIL.PRE_WRITE_PROCESS
3346: ( p_x_line_rec => l_line_rec
3347: , p_old_line_rec => l_old_line_rec);
3348: END IF;
3349:
3354: oe_debug_pub.add( 'WRITE TO DB' , 1 ) ;
3355: END IF;
3356:
3357: IF l_line_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
3358: OE_Line_Util.Delete_Row
3359: ( p_line_id => l_line_rec.line_id);
3360:
3361: -- If an OTA line has been deleted, then call the OTA API
3362: -- to delete the event in the OTA tables
3400: IF l_debug_level > 0 THEN
3401: oe_debug_pub.add( 'CALLING UPDATE ROW' , 1 ) ;
3402: END IF;
3403:
3404: OE_Line_Util.Update_Row (l_line_rec);
3405:
3406: ELSIF l_line_rec.operation = OE_GLOBALS.G_OPR_CREATE THEN
3407:
3408: l_line_rec.creation_date := SYSDATE;
3411: IF l_debug_level > 0 THEN
3412: oe_debug_pub.add( '3.STATUS '||L_LINE_REC.SCHEDULE_STATUS_CODE , 1 ) ;
3413: END IF;
3414:
3415: OE_Line_Util.Insert_Row (l_line_rec);
3416:
3417: END IF;
3418:
3419: END IF; -- operation = delete
3418:
3419: END IF; -- operation = delete
3420:
3421: -- Post Db Processes
3422: Oe_Line_Util.Post_Write_Process
3423: (p_x_line_rec => l_line_rec,
3424: p_old_line_rec => l_old_line_rec );
3425:
3426: END IF; -- write to db true
3607:
3608:
3609: -- New event has been created to handle post line loop issues.
3610:
3611: OE_LINE_UTIL.Post_Line_Process
3612: (p_control_rec => l_control_rec,
3613: p_x_line_tbl => p_x_line_tbl);
3614:
3615:
6836: IF (l_header_id IS NOT NULL AND
6837: l_header_id <> FND_API.G_MISS_NUM) THEN
6838: p_x_line_tbl(I).header_id := l_header_id;
6839: ELSE
6840: oe_line_util.query_header
6841: (p_line_id => p_x_line_tbl(I).line_id,
6842: x_header_id => l_header_id);
6843: p_x_line_tbl(I).header_id := l_header_id;
6844: END IF;
9011: IF (l_header_id IS NOT NULL AND
9012: l_header_id <> FND_API.G_MISS_NUM) THEN
9013: l_line_tbl(I).header_id := l_header_id;
9014: ELSE
9015: oe_line_util.query_header
9016: (p_line_id => l_line_rec.line_id,
9017: x_header_id => l_header_id);
9018: l_line_tbl(I).header_id := l_header_id;
9019: END IF;
10683: WHILE I IS NOT NULL LOOP
10684:
10685: IF p_x_line_tbl(I).operation = OE_GLOBALS.G_OPR_LOCK THEN
10686:
10687: OE_Line_Util.Lock_Row
10688: ( p_x_line_rec => p_x_line_tbl(I)
10689: , x_return_status => l_return_status
10690: );
10691:
11173: END IF;
11174:
11175: -- Get line ( parent = header )
11176:
11177: OE_Line_Util.Query_Rows
11178: ( p_header_id => p_header_id
11179: , x_line_tbl => x_line_tbl
11180: );
11181: