oracle ebs 接收数量,[zz]Oracle EBS API: 库存数量查询API示例

这个示例展示了如何使用Oracle EBS(INV)的API查询特定库存组织下物料的可用数量。通过调用`apps.INV_Quantity_Tree_PUB.Query_Quantities`函数,并传入相应参数如组织ID、物料ID、库存模式等,获取物料的在库、预留、建议等库存数据。如果API返回状态不成功,则返回库存数量为0。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Oracle EBS API: 库存数量查询API示例 (Sample: Inventory quantity inquiry API )

本示例对Oracle INV的API进行封装, 实现了某个库存组织下物料的可用数量查询.

create or replace function query_item_qty(v_item_id number)

return integer is

l_onhand_qty         NUMBER;

L_api_return_status  VARCHAR2(200);

l_msg_count          NUMBER;

l_msg_data           VARCHAR2(200);

is_revision_control  BOOLEAN;

l_qty_oh             NUMBER;

l_qty_res_oh         NUMBER;

l_qty_res            NUMBER;

l_qty_att            NUMBER;

l_qty_atr            NUMBER;

l_qty_sug            NUMBER;

begin

apps.inv_quantity_tree_grp.clear_quantity_cache;

apps.INV_Quantity_Tree_PUB.Query_Quantities (

p_api_version_number => 1.0

, p_init_msg_lst =>  apps.fnd_api.g_false

, x_return_status => L_api_return_status

, x_msg_count => l_msg_count

, x_msg_data => l_msg_data

, p_organization_id => 207

, p_inventory_item_id => v_item_id

, p_tree_mode => apps.INV_Quantity_Tree_PUB.g_transaction_mode

, p_onhand_source => 3

, p_is_revision_control=> false

, p_is_lot_control => FALSE

, p_is_serial_control => FALSE

, p_revision => NULL

, p_lot_number => NULL

, p_subinventory_code => ‘FGI’

, p_locator_id => NULL

, x_qoh => l_qty_oh

, x_rqoh => l_qty_res_oh

, x_qr => l_qty_res

, x_qs => l_qty_sug

, x_att => l_qty_att

, x_atr => l_qty_atr );

if L_api_return_status <> fnd_api.g_ret_sts_success then

l_onhand_qty := 0;

else

l_onhand_qty := l_qty_oh;

end if;

return(l_onhand_qty);

exception

when others then

log_error(’query_item_qty’, sqlerrm);

return(0);

end query_item_qty;

/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值