on 11-11-2008 10:27 AM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.