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

any Functional Module

Former Member
0 Likes
468

Hello Guys..

I am using a character fields in which users enter some numeric value's. The variable I am using to assign the value is off type numeic.

my Problem will be explain here more clearly.

Data : castsd type i,

ATWRT type ausp-ATWRT,

My problem is that since atwart is c type variable. so when users input some wrong value like

castsd = atwart. if users input wrongly atwart as <b>825'</b>

then program is giving dump.

I want to know is there any functional module and any other way through which i check the value if there is any string is there in value then I have to show value as zero.

i have try with CHECK_AND_CONVERT_NUMERICS. but not getting required output.

Please guide me.

Thanks

Swati...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
443

try fm NUMERIC_CHECK for checking numeric value

or

data : text(40) type c value '1233',

len type i,

pos type i.

len = strlen( text ).

do len times.

if text+pos(1) ca '0123456789'.

else.

message<not numeric>

endif.

pos = pos + 1.

enddo.

regards

shiba dutta

Message was edited by:

SHIBA DUTTA

3 REPLIES 3
Read only

Former Member
0 Likes
443

Hi swati,

1. U can use this FM NUMERIC_CHECK

(but this FM is ecc 5.0 onwards only)

regards,

amitm m.

Read only

Former Member
0 Likes
444

try fm NUMERIC_CHECK for checking numeric value

or

data : text(40) type c value '1233',

len type i,

pos type i.

len = strlen( text ).

do len times.

if text+pos(1) ca '0123456789'.

else.

message<not numeric>

endif.

pos = pos + 1.

enddo.

regards

shiba dutta

Message was edited by:

SHIBA DUTTA

Read only

Former Member
0 Likes
443

Hai Swati Namdev,

You can validate the value eventhogh you are declared it as char Type like below:

Let the char type variable is w_value.

if w_value co '0123456789'.

do what ever you want.

else.

MESSAGE ' w_val Contains non numeric values',TYPE 'E'.

endif.

Reward points if it helps you.

Regds,

Rama.Pammi