<?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: Select query error. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-error/m-p/2036111#M418219</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you also tell the reason Rich.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And both the where cluses need to match I guess ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards.&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Mar 2007 22:49:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-14T22:49:00Z</dc:date>
    <item>
      <title>Select query error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-error/m-p/2036107#M418215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I get this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Program ZTEST&lt;/P&gt;&lt;P&gt;Field "HRP1000-OBJID" unknown."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when I run this query:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZTEST.&lt;/P&gt;&lt;P&gt;data: end_date type sy-datum,&lt;/P&gt;&lt;P&gt;      pos(40) type C,&lt;/P&gt;&lt;P&gt;      user(12) type C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select single stext from hrp1000 into pos&lt;/P&gt;&lt;P&gt;           where hrp1000-objid = hrp9007-objid&lt;/P&gt;&lt;P&gt;           and plvar  eq '01'&lt;/P&gt;&lt;P&gt;           and   istat  eq '1'&lt;/P&gt;&lt;P&gt;           and   begda  le sy-datum&lt;/P&gt;&lt;P&gt;           and   endda  ge sy-datum&lt;/P&gt;&lt;P&gt;           and   reqnr  eq '297006'&lt;/P&gt;&lt;P&gt;           and   status eq '99'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write   pos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me whats the syntax in complex queries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2007 22:40:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-error/m-p/2036107#M418215</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-14T22:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Select query error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-error/m-p/2036108#M418216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First you need to select from that table before you can use it in another SELECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

REPORT ZTEST.
data: end_date type sy-datum,
pos(40) type C,
user(12) type C.
data: wa_hrp9007 type hrp9007


select Single * from hrp2007 into wa_hrp9007
         where .........    "&amp;lt;- Here you need to put the WHERE clause.

check sy-subrc  = 0.

select single stext from hrp1000 into pos
where hrp1000-objid = wa_hrp9007-objid    " Now you can use it here
and plvar eq '01'
and istat eq '1'
and begda le sy-datum
and endda ge sy-datum
and reqnr eq '297006'
and status eq '99'.


write pos.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2007 22:46:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-error/m-p/2036108#M418216</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-03-14T22:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Select query error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-error/m-p/2036109#M418217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;REPORT ZTEST.&lt;/P&gt;&lt;P&gt;data: end_date type sy-datum,&lt;/P&gt;&lt;P&gt;pos(40) type C,&lt;/P&gt;&lt;P&gt;user(12) type C,&lt;/P&gt;&lt;P&gt;p_objid type hrp1000-objid value '1234'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single stext from hrp1000 into pos&lt;/P&gt;&lt;P&gt;where objid = p_objid&lt;/P&gt;&lt;P&gt;and plvar eq '01'&lt;/P&gt;&lt;P&gt;and istat eq '1'&lt;/P&gt;&lt;P&gt;and begda le sy-datum&lt;/P&gt;&lt;P&gt;and endda ge sy-datum&lt;/P&gt;&lt;P&gt;and reqnr eq '297006'&lt;/P&gt;&lt;P&gt;and status eq '99'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write pos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just change the value of p_objid with the value you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;'Sudhi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2007 22:46:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-error/m-p/2036109#M418217</guid>
      <dc:creator>sudhindra_chandrashekar</dc:creator>
      <dc:date>2007-03-14T22:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Select query error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-error/m-p/2036110#M418218</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;P&gt;The field hrp9007-objid is not declared in the program..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare the field and check the syntax again..&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>Wed, 14 Mar 2007 22:47:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-error/m-p/2036110#M418218</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-14T22:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Select query error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-error/m-p/2036111#M418219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you also tell the reason Rich.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And both the where cluses need to match I guess ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards.&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2007 22:49:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-error/m-p/2036111#M418219</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-14T22:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Select query error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-error/m-p/2036112#M418220</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; It is a complex query, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I need to pull the stext from hrp1000 table, using "reqnr"(which is a field in hrp9007). So I will be first pulling the record first from hrp9007 based on reqnr and then pulling the stext from hrp1000 using objid from already pulled row(using reqnr).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all for your replies.&lt;/P&gt;&lt;P&gt;Can anyone give an idea how to write the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2007 23:00:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-error/m-p/2036112#M418220</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-14T23:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: Select query error.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-error/m-p/2036113#M418221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks All!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2007 23:36:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query-error/m-p/2036113#M418221</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-14T23:36:07Z</dc:date>
    </item>
  </channel>
</rss>

