<?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: statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329932#M797713</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;Instead of select * from give the select (field names).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mention the field names, hope it will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Jan 2008 05:30:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-29T05:30:09Z</dc:date>
    <item>
      <title>statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329931#M797712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i declared internal table like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab like  dbtab occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to fetch the data from the  dbtab. and i written&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from dbtab into corresponding fields of table itab.&lt;/P&gt;&lt;P&gt;write: itab-fileds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but in this way i am not getting records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this one i did differenrtly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from dbtab into corresponding fields of   itab.&lt;/P&gt;&lt;P&gt;write: itab-fileds.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in this way i am fetching all the records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is the problem in first select ststement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 05:25:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329931#M797712</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T05:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329932#M797713</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;Instead of select * from give the select (field names).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mention the field names, hope it will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 05:30:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329932#M797713</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T05:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329933#M797714</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 selecting the data u write write: itab-fileds.in loop endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 05:30:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329933#M797714</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T05:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329934#M797715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;prS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your first statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you are not looping the select statement.So internal table unable to print all records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in you select statement you are looping the select statement by SELECT ......ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is the reason second statement is giving output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more suggestion&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when you have declared internal table with same structure like your dbase table why do you use into coreesponding in select statement .It give bad performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't forget to reward if useful....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 05:30:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329934#M797715</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T05:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329935#M797716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In debug mode you verify your internal table contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then try to use this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;  write:/ itab-fields.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 05:31:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329935#M797716</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T05:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329936#M797717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you know actually ur itab is populated in both cases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;problem is in your write statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in first case there is no loop .&lt;/P&gt;&lt;P&gt;so try this syntax with first case----&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*select * from dbtab into corresponding fields of table itab.*&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;loop at itab.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;write: itab-fields.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endloop.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it will work definitely&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz reward if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;keep rockin&lt;/P&gt;&lt;P&gt;vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 05:31:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329936#M797717</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T05:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329937#M797718</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;&lt;/P&gt;&lt;P&gt;Declare internal table like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of ty_mara,&lt;/P&gt;&lt;P&gt;          matnr type mara-matnr,&lt;/P&gt;&lt;P&gt;          matkl type matkl-matkl,&lt;/P&gt;&lt;P&gt;          end of ty_mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_mara type table of ty_mara,           "internal table&lt;/P&gt;&lt;P&gt;        wa_mara type ty_mara.                   " work-area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select matnr matkl from mara&lt;/P&gt;&lt;P&gt;            into table it_mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then loop the table it_mara for displaying the records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_mara into wa_mara.&lt;/P&gt;&lt;P&gt; write: / wa_mara-matnr, wa_mara-matkl.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;don't use select endselect statment. it will cause performance issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Santosh Thorat&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 05:34:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329937#M797718</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T05:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329938#M797719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;   from dbtable&lt;/P&gt;&lt;P&gt;   into table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;  write:/ itab-field1,itab-field2....&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 05:36:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329938#M797719</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T05:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329939#M797720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In the first statement instead of using * use all the field names to be selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the case of  using * there must be end statement for that select. it perfomence is just like loop and endloop.&lt;/P&gt;&lt;P&gt;so that u can write the itab now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;vasavi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 05:38:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329939#M797720</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T05:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329940#M797721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select * from dbtab into corresponding fields &lt;STRONG&gt;of table&lt;/STRONG&gt; itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;case 1&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;whenever you use &lt;STRONG&gt;of table&lt;/STRONG&gt;  in a select statement in a select statement , it automatically loops for all record in dbtab in single line into itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;U&gt;case 2&lt;/U&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;but whenever you avoid &lt;STRONG&gt;of table&lt;/STRONG&gt; you have to add a endselect statement , and now you can loop between these two codes any no of statement you want with count equal to number of records in dbtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;DIFFERENCE&lt;/STRONG&gt;&lt;/U&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when you dont have any codes to loop that is you only have to populate the itab from dbtab always use &lt;STRONG&gt;case1&lt;/STRONG&gt; as performance wiser in case2 &lt;EM&gt;ENDSELECT&lt;/EM&gt; statement has to be executed every time for each record transported from dbtab to itab&lt;/P&gt;&lt;P&gt;this increases load on presentation server and database server.&lt;/P&gt;&lt;P&gt;eg suppose for 1000 lines 1000 times endselect statement will be executed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 05:51:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/statement/m-p/3329940#M797721</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T05:51:52Z</dc:date>
    </item>
  </channel>
</rss>

