日志
库存事务处理接口
![]() ![]()
库存事务处理临时表 Mtl_material_transactions_temp
批次事务处理临时表 mtl_transaction_lots_temp 序列事务处理临时表 mtl_serial_numbers_temp ü 表 Mtl_material_transactions_temp n allowed_units_lookup_code 默认值 3 n created_by 默认值 fnd_global.user_id n creation_date 默认值 sysdate n last_update_date 默认值 sysdate n last_update_login 默认值 fnd_global.login_id n last_updated_by 默认值 fnd_global.user_id n final_completion_flag 默认值 N n lock_flag 默认值 N n posting_flag 默认值 Y n process_flag 默认值 Y n source_line_id 默认值 null n transaction_header_id 来源 mtl_material_transactions_s.nextval n transaction_mode 默认值 3 n transaction_status 默认值 1 n transaction_temp_id 来源 mtl_material_transactions_s.nextval 以下信息来源于物料定义(mtl_system_items_b msi) n organization_id 来源 msi.organization_id n Inventory_item_id 来源 msi.inventory_item_id n item_description 来源 msi.description n item_inventory_asset_flag 来源 msi.inventory_asset_flag n item_location_control_code 来源 msi.location_control_code n item_lot_control_code 来源 msi.lot_control_code n item_primary_uom_code 来源 msi.primary_uom_code n item_restrict_subinv_code 来源 msi.restrict_subinventories_code n item_restrict_locators_code 来源 msi.restrict_locators_code n item_revision_qty_control_code 来源 msi.revision_qty_control_code n item_segments 来源 msi.segment1 n item_serial_control_code 来源 msi.serial_number_control_code n item_shelf_life_code 来源 msi.shelf_life_code n item_shelf_life_days 来源 msi.shelf_life_days n item_trx_enabled_flag 来源 msi.mtl_transactions_enabled_flag n transaction_uom 来源 msi.primary_uom_code 以下数据来源库存事务处理类型(mtl_transaction_types mt) n transaction_type_id 来源 mt.transaction_type_id n transaction_action_id 来源 mt.transaction_action_id n transaction_source_type_id 来源 mt.transaction_source_type_id 以下数据外部赋值 n transaction_date 库存事务处理日期必须在开放或者将来的库存会计期间 n acct_period_id 库存事务处理日期所在的库存会计期间 n primary_quantity 事务处理数量 n subinventory_code 仓库 n Locator_id 货位 n transaction_quantity 事务处理数量 n transaction_source_id 帐户别名对应的帐户或者帐户发放的帐户 n distribution_account_id 帐户别名对应的帐户或者帐户发放的帐户 提交后台请求(或者让系统自动提交,系统每隔几分钟提交一次) fnd_request.submit_request( 'INV', 'INCTCW', '', '', FALSE, to_char(g_group_id), '2', '','','','','','','','', '','','','','','','','','','','','','','','','','','','','', '','','','','','','','','','','','','','','','','','','','', '','','','','','','','','','','','','','','','','','','','', '','','','','','','','','','','','','','','','','','','','', '','','','','','','','','',''); 实例:(帐户别名接收的库存事务处理) --测试库存事务处理 declare errbuf VARCHAR2(240); errcode NUMBER; g_org_id NUMBER := 84; x_trx_qty NUMBER; x_acct_id NUMBER; x_request_id NUMBER; x_qty_disp NUMBER; x_oraphase VARCHAR2(240); x_return VARCHAR2(240); x_phase VARCHAR2(240); x_status VARCHAR2(240); x_message VARCHAR2(240); x_req_status BOOLEAN; x_precision NUMBER; g_period_id number; g_group_id number; g_item_id number := 23884; g_mtx mtl_material_transactions_temp%ROWTYPE; g_user_id number := 2539; g_date date := sysdate; g_subinv varchar2(30) :='972';-- 'SUBINV'; g_trx_type_id number := 41; -----账户别名接收 g_serial_prefix varchar2(30); g_lot_prefix varchar2(30); BEGIN begin select acct_period_id into g_period_id from org_acct_periods oap where oap.organization_id = 84/*g_org_id*/ and g_date between oap.period_start_date and oap.schedule_close_date; --dbms_output.put_line(g_period_id); exception when others then dbms_output.put_line(sqlerrm); end; BEGIN select mtl_material_transactions_s.nextval into g_group_id from dual; Exception when others then dbms_output.put_line(sqlerrm); END; x_trx_qty := 1; g_trx_type_id := 41; g_mtx.allowed_units_lookup_code := 3; g_mtx.created_by := g_user_id; g_mtx.creation_date := g_date; g_mtx.last_update_date := g_date; g_mtx.last_update_login := g_user_id; g_mtx.last_updated_by := g_user_id; g_mtx.final_completion_flag := 'N'; BEGIN select organization_id, inventory_item_id, description, a.inventory_asset_flag, a.location_control_code, a.lot_control_code, a.primary_uom_code, a.restrict_subinventories_code, a.restrict_locators_code, a.revision_qty_control_code, a.segment1, a.serial_number_control_code, a.shelf_life_code, a.shelf_life_days, a.mtl_transactions_enabled_flag, a.primary_uom_code, a.auto_serial_alpha_prefix, a.auto_lot_alpha_prefix into g_mtx.organization_id, g_mtx.inventory_item_id, g_mtx.item_description, g_mtx.item_inventory_asset_flag, g_mtx.item_location_control_code, g_mtx.item_lot_control_code, g_mtx.item_primary_uom_code, g_mtx.item_restrict_subinv_code, g_mtx.item_restrict_locators_code, g_mtx.item_revision_qty_control_code, g_mtx.item_segments, g_mtx.item_serial_control_code, g_mtx.item_shelf_life_code, g_mtx.item_shelf_life_days, g_mtx.item_trx_enabled_flag, g_mtx.transaction_uom, g_serial_prefix, g_lot_prefix from mtl_system_items_b a where organization_id = g_org_id and inventory_item_id = g_item_id; Exception when others then dbms_output.put_line(sqlerrm); END; g_mtx.lock_flag := 'N'; g_mtx.posting_flag := 'Y'; g_mtx.process_flag := 'Y'; g_mtx.source_line_id := -1; g_mtx.transaction_header_id := g_group_id; g_mtx.transaction_mode := 3; g_mtx.transaction_status := 1; g_mtx.transaction_temp_id := g_group_id; BEGIN select transaction_type_id, transaction_action_id, transaction_source_type_id into g_mtx.transaction_type_id, g_mtx.transaction_action_id, g_mtx.transaction_source_type_id from mtl_transaction_types a where a.transaction_type_id = g_trx_type_id; Exception when others then dbms_output.put_line(sqlerrm); END; g_mtx.acct_period_id := g_period_id; g_mtx.primary_quantity := x_trx_qty; g_mtx.subinventory_code := g_subinv; g_mtx.supply_locator_id := ''; g_mtx.transaction_date := g_date; g_mtx.transaction_cost := 1.001; g_mtx.transaction_quantity := x_trx_qty; g_mtx.transaction_source_id := 1220;--13; g_mtx.transaction_source_name := ''; g_mtx.operation_seq_num := ''; g_mtx.department_id := ''; g_mtx.wip_entity_type := ''; g_mtx.distribution_account_id := ''; begin insert into mtl_material_transactions_temp values g_mtx; --rollback; commit; dbms_output.put_line(g_mtx.transaction_header_id); dbms_output.put_line(g_mtx.transaction_source_type_id); exception when others then dbms_output.put_line(sqlerrm); rollback; end; x_request_id := fnd_request.submit_request('INV', 'INCTCW', '', '', FALSE, to_char(g_group_id), '2', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''); IF x_request_id > 0 THEN commit; dbms_output.put_line('后台请求 ' || x_request_id); END IF; END; ![]() |
只说不练,假把式。现在所做任何事情从实践中来到实践中去。
loading......
[@more@]
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7730229/viewspace-1020422/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7730229/viewspace-1020422/
使用签名档 道具:请选择道具隐身草彩虹炫天使之爱 悄悄话 | (以小纸条形式发送) 查看今日免费发送数量
通知到好友信息中心(该评论可显示在QQ好友及关注我的友人的信息中心)