<?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 Re: Get data from temp table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-temp-table/m-p/10342019#M1837378</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do join instead of for all entries , &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 May 2014 11:23:35 GMT</pubDate>
    <dc:creator>sriharsha_parayatham</dc:creator>
    <dc:date>2014-05-20T11:23:35Z</dc:date>
    <item>
      <title>Get data from temp table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-temp-table/m-p/10342016#M1837375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;Dear All ABAP Exeprts,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;I have written a query&amp;nbsp; but it gives error on&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;&lt;STRONG&gt;t_vbak-KNUMV &lt;SPAN class="L1S52"&gt;as&lt;/SPAN&gt; KNUMV&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="L1S52"&gt;line &lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;I want to get KNUMV from the&amp;nbsp;&amp;nbsp; t_vbak&amp;nbsp; table. How can I write this query.?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;Aneel&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L1S52"&gt;SELECT&lt;/SPAN&gt; vbeln &lt;SPAN class="L1S31"&gt;" Sales Document&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; posnr &lt;SPAN class="L1S31"&gt;" Sales Document Item&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; matnr &lt;SPAN class="L1S31"&gt;" Material Number&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arktx &lt;SPAN class="L1S31"&gt;" Short text for sales order&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S31"&gt;" item&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; kwmeng &lt;SPAN class="L1S31"&gt;" Cumulative Order Quantity&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vrkme &lt;SPAN class="L1S31"&gt;" Sales unit&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; t_vbak-KNUMV &lt;SPAN class="L1S52"&gt;as&lt;/SPAN&gt; KNUMV&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52"&gt;FROM&lt;/SPAN&gt; vbap&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52"&gt;INTO&lt;/SPAN&gt; &lt;SPAN class="L1S52"&gt;TABLE&lt;/SPAN&gt; t_vbap&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52"&gt;FOR&lt;/SPAN&gt; &lt;SPAN class="L1S52"&gt;ALL&lt;/SPAN&gt; ENTRIES &lt;SPAN class="L1S52"&gt;IN&lt;/SPAN&gt; t_vbak &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52"&gt;WHERE&lt;/SPAN&gt; vbeln &lt;SPAN class="L1S52"&gt;EQ&lt;/SPAN&gt; t_vbak-vbeln.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 06:30:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-temp-table/m-p/10342016#M1837375</guid>
      <dc:creator>aneel_munawar</dc:creator>
      <dc:date>2014-05-19T06:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Get data from temp table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-temp-table/m-p/10342017#M1837376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aneel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;You may have to do it in two steps.&lt;/LI&gt;&lt;LI&gt;I guess your T_VBAK internal table is already filled.&lt;/LI&gt;&lt;LI&gt;Now you are going to join this internal table with the values of database table VBAP comparing the VBELN.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pseudo Code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN class="L1S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;SELECT&lt;/SPAN&gt; * from vbak where ""some condition&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN class="L1S52" style="font-family: inherit; font-style: inherit; font-weight: inherit; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN class="L1S52" style="font-family: inherit; font-style: inherit; font-weight: inherit; font-size: 10pt;"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit; font-style: inherit; font-weight: inherit; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-family: inherit; font-style: inherit; font-weight: inherit; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vbeln &lt;SPAN class="L1S31" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;" Sales Document&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; posnr &lt;SPAN class="L1S31" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;" Sales Document Item&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; matnr &lt;SPAN class="L1S31" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;" Material Number&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arktx &lt;SPAN class="L1S31" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;" Short text for sales order&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S31" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;" item&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; kwmeng &lt;SPAN class="L1S31" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;" Cumulative Order Quantity&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vrkme &lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;FROM&lt;/SPAN&gt; vbap&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;INTO&lt;/SPAN&gt; &lt;SPAN class="L1S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;TABLE&lt;/SPAN&gt; t_vbap&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;FOR&lt;/SPAN&gt; &lt;SPAN class="L1S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;ALL&lt;/SPAN&gt; ENTRIES &lt;SPAN class="L1S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;IN&lt;/SPAN&gt; t_vbak&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L1S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;WHERE&lt;/SPAN&gt; vbeln &lt;SPAN class="L1S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;EQ&lt;/SPAN&gt; t_vbak-vbeln.&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;LOOP AT IT_VBAP ITO WA_VBAP.&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;READ TABLE IT_VBAK INTO WA_VBAK WHERE VBELN = WA_VBELN.&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;WA_FINAL-KNUMV&amp;nbsp; =&amp;nbsp; WA_VBAK-KNUMV.&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;******&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;some codes&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;append wa_final to it_final.&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;*******&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;ENDLOOP.&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Regards,&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Philip.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 06:40:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-temp-table/m-p/10342017#M1837376</guid>
      <dc:creator>philipdavy</dc:creator>
      <dc:date>2014-05-19T06:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Get data from temp table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-temp-table/m-p/10342018#M1837377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not possible in a single SELECT statement, every field of the result must come from the database : single columns and aggregates. So execute your SELECT and then merge the two internal table into a final table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could (should) also consider building a JOIN with the first SELECT which built T_VBAK, as a single JOIN between VBAK and VBAK should give (much) better performance in a single SELECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 13:29:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-temp-table/m-p/10342018#M1837377</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2014-05-19T13:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get data from temp table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-temp-table/m-p/10342019#M1837378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do join instead of for all entries , &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 11:23:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-temp-table/m-p/10342019#M1837378</guid>
      <dc:creator>sriharsha_parayatham</dc:creator>
      <dc:date>2014-05-20T11:23:35Z</dc:date>
    </item>
  </channel>
</rss>

