Application Development 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: 

Reg Currency Description and Amount in words

Former Member
0 Kudos

Hi

Can anybody help me out in finding Function Module for Currency Descripton and Amount in words.

For Example, if currency type is <b>USD</b> and the amount is <b>29,012.50</b>

then it should display the currency description as <b>The sum of US Dollars</b> and the amount in words as <b>Twenty Nine Thousand Twelve and Cents Fifty</b> and it should work for any currency type.

Thanks in Advance.

Swathi

14 REPLIES 14

Former Member
0 Kudos

check Fm : <b>Spell_amount</b>

//then it should display the currency description as <b>The sum of US Dollars</b> and the amount in words as Twenty Nine Thousand Twelve and Cents Fifty and it should work for any currency type.

To handle this u need to adjus the logic and make changes to the Final result yielded by the Fm

Just some adjustments on the same Fm will work

regards,

vijay

0 Kudos

data d_words like spell.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = '123.49'

CURRENCY = ' '

FILLER = ' '

LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = d_words

EXCEPTIONS

NOT_FOUND = 1

TOO_LARGE = 2

OTHERS = 3 .

if sy-subrc = 0.

write 'Success'.

endif.

Former Member
0 Kudos

HR_IN_CHG_INR_WRDS for India

SPELL_AMOUNT for others

Regards

Prabhu

Former Member
0 Kudos

Hi,

Use the belwo FM

Conversion of amounts to words utility SPELL_AMOUNT Convert numbers and figures in words convert an amount into words

<b>convert a number into words (CURRENCY=space)

set decimal point in an amount and return number of decimals for the currency (LANGUAGE=space) </b>

DATA:v_curr LIKE SPELL.
clear v_curr.
CALL FUNCTION 'SPELL_AMOUNT'
 EXPORTING
   AMOUNT          = 100
   CURRENCY        = ' '
*   FILLER          = ' '
*   LANGUAGE        = SY-LANGU
 IMPORTING
   IN_WORDS        = v_curr
 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.

Message was edited by:

Judith Jessie Selvi

Former Member
0 Kudos

Hi swathi,

check this code

REPORT ZSPELL.

TABLES SPELL.

DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.

DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '1234510'.

SY-TITLE = 'SPELLING NUMBER'.

PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.

WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.

FORM SPELL_AMOUNT USING PWRBTR PWAERS.

<b>CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = PAMOUNT

CURRENCY = PWAERS

FILLER = SPACE

LANGUAGE = 'E'

IMPORTING

IN_WORDS = T_SPELL

EXCEPTIONS

NOT_FOUND = 1

TOO_LARGE = 2

OTHERS = 3.</b>

ENDFORM. " SPELL_AMOUNT

Former Member
0 Kudos

Hi,

Use FM--- SPELL_AMOUNT

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = TEMP

CURRENCY = 'USD'

  • FILLER = ' '

LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = WA_IN_WORDS

  • 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.

Note :- Reward points if helpful.<b></b>

Former Member
0 Kudos

Hi

My problem is not getting solved by using this FM SPELL_AMOUNT.

My requirement is displaying an amount in words based on currency type.

For ex. If currency type is USD and amount is 29,012.50 then amount should be displayed as twenty nine thousand twelve and <b>cents</b> fifty. By using this FM am not getting the term <b>cents</b>. In a similar way, for currency type INR, amount should be displayed in rupees and paise.

Is there any way to solve this problem?

Regards

Swathi

0 Kudos

in the import just give the currency 'USD' or 'INR' like that.

data : text(130).

in the table in_words give your int table.

after taking the value in your itab.

loop at itab.

concatenate : 'Rs' itab-word 'Paisa' itab-decword into text.

write : / text.

endloop.

regards

shiba dutta

Former Member
0 Kudos

Hi swathi,

Cents are not known in SAP only USD with decimal places in known.

however check if this can solve teh problem...

for indian currency inr use the below function module....

HR_IN_CHG_INR_WRDS

for usd currency use the following code as an example..

data: amt_in type pc207-betrg value '29012.50'.

data: words type spell.

data: result type string.

call function 'SPELL_AMOUNT'

exporting

amount = amt_in

currency = 'USD'

  • FILLER = ' '

  • LANGUAGE = SY-LANGU

importing

in_words = words

  • 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.

concatenate 'USD' words-word 'AND' words-decword 'CENTS'

into result separated by space.

write:/ result.

hope this helps,

all the best,

sampath

  • award helpful answers

Former Member
0 Kudos

Hi Sampath

Thanks for your code. But I need to take care the same for different currency types. Is it possible?

Regards

Swathi

0 Kudos

i think you have to use case endcase to check that. you can find the entry of currency in TCURR table or you can take it from your program itself.

regards

shiba dutta

anversha_s
Active Contributor
0 Kudos

hi swathi,

u can show cents..chk this

1. FM : function spell_amount

2. Currency code : -> see table TCURT

( only for the main unit)

to spell main (rupee) and 2nd unit (paise) ,

you've to copy and expand table TCURT:

e.g.: MANDT SPRAS WAERS LTEXT KTEXT UNIT2

001 EN INR Indian Rupees Rupees Paise

001 EN EUR Euro Euro Cent

hope this will be helpful.

Regards

Anver

0 Kudos

Hi

There is no UNIT2 field in table tcurt. Where do I find it?

Regards

Swathi

brajesh_j
Member
0 Kudos

Hi Swathi,

Solution would be to make use of Z-table with extra fields like " Dtext" for denomination based on language & currency.

extra development required at ABAP level to consider the below cases

Case 1: amount= 345.01 then translation would be " three hundred forty five dollars and one cent"

Case 2: amount 345.02 then translation would be " three hundred forty five dollars and two cents"


Curently SAP doesn't support plural texts for currency as well.