<?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: SY-SUBRC in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075775#M430262</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;See if Sy-subrc = 0 &lt;/P&gt;&lt;P&gt;success or ( you can use it accordingly)&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;not succes &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/7b/fb96c8882811d295a90000e8353423/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/7b/fb96c8882811d295a90000e8353423/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Chilla&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 15 Apr 2007 10:37:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-15T10:37:16Z</dc:date>
    <item>
      <title>SY-SUBRC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075771#M430258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;y shouldnt v give SY-SUBRC with in select statement..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if yes y? wat  z the use??&lt;/P&gt;&lt;P&gt;if no y??? wat z the use??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Apr 2007 04:28:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075771#M430258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-15T04:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: SY-SUBRC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075772#M430259</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;Sy-subrc is used to check whether the select statement is executed successfully or not..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Meaning..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;***Record found.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;***No record found..&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Apr 2007 04:34:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075772#M430259</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-15T04:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: SY-SUBRC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075773#M430260</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;What do you mean by in SELECT statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you talking between SELECT and ENDSELECT? Between SELECT and END SELECT sy-subrc is always 0. Because if your code between SELECT .... ENDSELECT is being executed, that means that the record found in database. And if record found in database than sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if you have any question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Apr 2007 04:39:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075773#M430260</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-15T04:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: SY-SUBRC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075774#M430261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;chk this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is because, only if the condition given (in WHERE) in the SELECT statement is true then only it will go inside the SELECT ...ENDSELECT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In below select if there is an entry for the plant in p_werks in the table T001W then only the control will go inside. That means inside this SELECT ...ENDSELECT the value of sy-subrc will be always zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select SINGLE * from t001w where werks = p_werks.
if ( sy-subrc eq 0 ).
move '-Plant existing in table ' to msg.
else.
move '- Plant not existing in table ' to msg.
endif&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Apr 2007 04:40:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075774#M430261</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-15T04:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: SY-SUBRC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075775#M430262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;See if Sy-subrc = 0 &lt;/P&gt;&lt;P&gt;success or ( you can use it accordingly)&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;not succes &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/7b/fb96c8882811d295a90000e8353423/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/7b/fb96c8882811d295a90000e8353423/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Chilla&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Apr 2007 10:37:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075775#M430262</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-15T10:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: SY-SUBRC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075776#M430263</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;As Select EndSelect is generally used to fetch a lot of records and if inside it we use if sy-subrc = 0. then it will consume precious database time during which the table is locked for use.Hence it is unadvisable to use sy-subrc inside Select Endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can either use 'Select into Table' for the same along with 'Where' as the criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Award Suitable points for all the useful answers.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers.&lt;/P&gt;&lt;P&gt;ashish.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Apr 2007 11:17:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075776#M430263</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-15T11:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: SY-SUBRC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075777#M430264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sy-Subrc = 0 means records found as per the select statement. If sy-subrc is not equal to 0 then no records are found.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to know how many records it selected, check sy-dbcnt. if a select statement finds 60 records in a table then sy-dbcnt = 60.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I guess this is helpful&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2007 05:35:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075777#M430264</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-16T05:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: SY-SUBRC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075778#M430265</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;SELECTsets SY-SUBRC to 0 if at least one row was read, otherwise 4 or even 8 with SELECT SINGLE FOR UPDATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so you can use the sy-subrc to check weather the select statement has retrieved any data from the data base or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see the following example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters g_matnt type mara-matnr.&lt;/P&gt;&lt;P&gt;select single matnr from mara into g_matnr where matnr = g_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;if sy-subrc ne 0.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;message 'Invalid material ' Type 'E'.&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful......&lt;/P&gt;&lt;P&gt;Suresh......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2007 05:48:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075778#M430265</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-16T05:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: SY-SUBRC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075779#M430266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kota,&lt;/P&gt;&lt;P&gt;           As a rule, if &amp;lt;b&amp;gt;SY-SUBRC = 0&amp;lt;/b&amp;gt;, the statement was executed  &lt;/P&gt;&lt;P&gt;           successfully.SELECT sets &amp;lt;b&amp;gt;SY-SUBRC to 0&amp;lt;/b&amp;gt; for &amp;lt;b&amp;gt;every pass by &lt;/P&gt;&lt;P&gt;           value to an abap data  object&amp;lt;/b&amp;gt;  ,Otherwise to &amp;lt;b&amp;gt;4 if the result set is &lt;/P&gt;&lt;P&gt;           empty&amp;lt;/b&amp;gt;, Possibly &amp;lt;b&amp;gt;8 in SELECT SINGLE FOR UPDATE&amp;lt;/b&amp;gt; without the &lt;/P&gt;&lt;P&gt;           primary key being specified after where clause, &amp;lt;b&amp;gt;Else 12 for warning &lt;/P&gt;&lt;P&gt;           message&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt; &amp;lt;b&amp;gt;Conclusion:&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;                 sy-subrc would matter only if you give inside a &amp;lt;b&amp;gt;nested select statement&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;                 Else it must be declared out for observing the stated rules above...&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Dhayanandh .S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2007 06:17:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075779#M430266</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-16T06:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: SY-SUBRC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075780#M430267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hiii&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sy-subrc is used to check whether the query in the select statement is executrd or not.If sy-subrc is 0 then select query is successfully executed .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Hitesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 05:37:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075780#M430267</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-17T05:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: SY-SUBRC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075781#M430268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi kota sansy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY in general means system variables. SUBRC is used to check whether the previous statement was executed successfully. If subrc is 0 means it was successful. It is used within the select statement to check whether some data have been selected using that select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Santhosh Kumar .V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2007 06:00:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-subrc/m-p/2075781#M430268</guid>
      <dc:creator>Santhosh_Vellingiri</dc:creator>
      <dc:date>2007-04-17T06:00:10Z</dc:date>
    </item>
  </channel>
</rss>

