<?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: get next available dat in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-next-available-dat/m-p/2300432#M502675</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;you can try to implement the below mentioned logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;loop at itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function /SDF/CMO_DATETIME_DIFFERENCE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this function can calculate the difference between two dates and than you can store that difference between the datesand ITAB2-date in local variables.When you will be looping again in itab2.compare the difference with earlier result and than if the old one is less than hold the first dateand difference in the local variables else can replace the values of with the second date and difference in the local variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Mohit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 May 2007 03:49:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-22T03:49:52Z</dc:date>
    <item>
      <title>get next available dat</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-next-available-dat/m-p/2300429#M502672</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;i want to retreive the next available date from one internal table based on input from another internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab1&lt;/P&gt;&lt;P&gt;02/02/2001&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;02/04/2006&lt;/P&gt;&lt;P&gt;02/03/2002&lt;/P&gt;&lt;P&gt;02/05/2002&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now for the value in itab1(02/02/2001) i must look up itab2 and get the date closest to the date in itab1, which in this case is 02/03/2002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;has anyone worked on such calculations before.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2007 03:20:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-next-available-dat/m-p/2300429#M502672</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-22T03:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: get next available dat</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-next-available-dat/m-p/2300430#M502673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Loop at itab1.&lt;/P&gt;&lt;P&gt;loop at itab2 where date GT itab1-date.&lt;/P&gt;&lt;P&gt;itab3-date = itab2.date.&lt;/P&gt;&lt;P&gt;append itab3.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort itab3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read itab3 index 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points to all useful answers.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;SaiRam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2007 03:38:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-next-available-dat/m-p/2300430#M502673</guid>
      <dc:creator>former_member196280</dc:creator>
      <dc:date>2007-05-22T03:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: get next available dat</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-next-available-dat/m-p/2300431#M502674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sort itab2 by date ascending&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1 into wa1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab2 into wa2 where wa2-date &amp;gt; wa1-date.&lt;/P&gt;&lt;P&gt;write wa2-date " this date is the closet date.&lt;/P&gt;&lt;P&gt;break . &lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2007 03:39:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-next-available-dat/m-p/2300431#M502674</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-22T03:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: get next available dat</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-next-available-dat/m-p/2300432#M502675</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;you can try to implement the below mentioned logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;loop at itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function /SDF/CMO_DATETIME_DIFFERENCE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this function can calculate the difference between two dates and than you can store that difference between the datesand ITAB2-date in local variables.When you will be looping again in itab2.compare the difference with earlier result and than if the old one is less than hold the first dateand difference in the local variables else can replace the values of with the second date and difference in the local variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Mohit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2007 03:49:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-next-available-dat/m-p/2300432#M502675</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-22T03:49:52Z</dc:date>
    </item>
  </channel>
</rss>

