11-14-2007 11:47 AM
Hi all,
I need a function to convert the brazillian currency format (1002,45) to american currency format (1,002.45).
I kwon how to do this using replace, but i wanna something easier. Because in brazillian way they do not use a dot after 1 (like 1.002,45). I aprreciate all kind of help.
11-14-2007 11:50 AM
11-14-2007 11:51 AM
Hi,
Goto transaction SU3.
goto DEFAULT tab
Change the DECIMAL NOTATION as per your requirement
SAVE
Best regards,
Prashant
11-14-2007 11:51 AM
hi,
try using these, might help you.
CONVERT_TO_FOREIGN_CURRENCY Convert local currency to foreign currency.
CONVERT_TO_LOCAL_CURRENCY Convert from foreign currency to local currency
reward if useful..
11-14-2007 11:58 AM
Hi,
use something like this:
CALL FUNCTION 'CONVERT_TO_FOREIGN_CURRENCY'
EXPORTING
date =
foreign_currency = 'USD'
local_amount = l_value
local_currency = 'BRL'
IMPORTING
FOREIGN_AMOUNT = l_value
EXCEPTIONS
NO_RATE_FOUND = 1
OVERFLOW = 2
NO_FACTORS_FOUND = 3
NO_SPREAD_FOUND = 4
DERIVED_2_TIMES = 5
OTHERS = 6
.
rgs
11-14-2007 12:00 PM
<b>SD_GET_LOCAL_CURRENCY
LOCAL_CURRENCY_DETERMINE
LOCAL_CURRENCY_GET
ISB_CONVERT_TO_LOCAL_CURRENCY
Currency Convertion (i.e. from EUR to GBP):
http://www.sapdevelopment.co.uk/country/country_curr.htm
Convert currency value from internal(SAP) to external(display)
http://www.sapdevelopment.co.uk/country/country_inttoext.htm
CONVERT_TO_LOCAL_CURRENCY_N
CONVERT_TO_LOCAL_CURRENCY_O.
CONVERT_TO_FOREIGN_CURRENCY
Chk this Link
11-14-2007 12:09 PM
Hi,
Code as follows:
SELECT SINGLE waers FROM t001
INTO wf_waers
WHERE bukrs = int_bseg-bukrs.
WRITE int_bseg-h_dmbtr TO int_final-h_dmbtr CURRENCY wf_waers.
Hope this helps.
reward if helpful.
Regards,
Sipra
11-14-2007 12:35 PM
Hi,
Below is the code for converting currency values from one currency to another. For demonstration purposes
this example converts 10 euros into GBP. Please note when you display this value you may first need to
convert it from its internal SAP value to the proper external display value. See here for more details.
DATA: gd_fcurr TYPE tcurr-fcurr,
gd_tcurr TYPE tcurr-tcurr,
gd_date TYPE sy-datum,
gd_value TYPE i.
gd_fcurr = 'EUR'.
gd_tcurr = 'GBP'.
gd_date = sy-datum.
gd_value = 10.
PERFORM currency_conversion USING gd_fcurr
gd_tcurr
gd_date
CHANGING gd_value.
Convert value to Currency value
&----
*& Form currency_conversion
&----
text
----
-->P_GD_FCURR text
-->P_GD_TCURR text
-->P_GD_DATE text
<--P_GD_VALUE text
----
FORM currency_conversion USING p_fcurr
p_tcurr
p_date
CHANGING p_value.
DATA: t_er TYPE tcurr-ukurs,
t_ff TYPE tcurr-ffact,
t_lf TYPE tcurr-tfact,
t_vfd TYPE datum,
ld_erate(12) TYPE c.
CALL FUNCTION 'READ_EXCHANGE_RATE'
EXPORTING
CLIENT = SY-MANDT
date = p_date
foreign_currency = p_fcurr
local_currency = p_tcurr
TYPE_OF_RATE = 'M'
EXACT_DATE = ' '
IMPORTING
exchange_rate = t_er
foreign_factor = t_ff
local_factor = t_lf
valid_from_date = t_vfd
DERIVED_RATE_TYPE =
FIXED_RATE =
OLDEST_RATE_FROM =
EXCEPTIONS
no_rate_found = 1
no_factors_found = 2
no_spread_found = 3
derived_2_times = 4
overflow = 5
zero_rate = 6
OTHERS = 7
.
IF sy-subrc EQ 0.
ld_erate = t_er / ( t_ff / t_lf ).
p_value = p_value * ld_erate.
ENDIF.
ENDFORM. " currency_conversion
Reward if help full.
11-14-2007 12:50 PM
Hi,
The simplest way is to change the country code form Brasil to US.
The field for country code is VBPLA-LAND1. assign value 'US' to it before running your application.
Deserve reward.
regards,
Gaurav
11-14-2007 1:55 PM
Hi,
You can use FM CONVERT_TO_LOCAL_CURRENCY.
Simpliest method :
divide the amount by 100.
Thanks,
Sri.