<?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: query problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-problem/m-p/2017815#M412576</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;In your where condition your are using itab1 work area 'pernr = itab1-employee' check this if it has a value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Mar 2007 17:05:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-23T17:05:24Z</dc:date>
    <item>
      <title>query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-problem/m-p/2017814#M412575</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 an issue related to this query for quite sometime and tried to find what the problem is?&lt;/P&gt;&lt;P&gt;Can anyone help me understand what am I missing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab1 occurs 0,&lt;/P&gt;&lt;P&gt;            employee(8) type n,&lt;/P&gt;&lt;P&gt;            reason_type(2),&lt;/P&gt;&lt;P&gt;            reason_code(2),&lt;/P&gt;&lt;P&gt;            return_date like sy-datum,&lt;/P&gt;&lt;P&gt;end of itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_0019 like pa0019 occurs 0 with  header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       select single * from pa0019 into it_0019 where&lt;/P&gt;&lt;P&gt;        pernr = itab1-employee and tmart ='z9' and termn = '20050707'&lt;/P&gt;&lt;P&gt;        if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        move-corresponding it_0019 to wa_0019.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;I am getting -sy-subrc = 4 and I do see a record in the table for this.&lt;/P&gt;&lt;P&gt;I am not able to understand why it is returning the value as '4'.&lt;/P&gt;&lt;P&gt;It is avery simple query but giving a hard time.&lt;/P&gt;&lt;P&gt;Thanks in advance, would really appreciate it.&lt;/P&gt;&lt;P&gt;SK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2007 16:54:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-problem/m-p/2017814#M412575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-23T16:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-problem/m-p/2017815#M412576</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;In your where condition your are using itab1 work area 'pernr = itab1-employee' check this if it has a value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2007 17:05:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-problem/m-p/2017815#M412576</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-23T17:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-problem/m-p/2017816#M412577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I checked the field value and there is am employee id number while running the query.&lt;/P&gt;&lt;P&gt;Thanks for the reply,&lt;/P&gt;&lt;P&gt;SK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2007 17:25:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-problem/m-p/2017816#M412577</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-23T17:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-problem/m-p/2017817#M412578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is problem with the select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'select single * from pa0019 into it_0019'  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case you are selecting single records from table  pa0019. The selection is made on all the fields of table PA0019 but the internal table 'it_0019'  has only four fields also the fields name in internal table are different then that of table pa0019.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This issue can be resolve with below steps.&lt;/P&gt;&lt;P&gt;(1) Change the internal table field names as what they appear in PA0019&lt;/P&gt;&lt;P&gt;(2) change the select statement as :&lt;/P&gt;&lt;P&gt;    SELECT single * from PA0019 into CORRESPONDING fields of table it_0019&lt;/P&gt;&lt;P&gt;                                                WHERE....&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;Sandeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2007 18:48:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-problem/m-p/2017817#M412578</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-23T18:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-problem/m-p/2017818#M412579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your WHERE clause &amp;lt;u&amp;gt;tmart = 'z9'&amp;lt;/u&amp;gt; should be &amp;lt;u&amp;gt;tmart = 'Z9'&amp;lt;/u&amp;gt; (in upper case).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2007 19:04:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-problem/m-p/2017818#M412579</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-23T19:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-problem/m-p/2017819#M412580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One common advice I give for SELECT:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just comment all the conditions in WHERE clause and keep one at a time. now, debug and see the SY-SUBRC value..... If this clause is fine, then uncomment the next clause..and so on......&lt;/P&gt;&lt;P&gt;This way, it is easy to catch the error..&lt;/P&gt;&lt;P&gt;By the way, just try by replacing the 'z' with 'Z' in 2nd WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if helpful&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2007 21:34:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-problem/m-p/2017819#M412580</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-23T21:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-problem/m-p/2017820#M412581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check if itab1-employee is having value in debug mode and if it has any zero prefix in it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The database stores personnel numbers with zero prefix. If it is not there use conversion routine to insert the leading zeroes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Subramanian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2007 21:40:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-problem/m-p/2017820#M412581</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-23T21:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: query problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-problem/m-p/2017821#M412582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorry for replying to this thread a bit late, I identified the problem. it was in a BDC program which the particular record was getting created in 0019. The query was fine, because I had tried everything that you guys had mentioned above even then the query was failing. But later identified that the record was getting created through a BDC program in a wrong way. I fixed that and rest was fine. It tooka while to figure that out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks anyway for your quick respnse, shall award points accordingly.&lt;/P&gt;&lt;P&gt;SK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2007 16:05:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-problem/m-p/2017821#M412582</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-26T16:05:41Z</dc:date>
    </item>
  </channel>
</rss>

