The following lines contain the word 'select', 'insert', 'update' or 'delete':
/* update_move_order_lines procedure modified material line and send to the inv api */
/* to process the move order line.
/* Swapna K 11-OCT-2007 Bug#6446877 */
/* update_move_order_lines procedure is changed to fetch the alloc uom of the material */
/* line and send to the inv api to process the move order line. */
/*************************************************************************************************/
PROCEDURE create_move_order_hdr (
p_organization_id IN NUMBER
,p_move_order_type IN NUMBER
,x_move_order_header_id OUT NOCOPY NUMBER
,x_return_status OUT NOCOPY VARCHAR2)
IS
l_api_name CONSTANT VARCHAR2 (30) := 'create_move_order_hdr';
l_in_trohdr_rec.last_update_date := gme_common_pvt.g_timestamp;
l_in_trohdr_rec.last_updated_by := gme_common_pvt.g_user_ident;
SELECT mtl_transactions_enabled_flag, secondary_uom_code, segment1
FROM mtl_system_items_b
WHERE organization_id = v_org_id
AND inventory_item_id = v_inventory_item_id;
l_in_trolin_tbl (l_count).last_update_date :=
gme_common_pvt.g_timestamp;
l_in_trolin_tbl (l_count).last_updated_by :=
gme_common_pvt.g_user_ident;
SELECT mtl_transactions_enabled_flag, concatenated_segments, primary_uom_code
FROM mtl_system_items_kfv
WHERE inventory_item_id = v_inventory_item_id
AND organization_id = v_org_id;
SELECT l.*
FROM mtl_txn_request_lines l, mtl_txn_request_headers h
WHERE l.organization_id = p_organization_id
AND transaction_source_type_id =
gme_common_pvt.g_txn_source_type
AND l.txn_source_id = p_batch_id
AND l.txn_source_line_id = p_material_detail_id
AND l.line_status NOT IN (5, 6)
AND h.header_id = l.header_id
AND h.move_order_type NOT IN
(gme_common_pvt.g_invis_move_order_type
,inv_globals.g_move_order_put_away)
ORDER BY l.header_id, l.line_id;
PROCEDURE delete_move_order_lines (
p_organization_id IN NUMBER
,p_batch_id IN NUMBER
,p_material_detail_id IN NUMBER
,p_invis_move_line_id IN NUMBER DEFAULT NULL
,p_invis_move_header_id IN NUMBER DEFAULT NULL
,x_return_status OUT NOCOPY VARCHAR2)
IS
l_api_name CONSTANT VARCHAR2 (30) := 'delete_move_order_lines';
delete_mo_line_err EXCEPTION;
delete_mo_hdr_err EXCEPTION;
SELECT COUNT (1)
FROM mtl_txn_request_lines
WHERE header_id = v_header_id;
l_trolin_tbl (i).operation := inv_globals.g_opr_delete;
l_trolin_tbl (l_row).operation := inv_globals.g_opr_delete;
gme_debug.put_line('No move order lines to delete');
RAISE delete_mo_line_err;
l_trohdr_rec.operation := inv_globals.g_opr_delete;
RAISE delete_mo_hdr_err;
WHEN delete_mo_line_err THEN
IF (g_debug IS NOT NULL) THEN
gme_debug.put_line
( 'inv_move_order_pub.process_move_order_line returns '
|| l_return_status);
WHEN delete_mo_hdr_err THEN
IF (g_debug IS NOT NULL) THEN
gme_debug.put_line
( 'inv_move_order_pub.process_move_order returns '
|| l_return_status);
END delete_move_order_lines;
PROCEDURE update_move_order_lines (
p_batch_id IN NUMBER
,p_material_detail_id IN NUMBER
,p_new_qty IN NUMBER := NULL
,p_new_date IN DATE := NULL
,p_invis_move_line_id IN NUMBER DEFAULT NULL
,x_return_status OUT NOCOPY VARCHAR2)
IS
l_api_name CONSTANT VARCHAR2 (30) := 'update_move_order_lines';
SELECT l.*
FROM mtl_txn_request_lines l, mtl_txn_request_headers h
WHERE transaction_source_type_id =
gme_common_pvt.g_txn_source_type
AND l.txn_source_id = p_batch_id
AND l.txn_source_line_id = p_material_detail_id
AND l.line_status NOT IN (5, 6)
AND h.header_id = l.header_id
AND h.move_order_type NOT IN
(gme_common_pvt.g_invis_move_order_type
,inv_globals.g_move_order_put_away)
ORDER BY l.creation_date DESC;
select dtl_um
from gme_material_details
where material_detail_id = p_material_detail_id;
l_trolin_tbl (1).operation := inv_globals.g_opr_update;
inv_globals.g_opr_delete;
inv_globals.g_opr_update;
l_trolin_tbl (1).operation := inv_globals.g_opr_update;
l_trolin_tbl (l_cnt).operation := inv_globals.g_opr_update;
END update_move_order_lines;
SELECT 1
FROM mtl_txn_request_lines l, mtl_txn_request_headers h
WHERE l.txn_source_id = p_batch_id
AND l.txn_source_line_id = p_material_detail_id
AND l.organization_id = p_organization_id
AND l.line_status NOT IN (5, 6)
AND h.header_id = l.header_id
AND h.move_order_type = gme_common_pvt.g_move_order_type
AND ROWNUM = 1;
SELECT primary_uom_code, secondary_uom_code, concatenated_segments
FROM mtl_system_items_kfv
WHERE organization_id = v_org_id
AND inventory_item_id = v_inventory_item_id;
PROCEDURE delete_batch_move_orders (
p_organization_id IN NUMBER
,p_batch_id IN NUMBER
,p_delete_invis IN VARCHAR2 := 'F'
,x_return_status OUT NOCOPY VARCHAR2)
IS
l_api_name CONSTANT VARCHAR2 (30) := 'delete_batch_move_orders';
SELECT h.batch_id, h.move_order_header_id, d.material_detail_id
,d.move_order_line_id
FROM gme_batch_header h, gme_material_details d
WHERE h.organization_id = p_organization_id
AND h.batch_id = p_batch_id
AND d.batch_id = h.batch_id
AND d.line_type = gme_common_pvt.g_line_type_ing;
IF (p_delete_invis = fnd_api.g_true) THEN
l_invis_line_id := l_lines_tbl (i).move_order_line_id;
delete_move_order_lines
(p_organization_id => p_organization_id
,p_batch_id => l_lines_tbl (i).batch_id
,p_material_detail_id => l_lines_tbl (i).material_detail_id
,p_invis_move_line_id => l_invis_line_id
,p_invis_move_header_id => l_invis_header_id
,x_return_status => l_return_status);
END delete_batch_move_orders;