Application Development 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: 

how i can validate user input on screen

Former Member
0 Kudos

hi all,

pls tell me how i can validate user input on screen.

thanks and regards

vikas saini

4 REPLIES 4

Former Member
0 Kudos

using chain and endchain statements

Former Member
0 Kudos

In the program define the check at

at selection screen event.

for exmaple if i want to check my selection screen parameter for company code zbukrs.

AT SELECTION-SCREEN ON ZBUKRS.

PERFORM CHECK_BUKRS USING ZBUKRS .

CALL FUNCTION 'FI_COMPANY_CODE_CHECK'

EXPORTING

I_BUKRS = ZBUKRS

EXCEPTIONS

COMPANY_CODE = 1

OTHERS = 2.

IF SY-SUBRC NE 0 .

MESSAGE E128(8I) .

ENDIF.

hope it helps.

anya

Former Member
0 Kudos

Hi,

Use

AT SELECTION-SCREEN ON

This even it used to validate one particular field..And if there is any error in the validation..The other fields will be disabled for input..This is like FIELD xxx MODULE xxx in dialog programming..

Regards,

Chandru

Former Member
0 Kudos

Hi,

Using at selection-screen on field event we can validate the user input to the screen.

suppose you want to restrict the user to give the input lower value as some 1000 and upper valueas

some 2000.If user enters any value other than that in lower and upper input fields you want to

raise error messager that 'please enter a valid input value'.

if you want to code for the above scenario do like this,

at selection-screen on s_lifnr.

if s_lifnr-low < 1000 and s_lifnr-low >1999.

message 'E' 000(0) with 'enter a valid lower input'.

else if s_lifnr-high < 1001 and s_lifnr-high > 2000.

message 'E' 000(1) with 'enter correct upper value'.

endif.

regards,

swami.