<?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 getting most recent record from table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-most-recent-record-from-table/m-p/5202749#M1203632</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to get the most recent record in an ODS. Sorting by calday will not work for me since the records may not be entered by date order. This is what I have now, ordered by calday. I need to change it to get the most recent record. Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from /BIC/ACFI_O00100 into WA_FLDS&lt;/P&gt;&lt;P&gt;up to 1 rows&lt;/P&gt;&lt;P&gt;where /BIC/FACID = SOURCE_FIELDS-/BIC/FACID&lt;/P&gt;&lt;P&gt;and CALYEAR = SOURCE_FIELDS-CALDAY+00(04)&lt;/P&gt;&lt;P&gt;order by CALDAY DESCENDING.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Feb 2009 20:23:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-13T20:23:11Z</dc:date>
    <item>
      <title>getting most recent record from table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-most-recent-record-from-table/m-p/5202749#M1203632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to get the most recent record in an ODS. Sorting by calday will not work for me since the records may not be entered by date order. This is what I have now, ordered by calday. I need to change it to get the most recent record. Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from /BIC/ACFI_O00100 into WA_FLDS&lt;/P&gt;&lt;P&gt;up to 1 rows&lt;/P&gt;&lt;P&gt;where /BIC/FACID = SOURCE_FIELDS-/BIC/FACID&lt;/P&gt;&lt;P&gt;and CALYEAR = SOURCE_FIELDS-CALDAY+00(04)&lt;/P&gt;&lt;P&gt;order by CALDAY DESCENDING.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2009 20:23:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-most-recent-record-from-table/m-p/5202749#M1203632</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-13T20:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: getting most recent record from table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-most-recent-record-from-table/m-p/5202750#M1203633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No other choice than adding a field with TIME or sequence information for example (or maybe with native sql but I don't think you'd like to, and it's not advised)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2009 23:19:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-most-recent-record-from-table/m-p/5202750#M1203633</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2009-02-13T23:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: getting most recent record from table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-most-recent-record-from-table/m-p/5202751#M1203634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uday,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please dont use "ORDER BY" clause in your select statement.  This will alter order in which record got created.  Another tip is whether you are table contains date and time record got written? If so use this field in your ORDER BY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2009 23:21:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-most-recent-record-from-table/m-p/5202751#M1203634</guid>
      <dc:creator>nkr1shna</dc:creator>
      <dc:date>2009-02-13T23:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: getting most recent record from table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-most-recent-record-from-table/m-p/5202752#M1203635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;Use change document object to track the manner the records created in the table. The respective values are stored in the CDPOS and CDHDR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS The prerequisite for this entries to be created is that the check box for change document must be check in the data element level. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this wiki for step by step procedure for change document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Change document|https://wiki.sdn.sap.com/wiki/display/ABAP/Change+Document]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sharath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Feb 2009 04:51:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-most-recent-record-from-table/m-p/5202752#M1203635</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-14T04:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: getting most recent record from table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-most-recent-record-from-table/m-p/5202753#M1203636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will alter order in which record got created.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;To make things clear to everybody, you MUST NOT assume that without ORDER BY, you get records by the order they are created ! It completely depends on database server (RDBMS) logic : for example, if you create 2 indexes on the table, the RDBMS may choose any index and any order. The only solution to have records sorted is to use ORDER BY (or SORT at ABAP level).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Feb 2009 14:21:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-most-recent-record-from-table/m-p/5202753#M1203636</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2009-02-14T14:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: getting most recent record from table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-most-recent-record-from-table/m-p/5202754#M1203637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let's also remember that this question has been asked many times before and that there is no generally satisfactory answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Feb 2009 18:56:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-most-recent-record-from-table/m-p/5202754#M1203637</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-14T18:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: getting most recent record from table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-most-recent-record-from-table/m-p/5202755#M1203638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it is better to get the data in internal tabel and the fliter the most recent one from the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Feb 2009 06:30:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-most-recent-record-from-table/m-p/5202755#M1203638</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-15T06:30:11Z</dc:date>
    </item>
  </channel>
</rss>

