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

How to differenciate ALPHANUMERIC from NUMERIC values.

Former Member
0 Likes
699

Hi all,

I have the below requirement..

A variable will take either alpha numeric value or Numeric Value..

and based on this i have to set other fields.

isay for e.g,

if it is alpha numeric Then say field X will be set to 1.or if it is Numeric field then

X will be set to 2.

help me in solving this issue.

thanks in Advance.

regards

Balaji

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
631

Hello,

USe the FM <b>NUMERIC_CHECK</b>

If useful reward.

Vasanth

5 REPLIES 5
Read only

Former Member
0 Likes
632

Hello,

USe the FM <b>NUMERIC_CHECK</b>

If useful reward.

Vasanth

Read only

Former Member
0 Likes
631

IF <i>FIELD</i> CO '0123456789' . "Numeric

.....

ELSE. "Alphanumeric

.....

ENDIF.

Read only

Former Member
0 Likes
631

Hi,

You can use following comparision for the varaiable which is containing value:

If variable CA sy-abcde.

set flag alphanumeric.

Elseif variable CO '1234567890'.

set flag numeric.

Endif.

Ashvender

Read only

Former Member
0 Likes
631

hi,

use this function module.

CALL FUNCTION 'NUMERIC_CHECK'
         EXPORTING
              STRING_IN = L_SAKNR
         IMPORTING
              HTYPE     = L_TIPO.

<b>or</b>

<b>IF var1 CO '0123456789'

FLAG = 1.

ELSE.

FLAG = 2.

ENDIF.</b>

regards,

Ashokreddy

Read only

0 Likes
631

HI..

I Appreciate all the Useful Answers From you..

Thanks a Lot for Ur Responses.

Regards

Balaji

All The Answers has been Rewarded......