<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic SQL query: availability check in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-availability-check/m-p/12509172#M2003878</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I'm trying to create a simple availability check for quotation items, but my problem is that the open quantities ([OpenCreQty]) of the same items distributed on different positions are not summed and matched with the stock.&lt;/P&gt;
  &lt;P&gt;I have tried to solve this by equating with the sum of the open quantity, but unfortunately this does not work yet.&lt;/P&gt;
  &lt;P&gt;Has anyone an idea to fix this simple query?&lt;/P&gt;
  &lt;P&gt;Thank you for your hint in advance.&lt;/P&gt;
  &lt;P&gt;SELECT T1.[U_position], T1.[ItemCode], T1.[Quantity], T1.[OpenCreQty], T2.[OnHand] &lt;/P&gt;
  &lt;P&gt;FROM OQUT T0 &lt;/P&gt;
  &lt;P&gt;INNER JOIN QUT1 T1 ON T0.[DocEntry] = T1.[DocEntry] &lt;/P&gt;
  &lt;P&gt;INNER JOIN OITM T2 ON T1.[ItemCode] = T2.[ItemCode] &lt;/P&gt;
  &lt;P&gt;WHERE T0.[DocNum] = '332008' AND T2.[OnHand] &amp;lt; (SELECT SUM(T1.[OpenCreQty]) FROM OQUT T0 INNER JOIN QUT1 T1 ON T0.[DocEntry] = T1.[DocEntry] WHERE T0.[DocNum] = '332008' GROUP BY T1.[OpenCreQty]) AND T2.[InvntItem] = 'Y' &lt;/P&gt;
  &lt;P&gt;GROUP BY T1.[U_position], T1.[ItemCode], T1.[Quantity], T1.[OpenCreQty], T2.[OnHand]&lt;/P&gt;</description>
    <pubDate>Wed, 09 Mar 2022 19:05:40 GMT</pubDate>
    <dc:creator>former_member1236455</dc:creator>
    <dc:date>2022-03-09T19:05:40Z</dc:date>
    <item>
      <title>SQL query: availability check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-availability-check/m-p/12509172#M2003878</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I'm trying to create a simple availability check for quotation items, but my problem is that the open quantities ([OpenCreQty]) of the same items distributed on different positions are not summed and matched with the stock.&lt;/P&gt;
  &lt;P&gt;I have tried to solve this by equating with the sum of the open quantity, but unfortunately this does not work yet.&lt;/P&gt;
  &lt;P&gt;Has anyone an idea to fix this simple query?&lt;/P&gt;
  &lt;P&gt;Thank you for your hint in advance.&lt;/P&gt;
  &lt;P&gt;SELECT T1.[U_position], T1.[ItemCode], T1.[Quantity], T1.[OpenCreQty], T2.[OnHand] &lt;/P&gt;
  &lt;P&gt;FROM OQUT T0 &lt;/P&gt;
  &lt;P&gt;INNER JOIN QUT1 T1 ON T0.[DocEntry] = T1.[DocEntry] &lt;/P&gt;
  &lt;P&gt;INNER JOIN OITM T2 ON T1.[ItemCode] = T2.[ItemCode] &lt;/P&gt;
  &lt;P&gt;WHERE T0.[DocNum] = '332008' AND T2.[OnHand] &amp;lt; (SELECT SUM(T1.[OpenCreQty]) FROM OQUT T0 INNER JOIN QUT1 T1 ON T0.[DocEntry] = T1.[DocEntry] WHERE T0.[DocNum] = '332008' GROUP BY T1.[OpenCreQty]) AND T2.[InvntItem] = 'Y' &lt;/P&gt;
  &lt;P&gt;GROUP BY T1.[U_position], T1.[ItemCode], T1.[Quantity], T1.[OpenCreQty], T2.[OnHand]&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 19:05:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-availability-check/m-p/12509172#M2003878</guid>
      <dc:creator>former_member1236455</dc:creator>
      <dc:date>2022-03-09T19:05:40Z</dc:date>
    </item>
  </channel>
</rss>

