<?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 date operations with internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-operations-with-internal-table/m-p/1434648#M207372</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear friends&lt;/P&gt;&lt;P&gt;           would you like to tell me. how i determine the most recent date and time from internal table i am not supposed to sort the table by date and time... I must check date and time with other records date and time to determine which record is most recently changed...&lt;/P&gt;&lt;P&gt;here the scenario is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;id       idnumber  chdate      chtime &lt;/P&gt;&lt;P&gt;1        123456    20060606    135312&lt;/P&gt;&lt;P&gt;2        123456    20060606    135900&lt;/P&gt;&lt;P&gt;3        123456    20060606    132300&lt;/P&gt;&lt;P&gt;4        123457    20060606    140000&lt;/P&gt;&lt;P&gt;5        123457    20060606    142500&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the above scenario i must keep in my mind that the most recently changed record is identical to its idnumber i can say that:&lt;/P&gt;&lt;P&gt;the record should be fetched this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;id       idnumber  chdate      chtime &lt;/P&gt;&lt;P&gt;3        123456    20060606    132300&lt;/P&gt;&lt;P&gt;5        123457    20060606    142500&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because here the id 3 is the most recently changed in the idnumber 123456&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where id 5 is the most recently changed in the idnumber 123457&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help me to determin how i am supposed to carry out this task  any suggestion, code will be great help of mine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Naim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Jun 2006 07:39:22 GMT</pubDate>
    <dc:creator>naimkhans_babi</dc:creator>
    <dc:date>2006-06-15T07:39:22Z</dc:date>
    <item>
      <title>date operations with internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-operations-with-internal-table/m-p/1434648#M207372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear friends&lt;/P&gt;&lt;P&gt;           would you like to tell me. how i determine the most recent date and time from internal table i am not supposed to sort the table by date and time... I must check date and time with other records date and time to determine which record is most recently changed...&lt;/P&gt;&lt;P&gt;here the scenario is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;id       idnumber  chdate      chtime &lt;/P&gt;&lt;P&gt;1        123456    20060606    135312&lt;/P&gt;&lt;P&gt;2        123456    20060606    135900&lt;/P&gt;&lt;P&gt;3        123456    20060606    132300&lt;/P&gt;&lt;P&gt;4        123457    20060606    140000&lt;/P&gt;&lt;P&gt;5        123457    20060606    142500&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the above scenario i must keep in my mind that the most recently changed record is identical to its idnumber i can say that:&lt;/P&gt;&lt;P&gt;the record should be fetched this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;id       idnumber  chdate      chtime &lt;/P&gt;&lt;P&gt;3        123456    20060606    132300&lt;/P&gt;&lt;P&gt;5        123457    20060606    142500&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because here the id 3 is the most recently changed in the idnumber 123456&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where id 5 is the most recently changed in the idnumber 123457&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help me to determin how i am supposed to carry out this task  any suggestion, code will be great help of mine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Naim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jun 2006 07:39:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-operations-with-internal-table/m-p/1434648#M207372</guid>
      <dc:creator>naimkhans_babi</dc:creator>
      <dc:date>2006-06-15T07:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: date operations with internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-operations-with-internal-table/m-p/1434649#M207373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a quick reply. Perhaps you could use this logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Group by IDNUMBER&lt;/P&gt;&lt;P&gt;2. Loop by IDNUMBER.&lt;/P&gt;&lt;P&gt;3. Subtract the CHDATE from DATENOW(Current Date SY-DATUM), CHTIME from TIMENOW(Current SY-TIMLO).&lt;/P&gt;&lt;P&gt;4. At each loop hold the previous value from and compare the current.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you could make use of another Internal Table. Fill the other internal table by IDNUMBER and sort by chtime and chdate.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jun 2006 07:50:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-operations-with-internal-table/m-p/1434649#M207373</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-15T07:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: date operations with internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-operations-with-internal-table/m-p/1434650#M207374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;very simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;change the sequence of field declaration in your internal table which is holding this data so that IDNUMBER becomes first field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;idnumber id chdate chtime &lt;/P&gt;&lt;P&gt;123456   1 20060606 135312&lt;/P&gt;&lt;P&gt;123456   2 20060606 135900&lt;/P&gt;&lt;P&gt;123456   3 20060606 132300&lt;/P&gt;&lt;P&gt;123457   4 20060606 140000&lt;/P&gt;&lt;P&gt;123457   5 20060606 142500&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now SORT &amp;lt;TABLE&amp;gt; BY IDNUMBER ASCENDING CHDATE DESCENDING CHTIME DESCENDING.&lt;/P&gt;&lt;P&gt;DATA : WORKAREA LIKE &amp;lt;TABLE&amp;gt;&lt;/P&gt;&lt;P&gt;Loop at &amp;lt;TABLE&amp;gt;.&lt;/P&gt;&lt;P&gt;WORKAREA = &amp;lt;TABLE&amp;gt;.&lt;/P&gt;&lt;P&gt;AT END OF IDNUMBER.&lt;/P&gt;&lt;P&gt;WRITE: / WORKAREA-ID.&lt;/P&gt;&lt;P&gt;*C-- Here you will get the latest id.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jun 2006 07:51:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-operations-with-internal-table/m-p/1434650#M207374</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-15T07:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: date operations with internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-operations-with-internal-table/m-p/1434651#M207375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  For example if ur select statement is like this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   select id idnumber chdate chtime from xtable into table itab  where ...&amp;lt;condn&amp;gt;..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    sort itab by  idnumber chdate chtime  descending.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;     delete adjacent duplicates from itab comparing idnumber .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     Code like above statement..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   You can get result...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;id idnumber chdate chtime &lt;/P&gt;&lt;P&gt;3 123456 20060606 132300&lt;/P&gt;&lt;P&gt;5 123457 20060606 142500&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Reward the points if it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jun 2006 08:07:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-operations-with-internal-table/m-p/1434651#M207375</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-15T08:07:20Z</dc:date>
    </item>
  </channel>
</rss>

