<?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 INTO TABLE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086765#M977096</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had another example. I can see the 60% in the above example.&lt;/P&gt;&lt;P&gt;But try this small modification of the example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  data : gt_bkpf like bkpf occurs 0,
         gs_bkpf like bkpf.

    select *
           into gs_bkpf
           from bkpf
           up to 100000 rows.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have no access to a system with such large BKPF tables,  I see .... less than 10% difference, here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the reality?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Jul 2008 14:38:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-02T14:38:30Z</dc:date>
    <item>
      <title>SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086749#M977080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a possibility to convert something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF r_mystruct,
	field1(10),
	field2(20),
	field3(30),
	field4(40),
	field5,
	field6(5)
       END OF r_mystruct.

DATA:
	tab TYPE STANDARD TABLE OF r_mystruct WITH HEADER LINE.

MOVE sy-index TO tab-field5.
SELECT aufnr gsber ktext FROM aufk INTO CORRESPONDING FIELDS OF aufk.
	MOVE aufk-aufnr TO tab-myfield1.
	MOVE aufk-aufnr TO tab-myfield2.
	MOVE aufk-ktext TO tab-myfield3.
	MOVE aufk-gsber TO tab-myfield4.
	APPEND tab.
ENDSELECT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to a statement involving a SELECT INTO TABLE ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried something like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT aufnr aufnr ktext gsber ( sy-index ) NULL FROM aufk INTO TABLE tab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i get numerous errors (and yes, i need to have aufnr twice)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any hints on how to transfer selected fields to a completely custom structure, is it possible ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance, &lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 06:16:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086749#M977080</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-02T06:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086750#M977081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bart,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you ever hear about table buffer?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just define in tables statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables : aufk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;remove into corresponding field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 06:22:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086750#M977081</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-02T06:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086751#M977082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is I don't want to select data into table with exactly the same fields as the source table(here AUFK).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to make a custom structure which is &lt;STRONG&gt;common for&lt;/STRONG&gt; &lt;STRONG&gt;many selects&lt;/STRONG&gt; &lt;STRONG&gt;from different tables&lt;/STRONG&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In presented select AUFNR from AUFK table goes to field1.&lt;/P&gt;&lt;P&gt;I have more selects, for example from PRPS where PSPNR goes into field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I'm interested in optimizing the select by converting the SELECT - MOVE - ENDSELECT to a SELECT INTO TABLE, but once again not a table of AUFK or PRPS, but my custom table consisting of a set of custom rows (type r_myrecord, with fields field1, field2 .. ).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 06:32:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086751#M977082</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-02T06:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086752#M977083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi declare the type as....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF r_mystruct,&lt;/P&gt;&lt;P&gt;                field1(10),&lt;/P&gt;&lt;P&gt;	aufnr type aufk-aufnr,&lt;/P&gt;&lt;P&gt;	ktext  type aufk-ktext ,&lt;/P&gt;&lt;P&gt;	gsber type aufk-gsber,&lt;/P&gt;&lt;P&gt;                field5,&lt;/P&gt;&lt;P&gt;	field6(5)&lt;/P&gt;&lt;P&gt;       END OF r_mystruct.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA: tab TYPE STANDARD TABLE OF r_mystruct WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SELECT * INTO CORRESPONDING FIELDS OF TABLE tab&lt;/P&gt;&lt;P&gt;               FROM  aufk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the abv select query will fetch the aufnr,ktext and gsber fields...&lt;/P&gt;&lt;P&gt;for rest of the fields...usse the below loop..after the select statement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;itab-field1 = itab-aufnr.&lt;/P&gt;&lt;P&gt;itab-field5 = sy-index.&lt;/P&gt;&lt;P&gt;itab-field6 = ''.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rudra Prasanna Mohapatra on Jul 2, 2008 8:37 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 06:37:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086752#M977083</guid>
      <dc:creator>former_member195383</dc:creator>
      <dc:date>2008-07-02T06:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086753#M977084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To sum it up more picture wise:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT aufnr aufnr ktext gsber ( sy-index ) NULL FROM aufk INTO TABLE tab.
or
SELECT pspnr posid post1 pgsbr ( sy-index ) 'blah' FROM prps INTO TABLE tab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So at the end I expect to obtain, in the first case:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;tab[] = 
FIELD1     FIELD2     FIELD3     FIELD4     FIELD5    FIELD6
aufnr	     aufnr      ktext      gsber      9         [empty]
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the second case:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
tab[]=
FIELD1     FIELD2     FIELD3     FIELD4     FIELD5    FIELD6
pspnr	     pspnr      post1      pgsbr      7         blah&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in the first select, some fields of AUFK go into the tab\[\] and in second select fields of PRPS go into tab\[\].&lt;/P&gt;&lt;P&gt;And I'm asking is it possible to do it &lt;STRONG&gt;avoiding the LOOP with MOVE aufnr or syindex or 'blah' to fieldX&lt;/STRONG&gt;, I'd like it to be handled by the SELECT INTO TABLE &lt;STRONG&gt;automatically&lt;/STRONG&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 06:44:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086753#M977084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-02T06:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086754#M977085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Bart,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selecting the same field twice in one SELECT ==&amp;gt; works&lt;/P&gt;&lt;P&gt;'selecting' a system variable (sy-index) ==&amp;gt; does not work&lt;/P&gt;&lt;P&gt;'selecting' NULL ==&amp;gt; does not work&lt;/P&gt;&lt;P&gt;'selecting' a literal ('blah') ==&amp;gt; does not work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;ec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 06:50:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086754#M977085</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2008-07-02T06:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086755#M977086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES: BEGIN OF r_mystruct,
	field1 like aufk-aufnr,
	field2 like aufk-aufnr,
	field3 like aufk-ktext,
	field4 like aufk-gsber,
       END OF r_mystruct.
 
DATA:
	tab TYPE STANDARD TABLE OF r_mystruct WITH HEADER LINE.
 

SELECT aufnr aufnr ktext gsber FROM aufk INTO table tab.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 06:51:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086755#M977086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-02T06:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086756#M977087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after using the select query why dont u use the below loop statement....That will solve ur purpose of selecting null value ans sy-index value...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;itab-field1 = itab-aufnr.&lt;/P&gt;&lt;P&gt;itab-field5 = sy-index.&lt;/P&gt;&lt;P&gt;itab-field6 = ''.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 06:53:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086756#M977087</guid>
      <dc:creator>former_member195383</dc:creator>
      <dc:date>2008-07-02T06:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086757#M977088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES: BEGIN OF r_mystruct,
	field1(10),
	field2(20),
	field3(30),
	field4(40),
	field5,
	field6(5)
       END OF r_mystruct.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are all mostly circling around this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES: BEGIN OF r_mystruct,
field1(10),
aufnr type aufk-aufnr,
ktext type aufk-ktext ,
gsber type aufk-gsber,
field5,
field6(5)
END OF r_mystruct.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've already said I want to feed the same structure once with AUFK data, once with PRPS data or data from some other tables.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT * INTO CORRESPONDING FIELDS OF TABLE tab
FROM aufk. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will work ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this won't:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT pspnr [here some other fields from PRPS] INTO CORRESPONDING FIELDS OF TABLE tab
FROM prps.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Your structure is only suitable for AUFK.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 07:12:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086757#M977088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-02T07:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086758#M977089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;than you can do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT aufn AS field1 whatever AS field2 whatever AS field3 ...&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE tab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 07:17:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086758#M977089</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2008-07-02T07:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086759#M977090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Allright, everything obviously can't be solved by the SELECT only, but pointed alternatives of Rudra Prasanna and Eric Cartman \[ xxx AS field1, gosh how could I miss that ] were helpful. Points rewarded. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 07:33:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086759#M977090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-02T07:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086760#M977091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't understand why it should not be possible to do it in one SELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your original solution is probably the best solution already.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT aufnr gsber ktext FROM aufk INTO CORRESPONDING FIELDS OF aufk.&lt;/P&gt;&lt;P&gt;	MOVE aufk-aufnr TO tab-myfield1.&lt;/P&gt;&lt;P&gt;	MOVE aufk-aufnr TO tab-myfield2.&lt;/P&gt;&lt;P&gt;	MOVE aufk-ktext TO tab-myfield3.&lt;/P&gt;&lt;P&gt;	MOVE aufk-gsber TO tab-myfield4.&lt;/P&gt;&lt;P&gt;                MOVE (sy-index   TO tab-myfield5.&lt;/P&gt;&lt;P&gt;                MOVE 'blabla'       TO tab-myfield6.&lt;/P&gt;&lt;P&gt;APPEND tab.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is only the misunderstanding, that SELECT ... INTO TABLE is supposed to be much better&lt;/P&gt;&lt;P&gt;that SELECT ... ENDSELECT, which is not true!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get rid of the INTO COORESPONDING FIELDS, define a smaller structure where INTO works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And what is SY-INDEX????&lt;/P&gt;&lt;P&gt;Field:SY-INDEX&lt;/P&gt;&lt;P&gt;Definition&lt;/P&gt;&lt;P&gt;In DO- and WHILEloops, the number of the previous loop passes including the current pass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is that what you want?&lt;/P&gt;&lt;P&gt;Or the counter of the internal table?&lt;/P&gt;&lt;P&gt;or just a counter?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 11:13:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086760#M977091</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-02T11:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086761#M977092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; There is only the misunderstanding, that SELECT ... INTO TABLE is supposed to be much better&lt;/P&gt;&lt;P&gt;&amp;gt; that SELECT ... ENDSELECT, which is not true!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Siegfried,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how does this compare to the statement "It is always faster to use the Into Table version of a Select  statement than to use Append statements. " of the performance examples within SE80? I suspect that some of these are quite outdated anyways.&lt;/P&gt;&lt;P&gt;Please shed some light on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 11:26:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086761#M977092</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-07-02T11:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086762#M977093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I created a small, fast and dirty test:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : begin of gt_bkpf occurs 0,
       bukrs like bkpf-bukrs,
       belnr like bkpf-belnr,
       gjahr like bkpf-gjahr,
       end of gt_bkpf.

select bukrs belnr gjahr up to 100000 rows
       from bkpf
       into gt_bkpf.
append gt_bkpf.
endselect.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : begin of gt_bkpf occurs 0,
       bukrs like bkpf-bukrs,
       belnr like bkpf-belnr,
       gjahr like bkpf-gjahr,
       end of gt_bkpf.

select bukrs belnr gjahr up to 100000 rows
       from bkpf
       into table gt_bkpf.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first example takes about 60% more time, than the first.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 11:38:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086762#M977093</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2008-07-02T11:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086763#M977094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would be more convinced, if you measure the faster one first and slower later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even if you measure identical things you will see often that the first one is slower than the second.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;60% is too much I would say.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see 10%, but I am looking forward to other measurements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 10% overhead for the SELECT ... ENDSELECT is here o.k., because it save the LOOP, which is probably more expensive than 10%.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 13:05:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086763#M977094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-02T13:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086764#M977095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;based on Eric's example with 100K records:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Array read:    0.139 seconds&lt;/P&gt;&lt;P&gt;Append:    0.329 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1000K records:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Array read:    1.406 seconds&lt;/P&gt;&lt;P&gt;Append:    3.286 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;very consistent from second measurement on. sandbox with 80 million BKPF entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 13:36:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086764#M977095</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-07-02T13:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086765#M977096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had another example. I can see the 60% in the above example.&lt;/P&gt;&lt;P&gt;But try this small modification of the example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  data : gt_bkpf like bkpf occurs 0,
         gs_bkpf like bkpf.

    select *
           into gs_bkpf
           from bkpf
           up to 100000 rows.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have no access to a system with such large BKPF tables,  I see .... less than 10% difference, here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the reality?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 14:38:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086765#M977096</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-02T14:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086766#M977097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BKPF/BSEG and COBK/COEP are our monsters here, very FI/CO heavy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;100K reading ALL fields from BKPF (select * into):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Array read:  3.340 seconds&lt;/P&gt;&lt;P&gt;Append:  3.646 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is your 10%...interesting result indeed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then: 100K selecting * into corresponding fields (structure as in Erics example)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Array read:    0.146 seconds&lt;/P&gt;&lt;P&gt;Append:  &lt;DEL&gt;3.399 seconds&lt;/DEL&gt;  wrong, correct: 0.305 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...any interpretations?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: All my results in a little overview:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
                                                                                100,000  BKPF records read.                                                                                
SELECT * FROM tab INTO CORRESPONDING FIELDS (3 fields in target structure):           
Array Select:            0.145  sec                                                   
Loop/Append :            0.307  sec                                                   
SELECT f1 f2 f3 FROM tab INTO (3 fields in target structure):                         
Array Select:            0.135  sec                                                   
Loop/Append :            0.304  sec                                                   
SELECT f1 f2 f3 FROM tab INTO CORRESPONDING FIELDS (all fields in target structure):  
Array Select:            0.400  sec                                                   
Loop/Append :            0.540  sec                                                   
SELECT * FROM tab INTO (all fields in target structure):                              
Array Select:            3.411  sec                                                   
Loop/Append :            3.692  sec                                                   
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2008 14:58:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086766#M977097</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-07-02T14:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086767#M977098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I gave it a try as well and had the same result. The difference was less than 10% (rather surprising). However two remarks:&lt;/P&gt;&lt;P&gt;- From tables like BKPF/BSEG I always select with field list and never with *&lt;/P&gt;&lt;P&gt;- In the line-by-line select there &lt;EM&gt;should&lt;/EM&gt; be some data manipulation between the SELECT and the APPEND, which also reduces the performance. Otherwise it does not make much sense to select this way. In fact we have to compare:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ....&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;data manipulation&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;APPEND  ....&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ... INTO TABLE ...&lt;/P&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;data manipulation&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 07:02:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086767#M977098</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2008-07-03T07:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT INTO TABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086768#M977099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eric,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; - From tables like BKPF/BSEG I always select with field list and never with *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Me too, but my results here show that as long as you define a target table with only the necessary fields, there is almost no difference between SELECT * INTO CORRESPONDING FIELDS and SELECT f1 f2 f3 ... INTO (with our without INTO CORRESPONDING FIELDS). The mistake that a lot of people make is to SELECT * INTO a target table that is simply defined by the database table, e.g. BKPF, but then only work with a small subset of all that data. Large overhead.&lt;/P&gt;&lt;P&gt;In fact, SELECT * INTO CORRESPONDING FIELDS into a target table with few colums allows for nice dynamic programming possibilities.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; - In the line-by-line select there &lt;EM&gt;should&lt;/EM&gt; be some data manipulation between the SELECT and the APPEND, which also reduces the performance. Otherwise it does not make much sense to select this way. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;True, but here I just wanted to compare the pure runtimes of these two constructs. I will add your additional test to my little program here.&lt;/P&gt;&lt;P&gt;Of course the results may vary on different hardware/OS/DB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: here it is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 1,000,000  BKPF records read.                                                                                
SELECT f1 f2 f3 FROM tab INTO (4 fields in target structure) with manipulation:    
Array Select, LOOP INTO     :            2.511  sec                                
Array Select, LOOP ASSIGNING:            2.059  sec                                
Loop/Manipulate/Append      :            3.498  sec                                
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Array select still in front...ASSIGNING better than INTO, but we knew that anyway, didn't we. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Manipulation is to concatenate f1 f2 f3 into an additional field f4.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jul 2008 07:17:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table/m-p/4086768#M977099</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-07-03T07:17:08Z</dc:date>
    </item>
  </channel>
</rss>

