<?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: slin check warning with select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/slin-check-warning-with-select-statement/m-p/6018618#M1347255</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; Hi,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; use it this way... &lt;/P&gt;&lt;P&gt;&amp;gt; just write an if condition like the way it is shown below.....&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;CODE&gt;select single field1 from table into vari1
&amp;gt; where vbeln = p_vbeln.
&amp;gt; if sy-subrc = 0.
&amp;gt; "  your logic.......
&amp;gt; else.
&amp;gt; if vari1 is not initial.  " add this if condition if sy-subrc is not equal to zero.......
&amp;gt;   clear vari1. " this will not affect the flow of your program and also neither the output.....
&amp;gt; endif.&lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Regards,&lt;/P&gt;&lt;P&gt;&amp;gt; Siddarth&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;All that message means is that the field isn't used after being filled.  Often, this could be an indication of useless code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, what you're suggesting., is that you put in some &lt;STRONG&gt;more&lt;/STRONG&gt; spurious, useless code, just so that the message goes away!  That is absolutely the &lt;STRONG&gt;wrong&lt;/STRONG&gt; way of going about it.  It makes the code MORE complex, therefore LESS maintainable, therefore MORE expensive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case - an existence check - it's the only way to do it.  You have to have a variable which is never read - so that is &lt;STRONG&gt;why&lt;/STRONG&gt; it is perfectly fine to use #EC NEEDED. and &lt;STRONG&gt;why&lt;/STRONG&gt; SAP provided the option!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 23 Aug 2009 20:08:55 GMT</pubDate>
    <dc:creator>matt</dc:creator>
    <dc:date>2009-08-23T20:08:55Z</dc:date>
    <item>
      <title>slin check warning with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slin-check-warning-with-select-statement/m-p/6018613#M1347250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;experts &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : vari1 type ztable-field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want to check whether the entry exists in the table or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single field1 from table into vari1&lt;/P&gt;&lt;P&gt;where vbeln = p_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the slin check i got a warning message like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"No read access to field VARI1."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not using the varaible anywhere in the program except in the select query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please tell is this correct way of coding or not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Aug 2009 18:08:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slin-check-warning-with-select-statement/m-p/6018613#M1347250</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-23T18:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: slin check warning with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slin-check-warning-with-select-statement/m-p/6018614#M1347251</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;use it this way... &lt;/P&gt;&lt;P&gt;just write an if condition like the way it is shown below.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select single field1 from table into vari1
where vbeln = p_vbeln.
if sy-subrc = 0.
"  your logic.......
else.
if vari1 is not initial.  " add this if condition if sy-subrc is not equal to zero.......
  clear vari1. " this will not affect the flow of your program and also neither the output.....
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddarth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Aug 2009 18:41:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slin-check-warning-with-select-statement/m-p/6018614#M1347251</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-23T18:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: slin check warning with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slin-check-warning-with-select-statement/m-p/6018615#M1347252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think what ever u r doing is correct from validation point of view and u r getting this msg, b'cause u r only storing the value in the field but not using it any where. Infact you can also avid this message by using following technique.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suppose u have a workarea (say w_var) that u r using in the prog. where ztable-field1 is a field of it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then u can reconstruct the select:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single field1 from table into w_var-field1&lt;/P&gt;&lt;P&gt;where vbeln = p_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after sy-subrc check clear this field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear w_var-field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if you run SLIN u will not get this message any more.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Joy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Aug 2009 19:23:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slin-check-warning-with-select-statement/m-p/6018615#M1347252</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-23T19:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: slin check warning with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slin-check-warning-with-select-statement/m-p/6018616#M1347253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check the ztable-field1 does it have any read only access, or check if it is using some authority check and restricting you to acess it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Aug 2009 19:28:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slin-check-warning-with-select-statement/m-p/6018616#M1347253</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-08-23T19:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: slin check warning with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slin-check-warning-with-select-statement/m-p/6018617#M1347254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can add a pseudo comment which you can get in the SLIN error itself to HIDE the error.&lt;/P&gt;&lt;P&gt;pseudo codes are like &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;" #EC_NEEDED. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; --&amp;gt;check the exact one given in SLIN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that you will add to the end of code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select single field1 from table into vari1
       where vbeln = p_vbeln. " #EC_NEEDED.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Aug 2009 19:58:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slin-check-warning-with-select-statement/m-p/6018617#M1347254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-23T19:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: slin check warning with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slin-check-warning-with-select-statement/m-p/6018618#M1347255</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; Hi,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; use it this way... &lt;/P&gt;&lt;P&gt;&amp;gt; just write an if condition like the way it is shown below.....&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;CODE&gt;select single field1 from table into vari1
&amp;gt; where vbeln = p_vbeln.
&amp;gt; if sy-subrc = 0.
&amp;gt; "  your logic.......
&amp;gt; else.
&amp;gt; if vari1 is not initial.  " add this if condition if sy-subrc is not equal to zero.......
&amp;gt;   clear vari1. " this will not affect the flow of your program and also neither the output.....
&amp;gt; endif.&lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Regards,&lt;/P&gt;&lt;P&gt;&amp;gt; Siddarth&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;All that message means is that the field isn't used after being filled.  Often, this could be an indication of useless code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, what you're suggesting., is that you put in some &lt;STRONG&gt;more&lt;/STRONG&gt; spurious, useless code, just so that the message goes away!  That is absolutely the &lt;STRONG&gt;wrong&lt;/STRONG&gt; way of going about it.  It makes the code MORE complex, therefore LESS maintainable, therefore MORE expensive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case - an existence check - it's the only way to do it.  You have to have a variable which is never read - so that is &lt;STRONG&gt;why&lt;/STRONG&gt; it is perfectly fine to use #EC NEEDED. and &lt;STRONG&gt;why&lt;/STRONG&gt; SAP provided the option!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Aug 2009 20:08:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slin-check-warning-with-select-statement/m-p/6018618#M1347255</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2009-08-23T20:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: slin check warning with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slin-check-warning-with-select-statement/m-p/6018619#M1347256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Matt for the suggestion,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I never knew this option thou it looked simple...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Learned something new from this....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Siddarth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Aug 2009 20:12:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slin-check-warning-with-select-statement/m-p/6018619#M1347256</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-23T20:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: slin check warning with select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/slin-check-warning-with-select-statement/m-p/6018620#M1347257</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;the error is  there because may be you are not using this variable anywhere.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You filling the variable but not reading it .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These are warnings . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just initialize the variable .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aditi Wason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Aug 2009 20:58:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/slin-check-warning-with-select-statement/m-p/6018620#M1347257</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-23T20:58:29Z</dc:date>
    </item>
  </channel>
</rss>

