<?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: Problem in select query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542998#M1265798</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rock,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Ususally this problem is happening immediately after transport of program or immediately after creation of the material&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please explain what this statement means ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Apr 2009 11:57:07 GMT</pubDate>
    <dc:creator>SuhaSaha</dc:creator>
    <dc:date>2009-04-24T11:57:07Z</dc:date>
    <item>
      <title>Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542991#M1265791</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;Iam using a select query to check whether that material code exist or not.But even though material is created SY-SUBRC is coming 4.Iam doing this in one of my module pool program and this is working perfectly from more than a month in Production.This problem is coming for only few materials only not for all materials.The following is my select query :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT COUNT( * ) FROM MARA WHERE MATNR = WA_BOQP-ZMATNR.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4 days back I had a report in that I was selecting Sales orders based on the given selection screen data.The select query should have selected 12 SO but it was giving only 8 SO.The same report when run after 7-8 hours(after transport),started giving 12 SO.I was Amazed,same thing happend in one more program also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What might  be the problem? is it a BASIS guy problem or what?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope my query is clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Reagrds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rock.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2009 11:04:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542991#M1265791</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-24T11:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542992#M1265792</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;Please use a Conversion Exit before passing the material number to the "where" clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Ravish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2009 11:10:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542992#M1265792</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-24T11:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542993#M1265793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Ensure you that field WA_BOQP-ZMATNR is in internal format. (and in DB too).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2009 11:10:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542993#M1265793</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-24T11:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542994#M1265794</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;i think No problem at all because you said its working perfactly after transport.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if no records come from ur query then it will give subrc eq 4. and if material is available in table then first check no space is there in your workarea field ( WA_BOQP-ZMATNR ) value with the help of debugging and it must be of same type on which you are puting where condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;may this helpful to you..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chintan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Chintan_SAP on Apr 24, 2009 4:42 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2009 11:11:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542994#M1265794</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-24T11:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542995#M1265795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It might be case of Conversion issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YOu have to use the fm CONVERSION_EXIT_MATNR_INPUT  before the select query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;call function 'CONVERSION_EXIT_MATNR_INPUT'
exporting
INPUT = WA_BOQP-ZMATNR
Importing
OUTPUT = WA_BOQP-ZMATNR.
SELECT COUNT( * ) FROM MARA WHERE MATNR = WA_BOQP-ZMATNR.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2009 11:12:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542995#M1265795</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-24T11:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542996#M1265796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all,but I think all of u took me wrogly.&lt;/P&gt;&lt;P&gt;1)Iam using conversion exit b4 select query.&lt;/P&gt;&lt;P&gt;2)Ususally this problem is happening immediately after transport of program or immediately after creation of the material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That SO numbers problem came immediately after transport and material problem is coming immediately after creation of the material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope am clear in my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rock.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2009 11:19:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542996#M1265796</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-24T11:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542997#M1265797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rock...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of SELECT COUNT.. better go for SELECT UP TO 1 ROWS......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason is that... certain database systems do not manage the number of lines in a table in their catalog and therefore must retrieve this number, the function COUNT( * ) is not suited to check whether a table contains lines at all. You should better use SELECT f ... FROM tab UP TO 1 ROWS for any table field f. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.....!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2009 11:52:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542997#M1265797</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-24T11:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542998#M1265798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rock,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Ususally this problem is happening immediately after transport of program or immediately after creation of the material&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please explain what this statement means ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2009 11:57:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542998#M1265798</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-04-24T11:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542999#M1265799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I clubbed 2 different things there,half of my statement is referring to one problem of any report when transported to Production,some select statements giving wrong results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second case is happening with material numbers,when u create material and immediately run any report system is unable to select that material.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hop am clear in my questia.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rock.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2009 12:01:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5542999#M1265799</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-24T12:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5543000#M1265800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rock,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perhaps anybody implement any FM "in update task" and is not working fine.&lt;/P&gt;&lt;P&gt;When you create a material (or any other object) you receive the message that "Material saved succesfully" but if there are update process, custom or standard, the database is not updated instead all of this process finish. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the problem is just after save the material, i think that this is the problem. A Z process that are not working fine in update mode, or that all update process in the system are full and the BD actualization have to wait.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Pepe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2009 12:07:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5543000#M1265800</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-24T12:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5543001#M1265801</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;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data l_count type i.&lt;/P&gt;&lt;P&gt;SELECT COUNT( * ) into l_count FROM MARA group by MATNR&lt;/P&gt;&lt;P&gt; having MATNR = '000000000000000001'.&lt;/P&gt;&lt;P&gt; write l_count.&lt;/P&gt;&lt;P&gt; endselect.&lt;/P&gt;&lt;P&gt; if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt; write 'Entry exists'.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2009 12:27:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5543001#M1265801</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2009-04-24T12:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5543002#M1265802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all for u r precious time and good replies.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2009 06:10:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-select-query/m-p/5543002#M1265802</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-11T06:10:52Z</dc:date>
    </item>
  </channel>
</rss>

