<?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: Date and time range validatation. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-range-validatation/m-p/3838991#M923060</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi there....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the current date is stored in the system variable sy-datum and the current time resides in sy-uzeit. So u can use these two variables  to check whether the current time and date is within ur defined limits. to define the limit, make sure the variables which hold the value of ur limiting date and time, should be declared as of type sy-datum and sy-uzeit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do reward if helpful or get back if u hav further queries.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 25 May 2008 07:15:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-25T07:15:59Z</dc:date>
    <item>
      <title>Date and time range validatation.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-range-validatation/m-p/3838990#M923059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's say I have a blocking date and time period &lt;/P&gt;&lt;P&gt;12/05/2008 23:00 and &lt;/P&gt;&lt;P&gt;13/05/2008 07:00.&lt;/P&gt;&lt;P&gt;And now my problem is how do I program to check whether the current time is within the given time period as mentioned above?&lt;/P&gt;&lt;P&gt;Say, the current date and time now is 12/05/2008 23:45. Is there any standard function can validate it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for everyone will can provide the answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 May 2008 07:05:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-range-validatation/m-p/3838990#M923059</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-25T07:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Date and time range validatation.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-range-validatation/m-p/3838991#M923060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi there....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the current date is stored in the system variable sy-datum and the current time resides in sy-uzeit. So u can use these two variables  to check whether the current time and date is within ur defined limits. to define the limit, make sure the variables which hold the value of ur limiting date and time, should be declared as of type sy-datum and sy-uzeit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do reward if helpful or get back if u hav further queries.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 May 2008 07:15:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-range-validatation/m-p/3838991#M923060</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-25T07:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Date and time range validatation.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-range-validatation/m-p/3838992#M923061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can the current date and time from the systems variables SY-DATM and SY-UZEIT. Write a code as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PARAMETERS: p_date1 TYPE datum obligatory,
            p_time1 TYPE syuzeit obligatory,
            p_date2 TYPE datum obligatory,
            p_time2 TYPE syuzeit obligatory.


AT SELECTION-SCREEN.
IF sy-datum NOT BETWEEN p_date1 AND p_date2.

  MESSAGE e001(ztest) WITH 'Invalid Date'.

ELSEIF sy-datum = p_date1.
  IF NOT sy-uzeit GE p_time1.
    MESSAGE e001(ztest) WITH 'Invalid Time'.
  ENDIF.
ELSEIF sy-datum = p_date2.
  IF NOT sy-uzeit lE p_time2.
    MESSAGE e001(ztest) WITH 'Invalid Time'.
  ENDIF.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this code helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 May 2008 08:59:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-range-validatation/m-p/3838992#M923061</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-25T08:59:40Z</dc:date>
    </item>
  </channel>
</rss>

