‎2009 Feb 25 7:04 AM
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.
‎2009 Feb 25 7:06 AM
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
‎2009 Feb 25 7:08 AM
U cannot pass a value with comma to a variable ..
'.' dot is accepted but not comma ..
declare the variable as a char variable ...
‎2009 Feb 25 7:09 AM
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.
‎2009 Feb 25 7:11 AM
Hi,
the variable should be of type currency like
data: gv_variable type CURR LENGTH 13 decimals 2.
Thanks,
Srilakshmi.
‎2009 Feb 25 7:12 AM
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
‎2009 Feb 25 7:20 AM
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