2005 Nov 06 9:56 AM
Hi all!!
I have to convert decimals currency from given amount.
I mean if I get USD the result is cents.
EUR the result is cents etc...
Thanks!!!!!
DIANA
Hi all!!
I have to convert decimals currency from given amount.
I mean if I get USD the result is cents.
EUR the result is cents etc...
Thanks!!!!!
DIANA
2005 Nov 06 10:27 AM
Hi,
Not quite sure if I got what you need but here's an example how to convert given amount to another currency:
CALL FUNCTION 'CONVERT_AMOUNT_TO_CURRENCY' EXPORTING
date = sy-datum
foreign_currency = 'USD'
foreign_amount = '2000.00'
local_currency = 'EUR'
IMPORTING
local_amount = amount.Also take a look in these Function Modules:
CURRENCY_CONVERT,
CURRENCY_CONVERT_TO_EURO,
CURRENCY_CONVERTING_FACTOR ,
CONVERT_CURRENCY_BY_RATE,
CONVERT_FOREIGN_TO_FOREIGN_CUR
Hope it helps,
Ville
2005 Nov 06 10:33 AM
Hi,
If I understood your requirement correctly you want to convert the decimal part of the amount. If the amount is 123.45, you want to convert 45 as well. For this pls use the function module SPELL_AMOUNT. The import parameter IN_WORDS-DECWORD will give this.
Cheers
Vinod
2005 Nov 06 11:29 AM
No
You didn't get what I need...I'll try to explain more clear..
I have to convert currency in decimal places but not the amount itself (for getting the amount I'm using FM SPELL_AMOUNT ) For example I have to get THE WORD "cents" in case of input USD...
INPUT: USD
OUTPUT: CENTS
2005 Nov 06 12:07 PM
Hi
Perhaps I've not understood your problem, but if you wanto the amount in cent why do multiple the amount for 100?
AMOUNT = 100,12 USD => AMOUNT = 10012 CENT
Now call fm SPELL_AMOUNT for 10012
Max
2005 Nov 06 12:14 PM
NO NO NO
I don't need the amount at all!
I need THE WORD "CENTS" when I got currency EQ USD(for example).
I mean giving the currency(USD/EUR/RUBL(RUS)/LIRA/SHEKEL) I need to get the "cents" of it.(NOT THE AMOUNT)
2005 Nov 06 12:40 PM
Ok
I think the word 'CENTS' there isn't in SAP, but you can check if your currency can have two decimals (so it manages the cents) in the table TCURX.
If there isn't in TCURX, it means the currency supports two decimal, if there is you have to see the field CURRDEC to know how many decimals the currency can have.
After you can use FM SPELL_AMOUNT to obtein the decimal part in words.
TABLES SPELL.
DATA: CURRENCY LIKE SY-WAERS VALUE 'USD'.
DATA: AMOUNT TYPE WRBTR.
MOVE '1234.14' TO AMOUNT.
SELECT SINGLE CURRKEY FROM TCURX INTO CURRENCY
WHERE CURRKEY EQ CURRENCY.
CHECK SY-SUBRC <> 0.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = AMOUNT
CURRENCY = CURRENCY
FILLER = ' '
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = SPELL
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE: SPELL-WORD, CURRENCY, 'and', SPELL-DECWORD, 'CENTS'.
Max
2005 Nov 06 12:53 PM
Yes, But I need not only "cents"
I need FOR ANY CURRENCY!
FOR EXAMPLE: If I have LIRA as INPUT the OUTPUT is "centesimo" (in ITALY)
2005 Nov 06 1:07 PM
I believe you shoud create a custom table with translate of word CENT.
I think this table should have the client and language as key fields, perhaps currency too:
The Euro is currency used by many European Country, so you can need several translates of word CENT for the same currency.
Max
2005 Nov 06 1:17 PM
2005 Nov 06 1:31 PM
If there is it, it could be in T015Z or TCURT, otherwise...good luck
Max
Message was edited by: max bianchi
2005 Nov 06 1:52 PM
Hi Diana,
As far as I am aware of SAP is not storing the currency denomination text. You can do two things, either keep this information in a table or hardcode if it never changes.
Cheers
Vinod
2006 May 09 1:00 PM
Hi Diana,
I have a similar problem in my development. Can you please tell me if you found any solution within SAP or did u have to create a custom table??
Thanks!!
Bindu
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |