<?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: Select statement to use existing internal table data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-to-use-existing-internal-table-data/m-p/464259#M14668</link>
    <description>&lt;P&gt;I'm rather curious what business scenario would require such data selection? It's not unusual to search for, say, order items created in the last X days. In this case we'd just use a date range in WHERE condition. But to search so specifically for "order A items created on X date and order B items created on Y date" in one swoop seems rather odd... &lt;/P&gt;&lt;P&gt;Just wondering if by chance you might be over-thinking the requirement or there is some miscommunication.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Apr 2017 16:53:02 GMT</pubDate>
    <dc:creator>Jelena_Perfiljeva</dc:creator>
    <dc:date>2017-04-12T16:53:02Z</dc:date>
    <item>
      <title>Select statement to use existing internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-to-use-existing-internal-table-data/m-p/464254#M14663</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Here is my requirement. I have an internal table with Sales Order and Creation date. Now, I just need to get the item details into another internal table (from VBAP) AND I need to get the Creation date from the first internal table. I know we can get the items into second internal table and then loop through the list and query the first table to get the Creation date.&lt;/P&gt;&lt;P&gt;My question, is it possible to get the data into second internal table directly while querying the VBAP table with the new ABAP standards (we are on 7.50 with SP 5).&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Chandra&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 20:28:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-to-use-existing-internal-table-data/m-p/464254#M14663</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-04-07T20:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement to use existing internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-to-use-existing-internal-table-data/m-p/464255#M14664</link>
      <description>&lt;P&gt;Using internal tables as data sources of joins is not yet possible in that release ...&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 21:54:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-to-use-existing-internal-table-data/m-p/464255#M14664</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2017-04-07T21:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement to use existing internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-to-use-existing-internal-table-data/m-p/464256#M14665</link>
      <description>&lt;P&gt;Just join vbak, vbap then for all entries with internal sale  then get sale create date in vbak and some item data in vbap.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Apr 2017 02:49:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-to-use-existing-internal-table-data/m-p/464256#M14665</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-04-08T02:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement to use existing internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-to-use-existing-internal-table-data/m-p/464257#M14666</link>
      <description>&lt;P&gt;Use the inner join,,,,,,&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 18:26:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-to-use-existing-internal-table-data/m-p/464257#M14666</guid>
      <dc:creator>palash_mazumder</dc:creator>
      <dc:date>2017-04-11T18:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement to use existing internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-to-use-existing-internal-table-data/m-p/464258#M14667</link>
      <description>&lt;P&gt;How is this helpful to OP? They already said explicitly they're aware of such option.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 16:46:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-to-use-existing-internal-table-data/m-p/464258#M14667</guid>
      <dc:creator>Jelena_Perfiljeva</dc:creator>
      <dc:date>2017-04-12T16:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement to use existing internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-to-use-existing-internal-table-data/m-p/464259#M14668</link>
      <description>&lt;P&gt;I'm rather curious what business scenario would require such data selection? It's not unusual to search for, say, order items created in the last X days. In this case we'd just use a date range in WHERE condition. But to search so specifically for "order A items created on X date and order B items created on Y date" in one swoop seems rather odd... &lt;/P&gt;&lt;P&gt;Just wondering if by chance you might be over-thinking the requirement or there is some miscommunication.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 16:53:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-to-use-existing-internal-table-data/m-p/464259#M14668</guid>
      <dc:creator>Jelena_Perfiljeva</dc:creator>
      <dc:date>2017-04-12T16:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement to use existing internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-to-use-existing-internal-table-data/m-p/464260#M14669</link>
      <description>&lt;P&gt;Is this what you are looking for?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES:
  BEGIN OF ty_new_tab,
    vbeln TYPE vbeln,
    posnr TYPE posnr,
    matnr TYPE matnr,
    erdat TYPE erdat,
  END OF ty_new_tab,

  tty_new_tab TYPE STANDARD TABLE OF ty_new_tab WITH EMPTY KEY.

SELECT * FROM vbak
  INTO TABLE @DATA(vbak_tab)
  UP TO 20 ROWS.

SELECT * FROM vbap
  FOR ALL ENTRIES IN @vbak_tab
  WHERE vbeln = @vbak_tab-vbeln
  INTO TABLE @DATA(vbap_tab).

DATA(new_tab) =
  VALUE tty_new_tab(
      FOR vbap_line IN vbap_tab
        ( vbeln = vbap_line-vbeln
          posnr = vbap_line-posnr
          matnr = vbap_line-matnr
          erdat = vbak_tab[ vbeln = vbap_line-vbeln ]-erdat
        )
   ).

cl_demo_output=&amp;gt;display( new_tab ).
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Apr 2017 20:28:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-to-use-existing-internal-table-data/m-p/464260#M14669</guid>
      <dc:creator>raghug</dc:creator>
      <dc:date>2017-04-12T20:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement to use existing internal table data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-to-use-existing-internal-table-data/m-p/464261#M14670</link>
      <description>&lt;P&gt;Yes, this technically does a LOOP with the FOR statement, but this is a single command and a single place where the data extraction is being dealt with. This is opposed to older ABAP which would have been..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:
  vbak_line TYPE vbak,
  new_line  TYPE ty_new_tab,
  new_tab   TYPE tty_new_tab.

MOVE-CORRESPONDING vbap_tab TO new_tab.

LOOP AT new_tab INTO new_line.
  READ TABLE vbak_tab WITH KEY vbeln = sy-subrc INTO vbak_line.
  new_line-erdat = vbak_line-erdat.
  MODIFY new_tab FROM new_line.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Apr 2017 22:06:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-to-use-existing-internal-table-data/m-p/464261#M14670</guid>
      <dc:creator>raghug</dc:creator>
      <dc:date>2017-04-12T22:06:07Z</dc:date>
    </item>
  </channel>
</rss>

