You are on page 1of 2

declare

v_acct_id number;
cursor rs is select segment1,
organization_id,
unit_weight,description,
planner_code,completion_locator,
completion_subinventory
from XXIT_INV_ITEM_IMPORT
where organization_id = 607 ;
v_intentory_item_id NUMBER := 99;
V_INVENTORY_LOCATION_ID NUMBER := 99 ;
begin
for r in rs loop
select inventory_item_id into v_intentory_item_id from mtl_system_items_b wher
e segment1 = r.segment1 and organization_id = 105;

select INVENTORY_LOCATION_ID into V_INVENTORY_LOCATION_ID from MTL_ITEM_LOCATI


ONS where
segment1 = r.description and segment2 = r.planner_code and segment3 = r.compl
etion_locator;
EXCEPTION
WHEN NO_DATA_FOUND THEN
V_INVENTORY_LOCATION_ID := null;

insert into mtl_transactions_interface (source_code, source_line_id, source_he


ader_id, process_flag,
transacti
on_mode, last_update_date, last_updated_by, creation_date,
created_b
y, organization_id, transaction_quantity, transaction_uom,
inventory_
item_id, transaction_date, transaction_type_id,TRANSACTION_ACTION_ID,
TRANSACTIO
N_SOURCE_TYPE_ID,TRANSACTION_SOURCE_ID,TRANSACTION_REFERENCE,
subinvento
ry_code, locator_id)
values ( 'Geith Parts Adju
stments', -48, -48, 1,
3, sysdat
e, -1, sysdate,
-1, 607, r
.unit_weight, 'EA',
v_intentor
y_item_id, sysdate, 41,27,
6,682,'Gei
th Parts Adjustments',
'CHISTOCK', V_I
NVENTORY_LOCATION_ID) ;
commit;

end loop;
end;
/

You might also like