<?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 problem for selection. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923539#M1484633</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok.  Then you may use this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
SELECT SINGLE ZDATE ZTIME INTO (V_DATE,V_TIME ) FROM ZWHVBOM.
if sy-subrc eq 0.
  Udat1-low = v_date.
  Udat1-high = sy-datum.
  Utime1-low = v_time.
  Utime1-high = sy-uzeit.
endif.

SELECT objectclas objectid FROM cdhdr INTO CORRESPONDING FIELDS OF TABLE mt_cdhdr
WHERE objectclas eq 'STUE_V'
AND ( ( udate &amp;gt; udat1-low  AND udate &amp;lt; udat1-high ) OR
      ( udate = udat1-low  AND udate &amp;lt; udat1-high AND utime &amp;gt;= utime1-low ) OR
      ( udate = udat1-high AND udate &amp;gt; udat1-low  AND utime &amp;lt;= utime1-high) OR
      ( udate = udat1-low  AND udate = udat1-high AND utime &amp;gt;= utime1-low AND utime &amp;lt;= utime1-high ) )
AND ( tcode eq 'CS01' OR
      tcode eq 'CS02' OR
      tcode eq 'C201' OR
      tcode eq 'C202' ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I deleted V_DATE1 and V_TIME1 variables since they are not used on the select.  I don't know if you'll need them later for other purposes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gastón Jareño on May 5, 2010 10:49 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually the ENDIF should be after the SELECT, preventing the case the first SELECT is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 May 2010 14:47:09 GMT</pubDate>
    <dc:creator>gastn_jareo</dc:creator>
    <dc:date>2010-05-05T14:47:09Z</dc:date>
    <item>
      <title>date and time problem for selection.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923525#M1484619</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 am writing select query as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT objectclas objectid FROM cdhdr INTO CORRESPONDING FIELDS OF TABLE mt_cdhdr&lt;/P&gt;&lt;P&gt;                   WHERE objectclas eq  'STUE_V'&lt;/P&gt;&lt;P&gt;                     AND udate  in udat1&lt;/P&gt;&lt;P&gt;                     AND utime  in utime1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in CDHDR if you give the values as below for date and time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UDATE 04.05.2010 ( From )   UDATE 05.05.2010 ( TO )&lt;/P&gt;&lt;P&gt;UTIME  23:24:21  ( From )        UTIME  06:24:33  ( TO ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was not getting the values for this selection because I am getting the error like ( Lower limit is greater than uppre limit ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks ,&lt;/P&gt;&lt;P&gt;Vinay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 09:28:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923525#M1484619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-05T09:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: date and time problem for selection.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923526#M1484620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select-options : s_date for ...  no-extension ,&lt;/P&gt;&lt;P&gt;s_time for .. no-extension&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;( date eq s_date-low and&lt;/P&gt;&lt;P&gt;time ge s_time-low  ) or&lt;/P&gt;&lt;P&gt;( date eq s_date-high and&lt;/P&gt;&lt;P&gt;time le s_time-high ) or&lt;/P&gt;&lt;P&gt;(date gt s_date-low and &lt;/P&gt;&lt;P&gt;date lt s_date-high )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 09:34:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923526#M1484620</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2010-05-05T09:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: date and time problem for selection.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923527#M1484621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vinay&lt;/P&gt;&lt;P&gt;Define your select option without extensione&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
s_time for date no-extension
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and change the select as follow:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT objectclas objectid FROM cdhdr INTO CORRESPONDING FIELDS OF TABLE mt_cdhdr
WHERE objectclas eq 'STUE_V'
AND udate in udat1
AND (utime ge utime1-low
OR utime le utime1-high).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 09:39:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923527#M1484621</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-05T09:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: date and time problem for selection.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923528#M1484622</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;Your lower limit time is greater than upperlimit time. You can do it in 2 ways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Just pass only date and filter it later by date and time combination.&lt;/P&gt;&lt;P&gt;2. Pass the combination of date and time to where clause.(May lead to performance issues)&lt;/P&gt;&lt;P&gt;eg: WHERE objectclas eq 'STUE_V'&lt;/P&gt;&lt;P&gt;      AND    (( UDATE GE 04.05.2010 AND UTIME GE 23:24:21 ) OR ( UDATE LE 05.05.2010 AND UTIME LE 06:24:33 )).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use appropriate syntax and variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 09:39:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923528#M1484622</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2010-05-05T09:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: date and time problem for selection.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923529#M1484623</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;This is because in the field UTIME1 the low value is greater than the high value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a user you are trying to select data from 04.05.2010 / 23:24:21 to 05.05.2010 / 06:24:33 but unfortunately the compiler does not have sufficient AI to interpret this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It takes the date &amp;amp; time fields separately and finds for the UTIME field you have an erroneous input. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No how to handle this situation i think the other users have already given you sufficient hints. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: For these specific cases we have time-stamp field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 09:41:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923529#M1484623</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-05-05T09:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: date and time problem for selection.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923530#M1484624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its working fine now for below condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UDATE 04.05.2010 ( From ) UDATE 05.05.2010 ( TO )&lt;/P&gt;&lt;P&gt;UTIME 23:24:21 ( From ) UTIME 06:24:33 ( TO ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But getting all the values of above condition for this below condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UDATE 05.05.2010 ( From ) UDATE 05.05.2010 ( TO )&lt;/P&gt;&lt;P&gt;UTIME 06:24:33  ( From ) UTIME 07:24:33 ( TO ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check and let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vinay parakala on May 5, 2010 12:34 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 10:34:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923530#M1484624</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-05T10:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: date and time problem for selection.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923531#M1484625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my solution works also with that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 11:54:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923531#M1484625</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2010-05-05T11:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: date and time problem for selection.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923532#M1484626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not yet solved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 13:37:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923532#M1484626</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-05T13:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: date and time problem for selection.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923533#M1484627</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;your query should be rewritten as , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT objectclas objectid FROM cdhdr INTO CORRESPONDING FIELDS OF TABLE mt_cdhdr&lt;/P&gt;&lt;P&gt;WHERE objectclas eq 'STUE_V'&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AND udate ge udat1-low&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and  udate le udat1-high&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AND utime ge utime1-low&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and utime le utime1-high&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Seema&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 13:47:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923533#M1484627</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-05T13:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: date and time problem for selection.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923534#M1484628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could write your code like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT objectclas objectid FROM cdhdr INTO CORRESPONDING FIELDS OF TABLE mt_cdhdr
WHERE objectclas eq 'STUE_V'
AND (( udate = udat1-low AND utime &amp;gt;= utime1-low) 
OR (udate &amp;gt; udat1-low and udate &amp;lt; udat1-high)
OR (udate = udat1-high and utime &amp;lt;= utime1-high)). &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 13:57:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923534#M1484628</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-05T13:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: date and time problem for selection.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923535#M1484629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gusthavo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for message . But your code was like above ....Not yet solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vinay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 14:17:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923535#M1484629</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-05T14:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: date and time problem for selection.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923536#M1484630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you should not use a simple SELECT-OPTION since it allows you to include and exclude a lot of combinations of ranges and particular days and hours, and is not clear what you should select for  all cases.  If you use SELECT-OPTION with NO-EXTENSION clause it will be more clear and may be it will cover what you need.  Then, you may use it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT-OPTIONS: udat1 ...  NO-EXTENSION,
                utime1...  NO-EXTENSION.

SELECT objectclas objectid FROM cdhdr INTO CORRESPONDING FIELDS OF TABLE mt_cdhdr
WHERE objectclas eq 'STUE_V'
AND ( ( udate &amp;gt; udat1-low AND udate &amp;lt; udat1-high ) OR
      ( udate = udat1-low AND utime &amp;gt;= utime1-low ) OR
      ( udate = udat1-high AND utime &amp;lt;= utime1-high) ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this solution is like others above.  The main difference is the use of NO-EXTENSION clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 14:26:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923536#M1484630</guid>
      <dc:creator>gastn_jareo</dc:creator>
      <dc:date>2010-05-05T14:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: date and time problem for selection.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923537#M1484631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry!  I found an error in my solution in case you want to select only one day and then udat1-low = udat1-high.  The corrected solution could be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
SELECT-OPTIONS: udat1 ...  NO-EXTENSION,
                utime1...  NO-EXTENSION.
 
SELECT objectclas objectid FROM cdhdr INTO CORRESPONDING FIELDS OF TABLE mt_cdhdr
WHERE objectclas eq 'STUE_V'
AND ( ( udate &amp;gt; udat1-low  AND udate &amp;lt; udat1-high ) OR
      ( udate = udat1-low  AND udate &amp;lt; udat1-high AND utime &amp;gt;= utime1-low ) OR
      ( udate = udat1-high AND udate &amp;gt; udat1-low  AND utime &amp;lt;= utime1-high) OR
      ( udate = udat1-low  AND udate = udat1-high AND utime &amp;gt;= utime1-low AND utime &amp;lt;= utime1-high ) ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 14:34:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923537#M1484631</guid>
      <dc:creator>gastn_jareo</dc:creator>
      <dc:date>2010-05-05T14:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: date and time problem for selection.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923538#M1484632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not using any select options so there is no matter of extensions here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see my code as below. last run date and time I am getting from ztable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SELECT SINGLE ZDATE  ZTIME INTO (V_DATE,V_TIME ) FROM ZWHVBOM.&lt;/P&gt;&lt;P&gt;  if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;    Udat1-sign   = 'I'.&lt;/P&gt;&lt;P&gt;    Udat1-option  = 'BT'.&lt;/P&gt;&lt;P&gt;    Udat1-low = v_date.&lt;/P&gt;&lt;P&gt;    Udat1-high = sy-datum.&lt;/P&gt;&lt;P&gt;    V_DATE1 = Udat1-high.&lt;/P&gt;&lt;P&gt;    Append udat1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Utime1-sign   = 'I'.&lt;/P&gt;&lt;P&gt;    Utime1-option  = 'BT'.&lt;/P&gt;&lt;P&gt;    Utime1-low  =  v_time.&lt;/P&gt;&lt;P&gt;    Utime1-high = sy-uzeit.&lt;/P&gt;&lt;P&gt;    V_TIME1 = Utime1-high.&lt;/P&gt;&lt;P&gt;    Append utime1.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  V_TIME1 = Utime1-high.&lt;/P&gt;&lt;P&gt;  SELECT objectclas objectid FROM cdhdr INTO CORRESPONDING FIELDS OF TABLE lt_cdhdr&lt;/P&gt;&lt;P&gt;                   WHERE objectclas eq 'STUE_V'&lt;/P&gt;&lt;P&gt;                     AND udate  in udat1&lt;/P&gt;&lt;P&gt;                     AND utime  in utime1&lt;/P&gt;&lt;P&gt;                     AND ( tcode eq 'CS01'&lt;/P&gt;&lt;P&gt;                      OR tcode eq 'CS02'&lt;/P&gt;&lt;P&gt;                      OR tcode eq 'C201'&lt;/P&gt;&lt;P&gt;                      OR tcode eq 'C202' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks - Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 14:36:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923538#M1484632</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-05T14:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: date and time problem for selection.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923539#M1484633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok.  Then you may use this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
SELECT SINGLE ZDATE ZTIME INTO (V_DATE,V_TIME ) FROM ZWHVBOM.
if sy-subrc eq 0.
  Udat1-low = v_date.
  Udat1-high = sy-datum.
  Utime1-low = v_time.
  Utime1-high = sy-uzeit.
endif.

SELECT objectclas objectid FROM cdhdr INTO CORRESPONDING FIELDS OF TABLE mt_cdhdr
WHERE objectclas eq 'STUE_V'
AND ( ( udate &amp;gt; udat1-low  AND udate &amp;lt; udat1-high ) OR
      ( udate = udat1-low  AND udate &amp;lt; udat1-high AND utime &amp;gt;= utime1-low ) OR
      ( udate = udat1-high AND udate &amp;gt; udat1-low  AND utime &amp;lt;= utime1-high) OR
      ( udate = udat1-low  AND udate = udat1-high AND utime &amp;gt;= utime1-low AND utime &amp;lt;= utime1-high ) )
AND ( tcode eq 'CS01' OR
      tcode eq 'CS02' OR
      tcode eq 'C201' OR
      tcode eq 'C202' ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I deleted V_DATE1 and V_TIME1 variables since they are not used on the select.  I don't know if you'll need them later for other purposes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gastón Jareño on May 5, 2010 10:49 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually the ENDIF should be after the SELECT, preventing the case the first SELECT is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 14:47:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923539#M1484633</guid>
      <dc:creator>gastn_jareo</dc:creator>
      <dc:date>2010-05-05T14:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: date and time problem for selection.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923540#M1484634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess the simpler solution then is not to use ranges. If you don't use ranges or select-options and use 4 parameters or variables&lt;/P&gt;&lt;P&gt;From date&lt;/P&gt;&lt;P&gt;to date&lt;/P&gt;&lt;P&gt;from time&lt;/P&gt;&lt;P&gt;to time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then use one of the selects proposed here, it will work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 May 2010 14:58:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923540#M1484634</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-05T14:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: date and time problem for selection.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923541#M1484635</link>
      <description>&lt;P&gt;This doesn't work if udat1-low and udat1-high because it would select all the entries for that date regardless of time.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 12:07:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-and-time-problem-for-selection/m-p/6923541#M1484635</guid>
      <dc:creator>thelazyhangman</dc:creator>
      <dc:date>2023-06-22T12:07:30Z</dc:date>
    </item>
  </channel>
</rss>

