2008 Mar 07 10:15 AM
Hi,
There is a function module that helps convert currency without decimals into the right format. For eg if the amount in BSEG table is in Taiwanese Dollars it will be displayed as 17.95 whereas the real amount is 1795.
So there is a function module which will convert the amount of 17.95 to 1795 (which can be used in a report for eg), once we pass the amount and the currency.
Any help would be greatly appreciated.
Thanks in advance.
Mick
2008 Mar 07 10:31 AM
follow the link
http://www.geocities.com/victorav15/sapr3/abapfun.html
try the function modules
ROUND Rounds value to a number of decimal places . . .
ROUND_AMOUNT Rounding based on company and currency
G_DECIMAL_PLACES_GET Number of decimal places set for currency
hope it helps do reward.
Edited by: sharad narayan on Mar 7, 2008 11:34 AM
follow the link
http://www.geocities.com/victorav15/sapr3/abapfun.html
try the function modules
ROUND Rounds value to a number of decimal places . . .
ROUND_AMOUNT Rounding based on company and currency
G_DECIMAL_PLACES_GET Number of decimal places set for currency
hope it helps do reward.
Edited by: sharad narayan on Mar 7, 2008 11:34 AM
2008 Mar 07 10:26 AM
hi ,
if it is always 2 decimals then can multiply with 100 to get the data into a variable and pass it to the final output.
reward points if useful,
venkat.
2008 Mar 07 10:29 AM
Thanks Venkat for the reply.
If there is a standard function module available, then would like to use it rather then trying to write some logic for it.
Regards,
Mick
2008 Mar 07 10:31 AM
follow the link
http://www.geocities.com/victorav15/sapr3/abapfun.html
try the function modules
ROUND Rounds value to a number of decimal places . . .
ROUND_AMOUNT Rounding based on company and currency
G_DECIMAL_PLACES_GET Number of decimal places set for currency
hope it helps do reward.
Edited by: sharad narayan on Mar 7, 2008 11:34 AM
2008 Mar 07 11:42 AM
Thanks Sharad and Vasant.
What I am looking for is a function module, to which I will pass the amount from BSEG (17.95) and the currency TWD and it will return 1795 in TWD.
Hope its clear.
2011 Sep 07 10:02 PM
Hi Mick James,
Did you get the solution for your question in this thread?
I am also looking for this conversion, can you please share the answer if you know?
Thanks,
RV
2011 Sep 07 10:28 PM
Hi,
You'd better ask a new question to be helped by the whole community instead of asking one person!
Anyway, you may use WRITE amount CURRENCY 'TWD' TO l_field_char.
Sandra
2011 Sep 08 8:27 AM
hi,
1. Use WRITE statement:
DATA dmbtr TYPE bseg-dmbtr VALUE '17.95'.
DATA lv_amount_c(30) TYPE c.
WRITE dmbtr CURRENCY 'TWD' TO lv_amount_c.
WRITE LV_AMOUNT_C NO-GAP.
2. call BAPI
DATA: amount_in LIKE bapicurr-bapicurr VALUE '17.95',
amount_ex LIKE bapicurr-bapicurr .
CALL FUNCTION 'BAPI_CURRENCY_CONV_TO_EXTERNAL'
EXPORTING
currency = 'TWD'
amount_internal = amount_in
IMPORTING
amount_external = amount_ex.
WRITE: / amount_in,amount_ex.
2008 Mar 07 10:34 AM
Hello,
Make use of this sample:
REPORT ZV_CONVERT_CURR .
DATA : L_NETWR TYPE VBAP-NETWR.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
DATE = SY-DATUM
FOREIGN_AMOUNT = '10.00'
FOREIGN_CURRENCY = 'INR'
LOCAL_CURRENCY = 'EUR'
IMPORTING
LOCAL_AMOUNT = L_NETWR
EXCEPTIONS
NO_RATE_FOUND = 1
OVERFLOW = 2
NO_FACTORS_FOUND = 3
NO_SPREAD_FOUND = 4
DERIVED_2_TIMES = 5
OTHERS = 6.
WRITE: L_NETWR.
Cheers,
Vasanth
2015 Mar 12 9:41 AM
2019 Oct 06 8:23 AM
Answer is to use the BAPI function designed for that purpose:
Data: Result type bapicurr-bapicurr
CALL FUNCTION 'BAPI_CURRENCY_CONV_TO_EXTERNAL'
EXPORTING
currency = 'JPY
amount_internal = '10'
IMPORTING
amount_external = Result.
It will Display 1000 Yen by converting the amount based on TCURX values
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |