The following lines contain the word 'select', 'insert', 'update' or 'delete':
select UPGRADED_FLAG, booked_flag into
g_upgraded_flag, g_booked_flag
from oe_order_headers_all
where header_id = p_header_id;
ELSIF p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
OR p_x_header_rec.operation = OE_GLOBALS.G_OPR_DELETE
THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add( 'OPERATION = UPDATE SO QUERY OLD' , 2 ) ;
OE_MSG_PUB.update_msg_context(
p_entity_code => 'HEADER'
,p_entity_id => p_x_header_rec.header_id
,p_header_id => p_x_header_rec.header_id
,p_line_id => null
,p_order_source_id => p_x_header_rec.order_source_id
,p_orig_sys_document_ref => p_x_header_rec.orig_sys_document_ref
,p_orig_sys_document_line_ref => null
,p_source_document_id => p_x_header_rec.source_document_id
,p_source_document_line_id => null );
IF ( p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
OR p_x_header_rec.operation = OE_GLOBALS.G_OPR_CREATE
OR p_x_header_rec.operation = OE_GLOBALS.G_OPR_DELETE) THEN
-- Check security
IF l_control_rec.check_security
AND (p_x_header_rec.operation = OE_GLOBALS.G_OPR_CREATE
OR p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE)
THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add( 'CALLING CHECK ATTRIBUTES SECURITY',0.5 ) ; -- debug level 0.5 added for bug 13435459
IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
OE_Validate_Header.Entity_Delete
( x_return_status => l_return_status
, p_header_rec => p_x_header_rec
);
IF NOT (p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
AND OE_Header_Security.g_check_all_cols_constraint = 'Y')
AND l_control_rec.check_security
THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add( 'CHECK ENTITY SECURITY' ,0.5 ) ; --debug level 0.5 added for bug 13435459
IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
OE_Header_Util.Delete_Row
( p_header_id => p_x_header_rec.header_id
);
p_x_header_rec.last_update_date := SYSDATE;
p_x_header_rec.last_updated_by := NVL(OE_STANDARD_WF.g_user_id, FND_GLOBAL.USER_ID); -- 3169637
p_x_header_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add( 'HEADER FLOW STATUS :'||P_X_HEADER_REC.FLOW_STATUS_CODE , 1 ) ;
OE_Header_Util.Update_Row (p_x_header_rec);
OE_Header_Util.Insert_Row (p_x_header_rec);
oe_debug_pub.add( 'DELETE REQUEST1' , 2 ) ;
oe_debug_pub.add( 'DELETE REQUEST2' , 2 ) ;
oe_debug_pub.add( 'DELETE REQUEST3' , 2 ) ;
SELECT order_source_id, orig_sys_document_ref, change_sequence,
source_document_type_id, source_document_id
INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
l_source_document_type_id, l_source_document_id
FROM OE_ORDER_HEADERS_ALL
WHERE header_id = l_header_Scredit_rec.header_id;
SELECT order_source_id, orig_sys_document_ref, change_sequence,
source_document_type_id, source_document_id
INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
l_source_document_type_id, l_source_document_id
FROM OE_ORDER_HEADERS_ALL
WHERE header_id = l_old_header_Scredit_rec.header_id;
ELSIF l_Header_Scredit_rec.operation = OE_GLOBALS.G_OPR_UPDATE
OR l_Header_Scredit_rec.operation = OE_GLOBALS.G_OPR_DELETE
THEN
l_Header_Scredit_rec.db_flag := FND_API.G_TRUE;
OE_MSG_PUB.update_msg_context(
p_entity_code => 'HEADER_SCREDIT'
,p_entity_id => l_header_Scredit_rec.sales_credit_id
,p_header_id => l_header_Scredit_rec.header_Id);
OR l_header_scredit_rec.operation = OE_GLOBALS.G_OPR_UPDATE)
THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add( 'CHECK ATTRIBUTES SECURITY' ) ;
IF l_Header_Scredit_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
OE_Validate_Header_Scredit.Entity_Delete
( x_return_status => l_return_status
, p_Header_Scredit_rec => l_Header_Scredit_rec
);
IF NOT (l_header_scredit_rec.operation = OE_GLOBALS.G_OPR_UPDATE
AND OE_Header_Scredit_Security.g_check_all_cols_constraint = 'Y')
AND l_control_rec.check_security
THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add( 'CHECK ENTITY SECURITY' ) ;
IF l_Header_Scredit_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
SAVEPOINT DELETE_SCREDIT_FAILED; --bug 5331854
select quota_flag into l_quota_flag from oe_sales_credit_types where sales_credit_type_id = l_header_scredit_rec.sales_credit_type_id;
select booked_flag into l_booked_flag from oe_order_headers where header_id = l_header_scredit_rec.header_id;
OE_Header_Scredit_Util.Delete_Row
( p_sales_credit_id => l_Header_Scredit_rec.sales_credit_id
);
oe_debug_pub.add('after delete_row and hdr validate_hsc_quota_total rt status : ' || l_header_scredit_rec.return_status);
l_Header_Scredit_rec.last_update_date := SYSDATE;
l_Header_Scredit_rec.last_updated_by := NVL(OE_STANDARD_WF.g_user_id, FND_GLOBAL.USER_ID); -- 3169637
l_Header_Scredit_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
IF l_Header_Scredit_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN
OE_Header_Scredit_Util.Update_Row (l_Header_Scredit_rec);
OE_Header_Scredit_Util.Insert_Row (l_Header_Scredit_rec);
oe_debug_pub.add( 'DELETE REQUEST4' , 2 ) ;
oe_delayed_requests_pvt.Delete_Reqs_for_Deleted_Entity
(p_entity_code =>OE_GLOBALS.G_ENTITY_HEADER_SCREDIT,
p_entity_id => l_header_scredit_rec.sales_credit_id,
x_return_status => l_return_status);
ROLLBACK TO SAVEPOINT DELETE_SCREDIT_FAILED;
oe_debug_pub.add( 'DELETE REQUEST5' , 2 ) ;
oe_debug_pub.add( 'DELETE REQUEST6' , 2 ) ;
oe_debug_pub.add( 'DELETE REQUEST7' , 2 ) ;
SELECT order_source_id, orig_sys_document_ref, change_sequence,
source_document_type_id, source_document_id
INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
l_source_document_type_id, l_source_document_id
FROM OE_ORDER_HEADERS_ALL
WHERE header_id = l_header_Payment_rec.header_id;
SELECT order_source_id, orig_sys_document_ref, change_sequence,
source_document_type_id, source_document_id
INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
l_source_document_type_id, l_source_document_id
FROM OE_ORDER_HEADERS_ALL
WHERE header_id = l_old_header_Payment_rec.header_id;
ELSIF l_Header_Payment_rec.operation = OE_GLOBALS.G_OPR_UPDATE
OR l_Header_Payment_rec.operation = OE_GLOBALS.G_OPR_DELETE
THEN
l_Header_Payment_rec.db_flag := FND_API.G_TRUE;
OE_MSG_PUB.update_msg_context(
p_entity_code => 'HEADER_PAYMENT'
,p_entity_id => l_header_Payment_rec.payment_number
,p_header_id => l_header_Payment_rec.header_Id);
OR l_header_payment_rec.operation = OE_GLOBALS.G_OPR_UPDATE)
THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add( 'CHECK ATTRIBUTES SECURITY' ) ;
IF l_Header_Payment_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add('Payment:before OE_Validate_Header_Payment.Entity_Delete', 5);
OE_Validate_Header_Payment.Entity_Delete
( x_return_status => l_return_status
, p_Header_Payment_rec => l_Header_Payment_rec
);
oe_debug_pub.add('Payment:after OE_Validate_Header_Payment.Entity_Delete', 5);
IF NOT (l_header_payment_rec.operation = OE_GLOBALS.G_OPR_UPDATE
AND OE_Header_Payment_Security.g_check_all_cols_constraint = 'Y')
AND l_control_rec.check_security
THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add( 'CHECK ENTITY SECURITY' ) ;
IF l_Header_Payment_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add('Payment:before Oe_Header_Payment_Util.Delete_Row',5);
OE_Header_Payment_Util.Delete_Row
( p_payment_number => l_Header_Payment_rec.payment_number
, p_header_id => l_Header_Payment_rec.header_id
);
oe_debug_pub.add('Payment:after Oe_Header_Payment_Util.Delete_Row',5);
l_Header_Payment_rec.last_update_date := SYSDATE;
l_Header_Payment_rec.last_updated_by := FND_GLOBAL.USER_ID;
l_Header_Payment_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
IF l_Header_Payment_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN
OE_Header_Payment_Util.Update_Row (l_Header_Payment_rec);
oe_debug_pub.add('Payment:before Oe_Header_Payment_Util.Insert_Row', 5);
OE_Header_Payment_Util.Insert_Row (l_Header_Payment_rec);
oe_debug_pub.add('Payment:after Oe_Header_Payment_Util.Insert_Row', 5);
oe_debug_pub.add( 'DELETE REQUEST4' , 2 ) ;
oe_delayed_requests_pvt.Delete_Reqs_for_Deleted_Entity
(p_entity_code =>OE_GLOBALS.G_ENTITY_HEADER_PAYMENT,
p_entity_id => l_header_payment_rec.header_id,
x_return_status => l_return_status);
oe_debug_pub.add( 'DELETE REQUEST5' , 2 ) ;
oe_debug_pub.add( 'DELETE REQUEST6' , 2 ) ;
oe_debug_pub.add( 'DELETE REQUEST7' , 2 ) ;
4) There is no change if the operation is UPDATE or DELETE on
class/options lines.
5) If the call is made from configurator code or options window
code, on all the classl lines, item_type_code is passed.
LOGIC:
only the new stuff is explained here(at a high level), rest is same.
***: indiactes previous code.
if boolean COMPLETE_AND_CLASS_SAVE_MODE is TRUE, we create CLASSES
if it is fales, we create OPTIONS.
MODE = standard_and_models and check_item_type = 1
l_process_this_line = TRUE;
go to end_of_lines (e.g class during option create, or update of option)
END IF;
L_event_tbl.DELETE;
ELSIF l_line_rec.operation = OE_GLOBALS.G_OPR_UPDATE OR
l_line_rec.operation = OE_GLOBALS.G_OPR_DELETE
THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add( 'OPERATION = UPDATE SO QUERY OLD' , 1 ) ;
OE_MSG_PUB.update_msg_context
( p_entity_code => 'LINE'
,p_entity_id => l_line_rec.line_id
,p_header_id => l_line_rec.header_id
,p_line_id => l_line_rec.line_id
,p_order_source_id => l_line_rec.order_source_id
,p_orig_sys_document_ref => l_line_rec.orig_sys_document_ref
,p_orig_sys_document_line_ref => l_line_rec.orig_sys_line_ref
,p_source_document_type_id => l_line_rec.source_document_type_id
,p_source_document_id => l_line_rec.source_document_id
,p_source_document_line_id => l_line_rec.source_document_line_id );
SELECT bom_item_type
INTO l_bom_item_type
FROM mtl_system_items
WHERE inventory_item_id = l_line_rec.inventory_item_id
AND organization_id
= OE_Sys_Parameters.VALUE('MASTER_ORGANIZATION_ID');
l_line_rec.operation = OE_GLOBALS.G_OPR_UPDATE)
THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add( 'CHECK ATTRIBUTES SECURITY' , 0.5 ) ; -- debug level changed to 0.5 for bug 13435459
IF l_line_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
OE_Validate_Line.Entity_Delete
( x_return_status => l_return_status
,p_line_rec => l_line_rec );
IF NOT (l_line_rec.operation = OE_GLOBALS.G_OPR_UPDATE AND
OE_Line_Security.g_check_all_cols_constraint = 'Y') AND
l_control_rec.check_security THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add( 'CHECK ENTITY SECURITY' , 0.5 ) ; --13435459
IF l_line_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
OE_Line_Util.Delete_Row
( p_line_id => l_line_rec.line_id);
ELSE -- operation is update or create
-- Get Who Information
l_line_rec.last_update_date := SYSDATE;
l_line_rec.last_updated_by := NVL(OE_STANDARD_WF.g_user_id, FND_GLOBAL.USER_ID); -- 3169637
l_line_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
IF l_line_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add( 'CALLING UPDATE ROW' , 0.5 ) ; --debug changed to 0.5 for 13435459
OE_Line_Util.Update_Row (l_line_rec);
oe_debug_pub.add( 'AFTER CALLING UPDATE ROW' , 0.5 ) ; --debug changed to 0.5 for 13435459
oe_debug_pub.add( 'CALLING INSERT ROW' , 0.5 ) ; --debug added for 13435459
OE_Line_Util.Insert_Row (l_line_rec);
oe_debug_pub.add( 'AFTER CALLING INSERT ROW' , 0.5 ) ; --debug added for 13435459
END IF; -- operation = delete
oe_debug_pub.add( 'DELETE REQUEST8' , 2 ) ;
oe_delayed_requests_pvt.Delete_Reqs_for_Deleted_Entity
(p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
p_entity_id => l_line_rec.line_id,
x_return_status => l_return_status);
l_options_index_tbl.DELETE;
OE_SET_UTIL.G_SET_TBL.delete; --bug#2428456
OE_SET_UTIL.G_SET_OPT_TBL.delete; -- bug#2428456
oe_debug_pub.add( 'DELETE REQUEST9' , 2 ) ;
OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.DELETE;
OE_SET_UTIL.G_SET_TBL.delete; --bug#2428456
OE_SET_UTIL.G_SET_OPT_TBL.delete; -- bug#2428456
oe_debug_pub.add( 'DELETE REQUEST10' , 2 ) ;
OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.DELETE;
OE_SET_UTIL.G_SET_TBL.delete; --bug#2428456
OE_SET_UTIL.G_SET_OPT_TBL.delete; -- bug#2428456
oe_debug_pub.add( 'DELETE REQUEST11' , 2 ) ;
OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.DELETE;
SELECT order_source_id, orig_sys_document_ref, change_sequence,
source_document_type_id, source_document_id, orig_sys_line_ref,
source_document_line_id, orig_sys_shipment_ref
INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
l_source_document_type_id, l_source_document_id, l_orig_sys_line_ref,
l_source_document_line_id, l_orig_sys_shipment_ref
FROM OE_ORDER_LINES_ALL
WHERE line_id = l_line_Scredit_rec.line_id;
SELECT order_source_id, orig_sys_document_ref, change_sequence,
source_document_type_id, source_document_id, orig_sys_line_ref,
source_document_line_id, orig_sys_shipment_ref
INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
l_source_document_type_id, l_source_document_id, l_orig_sys_line_ref,
l_source_document_line_id, l_orig_sys_shipment_ref
FROM OE_ORDER_LINES_ALL
WHERE line_id = l_old_line_Scredit_rec.line_id;
ELSIF l_Line_Scredit_rec.operation = OE_GLOBALS.G_OPR_UPDATE
OR l_Line_Scredit_rec.operation = OE_GLOBALS.G_OPR_DELETE
THEN
l_Line_Scredit_rec.db_flag := FND_API.G_TRUE;
OE_MSG_PUB.update_msg_context(
p_entity_code => 'LINE_SCREDIT'
,p_entity_id => l_line_Scredit_rec.sales_credit_id
,p_header_id => l_line_Scredit_rec.header_id
,p_line_id => l_line_Scredit_rec.line_id);
OR l_line_scredit_rec.operation = OE_GLOBALS.G_OPR_UPDATE)
THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add( 'CHECK ATTRIBUTES SECURITY' ) ;
IF l_Line_Scredit_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
OE_Validate_Line_Scredit.Entity_Delete
( x_return_status => l_return_status
, p_Line_Scredit_rec => l_Line_Scredit_rec
);
IF NOT (l_line_scredit_rec.operation = OE_GLOBALS.G_OPR_UPDATE
AND OE_Line_Scredit_Security.g_check_all_cols_constraint = 'Y')
AND l_control_rec.check_security
THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add( 'CHECK ENTITY SECURITY' ) ;
IF l_Line_Scredit_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
OE_Line_Scredit_Util.Delete_Row
( p_sales_credit_id => l_Line_Scredit_rec.sales_credit_id
);
l_Line_Scredit_rec.last_update_date := SYSDATE;
l_Line_Scredit_rec.last_updated_by := NVL(OE_STANDARD_WF.g_user_id, FND_GLOBAL.USER_ID); -- 3169637
l_Line_Scredit_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
IF l_Line_Scredit_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN
OE_Line_Scredit_Util.Update_Row (l_Line_Scredit_rec);
OE_Line_Scredit_Util.Insert_Row (l_Line_Scredit_rec);
oe_debug_pub.add( 'DELETE REQUEST12' , 2 ) ;
oe_delayed_requests_pvt.Delete_Reqs_for_Deleted_Entity
(p_entity_code =>OE_GLOBALS.G_ENTITY_LINE_SCREDIT,
p_entity_id => l_line_scredit_rec.sales_credit_id,
x_return_status => l_return_status);
oe_debug_pub.add( 'DELETE REQUEST13' , 2 ) ;
oe_debug_pub.add( 'DELETE REQUEST14' , 2 ) ;
oe_debug_pub.add( 'DELETE REQUEST15' , 2 ) ;
SELECT order_source_id, orig_sys_document_ref, change_sequence,
source_document_type_id, source_document_id, orig_sys_line_ref,
source_document_line_id, orig_sys_shipment_ref
INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
l_source_document_type_id, l_source_document_id, l_orig_sys_line_ref,
l_source_document_line_id, l_orig_sys_shipment_ref
FROM OE_ORDER_LINES_ALL
WHERE line_id = l_line_Payment_rec.line_id;
SELECT order_source_id, orig_sys_document_ref, change_sequence,
source_document_type_id, source_document_id, orig_sys_line_ref,
source_document_line_id, orig_sys_shipment_ref
INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
l_source_document_type_id, l_source_document_id, l_orig_sys_line_ref,
l_source_document_line_id, l_orig_sys_shipment_ref
FROM OE_ORDER_LINES_ALL
WHERE line_id = l_old_line_Payment_rec.line_id;
ELSIF l_Line_Payment_rec.operation = OE_GLOBALS.G_OPR_UPDATE
OR l_Line_Payment_rec.operation = OE_GLOBALS.G_OPR_DELETE
THEN
l_Line_Payment_rec.db_flag := FND_API.G_TRUE;
OE_MSG_PUB.update_msg_context(
p_entity_code => 'LINE_PAYMENT'
,p_entity_id => l_line_Payment_rec.payment_number
,p_header_id => l_line_Payment_rec.header_id
,p_line_id => l_line_Payment_rec.line_id);
OR l_line_payment_rec.operation = OE_GLOBALS.G_OPR_UPDATE)
THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add('Payment:before OE_Line_Payment_Security.Attributes', 5);
IF l_Line_Payment_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add('Payment:before OE_Validate_Line_Payment.Entity_Delete', 5);
OE_Validate_Line_Payment.Entity_Delete
( x_return_status => l_return_status
, p_Line_Payment_rec => l_Line_Payment_rec
);
oe_debug_pub.add('Payment:after OE_Validate_Line_Payment.Entity_Delete', 5);
IF NOT (l_line_payment_rec.operation = OE_GLOBALS.G_OPR_UPDATE
AND OE_Line_Payment_Security.g_check_all_cols_constraint = 'Y')
AND l_control_rec.check_security
THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add('Payment:before OE_Line_Payment_Security.Entity', 5);
IF l_Line_Payment_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add('Payment:before OE_Line_Payment_Util.Delete_Row', 5);
OE_Line_Payment_Util.Delete_Row
( p_payment_number => l_Line_Payment_rec.payment_number
, p_line_id => l_Line_Payment_rec.line_id
, p_header_id => l_Line_Payment_rec.header_id
);
oe_debug_pub.add('Payment:after OE_Line_Payment_Util.Delete_Row', 5);
l_Line_Payment_rec.last_update_date := SYSDATE;
l_Line_Payment_rec.last_updated_by := NVL(OE_STANDARD_WF.g_user_id, FND_GLOBAL.USER_ID); -- 3169637
l_Line_Payment_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
IF l_Line_Payment_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN
IF l_debug_level > 0 THEN
oe_debug_pub.add('Payment:before OE_Line_Payment_Util.Update_Row', 5);
OE_Line_Payment_Util.Update_Row (l_Line_Payment_rec);
oe_debug_pub.add('Payment:after OE_Line_Payment_Util.Update_Row', 5);
oe_debug_pub.add('Payment:before OE_Line_Payment_Util.Insert_Row', 5);
OE_Line_Payment_Util.Insert_Row (l_Line_Payment_rec);
oe_debug_pub.add('Payment:after OE_Line_Payment_Util.Insert_Row', 5);
oe_debug_pub.add( 'DELETE REQUEST12' , 2 ) ;
oe_delayed_requests_pvt.Delete_Reqs_for_Deleted_Entity
(p_entity_code =>OE_GLOBALS.G_ENTITY_LINE_PAYMENT,
p_entity_id => l_line_payment_rec.line_id,
x_return_status => l_return_status);
oe_debug_pub.add( 'DELETE REQUEST13' , 2 ) ;
oe_debug_pub.add( 'DELETE REQUEST14' , 2 ) ;
oe_debug_pub.add( 'DELETE REQUEST15' , 2 ) ;
ELSIF l_Lot_Serial_rec.operation = OE_GLOBALS.G_OPR_UPDATE
OR l_Lot_Serial_rec.operation = OE_GLOBALS.G_OPR_DELETE
THEN
l_Lot_Serial_rec.db_flag := FND_API.G_TRUE;
IF l_Lot_Serial_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
OE_Validate_Lot_Serial.Entity_Delete
( x_return_status => l_return_status
, p_Lot_Serial_rec => l_Lot_Serial_rec
);
IF l_Lot_Serial_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN
OE_Lot_Serial_Util.Delete_Row
( p_lot_serial_id => l_Lot_Serial_rec.lot_serial_id
);
l_Lot_Serial_rec.last_update_date := SYSDATE;
l_Lot_Serial_rec.last_updated_by := NVL(OE_STANDARD_WF.g_user_id, FND_GLOBAL.USER_ID); -- 3169637
l_Lot_Serial_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
IF l_Lot_Serial_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN
OE_Lot_Serial_Util.Update_Row (l_Lot_Serial_rec);
OE_Lot_Serial_Util.Insert_Row (l_Lot_Serial_rec);
oe_debug_pub.add( 'DELETE REQUEST17' , 2 ) ;
oe_debug_pub.add( 'DELETE REQUEST18' , 2 ) ;
oe_debug_pub.add( 'DELETE REQUEST19' , 2 ) ;
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
SELECT header_id
INTO l_header_id
FROM OE_ORDER_LINES_ALL
WHERE line_id = l_line_id;
OE_DBI_UTIL.Update_DBI_Log( x_return_status => l_return_status);
OE_GLOBALS.G_OPR_DELETE, OE_GLOBALS.G_OPR_UPDATE,
OE_GLOBALS.G_OPR_NONE) THEN
FND_MESSAGE.SET_NAME('ONT','OE_OI_OPERATION_CODE');
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
OE_GLOBALS.G_OPR_DELETE, OE_GLOBALS.G_OPR_UPDATE,
OE_GLOBALS.G_OPR_INSERT, OE_GLOBALS.G_OPR_NONE) THEN
FND_MESSAGE.SET_NAME('ONT','OE_OI_OPERATION_CODE');
IF p_x_line_tbl(I).operation = oe_globals.g_opr_update
AND p_x_line_tbl(I).split_action_code = 'SPLIT' THEN
-- Negotiation check has been added for bug 4758902
BEGIN
SELECT transaction_phase_code
INTO l_transaction_phase_code
FROM oe_order_lines_all
WHERE line_id = p_x_line_tbl(I).line_id;
OE_Line_Scredit_Util.Delete_Row(p_line_id =>p_x_line_scredit_tbl(I).line_id);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
SELECT flow_status_code into p_x_header_rec.flow_status_code
FROM oe_order_headers_all
WHERE header_id = p_x_header_rec.header_id;
OE_GLOBALS.G_OPR_DELETE, OE_GLOBALS.G_OPR_UPDATE,
OE_GLOBALS.G_OPR_NONE) THEN
FND_MESSAGE.SET_NAME('ONT','OE_OI_OPERATION_CODE');
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
OE_GLOBALS.G_OPR_DELETE, OE_GLOBALS.G_OPR_UPDATE,
OE_GLOBALS.G_OPR_INSERT, OE_GLOBALS.G_OPR_NONE) THEN
FND_MESSAGE.SET_NAME('ONT','OE_OI_OPERATION_CODE');
IF l_line_rec.operation = oe_globals.g_opr_update
AND l_line_rec.split_action_code = 'SPLIT' THEN
l_call_split := TRUE;
OE_Line_Scredit_Util.Delete_Row(p_line_id =>l_Line_Scredit_tbl(I).line_id);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
,p_delete => FND_API.G_TRUE
,x_return_status => l_return_status
);
OE_SET_UTIL.G_SET_TBL.delete; --bug#2428456
OE_SET_UTIL.G_SET_OPT_TBL.delete; -- bug#2428456
oe_debug_pub.add( 'DELETE REQUEST11' , 2 ) ;
OE_SET_UTIL.G_SET_TBL.delete; --bug#2428456
OE_SET_UTIL.G_SET_OPT_TBL.delete; -- bug#2428456
oe_debug_pub.add( 'DELETE REQUEST12' , 2 ) ;
OE_SET_UTIL.G_SET_TBL.delete; --bug#2428456
OE_SET_UTIL.G_SET_OPT_TBL.delete; -- bug#2428456
oe_debug_pub.add( 'DELETE REQUEST13' , 2 ) ;
l_Header_Adj_Att_tbl.delete; --6052770
l_Header_Adj_Assoc_Tbl.delete; --6052770
l_Line_Adj_tbl.delete; --6052770
l_Line_Price_Att_tbl.delete; --6052770
l_Line_Adj_Att_tbl.delete; --6052770
l_Line_Adj_Assoc_tbl.delete; --6052770
l_Line_Scredit_tbl.delete; --6052770
l_Line_Payment_tbl.delete; --6052770
l_Lot_Serial_tbl.delete; --6052770
we have to always do a select from bom_explosions. This is so that
we can figure out nocopy if all the items are currenlty part of the Bill.
Should not come here for split lines.
2221666 : order import sends option in already create model.
2299910 : copy order, sort_order for MI.
-------------------------------------------------------------------------*/
PROCEDURE Complete_Config_Line
( p_x_line_rec IN OUT NOCOPY OE_ORDER_PUB.Line_Rec_Type
,p_item_type IN NUMBER
,p_x_line_tbl IN OE_ORDER_PUB.Line_Tbl_Type
,p_process_partial IN BOOLEAN := FALSE)
IS
l_model_seq_id NUMBER;
,p_do_update => FALSE
,p_check_effective_date => 'N'
,x_config_effective_date => l_rev_date
,x_frozen_model_bill => l_frozen_model_bill
,x_return_status => l_return_status);
,p_do_update => FALSE
,x_config_effective_date => l_rev_date
,x_frozen_model_bill => l_frozen_model_bill
,x_return_status => l_return_status);
SELECT component_code, component_sequence_id, bom_sort_order,
uom_code, bom_item_type
INTO p_x_line_rec.component_code, p_x_line_rec.component_sequence_id,
p_x_line_rec.sort_order, p_x_line_rec.order_quantity_uom,
l_bom_item_type
FROM cz_config_details_v
WHERE config_hdr_id = p_x_line_rec.config_header_id
AND config_rev_nbr = p_x_line_rec.config_rev_nbr
AND config_item_id = p_x_line_rec.configuration_id;
SELECT component_code, component_sequence_id, sort_order,
primary_uom_code, bom_item_type
INTO p_x_line_rec.component_code, p_x_line_rec.component_sequence_id,
p_x_line_rec.sort_order, p_x_line_rec.order_quantity_uom,
l_bom_item_type
FROM bom_explosions
WHERE component_item_id = p_x_line_rec.inventory_item_id
AND explosion_type = Oe_Config_Util.OE_BMX_OPTION_COMPS
AND top_bill_sequence_id = l_model_seq_id
AND effectivity_date <= l_rev_date
AND disable_date > l_rev_date
AND organization_id = l_validation_org
AND component_code = p_x_line_rec.component_code;
SELECT component_code, component_sequence_id, sort_order,
primary_uom_code, bom_item_type
INTO p_x_line_rec.component_code, p_x_line_rec.component_sequence_id,
p_x_line_rec.sort_order, p_x_line_rec.order_quantity_uom,
l_bom_item_type
FROM bom_explosions
WHERE component_item_id = p_x_line_rec.inventory_item_id
AND explosion_type = Oe_Config_Util.OE_BMX_OPTION_COMPS
AND top_bill_sequence_id = l_model_seq_id
AND effectivity_date <= l_rev_date
AND disable_date > l_rev_date
AND organization_id = l_validation_org;
oe_debug_pub.add( 'SELECT COMP_CODE FAILED , NO DATA FOUND ' , 1 ) ;
oe_debug_pub.add( 'SELECT COMP_CODE FAILED , TOO_MANY ROWS ' , 1 ) ;
oe_debug_pub.add( 'SELECT COMP_CODE FAILED , OTHERS ' , 1 ) ;
SELECT ato_line_id
INTO l_ato_line_id
FROM oe_order_lines
WHERE top_model_line_id
= p_x_line_tbl(l_option_index).top_model_line_id
AND component_code = l_component_code
AND open_flag = 'Y';
SELECT component_sequence_id, inventory_item_id,
bom_sort_order, uom_code, quantity, bom_item_type
INTO p_x_line_tbl(l_index).component_sequence_id,
p_x_line_tbl(l_index).inventory_item_id,
p_x_line_tbl(l_index).sort_order,
p_x_line_tbl(l_index).order_quantity_uom,
p_x_line_tbl(l_index).ordered_quantity,
l_bom_item_type
FROM cz_config_details_v
WHERE component_code = l_component_code
AND config_hdr_id
= p_x_line_tbl(l_option_index).config_header_id
AND config_rev_nbr
= p_x_line_tbl(l_option_index).config_rev_nbr
AND config_item_id
= p_x_line_tbl(l_option_index).configuration_id;
SELECT ordered_quantity, component_sequence_id
INTO l_model_quantity, l_model_seq_id
FROM oe_order_lines
WHERE line_id =
p_x_line_tbl(l_option_index).top_model_line_id;
SELECT component_sequence_id, component_item_id, sort_order,
primary_uom_code, EXTENDED_QUANTITY * l_model_quantity,
bom_item_type
INTO p_x_line_tbl(l_index).component_sequence_id,
p_x_line_tbl(l_index).inventory_item_id,
p_x_line_tbl(l_index).sort_order,
p_x_line_tbl(l_index).order_quantity_uom,
p_x_line_tbl(l_index).ordered_quantity,
l_bom_item_type
FROM bom_explosions be
WHERE be.explosion_type = OE_Config_Util.OE_BMX_OPTION_COMPS
AND be.top_bill_sequence_id = l_model_seq_id
AND be.plan_level > 0
AND be.effectivity_date <= l_rev_date
AND be.disable_date > l_rev_date
AND be.component_code = l_component_code
AND rownum = 1;
SELECT concatenated_segments
INTO p_x_line_tbl(l_index).ordered_item
FROM MTL_SYSTEM_ITEMS_KFV
WHERE inventory_item_id = p_x_line_tbl(I).inventory_item_id
AND organization_id = l_validation_org;