2008 Feb 09 4:37 AM
hi all,
pls tell me how i can validate user input on screen.
thanks and regards
vikas saini
hi all,
pls tell me how i can validate user input on screen.
thanks and regards
vikas saini
2008 Feb 09 4:42 AM
2008 Feb 09 4:44 AM
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
2008 Feb 09 4:45 AM
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
2008 Feb 09 4:54 AM
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.