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

How to convert decimal notation to comma notation

Former Member
0 Likes
6,909

Hi Folks,

I have an issue in converting decimal notation to comma notation for France.

I have changed the decimal notation in SU01 from 123.4 to 123,4 but when i run some custom program written by me it is extracting output as 123.4 than 123,4.

So i want to have the output of report to conver all numerical values(from decimal format to comma format) i.e., 123,4 format from the 123.4 format.

Please help me in fixing this issue

Edited by: Nishanth Kumar Reddy Chenchu on Apr 24, 2008 1:16 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,988

hi,

Use the following technique.

SPLIT FIELD1 AT '.' INTO FIELD2 FIELD3 .

CONCATENATE FIELD2 ',' FIELD3 INTO FIELD4.

here field1 is 123.4 and field2 --> 123 , field3 -->4

Now concatenate into fieldd4 gives 123,4.

Hope this solves the problem.

Reward points if helpful.

Thanks and regards.

9 REPLIES 9
Read only

Former Member
0 Likes
2,988

hi,

do this way ...


data : v_char(10) value '122.34'.

translate v_char using '.,'.

write : v_char.
  

Read only

0 Likes
2,988

Thanks for the reply.

is there any way other than this by using SET/GET Parameters

Read only

Former Member
0 Likes
2,989

hi,

Use the following technique.

SPLIT FIELD1 AT '.' INTO FIELD2 FIELD3 .

CONCATENATE FIELD2 ',' FIELD3 INTO FIELD4.

here field1 is 123.4 and field2 --> 123 , field3 -->4

Now concatenate into fieldd4 gives 123,4.

Hope this solves the problem.

Reward points if helpful.

Thanks and regards.

Read only

Former Member
0 Likes
2,988

use statement: REPLACE '.' with ','.

Regards.

Dara.

Read only

Former Member
0 Likes
2,988

This will definitly help you:

Replace all occurrences of '.' in var with ',' .

Reward if useful.

Dara.

Read only

Former Member
0 Likes
2,988

Hi,

you can use REPLACE and develope your own FM to handle the decimal notation change as per user profile.

Refer

Regards

Kiran Sure

Read only

vinod_vemuru2
Active Contributor
0 Likes
2,988

Hi Nishant,

U can use the statement WRITE TO. This will write the data as per the user settings. When ever user changes his settings like decimal notations then this statement will write the data as per the current settings of the user.

DATA: l_amount1 TYPE wrbtr VALUE '123.45',

l_amount(16) TYPE c.

WRITE:/1 l_amount1.

WRITE l_amount1 TO l_amount.

WRITE:/1 l_amount.

Just copy paste above code in a sample program. First execute this program and note the output. Then change the user settings for decimal notations and log of from SAP(Because user settings will become active only after fresh login). Now execute ur report and see the difference. In this way u no need to change the program when ever user changes his settings.

This thing not pnly applies for amount but also for date, time Quantity fields

Thanks,

Vinod

Read only

che_eky
Active Contributor
0 Likes
2,988

Hi Nishanth,

The overriding factor for the decimal notaion comes from the customising setting for the country. You can maintain this in the IMG as follows:

Sap Customizing Implementation Guide (transaction SPRO)

-> SAP Netweaver

-> General Settings

-> Set Countries

-> Define Countries in mSAP.com Systems (CRM, ERP, APO, BW, SEM,...)

The above path will lead you to maintenance view V_T005_BAS where you can change the decimal notation for the country.

Once the above has been done you should get the correct decimal notation appearing without having to perform any coding or other workaround.

Hope it helps.

Che

Read only

Former Member
0 Likes
2,988

its coz your user setting

goto the transaction( for eg vk12)

system -


>userprofile----->owndata

goto defaults tab..change settings in the format you like...

hope this helps

regards