08-28-2007 11:44 AM
Hi All,
We have areuirement of changing '.' ina fld of decimal type to ','.Any pointers to conversion routines which can be used ishighly appreciated.It's very urgent.
Regards,
Rajashree
08-28-2007 11:51 AM
Hi
If you want to Change this at the User level:
Menu path: SYSTEM -> USER PROFILE -> OWN DATA -> DEFAULTS TAB.
Here you can Set the Decimal format.
Or..
You can use the FM CONVERT_TO_LOCAL_CURRENCY
CONVERT_TO_FOREIGN_CURRENCY
Or..
You can use the command
REPLACE ALL OCCURRENCES OF '.' IN V_sTR WITH ','.
<b>Reward if Helpful</b>
08-28-2007 11:46 AM
hi,
You could use REPLACE ALL OCCURENCES of syntax to do the trick.
Thanks...
Preetham S
08-28-2007 11:47 AM
HI,
Use Replace,
DATA FIELD(10).
MOVE 'ABCB' TO FIELD.
REPLACE 'B' WITH 'string' INTO field
returns:
FIELD = 'AstringCB'
<b>Reward if helpful.</b>
08-28-2007 11:47 AM
Hi!
Depends on where do you wanted it to change, you can use:
- personal settings, in menu System - User defaults - Own data
- in a list using WRITE ... USING EDIT MASK ...
Regards
Tamá
08-28-2007 11:48 AM
hi,
Just check this sample code
CONCATENATE chg_flag wa_file1-bukrs wa_file1-aedtm wa_file1-begda
wa_file1-lgtxt wa_file1-pernr wa_file1-pernr v_bet01
INTO wa_temp1-rec SEPARATED BY ','.
CONDENSE wa_temp1-rec NO-GAPS.
This is to get the ',' between the fields.
08-28-2007 11:48 AM
Hi,
Instead of using conversion routines, inside the Loop ...Endloop, if you are sure of the '.' position, then use the offset concept like below.
Loop at itab.
if itab-field1+0(3) = '.'.
itab-field1+0(3) = ','.
endif.
modify itab transporting field1
clear itab.
endloop.
Hope this helps.
Regards,
JLN
08-28-2007 11:49 AM
Hi,
In the menu System-User Profile-Own Data, here goto the second tab. There is a field where you can select the decimal notation. You could chg this.
Thanks.....
Preetham S
08-28-2007 11:50 AM
Hi
if they want it for all the decimal values in all programs.. you can chng in user settings.. SAP Menu -- SYSTEM - USER PROFILE - OWN DATA..
If that is only for a specific report then you can use REPLACE STATEMENT.
but consider this thing. if the value is having more digits then there is a chnace that '.' as well as ',' will come this in the value... 12,345.00 or 12.345,00
in this case
REPLACE '.' with '@' IN w_variable.
REPLACE ',' with '.' IN w_variable.
REPLACE '@' with ',' IN w_variable.
try this...
08-28-2007 11:51 AM
Rajashree,
Is your requirement to convert decimals from format 999,999.00 to 999.999,00 ?
If yes.. It will probably be helpful to look at FM's with the name C14* there are some conversion routines there.
But, some of them define the decimal separator on the basis of your user profile.
08-28-2007 11:51 AM
Hi
If you want to Change this at the User level:
Menu path: SYSTEM -> USER PROFILE -> OWN DATA -> DEFAULTS TAB.
Here you can Set the Decimal format.
Or..
You can use the FM CONVERT_TO_LOCAL_CURRENCY
CONVERT_TO_FOREIGN_CURRENCY
Or..
You can use the command
REPLACE ALL OCCURRENCES OF '.' IN V_sTR WITH ','.
<b>Reward if Helpful</b>