<?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: Latest date in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765877#M644124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is that latest created date or latest run date??&lt;/P&gt;&lt;P&gt;-Kriss&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Aug 2007 21:17:05 GMT</pubDate>
    <dc:creator>former_member192429</dc:creator>
    <dc:date>2007-08-29T21:17:05Z</dc:date>
    <item>
      <title>Latest date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765875#M644122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following requirement. Create a custom table that will contain among other things the date and time created. Then every time a certain program runs, it will need to find the table entry with the latest created date. The date is not part of the table key. The table could be quite large.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm wondering if anyone has had a similary requirement and how they went about it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see a three possible solutions two of which have problems:&lt;/P&gt;&lt;P&gt;1) Read the date into an internal table, sort it and find the latest date/time. &lt;/P&gt;&lt;P&gt;      Problem, the table could be quite large therefore possibly running into memory problems (thrashing perhaps) and the time it would take to sort the internal table.&lt;/P&gt;&lt;P&gt;2) Select statement with "order by"&lt;/P&gt;&lt;P&gt;      Problem, similar to 1) above, table would be read sequentually, which could be a performance problem.&lt;/P&gt;&lt;P&gt;3) Index the table with date/time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your feedback will be much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nic&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 21:09:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765875#M644122</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T21:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Latest date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765876#M644123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try creating an index but remember that it may slow down your inserts and updates to the table. But index is the best option available to you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 21:13:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765876#M644123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T21:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Latest date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765877#M644124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is that latest created date or latest run date??&lt;/P&gt;&lt;P&gt;-Kriss&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 21:17:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765877#M644124</guid>
      <dc:creator>former_member192429</dc:creator>
      <dc:date>2007-08-29T21:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Latest date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765878#M644125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can read the table based on current date.&lt;/P&gt;&lt;P&gt;If no read the table with (date - 1).&lt;/P&gt;&lt;P&gt;if no read the table with (date - 2) and so on......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help you if your table is always fed with the latest dates.........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if this helps you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 21:19:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765878#M644125</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T21:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Latest date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765879#M644126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the latest created date/time. i.e., when entries are added to the table, they will have the current date/time as the created date/time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 21:25:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765879#M644126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T21:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Latest date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765880#M644127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the above logic if the date is found pull all those records into internal table and sort it and pull the latest date and time&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 21:28:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765880#M644127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T21:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Latest date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765881#M644128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sateesh,&lt;/P&gt;&lt;P&gt;If you mean read the database table, since the date is not part of the key, this would generate a sequential read of the table each time, though it would work ok if the table were indexed by date/time created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nic&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 21:29:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765881#M644128</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T21:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Latest date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765882#M644129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm with #3 as well. Is there any reason not to create the index?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 21:31:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765882#M644129</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T21:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Latest date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765883#M644130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nic, One simple solution to this is write the latest date to ABAP memory and rather than reading whole table you can read that date from ABAP memory (using EXPORT/ IMPORT )&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;PV&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 21:34:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765883#M644130</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T21:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Latest date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765884#M644131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;P V,&lt;/P&gt;&lt;P&gt;Hmmmmmm, you maybe on to something there, however if I remember correctly, EXPORTed data is not retained beyond a session. The program that creates entries in the table and the program that reads the table could be run hours apart from each other and could be run as part of separate batch jobs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the other hand, perhaps the latest date/time could be written to INDX or to TVARV as the entries are created. Something to look into. Thanks for the "slap upside the head" &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nic&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 21:47:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765884#M644131</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T21:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Latest date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765885#M644132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nic,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do with updation of the table as you are feeling.. try to take a timestamp kind of field in your table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;whenever a record is added or updated in the table, the timestamp field should be updated with the current date and time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While fetching the latesh record from the table, just add the MAX function in your select query.. Like..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT xxx&lt;/P&gt;&lt;P&gt;             yyy&lt;/P&gt;&lt;P&gt;              MAX(timestamp)&lt;/P&gt;&lt;P&gt;FROM dbtab&lt;/P&gt;&lt;P&gt;INTO e_dbtab&lt;/P&gt;&lt;P&gt;WHERE contions..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Best Regards,&lt;/P&gt;&lt;P&gt;Vikas Bittera.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**&lt;STRONG&gt;Points for useful answers&lt;/STRONG&gt;**&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2007 22:24:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765885#M644132</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-29T22:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Latest date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765886#M644133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;*The below code will help you to find out the last entry made&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZTRIP_TEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: ztable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;w_date like ztable-date,&lt;/P&gt;&lt;P&gt;w_time like ztable-time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select max( date )&lt;/P&gt;&lt;P&gt;from ztable&lt;/P&gt;&lt;P&gt;into w_date.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;  select max( time )&lt;/P&gt;&lt;P&gt;  from ztable&lt;/P&gt;&lt;P&gt;  into w_time&lt;/P&gt;&lt;P&gt;  where date eq w_date.&lt;/P&gt;&lt;P&gt;  if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;    select single *&lt;/P&gt;&lt;P&gt;    from ztable&lt;/P&gt;&lt;P&gt;    where date eq w_date and time eq w_time.&lt;/P&gt;&lt;P&gt;    if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;      write: ztable-date,ztable-time.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful, get back in case of query...&lt;/P&gt;&lt;P&gt;Cheers!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Tripat Pal Singh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2007 07:12:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/latest-date/m-p/2765886#M644133</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-30T07:12:24Z</dc:date>
    </item>
  </channel>
</rss>

