<?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: SQL error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564468#M255108</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select e071~trkorr as4date into zorder
   from e071 inner join e070
          on e071~trkorr = e070~trkorr
  where e071~pgmid = 'R3TR'
    and e071~object = 'PROG'
    and e071~obj_name = p_prog
  order by as4date descending.
  exit.
endselect.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Sep 2006 18:32:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-28T18:32:01Z</dc:date>
    <item>
      <title>SQL error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564461#M255101</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;Im trying the get the last order request of an object (saving in the variable zorder) using also the client specified (mandt), but doesnt work. My Select max is also not working ! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea how can I fix this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT single e071~trkorr INTO zorder&lt;/P&gt;&lt;P&gt;       FROM e071  CLIENT SPECIFIED&lt;/P&gt;&lt;P&gt;       INNER JOIN e070&lt;/P&gt;&lt;P&gt;       ON e071&lt;SUB&gt;trkorr = e070&lt;/SUB&gt;trkorr&lt;/P&gt;&lt;P&gt;       WHERE e071~PGMID = 'R3TR' AND&lt;/P&gt;&lt;P&gt;             e071~OBJECT = 'PROG' AND&lt;/P&gt;&lt;P&gt;             e071~OBJ_NAME = zt-object  AND&lt;/P&gt;&lt;P&gt;             e070&lt;SUB&gt;as4date = =(SELECT Max(e070&lt;/SUB&gt;as4date) FROM e070 where e071~PGMID = 'R3TR' AND&lt;/P&gt;&lt;P&gt;             e071~OBJECT = 'PROG' AND&lt;/P&gt;&lt;P&gt;             e071~OBJ_NAME = zt-object  ) AND&lt;/P&gt;&lt;P&gt;             mandt = '200'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br.&lt;/P&gt;&lt;P&gt;Anna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Sep 2006 17:39:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564461#M255101</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-28T17:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564462#M255102</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;SELECT single &amp;lt;b&amp;gt;trkorr&amp;lt;/b&amp;gt; INTO zorder&lt;/P&gt;&lt;P&gt;FROM e071 CLIENT SPECIFIED&lt;/P&gt;&lt;P&gt;INNER JOIN e070&lt;/P&gt;&lt;P&gt;ON e071&lt;SUB&gt;trkorr = e070&lt;/SUB&gt;trkorr&lt;/P&gt;&lt;P&gt;WHERE e071~PGMID = 'R3TR' AND&lt;/P&gt;&lt;P&gt;e071~OBJECT = 'PROG' AND&lt;/P&gt;&lt;P&gt;e071~OBJ_NAME = zt-object AND&lt;/P&gt;&lt;P&gt;e070&lt;SUB&gt;as4date = =(SELECT Max(e070&lt;/SUB&gt;as4date) FROM e070 where e071~PGMID = 'R3TR' AND&lt;/P&gt;&lt;P&gt;e071~OBJECT = 'PROG' AND&lt;/P&gt;&lt;P&gt;e071~OBJ_NAME = zt-object ) AND&lt;/P&gt;&lt;P&gt;mandt = '200'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Sep 2006 17:42:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564462#M255102</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-28T17:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564463#M255103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi srinu k  &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for ur reply but still doesnt work!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Sep 2006 17:48:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564463#M255103</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-28T17:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564464#M255104</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;check this now...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT single e071~trkorr INTO zorder&lt;/P&gt;&lt;P&gt;FROM e071 &lt;/P&gt;&lt;P&gt;INNER JOIN e070&lt;/P&gt;&lt;P&gt;ON e071&lt;SUB&gt;trkorr = e070&lt;/SUB&gt;trkorr &amp;lt;b&amp;gt;CLIENT SPECIFIED&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;WHERE e071~PGMID = 'R3TR' AND&lt;/P&gt;&lt;P&gt;e071~OBJECT = 'PROG' AND&lt;/P&gt;&lt;P&gt;e071~OBJ_NAME = zt-object AND&lt;/P&gt;&lt;P&gt;e070&lt;SUB&gt;as4date = =(SELECT Max(e070&lt;/SUB&gt;as4date) FROM e070 where e071~PGMID = 'R3TR' AND&lt;/P&gt;&lt;P&gt;e071~OBJECT = 'PROG' AND&lt;/P&gt;&lt;P&gt;e071~OBJ_NAME = zt-object ) AND&lt;/P&gt;&lt;P&gt;mandt = '200'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Sep 2006 17:53:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564464#M255104</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-28T17:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564465#M255105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srinu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The client specified problem is solved. But still get error in the select max.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more thing, the mandt clause also doesnt work (I had do delete), maybe it is because there is no mandt field in one of the tables ? In this case how I get this statement for a specific mandt ? &lt;/P&gt;&lt;P&gt;Many many thanks.&lt;/P&gt;&lt;P&gt;Anna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Sep 2006 18:08:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564465#M255105</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-28T18:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564466#M255106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since the tables are client-independent, the client specified addition isn't meaningful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you look at the SELECT MAX statement and consider it outside of the full selection, you are referencing both tables though no join exists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Michael Malvey&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Sep 2006 18:22:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564466#M255106</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-28T18:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564467#M255107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for ur reply, I understood your point.&lt;/P&gt;&lt;P&gt;In this case how can I get the last trasport request/order of an object using a select statement? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this but also doenst work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT single e071~trkorr INTO zorden&lt;/P&gt;&lt;P&gt;FROM e071&lt;/P&gt;&lt;P&gt;INNER JOIN e070&lt;/P&gt;&lt;P&gt;ON e071&lt;SUB&gt;trkorr = e070&lt;/SUB&gt;trkorr CLIENT SPECIFIED&lt;/P&gt;&lt;P&gt;WHERE e071~PGMID = 'R3TR' AND&lt;/P&gt;&lt;P&gt;      e071~OBJECT = 'PROG' AND&lt;/P&gt;&lt;P&gt;      e071~OBJ_NAME = 'XXXX' &lt;/P&gt;&lt;P&gt;      ORDER BY  e070-AS4DATE DESCENDING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Br&lt;/P&gt;&lt;P&gt;Anna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Sep 2006 18:28:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564467#M255107</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-28T18:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564468#M255108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select e071~trkorr as4date into zorder
   from e071 inner join e070
          on e071~trkorr = e070~trkorr
  where e071~pgmid = 'R3TR'
    and e071~object = 'PROG'
    and e071~obj_name = p_prog
  order by as4date descending.
  exit.
endselect.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Sep 2006 18:32:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564468#M255108</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-28T18:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564469#M255109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks  Michale and Srinu !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br.&lt;/P&gt;&lt;P&gt;Anna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Sep 2006 19:12:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-error/m-p/1564469#M255109</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-28T19:12:27Z</dc:date>
    </item>
  </channel>
</rss>

