cancel
Showing results for 
Search instead for 
Did you mean: 

Amount in Words,country depended

Former Member
0 Kudos

Hi Experts,I have to print amount in words in my smartform depending on country.

Example :

Amount : 20.20

Currency type : USD

Output : 20 dollars and 20 cents

I have already seen FMs 'Spell_Amount' and 'HR_IN_CHG_INR_WRDS'.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Data : v_a1 type i,

v_a2 type i,

v_amount(5) type p decimals 2 value 20.20,

str type string.

Split v_amount at '.' into v_a1,v_a2.

if curr = 'USD'

Concatenate v_a1 'Dollars and' v_a2 'Cents' into str separated by space.

elseif

Concatenate v_a1 'Rupees and' v_a2 'Paise' into str separated by space.

endif.

Answers (1)

Answers (1)

Former Member
0 Kudos

use spell_amount f.m

in spell structure u have field

DECWOrd -


>Decimal places in words

use that and get following ( 20 cents)

concatenate spell-word 'and' spell-decword into <variable>

IF KURR EQ 'USD' OR

KURR EQ 'EUR' OR

KURR EQ 'AUD'.

DECTEXT = 'CENTS'.

ELSEIF KURR EQ 'GBP'.

DECTEXT = 'PENCE'.

ENDIF.

CONCATENATE spell-word 'and' spell-decword dectext INTO <variable> SEPARATED BY SPACE.

Edited by: shan palani on Nov 11, 2008 4:07 PM