‎2007 Jul 16 9:15 PM
hi,
iam having an input field defined with
parameters p_order like likp-vbeln.
we have to enter the values between o and 9999999999 and for other values and characters or space in the input will have to show the error message.
please send me the code for the above for validating the input.
thanks in advance.
‎2007 Jul 16 9:21 PM
Hi,
Please try this.
PARAMETERS: P_ORDER LIKE LIKP-VBELN.
AT SELECTION-SCREEN ON p_order.
IF NOT p_order BETWEEN '0' and '9999999999'.
MESSAGE 'Please enter numeric value' TYPE 'E'.
ENDIF.
Regards,
Ferry Lianto
‎2007 Jul 16 9:55 PM
you can write simple like as below
all printable sign's which are used in Web
DATA: vergleich_string(100) VALUE
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.
parameters p_vbeln like vbap-vbeln.
at selection-screen on p_vbeln.
CONCATENATE vergleich_string ',./!@#$%&*-_+=~|\[{]}()"'
INTO vergleich_string.
if p_vbeln ca vergleich_string.
give error message.
endif.
Thanks
Seshu
‎2007 Jul 17 12:56 AM
Send the parameter to NUMERIC_CHECK function module and see the return type. If it is not NUMC, issue error. See below.
DATA: htype LIKE dd01v-datatype.
PARAMETERS: p_order LIKE likp-vbeln.
AT SELECTION-SCREEN.
CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
string_in = p_order
IMPORTING
string_out = p_order
htype = htype.
IF htype <> 'NUMC'.
MESSAGE e162(00) WITH 'Enter numeric value'.
ENDIF.