<?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 Comparing  DATES. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/1977904#M400432</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone , I`m trying to compare two dates , one of them is the field planfinish (type:  DEC	15 ) of cgpl_task table in CRM , it has the format  : 31.10.2006 03:59:00 ,  the other date is sy-datum. But I don`t know  what can I do ? , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example the next select bring me all registers ,  it doesnt care about  t1~planfinish &amp;gt; sy-datum  condition .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SELECT t2&lt;SUB&gt;objnr t1&lt;/SUB&gt;guid t1&lt;SUB&gt;external_id t1&lt;/SUB&gt;planfinish t2~stat INTO TABLE     ti_campaut&lt;/P&gt;&lt;P&gt;    FROM cgpl_task AS t1&lt;/P&gt;&lt;P&gt;    INNER JOIN crm_jest AS t2&lt;/P&gt;&lt;P&gt;    ON t1&lt;SUB&gt;guid = t2&lt;/SUB&gt;objnr&lt;/P&gt;&lt;P&gt;    WHERE t1~object_type = 'CPT'&lt;/P&gt;&lt;P&gt;      AND t2~inact = ' '&lt;/P&gt;&lt;P&gt;      AND t2~stat = 'I1122'&lt;/P&gt;&lt;P&gt;      AND t1~planfinish &amp;gt; sy-datum .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any help. ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Feb 2007 20:46:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-09T20:46:47Z</dc:date>
    <item>
      <title>Comparing  DATES.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/1977904#M400432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone , I`m trying to compare two dates , one of them is the field planfinish (type:  DEC	15 ) of cgpl_task table in CRM , it has the format  : 31.10.2006 03:59:00 ,  the other date is sy-datum. But I don`t know  what can I do ? , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example the next select bring me all registers ,  it doesnt care about  t1~planfinish &amp;gt; sy-datum  condition .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SELECT t2&lt;SUB&gt;objnr t1&lt;/SUB&gt;guid t1&lt;SUB&gt;external_id t1&lt;/SUB&gt;planfinish t2~stat INTO TABLE     ti_campaut&lt;/P&gt;&lt;P&gt;    FROM cgpl_task AS t1&lt;/P&gt;&lt;P&gt;    INNER JOIN crm_jest AS t2&lt;/P&gt;&lt;P&gt;    ON t1&lt;SUB&gt;guid = t2&lt;/SUB&gt;objnr&lt;/P&gt;&lt;P&gt;    WHERE t1~object_type = 'CPT'&lt;/P&gt;&lt;P&gt;      AND t2~inact = ' '&lt;/P&gt;&lt;P&gt;      AND t2~stat = 'I1122'&lt;/P&gt;&lt;P&gt;      AND t1~planfinish &amp;gt; sy-datum .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any help. ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 20:46:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/1977904#M400432</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T20:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing  DATES.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/1977905#M400433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you don't need the time stamp truncate the date with time stamp in the sy-datum format and compare.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or else try other system fields like sy-uzeit.&lt;/P&gt;&lt;P&gt;concatenate sy-datum and sy-uzeit and use it in ur select&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Vinni&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Vinni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 21:07:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/1977905#M400433</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T21:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing  DATES.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/1977906#M400434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey is ur problem solved ? if yes award points and close the thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 21:52:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/1977906#M400434</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T21:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing  DATES.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/1977907#M400435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ali,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you tell in which format the date is coming in field planfinish after writing select query?&lt;/P&gt;&lt;P&gt;e.g. 31102006 (DDMMYYYY) or 10312006 (MMDDYYY) etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the date in palnfinish is coming in DDMMYYYY format the you need to check Date format of sy-datum. Most of the time it is YYYYMMDD. In this case before comparing you need to format the sy-datum field in  another variable. e.g. Here sy-datum is in YYYYMMDD format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: v_date(8) TYPE c,&lt;/P&gt;&lt;P&gt;       v_date2(15) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_date&lt;EM&gt;4(4) = sy-datum&lt;/EM&gt;0(4).&lt;/P&gt;&lt;P&gt;v_date&lt;EM&gt;2(2) = sy-datum&lt;/EM&gt;4(2).&lt;/P&gt;&lt;P&gt;v_date&lt;EM&gt;0(2) = sy-datum&lt;/EM&gt;6(2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can make v_date in same sequence as planfinish.&lt;/P&gt;&lt;P&gt;If palnfinish is having TIME also then declare another variable of length 15 &amp;amp; concatenate the v_date &amp;amp; sy-uzeit into that variable &amp;amp; then compare.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate v_date sy-uzeit into v_date2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now compare this v_date2 with palnfinish field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ashven&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2007 22:06:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-dates/m-p/1977907#M400435</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-09T22:06:39Z</dc:date>
    </item>
  </channel>
</rss>

