{"id":1861,"date":"2011-04-17T15:08:27","date_gmt":"2011-04-17T09:38:27","guid":{"rendered":"http:\/\/sendyoursmiles.com\/?p=1861"},"modified":"2011-04-17T15:08:27","modified_gmt":"2011-04-17T09:38:27","slug":"get-on-hand-quantities-through-api","status":"publish","type":"post","link":"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api","title":{"rendered":"Get On Hand Quantities through API"},"content":{"rendered":"<p>This script can be used to get the below quantities.<br \/>\n1. On-hand Quantity<br \/>\n2. Available to Reserve<br \/>\n3. Quantity Reserved<br \/>\n4. Quantity Suggested<br \/>\n5. Available to Transact<br \/>\n6. Available to Reserve<\/p>\n<p>You can also get the On-hand quantities from the table mtl_onhand_quantities<\/p>\n<p>GET ON-HAND QUANTITIES API <\/p>\n<p><code><\/p>\n<p>DECLARE<br \/>\n   x_return_status         VARCHAR2 (50);<br \/>\n   x_msg_count             VARCHAR2 (50);<br \/>\n   x_msg_data              VARCHAR2 (50);<br \/>\n   v_item_id               NUMBER;<br \/>\n   v_org_id                NUMBER;<br \/>\n   v_qoh                   NUMBER;<br \/>\n   v_rqoh                  NUMBER;<br \/>\n   v_atr                   NUMBER;<br \/>\n   v_att                   NUMBER;<br \/>\n   v_qr                    NUMBER;<br \/>\n   v_qs                    NUMBER;<br \/>\n   v_lot_control_code      BOOLEAN;<br \/>\n   v_serial_control_code   BOOLEAN;<\/p>\n<p>BEGIN<br \/>\n   -- Set the variable values<br \/>\n   v_item_id := '6566';<br \/>\n   v_org_id := 61;<br \/>\n   v_qoh := NULL;<br \/>\n   v_rqoh := NULL;<br \/>\n   v_atr := NULL;<br \/>\n   v_lot_control_code := FALSE;<br \/>\n   v_serial_control_code := FALSE;<\/p>\n<p>   -- Set the org context<br \/>\n   fnd_client_info.set_org_context (1);<\/p>\n<p>   -- Call API<br \/>\n   inv_quantity_tree_pub.query_quantities<br \/>\n   (p_api_version_number       =&gt; 1.0,<br \/>\n    p_init_msg_lst             =&gt; 'F',<br \/>\n    x_return_status            =&gt; x_return_status,<br \/>\n    x_msg_count                =&gt; x_msg_count,<br \/>\n    x_msg_data                 =&gt; x_msg_data,<br \/>\n    p_organization_id          =&gt; v_org_id,<br \/>\n    p_inventory_item_id        =&gt; v_item_id,<br \/>\n    p_tree_mode                =&gt; apps.inv_quantity_tree_pub.g_transaction_mode, -- or 3<br \/>\n    p_is_revision_control      =&gt; FALSE,<br \/>\n    p_is_lot_control           =&gt; v_lot_control_code,  -- is_lot_control,<br \/>\n    p_is_serial_control        =&gt; v_serial_control_code,<br \/>\n    p_revision                 =&gt; NULL,        -- p_revision,<br \/>\n    p_lot_number               =&gt; NULL,           -- p_lot_number,<br \/>\n    p_lot_expiration_date      =&gt; SYSDATE,<br \/>\n    p_subinventory_code        =&gt; NULL,    -- p_subinventory_code,<br \/>\n    p_locator_id               =&gt; NULL,           -- p_locator_id,<br \/>\n    -- p_cost_group_id            =&gt; NULL,       -- cg_id,<br \/>\n    p_onhand_source            =&gt; 3,<br \/>\n    x_qoh                      =&gt; v_qoh,      -- Quantity on-hand<br \/>\n    x_rqoh                     =&gt; v_rqoh,           --reservable quantity on-hand<br \/>\n    x_qr                       =&gt; v_qr,<br \/>\n    x_qs                       =&gt; v_qs,<br \/>\n    x_att                      =&gt; v_att,  -- available to transact<br \/>\n    x_atr                      =&gt; v_atr    -- available to reserve<\/p>\n<p>   );<\/p>\n<p>   DBMS_OUTPUT.put_line ('On-Hand Quantity: ' || v_qoh);<br \/>\n   DBMS_OUTPUT.put_line ('Available to reserve: ' || v_atr);<br \/>\n   DBMS_OUTPUT.put_line ('Quantity Reserved: ' || v_qr);<br \/>\n   DBMS_OUTPUT.put_line ('Quantity Suggested: ' || v_qs);<br \/>\n   DBMS_OUTPUT.put_line ('Available to Transact: ' || v_att);<br \/>\n   DBMS_OUTPUT.put_line ('Available to Reserve: ' || v_atr);<\/p>\n<p>EXCEPTION<br \/>\n   WHEN OTHERS<br \/>\n   THEN<br \/>\n      DBMS_OUTPUT.put_line ('ERROR: ' || SQLERRM);<br \/>\nEND;<\/code><\/p>\n<p>GET ON-HAND QUANTITIES FROM TABLE <\/p>\n<p><code>SELECT * FROM MTL_ONHAND_QUANTITIES;<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This script can be used to get the below quantities. 1. On-hand Quantity 2. Available to Reserve 3. Quantity Reserved 4. Quantity Suggested 5. Available to Transact 6. Available to Reserve You can also get the On-hand quantities from the table mtl_onhand_quantities GET ON-HAND QUANTITIES API DECLARE x_return_status VARCHAR2 (50); x_msg_count VARCHAR2 (50); x_msg_data VARCHAR2 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-1861","post","type-post","status-publish","format-standard","hentry","category-scripts"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>On Hand Quantities through API oracle apps<\/title>\n<meta name=\"description\" content=\"1. On-hand Quantity 2. Available to Reserve 3. Quantity Reserved 4. Quantity Suggested 5. Available to Transact 6. Available to Reserve\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prudhvi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api#article\",\"isPartOf\":{\"@id\":\"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api\"},\"author\":{\"name\":\"Prudhvi\",\"@id\":\"https:\/\/erpschools.com\/erps\/#\/schema\/person\/dbed9bb7fb66aa7a700fc565da024512\"},\"headline\":\"Get On Hand Quantities through API\",\"datePublished\":\"2011-04-17T09:38:27+00:00\",\"dateModified\":\"2011-04-17T09:38:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api\"},\"wordCount\":53,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/erpschools.com\/erps\/#organization\"},\"articleSection\":[\"Scripts\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api\",\"url\":\"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api\",\"name\":\"On Hand Quantities through API oracle apps\",\"isPartOf\":{\"@id\":\"https:\/\/erpschools.com\/erps\/#website\"},\"datePublished\":\"2011-04-17T09:38:27+00:00\",\"dateModified\":\"2011-04-17T09:38:27+00:00\",\"description\":\"1. On-hand Quantity 2. Available to Reserve 3. Quantity Reserved 4. Quantity Suggested 5. Available to Transact 6. Available to Reserve\",\"breadcrumb\":{\"@id\":\"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/erpschools.com\/erps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get On Hand Quantities through API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/erpschools.com\/erps\/#website\",\"url\":\"https:\/\/erpschools.com\/erps\/\",\"name\":\"erpSchools\",\"description\":\"Oracle Apps\",\"publisher\":{\"@id\":\"https:\/\/erpschools.com\/erps\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/erpschools.com\/erps\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/erpschools.com\/erps\/#organization\",\"name\":\"erpSchools\",\"url\":\"https:\/\/erpschools.com\/erps\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/erpschools.com\/erps\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/erps_logo7.png\",\"contentUrl\":\"https:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/erps_logo7.png\",\"width\":250,\"height\":60,\"caption\":\"erpSchools\"},\"image\":{\"@id\":\"https:\/\/erpschools.com\/erps\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"http:\/\/facebook.com\/erpschools\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/erpschools.com\/erps\/#\/schema\/person\/dbed9bb7fb66aa7a700fc565da024512\",\"name\":\"Prudhvi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/erpschools.com\/erps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/488cec3605845b95cb20e60c67a8f5c7e74b65a305525c8006315d524f120db9?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/488cec3605845b95cb20e60c67a8f5c7e74b65a305525c8006315d524f120db9?s=96&d=blank&r=g\",\"caption\":\"Prudhvi\"},\"sameAs\":[\"http:\/\/www.erpschools.com\"],\"url\":\"https:\/\/erpschools.com\/erps\/author\/prudhvi\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"On Hand Quantities through API oracle apps","description":"1. On-hand Quantity 2. Available to Reserve 3. Quantity Reserved 4. Quantity Suggested 5. Available to Transact 6. Available to Reserve","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api","twitter_misc":{"Written by":"Prudhvi","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api#article","isPartOf":{"@id":"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api"},"author":{"name":"Prudhvi","@id":"https:\/\/erpschools.com\/erps\/#\/schema\/person\/dbed9bb7fb66aa7a700fc565da024512"},"headline":"Get On Hand Quantities through API","datePublished":"2011-04-17T09:38:27+00:00","dateModified":"2011-04-17T09:38:27+00:00","mainEntityOfPage":{"@id":"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api"},"wordCount":53,"commentCount":3,"publisher":{"@id":"https:\/\/erpschools.com\/erps\/#organization"},"articleSection":["Scripts"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api#respond"]}]},{"@type":"WebPage","@id":"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api","url":"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api","name":"On Hand Quantities through API oracle apps","isPartOf":{"@id":"https:\/\/erpschools.com\/erps\/#website"},"datePublished":"2011-04-17T09:38:27+00:00","dateModified":"2011-04-17T09:38:27+00:00","description":"1. On-hand Quantity 2. Available to Reserve 3. Quantity Reserved 4. Quantity Suggested 5. Available to Transact 6. Available to Reserve","breadcrumb":{"@id":"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/erpschools.com\/erps\/scripts\/get-on-hand-quantities-through-api#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/erpschools.com\/erps"},{"@type":"ListItem","position":2,"name":"Get On Hand Quantities through API"}]},{"@type":"WebSite","@id":"https:\/\/erpschools.com\/erps\/#website","url":"https:\/\/erpschools.com\/erps\/","name":"erpSchools","description":"Oracle Apps","publisher":{"@id":"https:\/\/erpschools.com\/erps\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/erpschools.com\/erps\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/erpschools.com\/erps\/#organization","name":"erpSchools","url":"https:\/\/erpschools.com\/erps\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/erpschools.com\/erps\/#\/schema\/logo\/image\/","url":"https:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/erps_logo7.png","contentUrl":"https:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/erps_logo7.png","width":250,"height":60,"caption":"erpSchools"},"image":{"@id":"https:\/\/erpschools.com\/erps\/#\/schema\/logo\/image\/"},"sameAs":["http:\/\/facebook.com\/erpschools"]},{"@type":"Person","@id":"https:\/\/erpschools.com\/erps\/#\/schema\/person\/dbed9bb7fb66aa7a700fc565da024512","name":"Prudhvi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/erpschools.com\/erps\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/488cec3605845b95cb20e60c67a8f5c7e74b65a305525c8006315d524f120db9?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/488cec3605845b95cb20e60c67a8f5c7e74b65a305525c8006315d524f120db9?s=96&d=blank&r=g","caption":"Prudhvi"},"sameAs":["http:\/\/www.erpschools.com"],"url":"https:\/\/erpschools.com\/erps\/author\/prudhvi"}]}},"_links":{"self":[{"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/posts\/1861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/comments?post=1861"}],"version-history":[{"count":0,"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/posts\/1861\/revisions"}],"wp:attachment":[{"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/media?parent=1861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/categories?post=1861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/tags?post=1861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}