The following lines contain the word 'select', 'insert', 'update' or 'delete':
FUNCTION Insert_Starting_Lot (
p_transaction_type IN NUMBER,
p_organization_id IN NUMBER,
p_wip_flag IN NUMBER,
p_split_flag IN NUMBER,
p_lot_number IN VARCHAR2,
p_inventory_item_id IN NUMBER,
p_quantity IN NUMBER,
p_subinventory_code IN VARCHAR2,
p_locator_id IN NUMBER,
p_revision IN VARCHAR2,
X_err_code OUT NOCOPY NUMBER,
X_err_msg OUT NOCOPY VARCHAR2
)
RETURN NUMBER IS
x_transaction_id NUMBER;
/* select WSM_split_merge_transactions_s.nextval
** into x_transaction_id
** from dual;
insert into WSM_lot_split_merges
(
transaction_id,
transaction_type_id,
organization_id,
last_update_date,
last_updated_by,
creation_date,
created_by,
wip_flag,
split_flag,
last_update_login
)
values
(
-- x_transaction_id,
WSM_split_merge_transactions_s.nextval,
p_transaction_type,
p_organization_id,
x_date,
x_user,
x_date,
x_user,
p_wip_flag,
p_split_flag,
x_login
)
returning transaction_id into x_transaction_id
;
insert into WSM_sm_starting_lots
(
transaction_id,
lot_number,
inventory_item_id,
organization_id,
quantity,
subinventory_code,
locator_id,
revision,
last_update_date,
last_updated_by,
creation_date,
created_by,
last_update_login
)
values
(
x_transaction_id,
p_lot_number,
p_inventory_item_id,
p_organization_id,
p_quantity,
p_subinventory_code,
p_locator_id,
p_revision,
x_date,
x_user,
x_date,
x_user,
x_login
)
;
x_err_msg := 'WSMPLBTH:INSERT_STARTING_LOT '||SUBSTR(SQLERRM, 1,60);
END Insert_Starting_Lot;
PROCEDURE Insert_Resulting_Lot (
p_transaction_id IN NUMBER ,
p_lot_number IN VARCHAR2 ,
p_inventory_item_id IN NUMBER ,
p_organization_id IN NUMBER ,
p_quantity IN NUMBER ,
p_subinventory_code IN VARCHAR2,
p_locator_id IN NUMBER,
X_err_code OUT NOCOPY NUMBER,
X_err_msg OUT NOCOPY VARCHAR2
) IS
x_date DATE := SYSDATE;
insert into WSM_sm_resulting_lots
(
transaction_id,
lot_number,
inventory_item_id,
organization_id,
quantity,
subinventory_code,
locator_id,
last_update_date,
last_updated_by,
creation_date,
created_by,
last_update_login
)
values
(
p_transaction_id,
p_lot_number,
p_inventory_item_id,
p_organization_id,
p_quantity,
p_subinventory_code,
p_locator_id,
x_date,
x_user,
x_date,
x_user,
x_login
);
x_err_msg := 'WSMPLBTH:INSERT_RESULTING_LOT '||SUBSTR(SQLERRM, 1,60);
END Insert_Resulting_Lot;
SELECT max(stock_locator_control_code)
INTO x_org_locator_control
FROM mtl_parameters
WHERE organization_id = p_organization_id;
x_err_msg := 'WSMPLBTH:INSERT_RESULTING_LOT '||SUBSTR(SQLERRM, 1,60);
INSERT INTO WIP_JOB_SCHEDULE_INTERFACE (
last_update_date,
last_updated_by,
creation_date,
created_by,
last_update_login,
group_id,
source_code,
source_line_id,
organization_id,
load_type,
status_type,
primary_item_id,
wip_supply_type,
job_name,
alternate_routing_designator,
alternate_bom_designator,
start_Quantity,
net_quantity,
wip_entity_id,
process_phase,
process_Status,
first_unit_start_date,
first_unit_completion_date,
last_unit_start_date,
last_unit_completion_date,
scheduling_method,
completion_subinventory,
completion_locator_id,
class_code,
description,
bom_reference_id,
routing_reference_id,
bom_revision_date,
routing_revision_date,
bom_revision,
routing_revision,
firm_planned_flag,
allow_explosion,
Lot_number,
coproducts_supply
)
VALUES
(
SYSDATE,
x_user_id,
SYSDATE,
x_user_id,
x_login,
-- x_group_id,
wip_job_schedule_interface_s.nextval,
'WSMLOT',
p_source_line_id,
p_organization_id,
5,
3,
p_primary_item_id,
3,
p_job_name,
p_alternate_rtg,
p_alternate_bom,
p_start_quantity,
p_net_quantity,
p_wip_entity_id,
2,
1,
p_start_date,
p_complete_date,
p_start_date,
p_complete_date,
3,
p_completion_subinventory,
p_completion_locator_id,
p_class_code,
p_description,
null, --p_bill_sequence_id,
null, --p_routing_sequence_id,
p_bom_revision_date,
p_routing_revision_date,
p_bom_revision,
p_routing_revision,
2,
'Y',
p_job_name,
p_coproducts_supply
)
returning group_id into x_group_id;
SELECT nvl(min(SUBSTR(error,1,100)),x_err_msg)
INTO x_err_msg
FROM WIP_INTERFACE_ERRORS
WHERE interface_id in
(SELECT interface_id
FROM wip_job_schedule_interface
WHERE group_id = x_group_id)
AND error_type = 1;
SELECT count(1)
INTO x_success
FROM WIP_DISCRETE_JOBS
WHERE wip_entity_id = p_wip_entity_id;
SELECT count(1)
INTO x_success
FROM WIP_OPERATIONS
WHERE wip_entity_id = p_wip_entity_id;
SELECT count(1)
INTO x_success
FROM WIP_REQUIREMENT_OPERATIONS
WHERE wip_entity_id = p_wip_entity_id;
SELECT min(SUBSTR(error,1,100))
INTO x_err_msg
FROM WIP_INTERFACE_ERRORS
WHERE interface_id in
(select interface_id
from wip_job_schedule_interface
where group_id = x_group_id)
AND error_type = 1;
PROCEDURE UPDATE_WRO( p_wip_entity_id NUMBER,
p_operation_seq_num NUMBER,
p_inventory_item_id NUMBER,
x_err_code OUT NOCOPY NUMBER,
x_err_msg OUT NOCOPY VARCHAR2 ) IS
BEGIN
UPDATE wip_requirement_operations
SET wip_supply_type = 1
WHERE wip_entity_id = p_wip_entity_id
AND operation_seq_num = p_operation_seq_num
AND inventory_item_id = p_inventory_item_id;
x_err_msg := 'WSMPLBTH:UPDATE_WRO '||SUBSTR(SQLERRM, 1,60);
inv_genealogy_pub.insert_genealogy
( p_api_version => 1.0,
p_object_type => 1,
p_parent_object_type => 1,
p_object_number => p_starting_lot_number,
p_inventory_item_id => p_source_item_id,
p_org_id => p_organization_id,
p_parent_object_number => p_resulting_lot_number,
p_parent_inventory_item_id => p_source_item_id,
p_parent_org_id => p_organization_id,
p_genealogy_origin => 3,
p_genealogy_type => 4,
p_origin_txn_id => p_transaction_id,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data ) ;