‎2008 Mar 07 11:03 AM
Hi,
i need to convert string to decimals.string has a value 98.00% i want to assign this to dec as .98
if any links for data type convertion.i.e from which type to which type we can assign.
please send me links.
thanks in advance.
‎2008 Mar 07 11:24 AM
Hi,
I think there will be a Function Module for this, but i don't have a system available to check.
You can do it with your own coding as follows:
data: lv_string type string,
lv_int type i,
lv_result type p decimals 2.
lv_string = '98.00%'.
replace '%' in lv_string with ''.
move lv_string to lv_int.
lv_result = lv_int / 100.I suppose this to work.
Regards,
Roelof
‎2008 Mar 07 11:09 AM
Divide the number by 100 after assigning to the variable
data : string1 type string value '98.00'.
data : v_dec type ANZHL.
v_dec = string1.
v_dec = v_dec / 100.
‎2008 Mar 07 11:24 AM
Hi,
I think there will be a Function Module for this, but i don't have a system available to check.
You can do it with your own coding as follows:
data: lv_string type string,
lv_int type i,
lv_result type p decimals 2.
lv_string = '98.00%'.
replace '%' in lv_string with ''.
move lv_string to lv_int.
lv_result = lv_int / 100.I suppose this to work.
Regards,
Roelof