You are on page 1of 3

11/12/21, 5:16 PM Document 268974.

1
  Last Login: November 12, 2021 2:43 PM IST Rajasekaran (Available) (0) Contact Us Help
PowerView is On

 
Dashboard Knowledge Service Requests Patches & Updates Community

Give Feedback...
Copyright (c) 2021, Oracle. All rights reserved. Oracle Confidential.

Check Onhand With PL/SQL: Review Stock Picture For An Item in a Given Organization / Subinventory [Video] To Bottom
(Doc ID 268974.1)

In this Document   Was this document helpful?  

Goal Yes
No
Solution    

  SQL Script
  Document Details  
  Video
  Script
Type:
  Example Output HOWTO
Status:
PUBLISHED
References Last Major
Update: May 6, 2016
Last Oct 1, 2021
Update: English
APPLIES TO: Language:
   

Oracle Inventory Management - Version 11.5.10.2 and later


Information in this document applies to any platform.
  Related Products  

Oracle Inventory Management


GOAL
   

  Information Centers  
How does one check onhand quantity levels with PL/SQL? Information Center: Oracle

Inventory Management
This script will provide snapshot for stock(material) for Item in an Organization / Subinventory. [1381258.2]
The script output will provide details with the following results:

   

  Document References  
Title Explanation Item Search Screen In 11.5.10
Do Not Show On Hand
Quantity on hand Onhand Quantity for the Item Quantity [296015.1]

Quantity res oh Reservable Quantity On hand


   

Quantity res Quantity reserved   Recently Viewed  

Quantity sug Quantity Suggested INV_Quantity_Tree_PUB.Query_


Quantity ATT Available To Transact Is Not Considering Item Status
[1906996.1]
Quantity ATR Available To Reserve SRDC - Oracle EAM/WIP : Gene
Collection [2336185.1]
  EBS Enterprise Asset Managem
Configuration Analyzer [235253

Note : Do not enter input parameters in quotes, such as subinventory when prompted 'Stores',
   

instead enter as Stores.

SOLUTION

SQL Script

Create the below script in a form of a SQL file.


Example : OnHand.sql

Enter the Inventory_item_id, Organization_id and the Subinventory_code.

Video

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=459011520045944&id=268974.1&displayIndex=10&_afrWindowMode=0&_adf.ct… 1/3
11/12/21, 5:16 PM Document 268974.1
Video - Step thru API call (02:59) Trouble seeing this video?

Script

set serveroutput on

prompt Enter Organization_id


accept org_id

prompt Enter

Inventory_item_id
accept item_id

DECLARE

L_api_return_status VARCHAR2(1);
l_qty_oh NUMBER;

l_qty_res_oh NUMBER;
l_qty_res NUMBER;

l_qty_sug NUMBER;

l_qty_att NUMBER;

l_qty_atr NUMBER;

l_msg_count NUMBER;

l_msg_data VARCHAR2(1000);

BEGIN

apps.inv_quantity_tree_grp.clear_quantity_cache;

dbms_output.put_line('Transaction Mode');

(
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 => &org_id


, p_inventory_item_id => &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
=> '&Subinventory'
, 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
);

dbms_output.put_line('Quantity on hand :'||to_char(l_qty_oh));


dbms_output.put_line('Quantity

res oh :'||to_char(l_qty_res_oh));
dbms_output.put_line('Quantity res :'||to_char(l_qty_res));

dbms_output.put_line('Quantity sug :'||to_char(l_qty_sug));

dbms_output.put_line('Quantity ATT :'||to_char(l_qty_att));

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=459011520045944&id=268974.1&displayIndex=10&_afrWindowMode=0&_adf.ct… 2/3
11/12/21, 5:16 PM Document 268974.1
dbms_output.put_line('Quantity ATR :'||to_char(l_qty_atr));

end;
/

Note: For p_tree_mode : Either reservation mode (1), Transaction mode, (2), Loose Only mode (3) or No LPN Reservation
mode (4). See the Oracle Manufacturing

details.
APIs and Open Interfaces Manual for more

Example Output

SQL> @onhand

Enter Organization_id
207


Inventory_item_id
Enter
163744


, p_organization_id => &org_id
old 22:
new 22: , p_organization_id => 207

old 23: , p_inventory_item_id => &item_id


new 23: , p_inventory_item_id => 163744

Enter value for subinventory:

old 31: , p_subinventory_code

=> '&Subinventory'
new 31: , p_subinventory_code => ''

Transaction Mode

Quantity on hand
:2390
Quantity res oh :2390

Quantity res :0

Quantity sug :0

Quantity ATT :2390


Quantity ATR :2390

PL/SQL procedure successfully completed.

Note: If there is onhand quantity in expired lots, the API will consider the expired lots as unavailable only if the parameter
"p_lot_expiration_date" is passed. This is mentioned in Bug 10281811

REFERENCES

NOTE:296015.1 - Item Search Screen In 11.5.10 Do Not Show On Hand Quantity


Oracle Manufacturing APIs and Open Interfaces Manual

Didn't find what you are looking for? Ask in Community...

Related
Products

Oracle E-Business Suite > Logistics > Logistics > Oracle Inventory Management > Material Status > Material Status

Keywords
API; AVAILABLE TO RESERVE; AVAILABLE TO TRANSACT; FND_API; INV_QUANTITY_TREE_PUB; ON HAND QUANTITY; ONHAND QUANTITY; OPEN INTERFACES; PARAMETER;
QUANTITY; STOCK ON HAND; SUBINVENTORY
Translations

English Source Korean 한국어

Back to Top
 
Copyright (c) 2021, Oracle. All rights reserved. Legal Notices and Terms of Use Privacy Statement
   

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=459011520045944&id=268974.1&displayIndex=10&_afrWindowMode=0&_adf.ct… 3/3

You might also like