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

Validate a date

Former Member
0 Likes
324

I want to validate a date in an select-option.

  • AT SELECTION-SCREEN ON s_fkdat.

  • IF s_fkdat > sy-datum.

  • MESSAGE e007 WITH 'Date cannot be in the future'.

  • ENDIF.

How can I do this? What is the correct syntax?

Thanks

Rafa

Moderator message - Please see before posting - post locked

Edited by: Rob Burbank on Aug 4, 2009 2:44 PM

1 REPLY 1
Read only

Former Member
0 Likes
297

Hi ,

try this way...


  AT SELECTION-SCREEN ON s_fkdat.
  loop at s_fkdat.
    IF s_fkdat -low > sy-datum.                             
        MESSAGE e007 WITH 'Date cannot be in the future'.
    ENDIF.
    IF s_fkdat -High > sy-datum.                             
        MESSAGE e007 WITH 'Date cannot be in the future'.
    ENDIF.
  endloop.
 

Prabhudas