‎2007 Dec 18 5:36 AM
Hi Experts,
I wanted the way how I can identify the particular variable is wheather character type or numeric type??
For example in my database i have records like abc, xyz, 125 etc.
Now I wanted to filter the data based on numeric & character file. Say in one table i want XYZ, ABC & in other one I want 125.
I believe that we have certain system fields available. Let me suggest.
‎2007 Dec 18 5:39 AM
Hi Neha,
Try using the logic
itab-(fieldname) > 0. "Field value
if yes numeric.
else.
not numeric.
endif.
Thanks,
Kasiraman R
‎2007 Dec 18 5:39 AM
Hi Neha,
Try using the logic
itab-(fieldname) > 0. "Field value
if yes numeric.
else.
not numeric.
endif.
Thanks,
Kasiraman R
‎2007 Dec 18 5:45 AM
Hi,
Neha
for tht u declare two internal tables
then in another internal table get database records then do like this
loop at maininternaltable.
if record co '0123456789'.
append to first_itab.
else.
append to second_itab.
endif.
if u do in this way u r problem get solves.
plzz reward if usefull
feel free to ask any quiries my mail id is mutyalasunilkumar@gmail.com
plzz dont forget to reward if useful.
‎2007 Dec 18 6:16 AM
Hi
Neha still if u dont get the answer plz dont hesitate to ask
and if u r problem is solved plzz reward
‎2007 Dec 18 6:21 AM
Hi,
sy-abcde will tell you whether the value ia alphabet.For numbers, you need to declare a varaible of 10 character length with value '0123456789' as suggested. If there is no alphanumeric, then you can code
if v1 ca sy-abcde.
"move it to itab1.
elseif v1 ca '0123456789'.
"move it to itab2.
endif.
‎2007 Dec 18 6:22 AM
Hi,
Use FM 'NUMERIC_CHECK' to find out whether the value is numeric or char.
Input: 123
Result : HTYPE : NUMC
INPUT: 35CA
Restul : CHAR
Hope this helps you.