‎2007 Sep 17 10:34 AM
hi gurus!
we want write a code for year validation. on my screen there is i/p field for year.
can u plz help me out.
Points sure !
Rahul
‎2007 Sep 17 10:54 AM
Hi,
Check the below code.
parameters: p_year(4) type n.
at selection-screen.
if p_year lt '1800'.
message 'Not a valid year' type 'E'.
endif.
‎2007 Sep 17 10:54 AM
Hi,
Check the below code.
parameters: p_year(4) type n.
at selection-screen.
if p_year lt '1800'.
message 'Not a valid year' type 'E'.
endif.
‎2007 Sep 17 12:17 PM
Hi,
Check Function Module <b>VALIDATE_YEAR</b>.
Hope this helps.
‎2007 Sep 17 12:23 PM
Hi,
You can use this code for validation in selection screen.
Report ZXXXX.
tables : bsis.
parameters : sp_year like bsis-gjhar.
at selection-screen.
if sp_year LE '1800'.
message 'Year should not be less than or equal to 1800' type 'E'.
endif.
Thanks,
Sri
‎2007 Sep 17 12:46 PM
if not P_YEAR between '0000' and '9999'.
message 'Year not valid' type 'E'.
endif.
Reward points if useful, get back in case of query...
Cheers!!!