Application Development and Automation 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: 
Read only

function module

Former Member
0 Likes
791

Hi,

Is there any function module to convert value of numeric field to words.

Eg.

Amount : $ 2881.88

Words: Two Thousand eight hundred eighty-one dollars and 88 cents

please mention constraints if any.

8 REPLIES 8
Read only

Former Member
0 Likes
722

HI

use SPELL_AMOUNT

code

data: words type spell.

call function 'SPELL_AMOUNT'

exporting

amount = '100000'

CURRENCY = ' '

FILLER = ' '

LANGUAGE = SY-LANGU

importing

in_words = words.

if words-word = 'ONE HUNDRED THOUSAND'.

words-word = '1 LAKH'.

endif.

write:/ words-word.[/code]

/community [original link is broken]

Reward if usefull

Read only

Former Member
0 Likes
722

hi Vivek.,

use these fm SPELL_AMOUNT,

HR_IN_CHG_INR_WRDS which tells amnt in Rupees.

Reward points if useful

Edited by: Chandra

Read only

Former Member
0 Likes
722

Use the function modules

SPELL_AMOUNT

HR_IN_CHG_INR_WRDS

Check the following for further details.

/community [original link is broken]

Reward Points if useful.

Read only

Former Member
0 Likes
722

hi

good

try with FM SPELL_AMOUNT.

thanks

mrutyun^

Read only

Former Member
0 Likes
722

hi,

use SPELL_AMOUNT fm,

give value

IMPORT

AMOUNT parameter

export

IN WORDS u get the output.

Read only

former_member386202
Active Contributor
0 Likes
722

Hi,

USe FM SPELL_AMOUNT

Regards,

Prashant

Read only

Former Member
0 Likes
722

Hi All,

i also want to know how to get the output as 88 cents and not eighty-eight cents (as shown in my example)

Read only

Former Member
0 Likes
722

hi,

you can try in other way,use spell_amount function first part and not for decimal part.

just before calling fm you separate value at . into 2 variables.

split value at '.' into v_value1 v_value2.

pass v_value1 to fm:spell_amount.

then depending upon the currency symbol you have to cancatenate other part currency like cents or paisa..etc.

currency = value+0(1).

if currency = '$'.

v_curr = 'cents'.

else.

v_curr = 'paisa'.

endif.

concatenate value_op_from_fm

v_value2

v_curr into final_variable.

Regds

Sivaparvathi

Please reward points if helpful..............