<?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: Time range Functions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087090#M1357968</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can simply compare time fields just as you can compare date fields, but they all have to be of TYPE t (or TIMS in DDIC).&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Sep 2009 11:17:24 GMT</pubDate>
    <dc:creator>ThomasZloch</dc:creator>
    <dc:date>2009-09-07T11:17:24Z</dc:date>
    <item>
      <title>Time range Functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087089#M1357967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Gurus ,&lt;/P&gt;&lt;P&gt;I have a time and i want to check it if is in a time range that i give .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example i want to test if the time  06:02:21 is inside the range  07:00:00 and 15:00:00 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any function ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do it with code but i can't get the right results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT PERNR_HOURS WHERE VIRWC = ITAB-VIRWC.&lt;/P&gt;&lt;P&gt;      IF ITAB_TIME-ERTIM  &amp;gt; PERNR_HOURS-IN AND&lt;/P&gt;&lt;P&gt;         ITAB_TIME-ERTIM  &amp;lt; PERNR_HOURS-OUT.&lt;/P&gt;&lt;P&gt;        ADD 1 TO MAN_COUNTER.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance ....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 11:11:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087089#M1357967</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-07T11:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: Time range Functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087090#M1357968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can simply compare time fields just as you can compare date fields, but they all have to be of TYPE t (or TIMS in DDIC).&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 11:17:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087090#M1357968</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-09-07T11:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Time range Functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087091#M1357969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You must have either something wrong in your logic or you are using wrong type. Check this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: time_in TYPE t VALUE '070000',
      time_out TYPE t VALUE '150000'.

PARAMETERS: pa_time TYPE t.

AT SELECTION-SCREEN.
  IF pa_time BETWEEN time_in AND time_out.
    MESSAGE 'Time is in range' TYPE 'S'.
  ELSE.
    MESSAGE 'Time is out of range' TYPE 'S'.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 11:21:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087091#M1357969</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-09-07T11:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Time range Functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087092#M1357970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use RANGES for this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: time like mkpf-cputm.
ranges: r_cputm for mkpf-cputm.
r_cputm-sign = 'I'.
r_cputm-option = 'BT'.
r_cputm-low = '07:00:00'.
r_cputm-high = '15:00:00'.
append r_cputm.

time = '06:00:00'.
if time in r_cputm.
  write: 'Inside range'.
else.
  write: 'Outside range'.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 11:23:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087092#M1357970</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-07T11:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Time range Functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087093#M1357971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
data:pa_c type sy-uzeit.
pa_c = '09:02:21'.

if pa_c between '07:00:00' and '15:00:00'.
  write 'TRUE'.
else.
  write 'FALSE'.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 11:27:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087093#M1357971</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2009-09-07T11:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Time range Functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087094#M1357972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My problem is that the &lt;STRONG&gt;in&lt;/STRONG&gt; hour is 19:00:00 and out time is 07:00:00 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The time that i want to check is  06:54:00 ....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 11:30:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087094#M1357972</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-07T11:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Time range Functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087095#M1357973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should include a corresponding date field in the comparison. Any more important secrets?&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 11:31:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087095#M1357973</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-09-07T11:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Time range Functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087096#M1357974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Thomas , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand now what do you mean but how can i do it ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 11:34:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087096#M1357974</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-07T11:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Time range Functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087097#M1357975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this logic:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: time like mkpf-cputm.
ranges: r_cputm for mkpf-cputm.
r_cputm-sign = 'I'.
r_cputm-option = 'BT'.
r_cputm-low = '070000'.
r_cputm-high = '150000'.
append r_cputm.

time = '060000'.
if time in r_cputm.
  if r_cputm-low &amp;lt; r_cputm-high.
    write: 'Inside range'.
  else.
    write: 'Outside range'.
  endif.
else.
  if r_cputm-low &amp;lt; r_cputm-high.
    write: 'Outside range'.
  else.
    write: 'Inside range'.
  endif.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 11:53:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087097#M1357975</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-07T11:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Time range Functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087098#M1357976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is with the date ...&lt;/P&gt;&lt;P&gt;Th clock-in date is 19:00:00 (02.09.2009) and clock-out is at 06:00:00 (03.09.2009) .&lt;/P&gt;&lt;P&gt;The date that i want to compare is 05:55:00 at 03.09.2009 ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How ....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 12:04:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087098#M1357976</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-07T12:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Time range Functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087099#M1357977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dimath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thats why we use date time stamp. Using Time stamp alone may pose potential errors like the one you faced.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you not use date time stamp instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 12:10:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087099#M1357977</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-09-07T12:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Time range Functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087100#M1357978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suppose i can . I have the dates .&lt;/P&gt;&lt;P&gt;Do you have an example ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 12:14:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087100#M1357978</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-07T12:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Time range Functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087101#M1357979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just for your case, i wrote this code ( you need to modify it accordingly &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: v_string TYPE string.

"Please note that TIMESTAMP is always in YYYYMMDDhhmmss format

DATA:
      v_timein  TYPE timestamp,
      v_timeout TYPE timestamp,
      v_time    TYPE timestamp.

CONCATENATE '20090902' '190000' INTO v_string.

v_timein = v_string.
CLEAR v_string.

CONCATENATE '20090903' '060000' INTO v_string.

v_timeout = v_string.
CLEAR v_string.

CONCATENATE '20090903' '055500' INTO v_string.

v_time = v_string.
CLEAR v_string.

IF v_time BETWEEN v_timein AND v_timeout.
  WRITE: 'Hurray !!!'.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 12:22:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087101#M1357979</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-09-07T12:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Time range Functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087102#M1357980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i just did it with FM ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lOOK ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'CACS_DATE_GET_TIMESTAMP'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   I_DATE            = '02.09.2009'&lt;/P&gt;&lt;P&gt;   I_TIME            = '23:00:20'&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   E_TIMESTAMP       = timestamp_in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       CALL FUNCTION 'CACS_DATE_GET_TIMESTAMP'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   I_DATE            = '03.09.2009'&lt;/P&gt;&lt;P&gt;   I_TIME            = '07:00:00'&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   E_TIMESTAMP       = timestamp_out.           .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       CALL FUNCTION 'CACS_DATE_GET_TIMESTAMP'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   I_DATE            = '03.09.2009'&lt;/P&gt;&lt;P&gt;   I_TIME            = '04:36:08'&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   E_TIMESTAMP       = timestamp_chk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if timestamp_chk between timestamp_in and timestamp_out .&lt;/P&gt;&lt;P&gt;   break dpadio121ras.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 12:23:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087102#M1357980</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-07T12:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Time range Functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087103#M1357981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dimath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you need the FM? If you see the code it basically CONCATENATEs the date-time values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Upto you to decide.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck !!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2009 12:29:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/time-range-functions/m-p/6087103#M1357981</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-09-07T12:29:00Z</dc:date>
    </item>
  </channel>
</rss>

