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: 

Function module for decimal notation conversion

Former Member
0 Kudos

Hi

Is there a function module to convert any decimal notation to the

1,234,567.890 , and if there is , then a sample code will be very useful

Thank you

3 REPLIES 3

Former Member
0 Kudos

hi,

do this way ...


data : v_target type p decimals 2,
         v_source like bseg-dmbtr value '1222.22'.

   write v_source to v_target.

  write v_target.

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please try FM C14N_NUMERIC_FORMAT.

or try this.


data: c(100) type c.
data: length type i.
data: offset type i.
                                                
c = '1223,54'.
                                                  
length = strlen( c ).
                                              
offset = length - 3.
                                                  
translate c+offset(1) using ',.'.
                                   
write:/ c.

Regards,

Ferry Lianto

Former Member
0 Kudos

Ok , the problem that i am facin is as follows :

I have a input field which is of type decimal .The value in this field is taken and updated to a table using BDC call transaction. Now when the user default setting is 1,234,567.890 the program works fine. For example if I input 3 , then the value entered is 3.000 . Which is correct. If the default setting is changed to 1.234.567,890 , the program automatically adds 3 zeros before the decimal . So if I enter 3 , the value input is 3.000,000 instead of 3,000

Is there a solution for this. I have checked the attributes and the Fixed point arithmatic is checked. I tried both with checked and unchecked...and the problem persists.