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

hi gurus! year validation function

Former Member
0 Likes
550

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
528

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.

4 REPLIES 4
Read only

Former Member
0 Likes
529

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.

Read only

Former Member
0 Likes
528

Hi,

Check Function Module <b>VALIDATE_YEAR</b>.

Hope this helps.

Read only

Former Member
0 Likes
528

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

Read only

Former Member
0 Likes
528

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!!!