Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Re:Time Validation

Former Member
0 Likes
591

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.

3 REPLIES 3
Read only

Former Member
0 Likes
506

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

Read only

Sijin_Chandran
Active Contributor
0 Likes
506

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).


Read only

satyabrata_sahoo3
Contributor
0 Likes
506

Hi,

You can try FM CONVERSION_EXIT_HH_MM_OUTPUT.

~SS~