Application Development 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: 

Unable to interpret "814,5 " as a number.

Former Member
0 Kudos

Hi,

I am receiving the message -> Unable to interpret "814,5 " as a number.

and getting Runtime error because of an assignment:

gv_maxpart = e_gefkat_res_tab-VERBRAUCH.

gv_maxpart is  DEC (decimal length 10,  places 4)

e_gefkat_res_tab-VERBRAUCH is char12

What has to be made ? I need this assignmwnt for a multiply statement

later.

Regards

ertas

1 ACCEPTED SOLUTION

chaouki_akir
Contributor
0 Kudos

Hello,

the SAP internal decimal separator is "." and not ",".

example :

MOVE '814,5' TO gv_maxpart. ==> KO

MOVE '814.5' TO gv_maxpart. ==> OK

What you can do is to use for example TRANSLATE abap instruction :

TRANSLATE    e_gefkat_res_tab-VERBRAUCH USING ',.'.
gv_maxpart = e_gefkat_res_tab-VERBRAUCH.

Cordialement,

Chaouki.

10 REPLIES 10

Former Member
0 Kudos

HI..

change the data type for field e_gefkat_res_tab-VERBRAUCH to DEC (decimal length 10, places 4)

OR

use some other field (type simlar to gv_maxpart) instead of e_gefkat_res_tab-VERBRAUCH for the assignment

Rgds

Former Member
0 Kudos

not possible because

e_gefkat_res_tab-VERBRAUCH contents the number what I need. Only problem this info

is stored as char instead dec. Therefore it is not possible to interpret "814,5 " as a number.

former_member212653
Active Contributor
0 Kudos

try this:



replace ','  in e_gefkat_res_tab-VERBRAUCH with '.'.

condense e_gefkat_res_tab-VERBRAUCH.
gv_maxpart = e_gefkat_res_tab-VERBRAUCH.

chaouki_akir
Contributor
0 Kudos

Hello,

the SAP internal decimal separator is "." and not ",".

example :

MOVE '814,5' TO gv_maxpart. ==> KO

MOVE '814.5' TO gv_maxpart. ==> OK

What you can do is to use for example TRANSLATE abap instruction :

TRANSLATE    e_gefkat_res_tab-VERBRAUCH USING ',.'.
gv_maxpart = e_gefkat_res_tab-VERBRAUCH.

Cordialement,

Chaouki.

Former Member
0 Kudos

sorry but I get now this message:

Short text

Unable to interpret "2.567.8 " as a number.

Regards

ertas

0 Kudos

A number can not have more than one decimal separator as "2.567.8".

"." is the sap internal decimal separator.

So "2.567.8" has 2 decimal separator.

So that is normal to have an error message.

Former Member
0 Kudos

I'm really sorry but all postings were not helpful.

This forum is going to be like more and more beginners level.

I'm missing former user.

I have found the solutuion the right solution is:

C14W_CHAR_NUMBER_CONVERSION

0 Kudos
I'm really sorry but all postings were not helpful.

=============>Sorry that my answers do not help you.

This forum is going to be like more and more like beginners level.

=============>Your question have been asked many time before in this forum. ==> YOU, HAVE A BEGINNER LEVEL.

I'm missing former user.

=============>See what, Rich HEILMAN (not a beginner level), answers to an identical question in this thread :

I have found the solutuion the right solution is:

C14W_CHAR_NUMBER_CONVERSION

=============>Congratulation to you.

former_member181995
Active Contributor
0 Kudos

IIhas,

e_gefkat_res_tab-VERBRAUCH both has to be type P decimal XX.

Amit.

ritesh_dugad2
Active Participant
0 Kudos

Do the following:

Suppose you have nos. 814,5 and 2.567,8 - both of which are giving errors: Follow the following steps:

1. Move both the numbers to a character field.

2. Replace ',' by 'X'

3. Replace '.' by ','

4. Replace 'X' by '.'

5. Move both numbers to a numeric field.

Alternatiely try to change your default settings for decimal notations in System --> User profile --> Own Data --> Defaults.