<?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 /SDF/CMO_DATETIME_DIFFERENCE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sdf-cmo-datetime-difference/m-p/4807422#M1125380</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ABAP Experts,&lt;/P&gt;&lt;P&gt;I have already first searched SDN for threads on function module /SDF/CMO_DATETIME_DIFFERENCE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However my question is not answered by seeing the threads and hence I am posting a question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION '/SDF/CMO_DATETIME_DIFFERENCE'&lt;/P&gt;&lt;P&gt;         EXPORTING&lt;/P&gt;&lt;P&gt;              DATE1            = DATE_A&lt;/P&gt;&lt;P&gt;              DATE2            = DATE_B&lt;/P&gt;&lt;P&gt;         IMPORTING&lt;/P&gt;&lt;P&gt;              DATEDIFF         = VAR1&lt;/P&gt;&lt;P&gt;         EXCEPTIONS&lt;/P&gt;&lt;P&gt;              INVALID_DATETIME = 1&lt;/P&gt;&lt;P&gt;              OTHERS           = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now DATE_A is greater than DATE_B, and result is positive, which is fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I reverse the order such that&lt;/P&gt;&lt;P&gt;   EXPORTING&lt;/P&gt;&lt;P&gt;              DATE1            = DATE_B&lt;/P&gt;&lt;P&gt;              DATE2            = DATE_A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i get the same magintude of difference which is fine, but I want the opposite sign say - M&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now one option is to concatenate - sign on the magnitude, but for that i will have to compare the two dates which may be date_A in 2000 and date_B in say 2008, will a simple comarision work,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how do I get a negative sign to the magnitude.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Nov 2008 07:32:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-21T07:32:49Z</dc:date>
    <item>
      <title>/SDF/CMO_DATETIME_DIFFERENCE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sdf-cmo-datetime-difference/m-p/4807422#M1125380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ABAP Experts,&lt;/P&gt;&lt;P&gt;I have already first searched SDN for threads on function module /SDF/CMO_DATETIME_DIFFERENCE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However my question is not answered by seeing the threads and hence I am posting a question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION '/SDF/CMO_DATETIME_DIFFERENCE'&lt;/P&gt;&lt;P&gt;         EXPORTING&lt;/P&gt;&lt;P&gt;              DATE1            = DATE_A&lt;/P&gt;&lt;P&gt;              DATE2            = DATE_B&lt;/P&gt;&lt;P&gt;         IMPORTING&lt;/P&gt;&lt;P&gt;              DATEDIFF         = VAR1&lt;/P&gt;&lt;P&gt;         EXCEPTIONS&lt;/P&gt;&lt;P&gt;              INVALID_DATETIME = 1&lt;/P&gt;&lt;P&gt;              OTHERS           = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now DATE_A is greater than DATE_B, and result is positive, which is fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I reverse the order such that&lt;/P&gt;&lt;P&gt;   EXPORTING&lt;/P&gt;&lt;P&gt;              DATE1            = DATE_B&lt;/P&gt;&lt;P&gt;              DATE2            = DATE_A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i get the same magintude of difference which is fine, but I want the opposite sign say - M&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now one option is to concatenate - sign on the magnitude, but for that i will have to compare the two dates which may be date_A in 2000 and date_B in say 2008, will a simple comarision work,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how do I get a negative sign to the magnitude.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2008 07:32:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sdf-cmo-datetime-difference/m-p/4807422#M1125380</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-21T07:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: /SDF/CMO_DATETIME_DIFFERENCE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sdf-cmo-datetime-difference/m-p/4807423#M1125381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved USe EXPORTING EARLIEST&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2008 07:47:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sdf-cmo-datetime-difference/m-p/4807423#M1125381</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-21T07:47:44Z</dc:date>
    </item>
  </channel>
</rss>

