‎2007 Jun 26 9:18 AM
Hello,
trying to check an PARAMETERS input value like this:
AT SELECTION-SCREEN ON connid.
IF connid < 0 OR connid > 1000.
MESSAGE e001(zabap_cri) WITH '0' '1000'.
ENDIF.
how to check if the input is a number and no character?
thx
chris
‎2007 Jun 26 9:29 AM
Hello,
DO like this.
AT SELECTION-SCREEN ON connid.
IF connid LT 0 OR
connid > 1000.
MESSAGE e001(zabap_cri) WITH '0' '1000'.
ENDIF.
" To check numer or charater use
IF CONNID CO '01234566789'
Write 'CONNID IS NUMBER'.
ELSE.
Write 'CONNID IS NOT A NUMBER'.
endif
Also use NUMERIC_CHECK FM
Vasanth
‎2007 Jun 26 9:26 AM
Hi
Check this.
ABAP Keyword ducumentation under logical expression.
Check keyword 'CO' and 'NA'
Check the keyword 'NA'
You will have to go the other way..
check that the value does not contain any character...
Regards,
Suruchi Mahajan
‎2007 Jun 26 9:29 AM
Hi
if connid ca sy-abcde.
message e000(zz) with 'Enter only numeric value'.
endif.
Regards
Navneet
‎2007 Jun 26 9:42 AM
Thanks to all. It works.
@Navneet:
Is the field sy-abcde especially use for this kind of check?
thx
chris
‎2007 Jun 26 9:44 AM
sy-abcde stores all the alphabets, ABCDE..........Z
if you use this it will not check if there are any special characters entered , so better use
IF CONNID CO '0123456789'.
<b>You need to reward points and close thread for helpful answers</b>
Message was edited by:
Chandrasekhar Jagarlamudi
‎2007 Jun 26 9:29 AM
Hello,
DO like this.
AT SELECTION-SCREEN ON connid.
IF connid LT 0 OR
connid > 1000.
MESSAGE e001(zabap_cri) WITH '0' '1000'.
ENDIF.
" To check numer or charater use
IF CONNID CO '01234566789'
Write 'CONNID IS NUMBER'.
ELSE.
Write 'CONNID IS NOT A NUMBER'.
endif
Also use NUMERIC_CHECK FM
Vasanth
‎2007 Jun 26 9:29 AM
if connid CO '0123456789'.
*number.
else.
* it is not a number
enid.
‎2007 Jun 26 9:33 AM
hi
as you have referred to spfli-connid, you no need to validate as its domain is NUMC (4), which will accept only numbers
if helpful, reward
Sathish. R
Message was edited by:
Sathish