06-10-2010 6:38 AM
Hi,
I have designed a Screen where I do have fields of Quantity, Currency and Numeric type.
User can pass '/' to these fields in the screen. But as these are Quantity, Currency and Numeric type, when '/' is passed it gives error message.
Now I have changed these fields to the CHAR type.
But the general Validations that occurs in these Fields should be done like if we enter alphabets (a,b,c etc) error message should be displayed.
Can anyone let me know how to check this?
Do we have any function module?
Regards,
Shravan G
06-10-2010 6:44 AM
PARAMETERS: p_num TYPE char10.
AT SELECTION-SCREEN.
IF p_num CN '0123456789,.'.
MESSAGE 'Field is numeric. Please correct your input' TYPE 'E'.
ENDIF.
Edited by: Suhas Saha on Jun 10, 2010 11:17 AM
06-10-2010 8:25 AM
Hi,
You can achieve it like this:
parameters: input type char10.
data: quantity(8) type p. " here you put your actual numeric field
at selection-screen on input.
if input = '/'.
* do something in case of slash - probably nothing for this is just the input check
else.
try.
quantity = input.
catch cx_sy_conversion_error.
message 'Enter numeric value or slash'(001) type 'E'.
endtry.
endif.
Regards, Gerd Rother