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

Re:Time Validation

Hello Experts,

I have to perform the validation on time field i.e,if I entered time is less than current time I have to show an error mesage. I have assigned sy-uzeit to workarea of timefield and am checking if timefield < sy-uzeit But it is taking sy-uze-it in the format hh:mm:ss so it is always showing error message that time is less than current time. can anyone suggest me the solution or how to convert hh:mm:ss into hh:mm format.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 17, 2012 at 08:28 AM

    Hi Santosh,

    check this. It works.

    parameters : time type sy-uzeit.

    if time < sy-uzeit.

    message 'Time is less then current time' type 'E'.

    endif.

    Regrads,

    RAvi Singh

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 17, 2012 at 09:56 AM

    Hi Santosh ,

    Declare the time field for inputting with type ST-UZEIT.

    It will work fine.

    And if you want only the HH:MM part you can use the following string options for the same.

    temp = time+0(4).


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 17, 2012 at 02:16 PM

    Hi,

    You can try FM CONVERSION_EXIT_HH_MM_OUTPUT.

    ~SS~

    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.