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

currency format DUMP

Former Member
0 Likes
970

Hello,

I am working on a program where I get the item price in a CSV file.

The price is coming as 123,50 (comma as used in EU)

When I assign this value to my variable, I am getting DUMP "Unable to interpret 123,50 as a number"

any idea how to come out of this?

The larger values could be 120.000.000,50

Please help.

6 REPLIES 6
Read only

keerthy_k
Product and Topic Expert
Product and Topic Expert
0 Likes
826

Hi,

While assigning the value dont use the 'comma' sign. if u want to assign 23,000. Then use only 23000 to the variable. Like

var_data = '23000'.

If u r assiging from another field, then make sure that both field types are same. If one is integer and other is numc or char, it will dump.

Keerthi.

Edited by: Keerthy K on Feb 25, 2009 8:07 AM

Read only

Former Member
0 Likes
826

U cannot pass a value with comma to a variable ..

'.' dot is accepted but not comma ..

declare the variable as a char variable ...

Read only

Former Member
0 Likes
826

take cahracter field with maximum number.

write a statement where replace ',' with '.'

REPALCE ALL OCCURANCES OF ' , ' WITH '. ' INTO WA_CASV-CUR. " Check Syantax in help

for example 230,00 will be 230.00.-> this is internal currecncy format.

now use write to statement to get user system format .

write wa_casv-cur to g_currency. " g-currency chnarcter variable

hope this helps.

Read only

Former Member
0 Likes
826

Hi,

the variable should be of type currency like

data: gv_variable type CURR LENGTH 13 decimals 2.

Thanks,

Srilakshmi.

Read only

Former Member
0 Likes
826

Hi,

you cannot assign value having comma to variable ,if yoy want to remove comma use REPLACE keyword and assign it .you are assign value with comma Bcoz of that it giving DUMP,

can you please recorrect it

Thanks and regards

Durga.K

Read only

Former Member
0 Likes
826

You can try a similiar logic like this.

data: lv_amt TYPE string ,
      lv_amt1 TYPE dmbtr.

lv_amt = '120.000.000,50'.

REPLACE All OCCURRENCES OF '.' IN lv_amt WITH ''.

REPLACE All OCCURRENCES OF ',' IN lv_amt WITH '.'.

lv_amt1 = lv_amt.

WRITE lv_amt1.

Regards

Sathar