<?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 ABAP  query help in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-help/m-p/1257246#M146562</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a query that is giving me a Run time Error and reason is  databse commit is being called before the databse selection is completed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understood the error but I do not know how to solve it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select * from  ZEDMSTR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    rec-businessunit = ZEDMSTR-ZBUSUNIT.&lt;/P&gt;&lt;P&gt;    rec-tablename = ZEDMSTR-ZTABNAME.&lt;/P&gt;&lt;P&gt;    rec-oldlegcode = ZEDMSTR-ZOLDLEGCODE.&lt;/P&gt;&lt;P&gt;    rec-description = ZEDMSTR-ZDESCRIPTION.&lt;/P&gt;&lt;P&gt;    rec-newlawsoncode = ZEDMSTR-ZNEWLAWCODE.&lt;/P&gt;&lt;P&gt;   WRITE: ' tHE RECORDS GOT APPENDED INTO THE TABLE'.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;  exit.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt;  append rec.&lt;/P&gt;&lt;P&gt;  endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table ZEDMSTR HAS FIVE FIELDS (SAME NUMBER DECLARED FOR THE INTERNL TABLE 'REC') AND I HAVE TO PULL ALL THE RECORDS OF ALL THE FIELDS FROM THE TABLE INTO REC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is how can I modify the select query  to eliminate the runtime exception and without the use of select...endselect. because I shall be reading over 40,000 records from the query and it may raise a performance issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help folks.&lt;/P&gt;&lt;P&gt;Vinu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Apr 2006 17:00:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-04-12T17:00:56Z</dc:date>
    <item>
      <title>ABAP  query help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-help/m-p/1257246#M146562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a query that is giving me a Run time Error and reason is  databse commit is being called before the databse selection is completed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understood the error but I do not know how to solve it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select * from  ZEDMSTR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    rec-businessunit = ZEDMSTR-ZBUSUNIT.&lt;/P&gt;&lt;P&gt;    rec-tablename = ZEDMSTR-ZTABNAME.&lt;/P&gt;&lt;P&gt;    rec-oldlegcode = ZEDMSTR-ZOLDLEGCODE.&lt;/P&gt;&lt;P&gt;    rec-description = ZEDMSTR-ZDESCRIPTION.&lt;/P&gt;&lt;P&gt;    rec-newlawsoncode = ZEDMSTR-ZNEWLAWCODE.&lt;/P&gt;&lt;P&gt;   WRITE: ' tHE RECORDS GOT APPENDED INTO THE TABLE'.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;  exit.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt;  append rec.&lt;/P&gt;&lt;P&gt;  endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table ZEDMSTR HAS FIVE FIELDS (SAME NUMBER DECLARED FOR THE INTERNL TABLE 'REC') AND I HAVE TO PULL ALL THE RECORDS OF ALL THE FIELDS FROM THE TABLE INTO REC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is how can I modify the select query  to eliminate the runtime exception and without the use of select...endselect. because I shall be reading over 40,000 records from the query and it may raise a performance issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help folks.&lt;/P&gt;&lt;P&gt;Vinu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Apr 2006 17:00:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-help/m-p/1257246#M146562</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-12T17:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP  query help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-help/m-p/1257247#M146563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vinu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : REC TYPE TABLE OF ZEDMSTR.&lt;/P&gt;&lt;P&gt;SELECT * FROM ZEDMSTR INTO CORRESPONDING FIELDS OF TABLE REC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't want to declare REC like that declare the way you want, but declare another table like the way I have done and loop at the table and move the records into REC table using a WORKAREA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : Please close the thread if this solves the issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Apr 2006 17:05:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-help/m-p/1257247#M146563</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-12T17:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP  query help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-help/m-p/1257248#M146564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vinu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, you don't need a SY-SUBRC check within a select end-select loop. Your check should be outside the loop. Are you getting this error while you are debugging? When you are debugging, a select endselect loop sometimes results in this dump. If you put your breakpoint after the endselect, you will not get this dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select * from ZEDMSTR.
  rec-businessunit = ZEDMSTR-ZBUSUNIT.
  rec-tablename = ZEDMSTR-ZTABNAME.
  rec-oldlegcode = ZEDMSTR-ZOLDLEGCODE.
  rec-description = ZEDMSTR-ZDESCRIPTION.
  rec-newlawsoncode = ZEDMSTR-ZNEWLAWCODE.
  append rec.
endselect.
if sy-subrc &amp;lt;&amp;gt; 0. &amp;lt;-- put your breakpoint here
  write:/ 'No records selected.'.
else.
  write:/ 'Records are appended.'.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Apr 2006 17:11:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-help/m-p/1257248#M146564</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-12T17:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP  query help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-help/m-p/1257249#M146565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have coded a select and want to test the value of sy-subrc, your test must come after the endselect. Why? The answer lies in the fact that the code between the select and endselect is executed once for each row returned from the database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If zero rows are returned from the database, the code between select and endselect is never executed. Therefore, you must code the test for sy-subrc after the endselect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Apr 2006 17:37:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-help/m-p/1257249#M146565</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-12T17:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP  query help</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-help/m-p/1257250#M146566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys for the input it really helped and solved the problem. I shall reward the points.&lt;/P&gt;&lt;P&gt;Vinu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Apr 2006 19:22:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-help/m-p/1257250#M146566</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-12T19:22:48Z</dc:date>
    </item>
  </channel>
</rss>

