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

validating the input field

Former Member
0 Likes
472

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.

3 REPLIES 3
Read only

ferry_lianto
Active Contributor
0 Likes
444

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

Read only

Former Member
0 Likes
444

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

Read only

Former Member
0 Likes
444

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.