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

numeric fields

Former Member
0 Likes
563

Hi Experts,

i have requirement where i need to upload the file from the desktop and validate the file data like formating structure of the fields (i.e., numeric fields contain numeric values, character fields contain alphanumeric characters, if a field is eight characters in lengh, input is equal to eight characters or less) .

Do we have the isnumeric , ischar , isdecimal functions in SAP to check for numeric , character and decimals fields . Appreciate your suggestions.

Thanks,

Latha.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
525

Hi,

In SAP there are many FM, or there is simple way to check fields using ABAP keywords such as CO(Contains Only), CA(Contain Any), etc

You can check help on these operators.

Reward points if useful.

Regards,

Atish

4 REPLIES 4
Read only

Former Member
0 Likes
526

Hi,

In SAP there are many FM, or there is simple way to check fields using ABAP keywords such as CO(Contains Only), CA(Contain Any), etc

You can check help on these operators.

Reward points if useful.

Regards,

Atish

Read only

0 Likes
525

Hi,

To check for only numeric value u can check if field co '0123456789'

To get the filed length use strlen(field) & get it in integer field.

Thanks

Sandeep

Reward if helpful

Read only

Former Member
0 Likes
525

Hi,

To check whether seq no contains only numericals

if seqno na '0123456789'.

to check whether v_string contains only characters

if v_string ca sy-abcde.

reward points if helpful

Thanks

venki

Read only

anversha_s
Active Contributor
0 Likes
525

hi,

Use

CATS_NUMERIC_INPUT_CHECK

or

You can use the Function Module:
NUMERIC_CHECK

Usage:

CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
STRING_IN = X
IMPORTING
STRING_OUT = X
HTYPE = H_TYPE.
if h_type = 'CHAR'.


WRITE:/ 'NOt Numeric'.
else.
write:/ 'Numeric'.
ENDIF

Rgds

Anversha.S