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

Formatting numbers

Former Member
0 Likes
856

Hi all.

Does anybodey know a FM that can convert numbers threw requested formats?

Meaning 1,544,631 turn into 1.544.631 and the like.

Thanks you all,

Rebeka

8 REPLIES 8
Read only

Former Member
0 Likes
820

use concatenate statements to arrange the numbers

Read only

Former Member
0 Likes
820
Use REPLACE statement.

OR

You can split it at ',' and then concatenate them separated by dot.

Thanks

Read only

Former Member
0 Likes
820

hi Rebeka ,

Take a variable of character type with required length example

Data:

gv_amount(20) type c.

Symply take the currency field and use WRITE TO statement to the variable. The currency will be written as per user format.

Example.

data:

gv_wrbtr type bseg-wrbtr.

assume some value in gv_wrbtr. Now simple write the below stt. to get the maintained user format.

write gv_wrbtr to gv_amount currency currency_field.

Venkat.

Read only

Former Member
0 Likes
820

As such there is no FM.

You need to write code by using REPLACE command in your string in desired formats.

Read only

Former Member
0 Likes
820

Hi all.

I don't want to use any REPLACE statement and so..

What if ther's a value appears like 1.001.2 (Thousand and one dot 2) and I want to replace it to 1,001.2 ?? I want to use a std. FM if there is such.

Read only

0 Likes
820

There is no function module for that. You have to write your own code, a good thing is to use a turing machine such as a [Busy beaver|http://en.wikipedia.org/wiki/Busy_beaver]

Read only

Former Member
0 Likes
820

use FM conversion_exit_alpa_input

Read only

Former Member
0 Likes
820

dfsdf