<?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: Issue with Select Single * in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763846#M1583901</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;there is no erratic behaviour in SELECT SINGLE, it works fine as designed and look for 1st random table line that fulfills your query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there may be many hits, you will get several random answers in several queries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Definitely the error is in your request! You should start your query with a field of same type as database field!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move your field to compare ta a work field you define in program!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Apr 2011 10:12:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-04-05T10:12:50Z</dc:date>
    <item>
      <title>Issue with Select Single *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763838#M1583893</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;Following is my select single query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE *&lt;/P&gt;&lt;P&gt;  FROM z_table&lt;/P&gt;&lt;P&gt;  WHERE mprn_from LE iv_pod_id&lt;/P&gt;&lt;P&gt;    AND mprn_to   GE iv_pod_id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mprn_from and mprn_to is of type NUMC, length 10&lt;/P&gt;&lt;P&gt;iv_pod_id is of type CHAR, length 50&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Value in iv_pod_id is '120000043221967'. This is not present in z_table. When we check using se16 and put the value in mprn_from and mprn_to, obviously it is truncated to 1200000432 becuase the field length is 10, and no records are selected when we press F8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when the above select single statement is executed, sy-subrc = 0 is returned. Some random value from Z-table is selected. I have no idea why this is happening. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2011 16:00:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763838#M1583893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-04T16:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Select Single *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763839#M1583894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why you want to compare a field with length 50 to that of 10 ??&lt;/P&gt;&lt;P&gt;You have to find out if this is really necessary or not or may be the first 10 char are of relevance something like &lt;/P&gt;&lt;P&gt;l_var  = iv_pod_id 0(10).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2011 16:12:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763839#M1583894</guid>
      <dc:creator>Sandeep_Panghal</dc:creator>
      <dc:date>2011-04-04T16:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Select Single *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763840#M1583895</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;1st it makes no sense searching with wrong field types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2nd you would find results in SE16 if you are looking with "&amp;gt;=" or "&amp;lt;=" as in your query and not only with the exact value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For that use the select options button just right of the execute button on se16 selection-screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 05:41:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763840#M1583895</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-05T05:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Select Single *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763841#M1583896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In Utilities mprn is numc 10, and mpan is char 50.&lt;/P&gt;&lt;P&gt;iv_pod holds the value for both mpan and mprn. Before the select query there is no check as to which value iv_pod is holding, mpan or mprn. I am going to put the check now. But my question still remains unanswered. Why this erratic behaviour by simple select single statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 06:27:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763841#M1583896</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-05T06:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Select Single *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763842#M1583897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.. Nikhil Jadha.,&lt;/P&gt;&lt;P&gt;*check  as below....&lt;/P&gt;&lt;P&gt;Tables : z_table.&lt;/P&gt;&lt;P&gt;Data : it like table of z_table,&lt;/P&gt;&lt;P&gt;          wa like line of it.&lt;/P&gt;&lt;P&gt;SELECT SINGLE *  FROM z_table into corresponding fields of  WA WHERE mprn_from LE iv_pod_id AND mprn_to GE iv_pod_id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Regards,&lt;/P&gt;&lt;P&gt;Samba&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: G.S.S.RAO on Apr 5, 2011 8:56 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 06:55:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763842#M1583897</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-05T06:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Select Single *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763843#M1583898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nikhil,&lt;/P&gt;&lt;P&gt;       I dont understand for wat purpose you are trying to compare the values of length 10 and 50.&lt;/P&gt;&lt;P&gt;But i try to suggest a way. convert the iv_pod_id from char into numc value and save it in a variable.&lt;/P&gt;&lt;P&gt;perform comparison using that variable.&lt;/P&gt;&lt;P&gt;      Hope it ll help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have also mentioned even it is giving in that format it returns the value sy-subrc eq 0. It may be due to comparing the first 10 values and considering that it may be greater or lesser than it. It is a guess and i am sorry if it is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Giriesh M on Apr 5, 2011 9:11 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 07:10:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763843#M1583898</guid>
      <dc:creator>GirieshM</dc:creator>
      <dc:date>2011-04-05T07:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Select Single *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763844#M1583899</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;PRE&gt;&lt;CODE&gt;SELECT SINGLE *
FROM z_table
WHERE mprn_from LE iv_pod_id
AND mprn_to GE iv_pod_id.

mprn_from and mprn_to is of type NUMC, length 10
iv_pod_id is of type CHAR, length 50

Value in iv_pod_id is '120000043221967'. This is not present in z_table. When we check using se16 and put the value in mprn_from and mprn_to, obviously it is truncated to 1200000432 becuase the field length is 10, and no records are selected when we press F8.

But when the above select single statement is executed, sy-subrc = 0 is returned. Some random value from Z-table is selected. I have no idea why this is happening.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sy-subrc will return  o  only because &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Value in iv_pod_id is '120000043221967'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and  mprn_to  is 10 character  &lt;/P&gt;&lt;P&gt;i dont know what are values in mprn_from and mprn_to  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you tell values &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;Deepak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 09:09:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763844#M1583899</guid>
      <dc:creator>deepak_dhamat</dc:creator>
      <dc:date>2011-04-05T09:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Select Single *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763845#M1583900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nikhil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since everyone iterated the fact of diff. data types I wont touch that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reg SY-SUBRC = 0, you have used indefinitive comparators (i.e) GE and LE. There can be infinite possibilities of both.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;= 10 can be 10 or 100 or 1000 and similarly for &amp;lt;=10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence it is picking any such value and you get sy-subrc = 0. &lt;DEL&gt;Also check SY-DBCNT for how many are possible&lt;/DEL&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the internal table/ work area you are trying to select into and you'll understand your problem.&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;Naveen Vajja&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ncvajja on Apr 5, 2011 12:04 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 09:58:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763845#M1583900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-05T09:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Select Single *</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763846#M1583901</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;there is no erratic behaviour in SELECT SINGLE, it works fine as designed and look for 1st random table line that fulfills your query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there may be many hits, you will get several random answers in several queries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Definitely the error is in your request! You should start your query with a field of same type as database field!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move your field to compare ta a work field you define in program!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 10:12:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-single/m-p/7763846#M1583901</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-05T10:12:50Z</dc:date>
    </item>
  </channel>
</rss>

