Skip to Content
author's profile photo Former Member
Former Member

time comparison.

Hai,

Thanks for your kind assistance.

I want to check whether Current time

is between 16:00 and 21:00

do we have any Function?

Regards

Chandra kumar.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 12, 2005 at 06:59 AM

    Hi dear chandra kumar,

    One can use this logic :

    *----


    report abc.

    data : t1 type sy-uzeit,

    t2 type sy-uzeit.

    t1 = '1600'.

    t2 = '2100'.

    write :/ sy-uzeit.

    if sy-uzeit >= t1 and sy-uzeit <= t2.

    write : 'current time is in between ' , t1 , 'and' , t2.

    else.

    write : 'current time is NOT in between ' , t1 , 'and' , t2.

    endif.

    *----


    I have opened my account in sdn for the first

    time today and this is my first reply to you.

    I Hope your purpose is solved.

    Please give point if u feel satisfied.

    Thanks & Regards,

    Amit Mittal.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello Amit,

      It's nice to know that we have a new member here at SDN. A hearty welcome to you. Hope to have a lot of discussions where we could share some interesting stuff.

      Regards,

      Anand Mandalika.

  • Posted on Jan 12, 2005 at 07:02 AM

    Hi ,Chandrea,

    If sy-uzeit between '16:00' and '21:00'.

    ...

    Andreas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 12, 2005 at 07:26 AM

    Hello Chandra,

    There's a small point that I would like to make. Though it is a good idea to use the exisitng Function Modules to meet our requirements, it is not very wise to always spend much time in searching for a Function Module in cases as simple as this one.

    There are several ways in which you can check for the condition you want- The following is one of them...

    if sy-uzeit between '080000' and '210000'.
    * Do the processing.
    endif.
    

    Regards,

    Anand Mandalika.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.