cancel
Showing results for 
Search instead for 
Did you mean: 

display amount in words (USD) including cents

Former Member
0 Kudos

hi friends,

here i am displaying amount in words(USD)

i am getting the out put but

in output i am not getting cents, i am getting only dollors

for eg 100.32

i have to display one hundred dollors and thirty two cents

can anyone help me out to try this issue.

thanks,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

check sample program

RF_SPELL

Regards

Prabhu

Former Member
0 Kudos

Try this f/m:

Spell_amount.

-SAKR

Answers (3)

Answers (3)

Former Member
0 Kudos

hi eswar

to get the decimal currency you need to create one transparent table named zcurr_text

with feilds mandt,spras,waers and ktext for ktext give the data element as char40

now create entries for example INR with Paise and for US create Cents.

now in the program lines

select ktext from zcurr_text into table it_dec_curr

where spras = 'EN'

and waers = 'USD'.

now concatenate all the four variable (two variable from spell_amount FM and one for unit currency and the other decimal currency for which the above code is ) into one char variable of length char250 and display it in the output.

kindly revert back if you have any doubts.

Reward points if helpful

Regards

Zarina

Former Member
0 Kudos

Hi,

Try like this:

split v_amount at '.' into v_number v_decimal.

call function spell_amount and pass v_number and get the value in V_no_wrd.

v_first = v_decimal DIV 10.

v_second = v_decimal MOD 10.

select single WORT into v_wort from T015Z where spras = en

einh = v_first

ziff = v_second.

Now concatenate all

concatenate v_ no_wrd 'DOLLORS' v_wort 'cents' into v_spell_amt.

write v_spell_amt.

Br,

Laxmi

Former Member
0 Kudos

Hi Venkat,

You can use the FM SPELL_AMOUNT to convert figure to words. Then you will have to put the the field SPELL-WORD as Dollars and SPELL-DECWORD as cents.

Reward if this helps.

Regards

Anurag